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/basic/class/value.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');

class value
{	
	public static function get($core, $parent, $extent=0, $series=null, $ctrl=true)
	{
		global $G;
		$data = $style = array();
		if($ctrl){
			$result = theme::ctrl($core, $extent, $series);
			if(isset($result['ctrl'])){
				foreach($result['ctrl'] as $v){
					$style[$v['name']] = $v['style'];
					$data[$v['name']] = $v['style']==2?delHtmlspecial($v['value']):$v['value'];
				}
			}
		}
		$result = mysql::select_all('id,name,value','theme',"parent='{$parent}' AND core='{$core}' AND extent='{$extent}'");
		if(isset($result)){
			foreach($result as $v){
				$data[$v['name']] = $style[$v['name']]==2?delHtmlspecial($v['value']):$v['value'];
				if(!isset($data['_'.$v['name']])){
					preg_match("/\w+,(\d+)$/", $v['name'], $match);
					$dstyle = $dparam = '';
					if($match[1]){
						$res = page::complex_one($match[1]);
						$dstyle = $res['style'];
						$param = json::decode($res['param']);
						$arr = array();
						foreach($param as $p){
							$arr[$p] = $p;
						}
						$dparam = $arr?urlencode(json::encode($arr)):null;
					}
				}
			}
		} 
		if(isset($G['area']) && preg_match('/"6"/',$G['config']['area_name_type'])){
			foreach($data as $k=>$v){
				if(preg_match('/[\x7f-\xff]/',$v) && !strstr($k,'_noarea')){
					if($style[$k]==0 || $style[$k]==1){
						$data[$k] = $G['area']['name'].$v;
					}else if($style[$k]==2){
						$data[$k] = RepHtmlStr($v,$G['area']['name']);
					}
				}
			}
		}
		return $data;
	}
	
	public static function set($tc, $parent, $extent=0)
	{
		global $G;
		$bosscms =true;
		if(isset($tc) && is_numeric($parent)){
			foreach($tc as $core=>$arr){
				/* 是否为数字,是则表示后台产品,图片,下载的栏目参数 */
				if(is_numeric($core)){
					$data = array(
						'extent' => $extent,
						'parent' => $parent,
						'core' => ''
					);
					foreach($arr as $k=>$v){
						$v = is_array($v)?json::enfilter($v):$v;
						if($v === ''){
							mysql::delete('theme',"extent='{$extent}' AND core='' AND parent='{$parent}' AND name='{$k}'");
						}else{
							$data['name'] = $k;
							$data['value'] = $v;
							mysql::select_set($data,'theme',array('value'));
						}
					}
				}else{
					$data = array(
						'extent' => $extent,
						'parent' => $parent,
						'core' => $core
					);
					$res = array();
					$result = theme::ctrl($core, $extent);
					if(isset($result['ctrl'])){
						foreach($result['ctrl'] as $c){
							$res[$c['name']] = $c['value'];
						}
					}
					foreach($arr as $k=>$v){
						$v = is_array($v)?json::enfilter($v):$v;
						if($res[$k] == $v){
							mysql::delete('theme',"extent='{$extent}' AND core='{$core}' AND parent='{$parent}' AND name='{$k}'");
						}else{
							$data['name'] = $k;
							$data['value'] = $v;
							mysql::select_set($data,'theme',array('value'));
						}
					}
				}
			}
		}
	}
}
?>