MyBB Community Forums

Full Version: 2 forum or more the latest thread show up into site?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello

Anyone know? i have succefuly to get latest thread forum 1 into site.

Now how to get the second forum as the code is. let says forum 1 is lynx and second muka. what i have to do?

Quote:<?php
chdir("lynx/"); // path to MyBB
define("IN_MYBB", 1);
require("./global.php");
$tlimit = 5; // How many titles you want


$query = $db->query("SELECT * FROM ".TABLE_PREFIX."threads ORDER BY tid DESC LIMIT $tlimit");

$list = '';
while($fetch = $db->fetch_array($query))
{
$list .= " | <strong><a href=\"lynx/showthread.php?tid={$fetch['tid']}\" target=\"_blank\">".htmlspecialchars_uni($fetch['subject'])."</a></strong>";
/*
$poster = "<a href=\"forum/member.php?action=profile&uid=".$fetch['uid']."\">{$fetch['username']}</a>";
$list .= "Created by: {$poster} ";
$list .= "<i>" .$fetch['replies']. " Replies</i>";
$list .= "<i> , " .$fetch['views']. " Views</i> ";
$list .= " (<i>Last post by: " .$fetch['lastposter']. "</i>)<br /><hr width=\"50\"><br />";
*/
}


//output

echo $list;

?>

thx
EDIT: Oops, I read this wrong.

You would have to change up the script a bit. Do you have the two forums in the same database, with two different prefixes or are they in different databases?