[REQUEST] Latest Forum Action
#4
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
Reply


Messages In This Thread
[REQUEST] Latest Forum Action - by leatherface - 2006-01-17, 07:48 AM
RE: [REQUEST] Latest Forum Action - by Ryan Gordon - 2006-01-17, 11:36 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)