Log in

View Full Version : Old top Ten thread code no longer works, help?


MetalAges
10-08-2005, 01:11 AM
Hey there all,

I had the following code that pulled the top ten latest threads from any given forum (worked fine until upgrading to 3.5.0):


<?php
error_reporting(7);

$templatesused='latest_hostedthreadbits,latest_hos tedthreads';


require('./global.php');

$latest = $DB_site->query("SELECT * FROM thread WHERE forumid='$fid' ORDER BY lastpost DESC LIMIT 10");


while ($recent = $DB_site->fetch_array($latest)) {

$title = $recent['title'];
$id = $recent['threadid'];
eval("\$latest_threads .= \"".fetch_template("latest_hostedthreadbits")."\";");
}




eval("print_output(\"".fetch_template('latest_hostedthreads')."\");");

?>


I pulled it into the page with the following include:

<?php include("http://www.ultimatemetal.com/forum/hosted10.php?s=&fid=294&size=1"); ?>

That code produces errors in 3.5.0 . I changed the code to this and now it just displays nothing:


<?php
error_reporting(7);

$templatesused='latest_hostedthreadbits,latest_hos tedthreads';

require_once('./global.php');

$latest = $db->query_read("SELECT * FROM thread WHERE forumid='$fid' ORDER BY lastpost DESC LIMIT 10");

while ($recent = $db->fetch_array($latest)) {

$title = $recent['title'];
$id = $recent['threadid'];
eval("\$latest_threads .= \"".fetch_template("latest_hostedthreadbits")."\";");
}

eval("print_output(\"".fetch_template('latest_hostedthreads')."\");");

?>


Any help appreciated, can't quite figure out why it isn't working. Here is what it produces:

<html>
<body bgcolor="" text="" link="" vlink="" alink="">

</body></html>