MyBB Community Forums

Full Version: [REQUEST] Latest Forum Action
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I dont know if this mod is already made but i'll request it anway...

I would like a mod that shows the 5 latest topics on your web site. Can this be done?
anybody?
yea. I've made two custom ones already. give me a sec and I'll whip one up
PHP Code:
<style type="text/css">
body font-familyArial; }
</
style>
<?
$link mysql_connect('YOUR DB HOST''YOUR DB USER''YOUR DB PASS');
if (!
$link) {
�� die('Could not connect: ' mysql_error());
}

$db_selected mysql_select_db('YOUR DB'$link);
if (!
$db_selected) {
�� die ('Can\'t open DB : ' mysql_error());
}

$sql 'SELECT * FROM mybb_threads ORDER BY tid DESC LIMIT 0, 5';
$result mysql_query($sql$link);

if (!
$result) {
�� echo "DB Error, could not query the database\n";
�� echo 'MySQL Error: ' mysql_error();
�� exit;
}

for (
$i=0$i mysql_num_rows($result); $i++) {
echo 
"+ <a href=\"/showthread.php?tid=".mysql_result($result$i0)."\" target=\"_blank\" style=\"color: #0080FF\" size=\"1\">".mysql_result($result$i2)."</a><br />";
}
mysql_free_result($result);
mysql_close($link);
?>

put this in your MyBB folder, and you need to replace the mysql_connect() and mysql_select_db() with the correct values.

Cheers
Okay im new to mybb so can you explain what i do more better?