include "/home/gcr/template.inc"; include "/home/gcr/_funciones/vars.inc.txt"; require "/home/gcr/public_html/forums/ipbsdk/ipbsdk_class.inc.php"; require('/home/gcr/_funciones/generales.php'); $torneo = 27; $galeria = 'category_id = 25 OR category_id = 25'; $t = new Template("./"); $t->set_file(array( "mainpage" => "index.htm", "enlaces" => "template_noticias.htm")); $link = mysql_connect("$dbHost", "$dbUser", "$dbPass") or die("Could not connect : " . mysql_error()); mysql_select_db("$dbDatabase1") or die("Could not select database"); $query = "SELECT count(tor_clan.name) FROM tor_clan WHERE idtournament= $torneo"; $result = mysql_query($query) or die("Query failed : " . mysql_error()); while (list( $clanes) = mysql_fetch_row($result)){ $t->set_var("cl",$clanes); $clanes = 6 - $clanes; $t->set_var("cu",$clanes); } $link = mysql_connect("$dbHost", "$dbUser", "$dbPass") or die("Could not connect : " . mysql_error()); mysql_select_db("$dbDatabase1") or die("Could not select database"); $query = "SELECT ibf_topics.tid, ibf_topics.title, ibf_topics.starter_name, ibf_topics.starter_id, ibf_topics.start_date, ibf_topics.last_poster_name, ibf_topics.last_poster_id, ibf_topics.posts, ibf_topics.last_post, ibf_posts.post FROM ibf_topics, ibf_posts WHERE (ibf_topics.forum_id=36) AND new_topic = 1 AND ibf_posts.topic_id = ibf_topics.tid AND ibf_topics.approved = 1 ORDER BY ibf_topics.start_date DESC LIMIT 10"; $result = mysql_query($query) or die("Query failed : " . mysql_error()); while (list( $tid, $title, $autor, $starter_id, $start_date, $last_poster, $last_poster_id, $posts, $last_post, $text) = mysql_fetch_row($result)) { $title2 = $title; $MAX_LENGTH = 27; $str_to_count = html_entity_decode($title); if (strlen($str_to_count) >= $MAX_LENGTH) { $s2 = substr($str_to_count, 0, $MAX_LENGTH - 3); $s2 .= "..."; $title = ($s2); } $fecha=date("j.M.y",$start_date); $last_post_date=date("j M Y, h:i A",$last_post); $t->set_var("tid",$tid); $t->set_var("post_date",$fecha); $t->set_var("topic_title",$title); $t->set_var("member_name",$autor); $t->set_var("autor_id",$starter_id); $t->set_var("last_poster",$last_poster); $t->set_var("last_poster_id",$last_poster_id); $t->set_var("replies",$posts); $t->set_var("posts",$posts); $t->set_var("post",$text); $t->set_var("last_post",$last_post_date); $t->parse("encabezados","enlaces",true); } $link = mysql_connect("$dbHost", "$dbUser", "$dbPass") or die("Could not connect : " . mysql_error()); mysql_select_db("$dbDatabase1") or die("Could not select database"); $query = "SELECT ibf_topics.tid, ibf_topics.title, ibf_topics.starter_name, ibf_topics.starter_id, ibf_topics.start_date, ibf_topics.last_poster_name, ibf_topics.last_poster_id, ibf_topics.posts, ibf_topics.last_post, ibf_posts.post FROM ibf_topics, ibf_posts WHERE (ibf_topics.forum_id=60) AND new_topic = 1 AND ibf_posts.topic_id = ibf_topics.tid AND ibf_topics.approved = 1 ORDER BY ibf_topics.start_date DESC LIMIT 10"; $result = mysql_query($query) or die("Query failed : " . mysql_error()); while (list( $tid, $title, $autor, $starter_id, $start_date, $last_poster, $last_poster_id, $posts, $last_post, $text) = mysql_fetch_row($result)) { $title2 = $title; $MAX_LENGTH = 27; $str_to_count = html_entity_decode($title); if (strlen($str_to_count) >= $MAX_LENGTH) { $s2 = substr($str_to_count, 0, $MAX_LENGTH - 3); $s2 .= "..."; $title = ($s2); } $fecha=date("j.M.y",$start_date); $last_post_date=date("j M Y, h:i A",$last_post); $t->set_var("tid",$tid); $t->set_var("post_date",$fecha); $t->set_var("topic_title",$title); $t->set_var("member_name",$autor); $t->set_var("autor_id",$starter_id); $t->set_var("last_poster",$last_poster); $t->set_var("last_poster_id",$last_poster_id); $t->set_var("replies",$posts); $t->set_var("posts",$posts); $t->set_var("post",$text); $t->set_var("last_post",$last_post_date); $t->parse("noticias","enlaces",true); } $link = mysql_connect("$dbHost", "$dbUser", "$dbPass") or die("Could not connect : " . mysql_error()); mysql_select_db("$dbDatabase1") or die("Could not select database"); $query = "SELECT id, masked_file_name, directory FROM ibf_gallery_images WHERE $galeria ORDER BY RAND( NOW( ) ) LIMIT 1 "; $result = mysql_query($query) or die("Query failed : " . mysql_error()); while (list( $tid, $file, $directorio) = mysql_fetch_row($result)) { $file = 'http://www.gamingcr.com/forums/uploads/'.$directorio.'/'.$file; $t->set_var("file",$file); $t->set_var("file_tid",$tid); } $SDK =& new IPBSDK(); $numero = $ipb->member['id']; if ($SDK->is_loggedin()) { $info = $SDK->get_info(); $username = $info['name']; $numero = $info['id']; $ultima = 'Logout'; $enlaces = 'Registrarse'; $member_titulo = $ipb->member['title']; fpremium ($numero, $ispremium); if ($ispremium = 0){ $member_status = $SDK->get_avatar(); $b = strpos($member_status, 'border='); $member_status = substr($member_status, 10, $b - 12); } else { $member_status = $SDK->get_avatar(); $b = strpos($member_status, 'border='); $member_status = substr($member_status, 10, $b - 12); } } else { $username = 'Invitado'; $ultima ='Login'; $enlaces = 'Registrarse'; $member_status = "http://gamingcr.com/images/Mapas/nomap.gif"; $member_titulo = "Sin rango"; } $t->set_var("username",$username); $t->set_var("ultima",$ultima); $t->set_var("leyenda",$leyenda); $t->set_var("enlaces",$enlaces); $t->set_var("controlpanel",$controlpanel); $t->set_var("member_status",$member_status); $t->set_var("member_titulo",$member_titulo); $online = $SDK->list_online_members("1"); // Grab Online Members - Detailed Info $details = $SDK->get_active_count(); $stats = $SDK->get_board_stats(); $totalonline = count($online); // Count up amount of people online $list = ""; // Initalize Variable $n = 0; if (count($online)) { foreach ($online as $i) { $list = ''.$i['name'].''; $t->set_var("lista",$list); $n = $n + 1; $t->set_var("i",$n); $t->parse("usuarios_online","conectados",true); } } $totals = $stats['total_topics'] + $stats['total_replies']; $t->set_var("utotal",$details['total']); $t->set_var("miembros",$details['members']); $t->set_var("invitados",$details['guests']); $t->set_var("anonimos",$details['anon']); $t->set_var("tusers", $stats['mem_count']); $t->set_var("treplies", $totals); $t->pparse("output","mainpage"); // output the value of MyOutput (our parsed data) /* Free resultset */ mysql_free_result($result); /* Closing connection */ mysql_close($link); ?>