include "/usr/home/knight/includes/site_translate.php";
include "/usr/home/knight/includes/overall.php";
include "/usr/home/knight/includes/seed.php";
include "/usr/home/knight/includes/bbcode.php";
// gyorokpeter: dropped the whole forum session thing from here
// now at least index.php won't break if forum is down
// You set these values!
$phpbb_root_path = 'forums/';
$forum_id = '32';
$limit = '5';
show_header($sitetext["welcome"]);
echo $ajaxtooltips
?>

echo $sitetext["welcome1"]."
".$sitetext["welcome2"]."
".$sitetext[
"welcome3"]."
";
if ($sitelang != "us") {
show_footer();
die();
}
// Grab info from the database.
$result = mysql_query("SELECT * FROM phpbb_posts WHERE forum_id='{$forum_id}' Order by post_time DESC LIMIT $limit");
// Show all records.
while($row = mysql_fetch_assoc($result)) {
$time = date("F j, Y, g:i a",$row['post_time']);
// gotta get the uid for bbcode 13 - //158bu3j6 or /\[item:?{8}\]\b[1-9][0-9]{8}\b\[\/item:?{8}\]/i
// Added by CT - to allow us to use "[item]244000002[/item]" to display tooltip
$num = preg_match_all("/\[item\]\b[1-9][0-9]{8}\b\[\/item\]/i", $row['post_text'], $matches);
if ($num) {
$matches = preg_replace("/\D/", "", $matches[0]);
foreach($matches as $key => $match){
$matches[$key] = ko_item($match);
$replace[] = '/\[item\]'.$match.'\[\/item\]/i';
}
$row['post_text'] = preg_replace($replace, $matches, $row['post_text']);
}
//
//this function is in bbcode.php, not the forum one.
$text = generate_text_for_display($row['post_text'], $row['bbcode_uid'], $row['bbcode_bitfield'], $row['enable_bbcode'] = $row['enable_smilies'] = $row['enable_magic_url'] = true);
$title = "{$row['post_subject']}";
$uresult = mysql_query("SELECT username FROM {$table_prefix}users WHERE user_id='{$row['poster_id']}'");
$urow = mysql_fetch_row($uresult);
$name = "{$urow['username']}";
echo <<< EOF
| $title | $time |
$text |
EOF;
Seed();
echo <<< EOF
|
| $name |
EOF;
}
// Close database connection.
mysql_close();
?>
View all news here!