connect(); init(); // MyNG setting up... // Set up the language modules_get_language(); // Templates $t = new Template($_SESSION['conf_system_root']."/themes/".$_SESSION['conf_vis_theme']."/templates/"); //Registramos el momento actual $current_time=time(); // Manage the login module $left_bar = manage_login($current_time,$t,$db); // Get the page number to show if(isset($_GET['page']) && $_GET['page'] != 0){ // We assure that the first page is shown if we // came from the newsgroups list page $page = $_GET['page']; }else{ $page = 1; } // Check if there are any newsgroups registered $consulta = sprintf("SELECT * FROM myng_newsgroup ORDER BY grp_name"); $db->query($consulta); if($db->num_rows() == 0){ // Redirect to the error page header("Location:".$_SESSION['conf_system_prefix']."error.php?error_id=1"); } $news_groups = array(); // Get the groups' data read_groups($ns,$serv_id,$port,$news_groups,$_SESSION['conf_system_zlib_yn']); //$system_info = _MYNGBROWSE_NG; $system_info ="Welcome to the Online Community for Environmental Issues"; $main = "newsgroups.htm"; $t->set_file("main",$main); $t->set_block("main","groups_block","groups_block_handle"); $t->set_block("main","nav_block","nav_block_handle"); // Count the number of groups $num_elements = sizeof($news_groups); // Limit the groups to show $primer_elemento = ($page - 1) * $_SESSION['conf_vis_nav_bar_items']; // Slice the array of groups $news_groups = array_slice($news_groups, $primer_elemento, $_SESSION['conf_vis_nav_bar_items']); if(!isset($_SESSION['usr_name'])){ $register_message = '
Not a user? Click here to register today!
'; } show_newsgroups($news_groups,$t); // Show the navegation bar navigation_bar($num_elements,$page); $challenge=md5(uniqid($myng['cadena'])); $t->set_var("secret_challenge",$challenge); $t->set_var("total_articles",$total_groups_article_count); $finish = finish_time($start); $t->set_var("page_time",$finish); $t->set_var("banner_ad", context_ad('728x90')); $t->set_var("register",$register_message); // Show all the page show_layout($t,$left_bar,$system_info,MYNG_VERSION); ?>