MyBB Community Forums
[REQUEST] Latest Forum Action - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Plugins (https://community.mybb.com/forum-73.html)
+---- Forum: Plugin Requests (https://community.mybb.com/forum-65.html)
+---- Thread: [REQUEST] Latest Forum Action (/thread-6118.html)



[REQUEST] Latest Forum Action - leatherface - 2006-01-17

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?


RE: [REQUEST] Latest Forum Action - leatherface - 2006-01-17

anybody?


RE: [REQUEST] Latest Forum Action - Ryan Gordon - 2006-01-17

yea. I've made two custom ones already. give me a sec and I'll whip one up


RE: [REQUEST] Latest Forum Action - Ryan Gordon - 2006-01-17

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


RE: [REQUEST] Latest Forum Action - leatherface - 2006-01-19

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