<br /><?<br />// Variables Section - Edit these to suit your needs<br />// Number of threads to show<br />$numposts = 10;<br /><br />//number of characters of the subject to display<br />$numchars = 40;<br /><br />// -----------------------------<br />// End of the variables section<br /><br />require_once ("./includes/main.inc.php");<br />// --------------------------<br />// Let's grab the threads<br />$query = "<br /> SELECT B_Number, B_Subject<br /> FROM {$config['tbprefix']}Posts<br /> WHERE B_Parent = '0'<br /> ORDER BY B_Posted DESC<br /> LIMIT $numposts<br />";<br />$sth = $dbh -> do_query($query); <br /><br />// -----------------------<br />// Cycle through the posts<br />while ( list($Number,$Subject) = $dbh -> fetch_array($sth)) {<br /> $Subject =substr($Subject,0,$numchars) . "...";<br /> $toprint .= "<a href=\"{$config['phpurl']}/showflat.php/Number/$Number\">$Subject</a><br \>";<br />}<br />$dbh -> finish_sth($sth);<br />echo $toprint;<br />