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?
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; }
$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();

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

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

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