HEX
Server: nginx/1.28.1
System: Linux 10-41-63-61 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64
User: www (1001)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: //www/wwwroot/bs.kntsleep.com/system/admin/view/view.class.php
<?php
/*
 * Copyright (c) Huyin Information Technology Co., Ltd. All Rights Reserved.
 * BOSSCMS Content Management System (https://www.bosscms.net/)
 */
defined('IS_OK') or exit('Access Forbidden');

into::basic_class('admin');

class view extends admin
{	
	public function init()
	{
		global $G;
		$G['cover'] = $this->cover();
		$G['no_copyright'] = true;
		$ctrl = load::ctrl();
		$info = load::info();
		$data['mbpage'] = $this->mbpage();
		$data['ctrl'] =	$data['core'] = array();
        foreach($ctrl as $core=>$series){
          if($series){
            $data['core'][$core] = $this->title($info[$core]['title']?$info[$core]['title']:$core);
			$data['ctrl'][$core] = $this->edit($core);
          }
        }
		$data['ctrl'][''] = '';
		echo $this->theme('view/view', $data);	
	}
	
	public function edit($core)
	{
		global $G;
		$G['cover'] = $this->cover('view');
		if(preg_match('/^\w+$/', $core)){
			$data['ctrl'] = theme::core_series($core, 0, null);
			$result = mysql::select_all('core,name,value','theme',"extent='0' AND core='{$core}' AND parent='0'");
			foreach($result as $v){
			    $data[$v['core']][$v['name']] = $v["value"];
			}
			return $this->theme('view/edit', $data);
		}
	}
	
	public function title($str)
	{
		switch($str){
			case 'sys_member':
				return '会员设置';
			case 'sys_area':
				return '城市分站设置';
			case 'common':
				return '公共设置';
			default:
				return $str;
		}
	}
	
	public function add()
	{
		global $G;
		$this->cover('view','M');
		if($tc = $G['post']['tc']){
			value::set($tc, 0, 0);
			alert('操作成功', url::mpf('view','view','init'));
		}else{
			alert('没有提交信息');
		}
	}
	
	public function page()
	{
		global $G;
		if(session::get("view{$G['language']['id']}")){
			location(url::view(session::get("view{$G['language']['id']}"),false));
		}else{
			location(url::home());
		}
	}

	public function mbpage()
	{
		global $G;
		$this->cover('view','R');
		$htmlrd = dir::read(load::theme('html/', 'web', false));
		$mbpage = array();
		foreach($htmlrd['file'] as $v){
			if(preg_match('/^home\.\w+$/',$v)){
				$mbpage[0] = array(
					'name' => $G['config']['home'],
					'list' => array(
						$v => url::home()
					)
				);
			}
			if(preg_match('/^tags\.\w+$/',$v) && $res=mysql::select_one('*','items',"type='10'")){
				$mbpage[10] = array(
					'name' => $G['option']['type'][10],
					'list' => array(
						$v => url::items($res)
					)
				);
			}
		}
		foreach($htmlrd['dir'] as $v){
			$rds = dir::read(load::theme('html/'.$v.'/', 'web', false));
			if($rds['file']){
				if(strstr($v,'_detail')){
					$table = str_replace('_detail','',$v);
					if(!$type = $G['pass']['type'][$table]){
						$table = 'model_'.$table;
						$type = $G['pass']['type'][$table];
					}
					if($type){
						$mbpage[$type.'.1']['name'] = $G['option']['type'][$type].'详情页';
						foreach($rds['file'] as $v2){
							$url = '';
							if($res = mysql::select_one('*',$table.'_content',"theme='{$v2}'")){
								$url = url::group(null,$res);
							}else if(($res=mysql::select_all('*','items',"themes='{$v2}' AND type='{$type}'")) || ($res=mysql::select_all('*','items',"type='{$type}'"))){
								foreach($res as $v3){
									if($res2 = mysql::select_one('*',$table,"items='{$v3['id']}' && display=1 && weight>=0 && recycle=0")){
										$url = url::group($v3['folder'],$res2);
										break;
									}else if($idls = implode(',',arrOption(page::items($v3['id']),'id','id'))){
										if($res2 = mysql::select_one('*',$table,"FIND_IN_SET(items,'{$idls}') && display=1 && weight>=0 && recycle=0")){
											$url = url::group($v3['folder'],$res2);
											break;
										}
									}
								}
							}
							if($url){
								$mbpage[$type.'.1']['list'][$v2] = $url;
							}
						}
					}
				}else{
					$type = $G['pass']['type'][$v];
					$mbpage[$type]['name'] = $G['option']['type'][$type].(preg_match('/^(2|3|4|5)\d?$/',$type)?'列表页':'页');
					foreach($rds['file'] as $v2){
						$url = '';
						if($res = mysql::select_one('*','items',"theme='{$v2}' AND type='{$type}'")){
							$url = url::items($res);
						}else if($v2==$v.'.html' && $res = mysql::select_one('*','items',"theme='' AND type='{$type}'")){
							$url = url::items($res);
						}
						if($url){
							$mbpage[$type]['list'][$v2] = $url;
						}
					}
				}
			}
		}
		ksort($mbpage);
		return $mbpage;
	}
}
?>