2006-07-21, 11:14 AM
2006-07-21, 11:32 AM
you can't do that on a normal html page. I advice you to copy the whole code into a phpfile and add this piece of code where you want to show the latest thread.
The part after echo is a normal html link. You can always change the html a bit, but I advice you to keep this link intact.
<?php
require "forum/global.php";
$query = mysql_query("SELECT * FROM ".TABLE_PREFIX."threads WHERE 1=1 ORDER BY dateline DESC LIMIT 0,1");
$thread = mysql_fetch_array($query);
echo '<a href="forum/showthread.php?tid='.$thread['tid'].'">'.$thread['subject'].'</a>';
?>
The part after echo is a normal html link. You can always change the html a bit, but I advice you to keep this link intact.
2006-07-21, 11:43 AM
Thank You !!!
Working Great
Working Great
2006-07-21, 12:15 PM
Please replace the query with the following so that drafts are not shown:
$query = mysql_query("SELECT * FROM ".TABLE_PREFIX."threads WHERE visible = '1' ORDER BY dateline DESC LIMIT 0,1");
2006-07-22, 12:28 AM
Hmm, but this doesnt seem to work for me. My forum is on / but my site is on /kb and it won't link correctly. Can this be fixed?
2006-07-22, 12:41 PM
Replace the line
echo '<a href="forum/showthread.php?tid='.$thread['tid'].'">'.$thread['subject'].'</a>';
withecho '<a href="http://www.your_url.tld/showthread.php?tid='.$thread['tid'].'">'.$thread['subject'].'</a>';
Replace http://www.your_url.tld/showthread.php with the real URL to your forums.2007-01-05, 10:25 PM
hello everybody,
I hope you are having a great new year start.
The above code is not working in my case.
it says
what should I do ?
I hope you are having a great new year start.
The above code is not working in my case.
it says
Direct initialization of this file is not allowed.
Please make sure IN_MYBB is defined.
what should I do ?