default blog view problem and integrating phpbb3/lifetype

default blog view problem and integrating phpbb3/lifetype

Postby dragonmasterzach on Tue Mar 02, 2010 8:23 am

Ive been trying to get lifetype setup on my website, but ive got a few problems.

1. When you go to /blog/index.php it displays the default blog, despite whether the user is logged in or not. Is there a way to change that, and if not where would I start looking for the code to mess with? Ive been trying to mess with different settings and different snippets of code to no avail. My guesse is that its something in blogaction.class.php but i could be wrong.

2. Im trying to use phpbb3 for the userbase, login, etc. I started using the code from this post, and it works, but there are a few hitches i keep running into. I use a php based navigation tab system which is supposed to pull the phpbb3 username (on lifetype i need the lifetype username(duh), which should be the same as phpbb3 when integrated) to change the content of some of the tabs. How would I access this info and where would be the best place to put the code?
On second though, I guess I could put it in the template. Is there a way to enable php in the templates so I can set the variables required and include the nav file? (i just have it at the end of the index.php file right now ) :roll:

Also, why isnt there a phpbb3userdataprovider.php? :) It would make things a whole lot easier. :P
dragonmasterzach
 
Posts: 4
Joined: Tue Mar 02, 2010 7:35 am
LifeType Version: 1.2.9

Re: default blog view problem and integrating phpbb3/lifetype

Postby jondaley on Tue Mar 02, 2010 4:58 pm

If I remember correctly, someone started a phpbb3provider, but it had significant bugs in it, so it was taken out of our release folder. I'd look on bugs.lifetype.net for it, and then if you have subversion access, you could check the logs in the userdata directory to find it. I also might have left it in the trunk, and only erased it from the published branch, though I can't remember that.

You can enable php in the templates - it is disabled for security reasons and also since most people don't need it. It's probably in administration->security.

What do you want the software to do? You can set the summary page to be the default - I can't remember if there is a setting for that, but people have made tiny changes in the past to enable that.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Re: default blog view problem and integrating phpbb3/lifetype

Postby dragonmasterzach on Tue Mar 02, 2010 11:38 pm

One of my navigation tabs is used to access lifetype. It reads 'My Blog', and links to 'http://sitename.tld/lifetype/'. It should display whoever's logged in blog. However, it only displays the default blog.

Or how could I change it to read 'http://sitename.tld/lifetype/?blogId=blogId'? How do I access the blogId variable in order to pass it to my php nav script?
dragonmasterzach
 
Posts: 4
Joined: Tue Mar 02, 2010 7:35 am
LifeType Version: 1.2.9

Re: default blog view problem and integrating phpbb3/lifetype

Postby dragonmasterzach on Wed Mar 03, 2010 1:09 am

this is what i have now:
Code: Select all
{php}
$atab='2';
//This include is what brings in my nav/header file throughout my entire site
//$atab is the current active tab
//$blogTabId is the blogId of the current user
include("/home/dos/public_html/sitedomain.tld/headerinclude.php");
{/php}
<script type="text/javascript">
//Quick hack, but it just displays the blogId of the current blog showing, not the users actual blogId
document.getElementById('blogTab').href='http://sitedomain.tld/lifetype/?blogId='+{$blog->getId()};
</script>


this is my code in phpbb3:

Code: Select all
<!-- PHP -->
mysql_select_db("dos_lifetype") or die(mysql_error());

//uses phpbb3 username to grab the matching blogId from lifetype DB
$a_username = $user->data['username'];
$result = mysql_query("SELECT * FROM lt_blogs WHERE blog = '".$a_username."'")
or die(mysql_error());
 
$row = mysql_fetch_array( $result );
$blogTabId = '?blogId='.$row['id'];
$atab='3';
include('../nav/nav.php');
<!-- ENDPHP -->


Is there some way to use something like: "$a_username = $blog->getUsername;" in lifetype within the {php}{/php} tags?


Or is there just a way to get the users' blog to auto show? ;)
dragonmasterzach
 
Posts: 4
Joined: Tue Mar 02, 2010 7:35 am
LifeType Version: 1.2.9

Re: default blog view problem and integrating phpbb3/lifetype

Postby jondaley on Wed Mar 03, 2010 11:20 am

I don't quite get what you are trying to do.

Once you are inside a lifetype template, it will probably be sort of hard/hacky to make it switch which blog it thinks is showing, since all of the variables will be wrong, e.g. $posts, $blog, $locate, etc.

I'd think you'd want to get the blogid prior to loading the lifetype code at all. I'd expect the phpbbuserdata class to do that stuff for you, but I've never used it myself.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Re: default blog view problem and integrating phpbb3/lifetype

Postby dragonmasterzach on Wed Mar 03, 2010 9:07 pm

What Im trying to do is:

1. I have a nav tab system at the top of the page.
__________________________________________
\__Home__/\__My Blog__/\__Forum__/\__ETC__/

Home links to sitedomain.tld/
My Blog links to sitedomain.tld/lifetype
Forum links to sitedomain.tld/forum
Etc.

2. When a user logs into the forum, it loggs them into the rest of the site, home page, lifetype, etc.

3. What i want to happen is that when they click on 'My Blog' it should bring them to their blog, (because they get a blog when they sign up obviously) not the default blog (ie. blogId=53, not blogId=1 etc.. and without it being in the address bar). I mean, it has to pick a blog somewhere, right? Where is that? I dont mind changing the internal code. Its just so confusing :roll:

4. I put a hack together pulling the userId from the phpbb3 session cookies, and using that to pull the correct blogId from the DB and changing the 'My Blog' link resulting in the 'My Blog' tab to link to 'sitedomain.tld/lifetype/?blogId=(insertBlogId)' instead of just 'sitedomain.tld/lifetype'

If I cant figure it out, ill just stick with my hack for now.

Also, is there a way to be able to post a blog outside of the admin panel? I dont like having to login to the site and THEN log into the admin panel, and navigate around there to find what I need. Its nice to have for ADMIN uses, but not blog posting, comment control, etc.
dragonmasterzach
 
Posts: 4
Joined: Tue Mar 02, 2010 7:35 am
LifeType Version: 1.2.9


Return to Configuration and Installation

cron