View Full Version : Plz help
Carnage540
04-18-2003, 04:46 AM
Hello guy..i want to include a latest forum post thing on my main page of my website. is there a hack or a way to do it. thanks.
it would look like this
Latest forum post
>> Hey guys
>> Welcome to the forum
>> Another forum post
and if it could limit character so if the subject is long it goes:
>> Hey guy wh...
etc.
Thanks!!
$posttext = $DB_site->query_first('SELECT text FROM post ORDER BY dateline');
if (strlen($posttext) > NUMBER) {
$posttext = substr($posttext, -3);
$posttext .= '...';
}
sorry, it's late so this is a general idea of what to do :)
Carnage540
04-19-2003, 07:03 AM
I don't get it. is there any site i can just download a .php file to include. or a code...i don't think that works on the main page.
I want to do it like your site ( i think it your site)
http://www.sitetutor.net/
The " Latest Threads " on the right...
i help out the guy who owns it, but is this more what your looking for? just put this inside any php file where you want the text to go
$getthreads = $DB_site->query('SELECT threadid, title, lastposter, lastpost FROM thread ORDER BY dateline DESC LIMIT 10');
print '<table>';
while($threads = $DB_site->fetch_array($getthreads)) {
print '<tr><td><a href="FORUMURL/showthread.php?s='.$session['sessionhash'].'&goto=newpost&threadid='.$threads['threadid'].'">'.$threads['title'].'</a><br />';
print 'Last Post by: '.$threads['lastposter'].'<br />';
print 'Posted on: '.vbdate($dateformat, $threads['lastpost']).'</td></tr>';
}
print '</table>';
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.