<?php
/*
	Dvbbs.php  - Version: 2.0.0
	Web: http://www.dvbbs.net
	Copyright: 2000-2006 Dvbbs.Net
	script file:index.php
	Function of the Page:homepage of blakol
	*/
define('THIS_SCRIPT', 'index');
require_once './global.php';
checklogin();
$lang=load_lang($lang, 'index' );
header("content-Type: text/html; charset=".$charset);
switch ($_GET['action']) {
	case '':
		frameset();
		break;
	case 't':
		$bodystyle=' style="padding:0px;"';
		head($lang['page_title_t']);
		$fver = VERSION;
		$domain = $ForumUrl;
		$domain = substr(md5($domain),0,16);
		$strlen = strlen($domain);
		$forumid = '';
		for ($i = 0; $i < $strlen; $i++) {
			if (is_numeric($domain{$i})) {
				$forumid .= $domain{$i};
			} else {
				$forumid .= ord($domain{$i}).'';
			}
		}
		$ftoday=$db->scalar("Select Sum(todaynum) as length From {$dv}board Where allowpost=1");
		$fol=$db->scalar("Select Count(*) as length From {$dv}online");
		require_once printout('index');
		$db->close;
		$output = str_replace(array('<!--<!---->','<!---->'),array('',''),ob_get_contents());
		ob_end_clean();
		$db_obstart == 1 ? ob_start('ob_gzhandler') : ob_start();
		echo $output.'</body></html>';
		flush;
		exit;
		break;
	case 'l':
		$bodystyle=' style="background:#799AE1;"';
		head($lang['page_title_l']);
		show_menu();
		$db->close;
		$output = str_replace(array('<!--<!---->','<!---->'),array('',''),ob_get_contents());
		ob_end_clean();
		$db_obstart == 1 ? ob_start('ob_gzhandler') : ob_start();
		echo $output.'</body></html>';
		flush;
		exit;
		break;
	case 'r':
		head($lang['page_title_r']);
		get_system_info();
		break;
	default:
		head($lang['page_title_r']);
		footer();
}
function get_system_info(){
	global $db,$lang,$forum_chansetting,$forum_pack,$forum_topicnum,$forum_postnum,$forum_usernum,$dv,$forum_info;
	$query=$db->query('select count(*) from '.$dv.'board');
	$board_count=@$db->result($query, 0,0);
	$query=$db->query('select count(*) from '.$dv.'user where usergroupid=5');
	$access_user=@$db->result($query, 0,0);
	$pay_user=$forum_chansetting[4];
	$site_username=$forum_pack[1];
	$site_password=$forum_pack[2];
	$server_os = PHP_OS.' + '.$_SERVER['SERVER_SOFTWARE'];
	$script_version= 'PHP '.PHP_VERSION.' '.strtoupper(php_sapi_name());
	$upload_max_filesize=getcon("upload_max_filesize");
	$smtp=get_yn_str(get_magic_quotes_gpc("smtp"));
	require_once printout('index');
	}
function frameset(){
	global $db,$db_obstart,$lang,$forum_type,$charset;
	require_once printout('frameset');
	$db->close;
	$output = str_replace(array('<!--<!---->','<!---->'),array('',''),ob_get_contents());
	ob_end_clean();
	$db_obstart == 1 ? ob_start('ob_gzhandler') : ob_start();
	echo $output;
	flush;
	exit;
	}
function show_menu(){
	global $lang;
	require (LANG_PATH."menu.lang.php");
	require_once printout('menu');
	}
	function getcon($varName)
    {
        switch($res = get_cfg_var($varName))
        {
            case 0:
            return NO;
            break;
            case 1:
            return YES;
            break;
            default:
            return $res;
            break;
        }
         
    }
?>