{$language_block['Forum title']}"; elseif($_SESSION["$random_code"] == "off") $links = " {$language_block['Forum title']}"; $template_block = implode("", file("templates/$template/block.php")); $template_block = str_replace("{template}", $template, $template_block); $template_block = str_replace("{links}", $links, $template_block); if(!isset($_SESSION["$random_code"]) || $_SESSION["$random_code"] == "on") { //----------------------------------------------------------------- // Get Table + Restrictions //----------------------------------------------------------------- if(isset($is_moderator) || isset($is_administrator) || isset($is_webmaster)) $forum_topics = $db->getTable("SELECT f.id AS fid, f.type, f.cat, f.subcat, f.lastpost_date, f.name, f.lastpost_id, f.lastpost_user, f.lastpost_email, f.lastpost_location, u.id AS uid, u.username FROM forum_topics AS f LEFT JOIN users AS u ON f.lastpost_id = u.id ORDER BY lastpost_date DESC LIMIT {$language_block['Forum config']}"); else $forum_topics = $db->getTable("SELECT f.id AS fid, f.type, f.cat, f.subcat, f.lastpost_date, f.name, f.lastpost_id, f.lastpost_user, f.lastpost_email, f.lastpost_location, s.id AS sid, s.type, u.id AS uid, u.username FROM forum_topics AS f LEFT JOIN forum_subcat AS s ON (s.id = f.subcat AND s.type != 3) LEFT JOIN users AS u ON f.lastpost_id = u.id WHERE f.subcat = s.id ORDER BY lastpost_date DESC LIMIT {$language_block['Forum config']}"); //----------------------------------------------------------------- // Make Foreach //----------------------------------------------------------------- foreach($forum_topics as $idx=>$forum_topic) { if($forum_topic['type'] != "3") { $content .= ""; $content .= "{$language_block[ ".today_yesterday($forum_topic['lastpost_date'],true).""; $content .= "
"; $content .= " » ".cuttext($forum_topic['name'],21)."
{$language_block['Forum by']} "; if(isset($forum_topic['username'])) $content .= "{$forum_topic['username']}"; else $content .= "{$forum_topic['lastpost_user']}"; $content .= " {$language_block["; $content .= ""; } } } $template_block = str_replace("{content}", $content, $template_block); $output = $template_block; return $output; } ?>