2010-06-25, 01:54 PM
Im using the code below to display the latest threads on a webpage from my forum. Im using the same code on another website and ive just changed the url in the code to use it with another forum, but it wont display the latest threads. Can anyone spot what im doing wrong ?
Its just displaying a blank page : http://www.windowsfreebies.com/latestthreadspopup.php
<html>
<head>
</head>
<body>
<body bgcolor="Silver">
<br>
<?php
chdir("http://www.windowsfreebies.com/"); // path to MyBB
define("IN_MYBB", 1);
require("global.php");
?>
<?php
$query = mysql_query("
SELECT t.*, u.username
FROM mybb_threads t
LEFT JOIN mybb_users u ON (u.uid=t.uid)
WHERE 1=1 AND t.visible='1' AND t.closed NOT LIKE 'moved|%'
ORDER BY t.lastpost DESC
LIMIT 0, 10" // Change the last digit to how many recent post you want to be shown
);
$list = '';
while($fetch = mysql_fetch_array($query))
{
$list .= "<strong><a href=http://www.windowsfreebies.com/showthread.php?tid={$fetch['tid']}\">".htmlspecialchars_uni($fetch['subject'])."</a></strong><br />";
$poster = "<a href=http://www.windowsfreebies.com/member.php?action=profile&uid=".$fetch['uid']."\">{$fetch['username']}</a>";
$list .= "Created by: {$poster}<br />";
$list .= "<i>" .$fetch['replies']. " Replies</i>";
$list .= " (<i>Last post by: " .$fetch['lastposter']. "</i>)<br /><hr width=\"50\"><br />";
}
//output
echo $list;
?>
</body>
</html>
Its just displaying a blank page : http://www.windowsfreebies.com/latestthreadspopup.php