getWhere('mc_servers', array('is_default', '=', 1)); $pre17 = $main_ip[0]->pre; $query_ip = htmlspecialchars($main_ip[0]->query_ip); $main_ip = htmlspecialchars($main_ip[0]->ip); /* * Get port of Minecraft server */ $parts = explode(':', $query_ip); if(count($parts) == 1){ $domain = $parts[0]; $default_ip = $parts[0]; $default_port = 25565; } else if(count($parts) == 2){ $domain = $parts[0]; $default_ip = $parts[0]; $default_port = $parts[1]; $port = $parts[1]; } else { echo 'Invalid Query IP'; die(); } // Get IP to display $parts = explode(':', $main_ip); if(count($parts) == 1){ $display_domain = $parts[0]; } else if(count($parts) == 2){ $display_domain = $parts[0]; $display_port = $parts[1]; } else { echo 'Invalid Display IP'; die(); } if((!isset($display_port))||($display_port == "25565")){ $address = $display_domain; } else { $address = $display_domain . ':' . $port; } $connect_with = str_replace('{x}', htmlspecialchars($address), $general_language['connect_with']); $smarty->assign('CONNECT_WITH', $connect_with); // Query the main IP // Are we using the built-in query or an external API? $external_query = $queries->getWhere('settings', array('name', '=', 'external_query')); $external_query = $external_query[0]->value; if($external_query == 'false'){ // Built in query, continue as normal require('core/integration/status/global.php'); } else { // External query $cache = new Cache(); require('core/integration/status/global_external.php'); } if(empty($Info)){ // Unable to query, offline $smarty->assign('MAIN_ONLINE', 0); } else { // Able to query, online $smarty->assign('MAIN_ONLINE', 1); } // Player count if($pre17 == 0){ $player_count = $Info['players']['online']; } else { $player_count = $Info['Players']; } if($player_count == 1) $smarty->assign('PLAYERS_ONLINE', $general_language['1_player_online']); else if($player_count > 1) $smarty->assign('PLAYERS_ONLINE', str_replace('{x}', $player_count, $general_language['x_players_online'])); else $smarty->assign('PLAYERS_ONLINE', $general_language['no_players_online']); ?>
display('styles/templates/' . $template . '/navbar.tpl'); // Session if(Session::exists('home')){ $smarty->assign('SESSION_FLASH', Session::flash('home')); } else { $smarty->assign('SESSION_FLASH', ''); } // Generate code for page $smarty->assign('SITENAME', $sitename); $smarty->assign('NEWS', $general_language['news']); $smarty->assign('SOCIAL', $general_language['social']); // Get news content $forum = new Forum(); // Initialise the forum to get the latest news $latest_news = $forum->getLatestNews(5); // Get latest 5 items // HTML Purifier require_once('core/includes/htmlpurifier/HTMLPurifier.standalone.php'); $config = HTMLPurifier_Config::createDefault(); $config->set('HTML.Doctype', 'XHTML 1.0 Transitional'); $config->set('URI.DisableExternalResources', false); $config->set('URI.DisableResources', false); $config->set('CSS.Trusted', true); $config->set('HTML.Allowed', 'u,p,b,i,a,small,blockquote,span[style],span[class],p,strong,em,li,ul,ol,div[align],br,img'); $config->set('CSS.AllowedProperties', array('position', 'padding-bottom', 'padding-top', 'top', 'left', 'height', 'width', 'overflow', 'text-align', 'float', 'color','background-color', 'background', 'font-size', 'font-family', 'text-decoration', 'font-weight', 'font-style', 'font-size')); $config->set('HTML.AllowedAttributes', 'target, href, src, height, width, alt, class, *.style'); $config->set('Attr.AllowedFrameTargets', array('_blank', '_self', '_parent', '_top')); $config->set('HTML.SafeIframe', true); $config->set('URI.SafeIframeRegexp', '%^(https?:)?//(www\.youtube(?:-nocookie)?\.com/embed/|player\.vimeo\.com/video/)%'); $purifier = new HTMLPurifier($config); $news = array(); foreach($latest_news as $item){ // Get poster's avatar $avatar = '