The online racing simulator
PHP PHPbb buffs I need help!
(1 post, started )
PHP PHPbb buffs I need help!
Hey I don't know if this is the right section as it is only remotely related to LFS I thought it would be best to post here.

I'm having a little problem with my website after consulting afew people who couldn't find the problem I thought I would ask you guys as alot of you know your stuff.

Heres my problem. On my main website http://www.fibracing.co.uk I have a script to get the latest 5 forum topics made, that works perfectly but for some reason everytime a page is loaded its causing the forum to end its current session and log you out. I've tried everything I can think of and I just cant seem to find any solution.

Here is the code:

The following code is used above all the meta tags etc... I have removed quotes to save the post from being huge lol
<?php

$phpbb_root_path = 'forum/';

define ('IN_PHPBB', true);

if (!file_exists($phpbb_root_path . 'extension.inc'))
{
die ('<tt><b>phpBB Fetch All:</b>
$phpbb_root_path is wrong and does not point to your forum.</tt>');
}

include_once ($phpbb_root_path . 'extension.inc');

include_once ($phpbb_root_path . 'common.' . $phpEx);

include_once ($phpbb_root_path . 'includes/bbcode.' . $phpEx);

include_once ($phpbb_root_path . 'mods/phpbb_fetch_all/common.' . $phpEx);

include_once ($phpbb_root_path . 'mods/phpbb_fetch_all/posts.' . $phpEx);

$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);

$news = phpbb_fetch_posts();

phpbb_disconnect();

// echo ('<pre>'); print_r($news); die();

?>

And this is the code used to echo out the posts in the page body:
<table>
<tr>
<td width="33%">

<strong><a href="<?php echo append_sid($phpbb_root_path . 'viewtopic.php?t=' . $news[0]['topic_id']); ?>" target="_blank"><?php echo $news[0]['topic_title']; ?></a></strong>
<br />
By:
<a href="<?php echo append_sid($phpbb_root_path . 'profile.php?mode=viewprofile&u=' . $news[0]['user_id']); ?>" target="_blank">
<?php echo $news[0]['username']; ?></a><br />
on <?php echo $news[0]['date']; ?> at <?php echo $news[0]['time']; ?>
<br />(<?php echo $news[0]['topic_replies']; ?>)
<a href="<?php echo append_sid($phpbb_root_path . 'viewtopic.php?t=' . $news[0]['topic_id']); ?>" target="_blank">
Comment<?php if ($news[0]['topic_replies'] != 1) { echo 's'; } ?></a><br /><br />

</td>
<td width="33%">

<strong><a href="<?php echo append_sid($phpbb_root_path . 'viewtopic.php?t=' . $news[1]['topic_id']); ?>" target="_blank"><?php echo $news[1]['topic_title']; ?></a></strong>
<br />
By:
<a href="<?php echo append_sid($phpbb_root_path . 'profile.php?mode=viewprofile&u=' . $news[1]['user_id']); ?>" target="_blank">
<?php echo $news[1]['username']; ?></a><br />
on <?php echo $news[1]['date']; ?> at <?php echo $news[1]['time']; ?>
<br />(<?php echo $news[1]['topic_replies']; ?>)
<a href="<?php echo append_sid($phpbb_root_path . 'viewtopic.php?t=' . $news[1]['topic_id']); ?>" target="_blank">
Comment<?php if ($news[1]['topic_replies'] != 1) { echo 's'; } ?></a><br /><br />

</td>

<td width="33%">

<strong><a href="<?php echo append_sid($phpbb_root_path . 'viewtopic.php?t=' . $news[2]['topic_id']); ?>" target="_blank"><?php echo $news[2]['topic_title']; ?></a></strong>
<br />
By:
<a href="<?php echo append_sid($phpbb_root_path . 'profile.php?mode=viewprofile&u=' . $news[2]['user_id']); ?>" target="_blank">
<?php echo $news[2]['username']; ?></a><br />
on <?php echo $news[2]['date']; ?> at <?php echo $news[2]['time']; ?>
<br />(<?php echo $news[2]['topic_replies']; ?>)
<a href="<?php echo append_sid($phpbb_root_path . 'viewtopic.php?t=' . $news[2]['topic_id']); ?>" target="_blank">
Comment<?php if ($news[2]['topic_replies'] != 1) { echo 's'; } ?></a><br /><br />

</td>
</tr>

<tr>
<td width="33%">

<strong><a href="<?php echo append_sid($phpbb_root_path . 'viewtopic.php?t=' . $news[3]['topic_id']); ?>" target="_blank"><?php echo $news[3]['topic_title']; ?></a></strong>
<br />
By:
<a href="<?php echo append_sid($phpbb_root_path . 'profile.php?mode=viewprofile&u=' . $news[3]['user_id']); ?>" target="_blank">
<?php echo $news[3]['username']; ?></a><br />
on <?php echo $news[3]['date']; ?> at <?php echo $news[3]['time']; ?>
<br />(<?php echo $news[3]['topic_replies']; ?>)
<a href="<?php echo append_sid($phpbb_root_path . 'viewtopic.php?t=' . $news[3]['topic_id']); ?>" target="_blank">
Comment<?php if ($news[3]['topic_replies'] != 1) { echo 's'; } ?></a><br /><br />

</td>

<td width="33%">

<strong><a href="<?php echo append_sid($phpbb_root_path . 'viewtopic.php?t=' . $news[4]['topic_id']); ?>" target="_blank"><?php echo $news[4]['topic_title']; ?></a></strong>
<br />
By:
<a href="<?php echo append_sid($phpbb_root_path . 'profile.php?mode=viewprofile&u=' . $news[4]['user_id']); ?>" target="_blank">
<?php echo $news[4]['username']; ?></a><br />
on <?php echo $news[4]['date']; ?> at <?php echo $news[4]['time']; ?>
<br />(<?php echo $news[4]['topic_replies']; ?>)
<a href="<?php echo append_sid($phpbb_root_path . 'viewtopic.php?t=' . $news[4]['topic_id']); ?>" target="_blank">
Comment<?php if ($news[4]['topic_replies'] != 1) { echo 's'; } ?></a><br /><br />

</td>
<td width="33%"><a href="http://www.fibracing.co.uk/forum/" target="_blank"><img src="http://www.fibracing.co.uk/images/forumbutton.jpg" border="0" alt="Visit the forums!" /></a></td>
</tr>
</table>

Sorry if this is massive lol I'm just dying for a solution its been a problem ive been trying to solve without scrapping the script for many days now. I haven't been into webdesign all that long so its probably something simple I have overlooked.

Any replys would be great!
Thanks in advance,
Dale.

PHP PHPbb buffs I need help!
(1 post, started )
FGED GREDG RDFGDR GSFDG