function b_lastarticles() { $name_function = "b_lastarticles"; $name_display = "Newest Articles"; global $a, $db, $blocks_db, $template, $language, $config, $misc, $PHP_SELF, $is_loged_in, $is_moderator, $is_administrator, $is_webmaster, $months, $days, $m, $y, $OnlineGuestsCount, $OnlineMembersCount; $random_code = md5("$name_function"); $random_code = substr("$random_code", 0, 5); if(!isset($content)) $content = NULL; if(!isset($_GET["$random_code"])) $_GET["$random_code"] = NULL; if($_GET["$random_code"] == "on") $_SESSION["$random_code"] = "on"; elseif($_GET["$random_code"] == "off") $_SESSION["$random_code"] = "off"; $query_string = "?{$_SERVER['QUERY_STRING']}"; foreach($blocks_db as $blocks) { $block_code = md5("{$blocks['name']}"); $block_code = substr("$block_code", 0, 5); $query_string = str_replace("&$block_code=off","", $query_string); $query_string = str_replace("&$block_code=on","", $query_string); } if($query_string == "?" || strpos($query_string, '=on') !== false || strpos($query_string, '=off') !== false) $code_query = "?"; else $code_query = "$query_string&"; if(!isset($_SESSION["$random_code"]) || $_SESSION["$random_code"] == "on") $links = " $name_display"; elseif($_SESSION["$random_code"] == "off") $links = " $name_display"; $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") { $last_downloads = $db->getTable("SELECT * FROM articles ORDER BY 'id' DESC LIMIT 5"); if(!isset($lastdownloads)) $lastdownloads = NULL; if($last_downloads != FALSE) { foreach($last_downloads as $idxx=>$last_download) { $lastdownloads .= "