UseBB Community

UseBB support, discussion and development

Latest Post in html (php) page.

Moderators: Gaia.

Post Reply

Page: 1

Author Post
Member
Registered: Mar 2009
Posts: 4
I got this script from an older post.

The code below works as far as displaying the last activity. The links to the post have:

/genealogy/Forum/topic.....

where /genealogy/ is the sub directory where I have the code on a test.php on the subdirectory that I want to make the page display the info.

How can I change the scipt to make the link to the post without /genealogy/ so the link looks like this /Forum/topic.... to get the path correct on the link.


<?php
mysql_connect('', '', '');
mysql_select_db('');
$r = mysql_query("SELECT t.id, t.topic_title
FROM usebb_posts p, usebb_topics t, usebb_forums f
WHERE f.auth LIKE '0%' AND t.forum_id = f.id AND p.id = t.last_post_id
ORDER BY p.post_time DESC LIMIT 10");
echo '<ul>';while ( $out = mysql_fetch_array($r) ) {
echo '<li><a href="Forum/topic.php?id='.$out['id'].'">';
echo htmlspecialchars($out['topic_title']).'</a></li>';
}echo '</ul>';
?>



TIA
JoeP
Member
Registered: Mar 2009
Posts: 4
I got it going. Thank you!

Post Reply

Page: 1

UseBB Community is powered by UseBB 1 Forum Software