⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index.php

📁 SSCMS网站管理系统 飞狐源码站 SSCMS可以将网站内容全部生成静态HTML文件,这样可以极大地节约主机资源
💻 PHP
字号:
<?
class CPage extends Page
{
        var $username;
        var $userid;
		var $user=array();
        function CPage(& $app)
        {
        $this->Page($app);
        $this->userid=userid;
        $this->username=username;
		$this->userlevel=userlevel;
		$objDataSet = & $this->objDataSet;
		$userid=$_SESSION[$this->userid];
        $this->user = $objDataSet->getDataById($_SESSION[$this->userid],$this->userid,$this->user);
       }
    function page_load()
    {    
        if (empty($this->in['act'])) $this->onMain();
    }

	function onMenu(){
		$sql = "select * from ".$this->modules." order by `mid`";
		$this->db->query($sql);
		$Data = array();
		while ($row = $this->db->fetch_array())
		{			
			$Data[] = $row;
		}
		foreach($this->modulesCache as $key=> $module){
			$ids = explode(",",$module['user_group_ids']);
			//print_r( $ids);
			if ($this->objUserAuth->isLogined($ids,$_SESSION[$this->userlevel]))
			{
				$module[show]=1;
			}
			$modules[]=$module;
		}
		$this->tpl->assign("Data",$Data);
		$this->tpl->assign("modulescache",$modules);
		$this->tpl->display('admin/menu.html');
	}

	function onMain()
	{
		$this->tpl->assign("DOCUMENT_ROOT",$_SERVER[DOCUMENT_ROOT]);
		$this->tpl->assign("gd_info",$this->describeGDdyn());
		$result = $this->db->query('SELECT VERSION() AS version');
        $row   =$this->db->fetch_row($result);
		$this->tpl->assign("mysqlversion",$row[0]);
		$this->tpl->assign("zendversion",zend_version());
		$this->tpl->assign("gd",$this->isfun("gd_info"));
		$this->tpl->assign("ftp",$this->isfun("ftp_login"));
		$this->tpl->assign("phpversion",PHP_VERSION);
		$this->tpl->assign("safemode",$this->getcon("safe_mode"));
		$this->tpl->assign("upload_max_filesize",$this->getcon("upload_max_filesize"));
        $this->tpl->assign("title",$this->app->getSysMsg('login'));
        $this->tpl->display("admin/main.html");
	}

	function onbox(){
		$this->tpl->display("admin/panel_box.html");
	}

	function onTop(){			
        $this->tpl->assign("user",$this->user);
		$this->tpl->display('admin/panel_header.html');
	}

	function onadmin_sys(){
		$this->tpl->assign("user",$this->user);
		$this->tpl->assign('publish_admin','Publish Admin');
		$this->tpl->display('admin/panel_admin_sys.html');
	}

	function onview(){
		if($this->in['extra']=='initMultiThread'){
			$this->tpl->display('admin/panel_MultiThread.html');
		}elseif($this->in['extra']=='taskInfo'){
			$this->tpl->display('admin/panel_taskInfo.html');
		}
	}

	function onchecknew(){
		$url='http://www.ss-cms.com/new.php?version='.VERSION;
		if ($open = file($url)) {
			$count = count($open);
			for($i = 0;$i < $count;$i++) {
				$theget .= $open[$i];
			}
			if($theget=='1'){
				echo $theget;
			}else{
				echo lang('current_version');
			}
		}else {
			echo $this->app->getSysMsg('check_erro');
		}
	}

	function ondown(){
		if($this->in[downurl]==''){
			$t='http://www.ss-cms.com/new.php?action=download&version='.VERSION;
			if ($open = file($t)) {
				$count = count($open);
				for($i = 0;$i < $count;$i++) {
					$theget .= $open[$i];
				}
			}else {
				echo $this->app->getSysMsg('check_erro');
			}
			}else $theget=$this->in[downurl];
			if(ereg('http://',$theget)){
				$this->app->includeClass('down');
				$down=new DownLoader;
				$down->FileSavedDir='../';
				$down->GetSoft($theget,'index.php?module=index&act=down','index.php?module=index&act=extra&url='.$theget);
			}else{
				echo lang('current_version');
			}		
	}

	function onextra(){
	}

	function onphpinfo(){
		phpinfo();
	}

	function describeGDdyn(){
		$info = gd_info();
		$keys  = array_keys($info);
		for($i=0;$i<count($keys);$i++){ 
			if($keys[$i]=='GD Version'){
				$gdinfo.= "<tr><td id='description'><b>".$keys[$i] ."</b>: </td><td id='description'>" . $info[$keys[$i]]."</td></tr>";
			}else{
				$gdinfo.= "<tr><td id='description'><b>".$keys[$i] ."</b>: </td><td id='description'>" . $this->yesNo($info[$keys[$i]])."</td></tr>";
			}
		}
		return $gdinfo;
	}

    function yesNo($bool){
		if($bool){ 
			return "<font color=\"#009900\">√</font>";
		}else{
			return "<font color=\"#FF0000\">×</font>";
		}
	}


	function getcon($varName)
    {
        switch($res = @get_cfg_var($varName))
        {
            case 0:
            return NO;
            break;
            case 1:
            return YES;
            break;
            default:
            return $res;
            break;
        }
         
    }

	function isfun($funName)
    {
        return (false !== function_exists($funName))?'<font color="green">YES</font>':NO;
    }
}
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -