So for widget it must be like this:
PHP Code:
ob_start();
require_once('./includes/functions_user.php');
require_once('./includes/functions_bigthree.php');
// Get Latest Sticky Threads
$selectthread = vB::$db->query_read("SELECT * FROM `thread` WHERE `forumid`='171' ORDER BY RAND() LIMIT 0,1");
$output_bits = '';
while($row = vB::$db->fetch_array($selectthread))
{
$attc = $row[firstpostid] ;
$selectattachment =vB::$db->query_read("SELECT * FROM `attachment` WHERE `contentid`='{$attc}'");
while ($att=vB::$db->fetch_array($selectattachment)) {
$output_bits .= "<img src='attachment.php?attachmentid=".$att[attachmentid]."&stc=1&thumb=1&d=1262998375' /><br /><a href='showthread.php?t=".$row[threadid]." target="_self"'>'.$row[title].'</a>";
}
}
$output = $output_bits;
ob_end_clean();