<?php

if(! defined('OT_ROOT')) {
	exit('Access Denied');
}


class Area{

	// 读取验证码
	public static function VerCode($svcForm,$svcId='',$svcGeetWidth='',$svcStyle=''){
		if (OT_OpenVerCode){
			global $webPathPart,$systemArr;

			if ($systemArr['SYS_verCodeMode'] == 20){
				return '<div id="geetestDiv"></div>
						<p id="geetestWait" style="color:blue;display:none;">正在加载验证码......</p>
						<p id="geetestNote" style="display:none;">请先完成验证</p>
						'. (strlen($svcGeetWidth)>0?'<script language="javascript" type="text/javascript">geetWidth = "'. $svcGeetWidth .'";</script>':'') .'
						<script language="javascript" type="text/javascript" src="'. $webPathPart .'tools/geetest/gt.js"></script>
						';
			}else{
				if (empty($svcId)){ $svcId='verCode'; }
				return '<input type="text" id="'. $svcId .'" name="verCode" maxlength="16" class="text" style="width:60px;'. $svcStyle .'" autocomplete="off" onfocus=\'GetVerCode("input")\' title="如看不清验证码，可以点击验证码进行更换" />&ensp;&ensp;<span id="showVerCode" class="font2_2" onclick=\'GetVerCode("font")\' style="cursor:pointer;">点击获取验证码</span>';
			}
		}else{
			return '<span class="font2_2">已关闭</span>';
		}
	}

	// 跟 wap/inc/classWapArea.php 的 VerCode() 一致
	public static function VerCodeWap($svcForm,$svcId='',$svcGeetWidth=''){
		if (OT_OpenVerCode){
			global $webPathPart,$systemArr;

			if ($svcGeetWidth == 'onePage'){ $systemArr['SYS_verCodeMode'] = 1; }
			if ($systemArr['SYS_verCodeMode'] == 20){
				if (strlen($svcGeetWidth) > 0){
					$jsStr = '<script language="javascript" type="text/javascript">geetWidth = "'. $svcGeetWidth .'";</script>';
					$jsPara = 'geetWidth='. $svcGeetWidth .'';
				}else{
					$jsStr = '';
					$jsPara = '';
				}
				return '<div id="geetestDiv"></div>
						<p id="geetestWait" style="color:blue;display:none;">正在加载验证码......</p>
						<p id="geetestNote" style="display:none;">请先完成验证</p>
						'. $jsStr .'
						<script id="geetestBox" language="javascript" type="text/javascript" src="'. $webPathPart .'tools/geetest/gt.js?v=1.0" data="'. $jsPara .'"></script>
						';
			}else{
				if (strlen($svcId) == 0){ $svcId='verCode'; }
				return '<input type="text" id="'. $svcId .'" name="verCode" maxlength="16" class="input1" onfocus=\'GetVerCode("input")\' placeholder="输入验证码" title="如看不清验证码，可以点击验证码进行更换" />&ensp;&ensp;<span id="showVerCode" onclick=\'GetVerCode("font")\' style="color:red;cursor:pointer;">点击获取验证码</span>';
			}
		}else{
			return '<span class="font2_2">已关闭</span>';
		}
	}

	// 读取验证码2 pop
	public static function VerCodePop($svcForm,$svcId='',$svcGeetWidth=''){
		if (OT_OpenVerCode){
			global $webPathPart,$systemArr;

			if ($systemArr['SYS_verCodeMode'] == 20){
				return '<div id="geePopDiv"></div>
						<p id="geePopWait" style="color:blue;display:none;">正在加载验证码......</p>
						<p id="geePopNote" style="display:none;">请先完成验证</p>
						'. (strlen($svcGeetWidth)>0 ? '<script language="javascript" type="text/javascript">geetPopWidth = "'. $svcGeetWidth .'";</script>' : '') .'
						<script language="javascript" type="text/javascript" src="'. $webPathPart .'tools/geetest/gtPop.js"></script>
						';
			}else{
				if (empty($svcId)){ $svcId='verCodePop'; }
				return '<input type="text" id="'. $svcId .'" name="verCode" maxlength="16" class="text" style="width:60px;padding:5px;" autocomplete="off" onfocus=\'GetVerCode("input","pop")\' title="如看不清验证码，可以点击验证码进行更换" />&ensp;&ensp;<span id="showVerCodePop" class="font2_2" onclick=\'GetVerCode("font","pop")\' style="cursor:pointer;">点击获取验证码</span>';
			}
		}else{
			return '<span class="font2_2">已关闭</span>';
		}
	}

	// 读取验证码 H5模式
	public static function VerCodeH5($spvcForm,$spvcId=''){
		if (OT_OpenVerCode){
			global $webPathPart,$systemArr;

			if ($systemArr['SYS_verCodeMode'] == 20){
				return '<div id="geetestDiv"></div>
						<p id="geetestWait" style="color:blue;display:none;">正在加载验证码......</p>
						<p id="geetestNote" class="display">请先完成验证</p>
						<script language="javascript" type="text/javascript" src="'. $webPathPart .'tools/geetest/gt.js"></script>
						';
			}else{
				if (empty($spvcId)){ $spvcId='verCode'; }
				return '<div style="height:44px;"><input type="text" id="'. $spvcId .'" name="verCode" maxlength="16" class="text verCode" style="float:left;width:120px;" placeholder="请输入验证码" autocomplete="off" onfocus=\'GetVerCode("input")\' title="如看不清验证码，可以点击验证码进行更换" /><div id="showVerCode" class="font2_2" onclick=\'GetVerCode("font")\' style="float:left;margin:12px 0 0 8px;cursor:pointer;">点击获取验证码</div></div>';
			}
		}else{
			return '<span class="font2_2">已关闭</span>';
		}
	}

	// 显示箭头
	// menuName:菜单名称；str:显示箭头的值，str2:与str值对比；sort:上/下箭头；
	public static function ShowArrow($menuName,$str,$str2,$sort){
		$arrowStr = '';
		$URL = OT::GetParam(array('orderName','orderSort'), array('orderName'=>$str));
		if ($str==$str2){
			if ($sort=='ASC'){
				$URL .= '&amp;orderSort=DESC';
				$arrowStr = '<small>▲</small>';
			}else{
				$URL .= '&amp;orderSort=ASC';
				$arrowStr = '<small>▼</small>';
			}
		}else{
			$URL .= '&amp;orderSort=ASC';
		}
		return '<a href="'. $URL .'">'. $menuName . $arrowStr .'</a>';
	}

	// WebPathPart变形还原
	public static function WppSign($signStr,$defVal=''){
		$signStr = str_replace('a', '../', $signStr);
		if (strpos('|../|../../|../../../|../../../../|','|'. $signStr .'|') === false){ $signStr=$defVal; }
		return $signStr;
	}

	// WebPathPart变形
	public static function WppMark($signStr){
		$signStr = str_replace('../', 'a', $signStr);
		return $signStr;
	}

	// 时间格式化
	public static function TimeFormat($timeStr,$mode){
		$newTime = '';
		switch ($mode){
			case 1:		$newTime = 'Y-m-d H:i:s';	break;
			case 2:		$newTime = 'Y-m-d H:i';		break;
			case 3:		$newTime = 'Y-m-d';			break;
			case 4:		$newTime = 'm-d';			break;
			default :	$newTime = 'Y-m-d H:i:s';	break;
		}
		$newTime = TimeDate::Get($newTime,$timeStr);

		return $newTime;
	}

	// 静态日期时间目录（废弃，为兼容性，后期删掉）
	public static function DatetimeDirName($dirTime,$dirMode=-1){
		return Info::DatetimeDirName($dirTime,$dirMode);
	}

	// 栏目模式路径（废弃，为兼容性，后期删掉）
	public static function InfoTypeUrl($itArr=array()){
		return Info::InfoTypeUrl($itArr);
	}

	// 文章图片的路径（废弃，为兼容性，后期删掉）
	public static function InfoImgUrl($imgValue, $imgPartUrl, $mode='pc'){
		return Info::InfoImgUrl($imgValue, $imgPartUrl, $mode);
	}

	// 缩略图路径（废弃，为兼容性，后期删掉）
	public static function ImgThumbPath($imgStr){
		return Info::ImgThumbPath($imgStr);
	}

	// img没有alt属性的加上alt属性（废弃，为兼容性，后期删掉）
	public static $altNewStr = '';
	public static function AddImgAlt($conStr, $altStr){
		return Info::AddImgAlt($conStr, $altStr);
	}

	// 加一键复制[OT_copy][/OT_copy]（废弃，为兼容性，后期删掉）
	public static function AddCopyBtn($conStr){
		return Info::AddCopyBtn($conStr);
	}

	// 过滤关键词/标签（废弃，为兼容性，后期删掉）
	public static function FilterThemeKey($str){
		return Info::FilterThemeKey($str);
	}

	// 过滤内容摘要（废弃，为兼容性，后期删掉）
	public static function FilterContentKey($str){
		return Info::FilterContentKey($str);
	}

	// 过滤编辑器内容（废弃，为兼容性，后期删掉）
	public static function FilterEditor($str){
		return Info::FilterEditor($str);
	}

	// 获取内容表的内容（废弃，为兼容性，后期删掉）
	public static function GetTabContent($tabID, $dataID){
		return Info::GetTabContent($tabID, $dataID);
	}

	// 设置内容表的内容（先检查，然后判断新增还是更新）（废弃，为兼容性，后期删掉）
	public static function SetTabContent($tabID, $dataID, $content){
		return Info::SetTabContent($tabID, $dataID, $content);
	}

	// 锚文本替换字符串(自动过滤超链接和图片标签)（废弃，为兼容性，后期删掉）
	public static function KeyWordContent($strTemp, $mode='pc'){
		return Info::KeyWordContent($strTemp, $mode);
	}

	// 评论/留言 跟帖
	public static function GenTie($id, $str, $event, $maxNum=3, $webPathPart=''){
		$retStr = '';
		if (strlen(''. $str) > 10){
			$currNum = 0;
			if ($maxNum < 1){ $maxNum = 3; }
			$contArr = explode('[arr]', Area::FaceSignToImg(Area::MessageEventDeal($str,$event),$webPathPart));
			$contCount = count($contArr);
			foreach ($contArr as $val){
				if ($currNum == $maxNum){
					$retStr .= '
					<div id="hide'. $id .'Btn" class="genTie">
						<div class="tieItem">
							<a href="javascript:void(0)" class="hideBox" onclick="$id(\'hide'. $id .'Btn\').style.display=\'none\';$id(\'hide'. $id .'Cont\').style.display=\'\';"><span class="txt">已经隐藏'. ($contCount - $currNum) .'层重复盖楼</span><span class="onBtn">[点击展开]</span></a>
						</div>
					</div>

					<div id="hide'. $id .'Cont" style="display:none;">
					';
				}

				$itemArr = explode('[|]',$val .'[|][|][|][|][|][|]');
				if (strlen($itemArr[3])>0 && strpos($event,'|IP|')!==false){
					$itemIpCN = '&ensp;<span class="font1_2d">['. $itemArr[3] .']</span>';
				}else{
					$itemIpCN = '';
				}
				$retStr .= '
					<div class="genTie">
						<div class="tieItem">
							<div class="author"><span class="name">'. (strlen($itemArr[6])>0 ? $itemArr[6] .'楼&ensp;' : '') . $itemArr[2] . $itemIpCN .'</span><span class="serNum">'. ($contCount - $currNum) .'</span></div>
							<p class="cont">'. $itemArr[4] .'</p>
						</div>
						';
				$currNum ++;
			}
			if ($currNum > 0){
				if ($currNum > $maxNum){ $currNum ++; }
				$retStr .= str_repeat('</div>',$currNum);
			}
		}
		return $retStr;
	}

	// 评论/留言 表情标记转换成图片标签
	public static function FaceSignToImg($str, $webPathPart=''){
		return preg_replace("/\[face:([0-9]{1,3})\]/i",'<img src="'. $webPathPart .'inc_img/face_def/${1}.gif" border="0" style="margin:0 1px 0 1px;" />',$str);
	}

	// 评论/留言 内容输出处理
	public static function MessageEventDeal($medStr, $medEvent){
		if (strpos(''. $medEvent,'|filterUrl|') !== false){ $medStr=Str::RegExp($medStr,'filterUrl'); }
		return $medStr;
	}

	// select标签option项模糊筛选
	public static function SelectOptionFind($selOptionId,$findWidth=100){
		return ''.
		'<script language="javascript" type="text/javascript">'.
		'var '. $selOptionId .'DataArr = new Array();'.
		''. $selOptionId .'DataArr = SelectOptionArr("'. $selOptionId .'");'.
		'</script>'.
		'<input type="text" id="'. $selOptionId .'FindStr" name="'. $selOptionId .'FindStr" class="form-control" style="width:'. $findWidth .'px;color:#c4c3c3;display:inline;" value="模糊查找" onclick="if (this.value==\'模糊查找\'){this.value=\'\';this.style.color=\'#000000\';}" onblur="if (this.value==\'\'){this.value=\'模糊查找\';this.style.color=\'#c4c3c3\';}" onkeyup="SelectOptionSearch(\''. $selOptionId .'FindStr\',\''. $selOptionId .'\','. $selOptionId .'DataArr);" title="自动筛选出符合条件的选项">'.
		'';
	}

	// 是否为外部提交(true是，false否)
	public static function CheckIsOutSubmit($mode='alertHref', $href='index.php'){
		if(Is::OutSubmit()) {
			if ($mode=='alertHref'){
				die('
				<script language="javascript" type="text/javascript">
				alert("请通过正规途径进入该页面.");document.location.href="'. $href .'";
				</script>
				');
			}elseif ($mode=='alertStr'){
				die('
				alert("请通过正规途径进入该页面.");;
				');
			}
		}
	}

	// 读取积分文件（废弃，为兼容性，后期删掉）
	public static function UserScore($typeStr){
		return Users::ScoreArr($typeStr);
	}

	// 用户金额排列
	public static function UserMoneyList($money){
		$money = floatval($money);
		return AppMoneyRecord::Jud() && $money > 0 ? '金额：'. $money : '';
	}

	// 用户积分排列
	// $isScore 1显示 10显示+不显示0项目
	public static function UserScoreList($score1, $score2, $score3, $isScore=1, $mode=''){
		global $userSysArr;
		if (empty($userSysArr)){ $userSysArr = Cache::PhpFile('userSys'); }

		if ($isScore >= 1){
			if ($mode == 'div'){
				$retStr = '';
				for ($i=1; $i<=3; $i++){
					if ($userSysArr['US_isScore'. $i] == 1 && (${'score'. $i} != 0 || (${'score'. $i} == 0 && $isScore != 10))){
						$retStr .= '<div>'. $userSysArr['US_score'. $i .'Name'] .'：'. ${'score'. $i} .'</div>';
					}
				
				}
			}else{
				$retStr = '<table cellpadding="0" cellspacing="0">';
				for ($i=1; $i<=3; $i++){
					if ($userSysArr['US_isScore'. $i] == 1 && (${'score'. $i} != 0 || (${'score'. $i} == 0 && $isScore != 10))){
						$retStr .= '
							<tr>
								<td align="right" style="padding:1px;font-size:12px;text-align:right;">'. $userSysArr['US_score'. $i .'Name'] .'：</td>
								<td style="padding:1px;">'. ${'score'. $i} .'</td>
							</tr>
							';
					}
				}
				$retStr .= '</table>';
			}
			return $retStr;
		}
	}


	// 会员上传图片删除（废弃，为兼容性，后期删掉）
	public static function DelUserFile($whereStr){
		return Users::DelFile($whereStr);
	}


	// 下载附件（废弃，为兼容性，后期删掉）
	public static function InfoFile($dataID, $IF_file, $IF_fileName, $IF_fileStr='', $fileTitle='', $fileStyle=0, $webPathPart=''){
		return Info::FileList($dataID, $IF_file, $IF_fileName, $IF_fileStr, $fileTitle, $fileStyle, $webPathPart);
	}


	// 内容库分表+1（废弃，为兼容性，后期删掉）
	public static function TabCurrNumAdd($tabRow = null){
		return Info::TabCurrNumAdd($tabRow);
	}


	// 创建内容库分表（废弃，为兼容性，后期删掉）
	public static function CreateInfoContent(){
		return Info::CreateInfoContent();
	}


	// 自动操作-定时检查-内容库分表（废弃，为兼容性，后期删掉）
	public static function AutoRunInfoContent(){
		return AutoRun::InfoContent();
	}

	// 自动操作-定时检查-会员组过期x天转为默认组（废弃，为兼容性，后期删掉）
	public static function AutoRunUserGroupExp(){
		return AutoRun::UserGroupExp();
	}

	// 自动操作-定时检查-内容页上下篇ID清空x天前（废弃，为兼容性，后期删掉）
	public static function AutoRunPrevNext(){
		return AutoRun::PrevNext();
	}

	// 自动操作-定时检查-内容页相关文章ID清空x天前（废弃，为兼容性，后期删掉）
	public static function AutoRunMarkNews(){
		return AutoRun::MarkNews();
	}

	// 自动操作-定时检查-广告数据（废弃，为兼容性，后期删掉）
	public static function AutoRunCa(){
		return AutoRun::Ca();
	}

	// logo区自定义内容
	public static function LogoDiy($str=''){
		global $DB;

	}

	// 加星号
	public static function RedSign(){
		return '<span style="color:red;">&ensp;*&ensp;</span>';
	}

	// 显示插件标志
	public static function PluSign($str='',$align='top'){
		return '<img src="images/img_plugin.png" title="'. $str .' 插件" alt="'. $str .' 插件" align="'. $align .'" />&ensp;';
	}

	// 显示插件标志0
	public static function PluSign0($str='',$align='top'){
		return '<img src="images/img_plugin0.png" title="'. $str .' 插件" alt="'. $str .' 插件" align="'. $align .'" />&ensp;';
	}

	
	// 添加会员操作记录（废弃，为兼容性，后期删掉）
	public static function AddLog($userID, $username, $note, $adminNote='', $logArr=array()){
		return Users::AddLog($userID, $username, $note, $adminNote, $logArr);
	}

	
	// 内容列表中按顺序选择条记录出来
	public static function ListPoint($type,$list,$arrType='str'){
		global $DB;

		$retArr = array('point'=>-1, 'str'=>'');
		switch ($type){
			case 'qiandao':
				$tabName = 'qiandaoSys';
				$fieldName = 'QS_urlPoint';
				$fieldPart = 'QS_';
				break;

			case 'proxyIp':
				$tabName = 'system';
				$fieldName = 'SYS_proxyIpPoint';
				$fieldPart = 'SYS_';
				break;

			case 'dingding':
				$tabName = 'appSys';
				$fieldName = 'AS_dingdingKeyPoint';
				$fieldPart = 'AS_';
				break;

			case 'weixinWork':
				$tabName = 'appSys';
				$fieldName = 'AS_weixinWorkKeyPoint';
				$fieldPart = 'AS_';
				break;

			case 'agentDingding':
				$tabName = 'agentUsers';
				$fieldName = 'AU_dingdingKeyPoint';
				$fieldPart = 'AU_';
				break;

			case 'agentWeixinWork':
				$tabName = 'agentUsers';
				$fieldName = 'AU_weixinWorkKeyPoint';
				$fieldPart = 'AU_';
				break;

			case 'userDingding':
				$tabName = 'users';
				$fieldName = 'UE_dingdingKeyPoint';
				$fieldPart = 'UE_';
				break;

			case 'userWeixinWork':
				$tabName = 'users';
				$fieldName = 'UE_weixinWorkKeyPoint';
				$fieldPart = 'UE_';
				break;

			default :
				if (in_array($arrType, array('point','str'))){
					return $retArr[$arrType];
				}else{
					return $retArr;
				}
		}
		$currPoint = intval($DB->GetOne('select '. $fieldName .' from '. OT_dbPref . $tabName)) + 1;
		$currArr = Str::SplitBr($list);
		$currCount = count($currArr);
		if ($currPoint >= $currCount || $currPoint > 1000){ $currPoint = 0; }
		$currStr = Str::Filter($currArr[$currPoint],'eol');
		$DB->query('update '. OT_dbPref . $tabName .' set '. $fieldName .'='. $currPoint .' where '. $fieldPart .'ID=1');

		$retArr = array('point'=>$currPoint, 'str'=>$currStr);
		if (in_array($arrType, array('point','str'))){
			return $retArr[$arrType];
		}else{
			return $retArr;
		}
	}


	// 判断邮箱、手机号是否提醒（废弃，为兼容性，后期删掉）
	public static function UserTixing($UE_authStr, $userSysArr, $level, $mode='js', $addiStr=''){
		return AreaApp::UserTixing($UE_authStr, $userSysArr, $level, $mode, $addiStr);
	}


	// 页面运行倒计时刷新
	public static function RunSecReload($sec){
		echo('
		<div id="countSec" style="color:red"></div>
		<script language="javascript" type="text/javascript">
		var runSec = '. $sec .';	// 秒数
		function CountDown(){
			if (runSec >= 0){
				document.getElementById("countSec").innerHTML = "还有 "+ runSec +" 秒刷新本页面";
				runSec --;
			}else{
				clearInterval(timer);
				window.location.reload();
			}
		}
		timer = setInterval("CountDown()", 1000);
		</script>	
		');
	}


	// 判断是否存在该插件（废弃，为兼容性，后期删掉）
	public static function JudPayApp($appID){
		return AreaApp::Jud($appID);
	}


	// 登录保存状态秒数（废弃，为兼容性，后期删掉）
	public static function LoginExpSec($num){
		return StrInfo::LoginExpSec($num);
	}


	// 文件路径（废弃，为兼容性，后期删掉）
	public static function FilePath($str, $fileName){
		return StrInfo::FilePath($str, $fileName);
	}

	// 上传文件目录（废弃，为兼容性，后期删掉）
	public static function FileDir($str){
		return StrInfo::FileDir($str);
	}

	// 上传文件后台目录（废弃，为兼容性，后期删掉）
	public static function FileAdminDir($str){
		return StrInfo::FileAdminDir($str);
	}

	// 颜色数值显示 >0 蓝色 <0 红色  =0黑色（废弃，为兼容性，后期删掉）
	public static function ColorNum($num, $remMoney=0){
		return PayInfo::ColorNum($num, $remMoney);
	}

	// 账户余额处理（废弃，为兼容性，后期删掉）
	public static function RemMoney($num){
		return PayInfo::RemMoney($num);
	}


	public static function MaxDate($dateStr){
		if (strtotime($dateStr) > strtotime('2038-01-01')){ $dateStr = '2038-01-01'; }
		return $dateStr;
	}


	public static function DateDiffStr($dateStr){
		$endDateStr = '';
		if (strlen(''. $dateStr) > 0 && strtotime($dateStr)){
			if (TimeDate::Diff('d',$dateStr,'2029-12-31') == 0 || TimeDate::Diff('d',$dateStr,'2038-01-01') == 0){
				$endDateStr = '<div class="font1_2">终身</div>';
			}elseif ($dateStr >= TimeDate::Get('date')){
				$endDateDiff = TimeDate::Diff('d',TimeDate::Get('date'),$dateStr)+1;
				if ($endDateDiff == 1){
					$endDateStr = $dateStr .'<div class="font2_2">(只剩今天)</div>';
				}else{
					$endDateStr = $dateStr .'<div class="font2_2">(剩'. $endDateDiff .'天)</div>';
				}
			}else{
				$endDateStr = $dateStr .'<div class="font2_2">(已过期)</div>';
			}
		}
		return $endDateStr;
	}

	// 替换列表框 一行一个，每行“|”隔开
	public static function ReplaceList($str, $repList){
		if (strpos(''. $repList,'|') !== false){
			$repArr = Str::SplitBr($repList);
			$repCount = count($repArr);
			for ($n=0; $n<$repCount; $n++){
				$rowArr = explode('|',Str::Filter($repArr[$n],'eol'));
				if (count($rowArr) == 2){
					$str = str_replace($rowArr[0],$rowArr[1],$str);
				}
			}
		}
		return $str;
	}

	// 判断公告是否为空 空true，没空false
	public static function AnnounEmptyJud($str, $len = 3){
		return strlen(trim(''. Str::RegExp($str,'html'))) < $len ? true : false;
	}

	// 检查是否开启共享库
	public static function CheckShareDB(){
		global $systemArr,$judShareDB,$shareDB;
		if ($judShareDB == false && $systemArr['SYS_isShareDb'] == 1){
			$shareDB = new PdoDb( array(
				'type'		=> 'mysql', 'dsn'=>'mysql:host='. $systemArr['SYS_shareDbIp'] .';port='. $systemArr['SYS_shareDbPort'] .';dbname='. $systemArr['SYS_shareDbName'],
				'dbName'	=> $systemArr['SYS_shareDbName'],
				'user'		=> $systemArr['SYS_shareDbUser'],
				'pwd'		=> $systemArr['SYS_shareDbPwd'],
				'charset'	=> $systemArr['SYS_dbCharset'],
				'pref'		=> $systemArr['SYS_shareDbPref'],
				'dbErr'		=> '共享库连接不上，请检查您填写的连接信息是否正确。'
				));
			$judShareDB = true;
		}
	}

	// 当前页网址URL异常处理 $url如果异常跳转网址，$strArr判断异常字符数组
	public static function UrlErrGoUrl($url='', $strArr = array('/','\\')){
		// $url1 = str_replace(array('/index.php','//'), '/', trim($_SERVER['REQUEST_URI']));	// URL里的精确的地址
		// $url2 = str_replace(array('/index.php','//'), '/', trim($_SERVER['SCRIPT_NAME']));	// 返回当前的文件名路径 /example/index.php
		$url1 = str_replace('/index.php', '/', trim($_SERVER['REQUEST_URI']));	// URL里的精确的地址
		$url2 = str_replace('/index.php', '/', trim($_SERVER['SCRIPT_NAME']));	// 返回当前的文件名路径 /example/index.php
		$url1Len = strlen($url1);
		$url2Len = strlen($url2);
		if ($url1Len > $url2Len){
			$partStr = substr($url1, $url2Len);
			$judGo = false;
			foreach ($strArr as $str){
				if (strpos($partStr, $str) !== false){
					$judGo = true;
					break;
				}
			}
			if ($judGo){
				if (strlen($url) == 0){ $url = $url2; }
				// JS::AlertHrefEnd('地址异常。', $url);
				JS::HrefEnd($url);
			}
		}
	}

	// id=backURL 返回地址文本框
	public static function BackUrlInput($backURL = ''){
		if ( $backURL == 'referer' && (! empty($_SERVER['HTTP_REFERER'])) ){
			return '<input type="hidden" id="backURL" name="backURL" value="'. $_SERVER['HTTP_REFERER'] .'" />';
		}elseif ($backURL != '' && $backURL != 'referer'){
			return '<input type="hidden" id="backURL" name="backURL" value="'. $backURL .'" />';
		}else{
			return '<script language="javascript" type="text/javascript">document.write(\'<input type="hidden" id="backURL" name="backURL" value="\'+ document.location.href +\'" />\')</script>';
		}
	}

	// id=webPathPart 返回当前页层级文本框
	public static function WebPathPartInput(){
		return '<script language="javascript" type="text/javascript">document.write(\'<input type="hidden" id="webPathPart" name="webPathPart" value="\'+ webPathPart +\'" />\')</script>';
	}


	// 判断菜单审核是否通过 true审核通过，false审核失败
	public static function UcAudit($str = ''){
		global $userSysArr,$userRow;
		$posJud = true;
		if (strlen($str) > 0){
			$posJud = Is::IncPos($userSysArr['US_userMenuList'], $str);
		}
		if ($userRow['UE_state'] == 0 && $posJud){
			return false;
		}else{
			return true;
		}
	}


	// 获取tabField表字段数组
	public static function TabFieldArr($type, $mode=''){
		global $DB;

		switch ($type){
			case 'apiUsers':
				$fieldArr = array(
					'apiUrl'	=> array(	// 绑定的API网址
						'type'		=> '文本',
						'name'		=> 'apiUrl',
						'value'		=> '',
						'addition'	=> 'url',
						)
					);
				break;
		
			case 'onePage':
				$fieldArr = array(
					'siteUrl'	=> array(	// onePage目录绑定的域名网址
						'type'		=> '文本',
						'name'		=> 'siteUrl',
						'value'		=> '',
						'addition'	=> 'url',
						)
					);
				break;
		
			default :
				JS::AlertBackEnd('TabFieldArr 类型不存在（'. $type .'）');
				break;
		}

		if ($mode == 'key'){
			return array_keys($fieldArr);
		}elseif (in_array($mode, array('type','value'))){
			$newArr = array();
			foreach($fieldArr as $key => $val){
				$newArr[$key] = $val[$mode];
			}

			$dataArr = array();
			$dataAll = $DB->GetAll('select TF_name,TF_value from '. OT_dbPref .'tabField where TF_type='. $DB->ForStr($type) .'');
			foreach ($dataAll as $val){
				$dataArr[$val['TF_name']] = $val['TF_value'];
			}
			$fieldArr = array_merge($newArr, $dataArr);	// 数据库信息覆盖进初始化数组里

			return $fieldArr;
		}else{
			return $fieldArr;
		}
	}


	// 获取tabField表字段数组
	public static function TabFieldRow($type, $name=''){
		global $DB;

		if (strlen($name) > 0){
			return $DB->GetOne('select TF_value from '. OT_dbPref .'tabField where TF_type='. $DB->ForStr($type) .' and TF_name='. $DB->ForStr($name));
		}else{
			$retArr = array();
			$dataAll = $DB->GetAll('select TF_name,TF_value from '. OT_dbPref .'tabField where TF_type='. $DB->ForStr($type) .'');
			foreach ($dataAll as $val){
				$retArr[$val['TF_name']] = $val['TF_value'];
			}

			return $retArr;
		}
	}

	// 获取tabField表字段数组
	public static function TabFieldVal($row, $name, $def=''){
		if (isset($row[$name])){
			return $row[$name];
		}else{
			return $def;
		}
	}


	// 通过类型和ID，跳转网址
	public static function GoUrl(){
		if (Is::Weixin()){
			echo('
			<!DOCTYPE html>
			<html>
			<head>
			<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
			<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0" />
			<meta name="apple-mobile-web-app-capable" content="yes" />
			<meta name="format-detection" content="telephone=no" />
			<title>微信上无法正常浏览，请打开浏览器浏览</title>
			</head>
			<body style="padding:0;margin:0;">	

			<img src="inc_img/weixinNoDown.png" width="100%" />	

			</body>
			</html>
			');
		}else{
			// require(OT_ROOT .'conobj.php');
			$type	= OT::GetStr('t');
			$id		= OT::GetInt('id');

			$goUrl = '';
			switch ($type){
				case 'info':
					$chkexe = $DB->query('select IF_URL from '. OT_dbPref .'info where IF_ID='. $id);
					if ($row = $chkexe->fetch()){ $goUrl = $row['IF_URL']; }
					unset($chkexe);
					break;

				case 'infoType':
					$chkexe = $DB->query('select IT_URL from '. OT_dbPref .'infoType where IT_ID='. $id);
					if ($row = $chkexe->fetch()){ $goUrl = $row['IT_URL']; }
					unset($chkexe);
					break;

				case 'infoWeb':
					$chkexe = $DB->query('select IW_URL from '. OT_dbPref .'infoWeb where IW_ID='. $id);
					if ($row = $chkexe->fetch()){ $goUrl = $row['IW_URL']; }
					unset($chkexe);
					break;

			}

			echo('
			<!DOCTYPE html>
			<html>
			<head>
			<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
			<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0" />
			<meta name="apple-mobile-web-app-capable" content="yes" />
			<meta name="format-detection" content="telephone=no" />
			<title>网址正在跳转中，请稍等......</title>
			</head>
			<body style="padding:0;margin:0;">	
			');

			if (strlen($goUrl)>7){
				echo('<script language="javascript" type="text/javascript">document.location.href="'. $goUrl .'";</script>');
			}else{
				echo('地址不存在。');
			}

			echo('
			</body>
			</html>
			');
		}
	}


	// 会员打赏JS内容
	public static function UserDashangJs(){
		global $DB;

		$userID = OT::GetInt('userID');

		if ($userID > 0){
			$urow = $DB->GetRow('select UE_dashangImg1,UE_dashangImg2,UE_dashangImg3 from '. OT_dbPref .'users where UE_ID='. $userID);
			if ($urow){
				if (strlen(''. $urow['UE_dashangImg1']) > 5){ $urow['UE_dashangImg1'] = Info::InfoImgUrl($urow['UE_dashangImg1'],'"+ webPathPart +"'. UsersFileDir); }
				if (strlen(''. $urow['UE_dashangImg2']) > 5){ $urow['UE_dashangImg2'] = Info::InfoImgUrl($urow['UE_dashangImg2'],'"+ webPathPart +"'. UsersFileDir); }
				if (strlen(''. $urow['UE_dashangImg3']) > 5){ $urow['UE_dashangImg3'] = Info::InfoImgUrl($urow['UE_dashangImg3'],'"+ webPathPart +"'. UsersFileDir); }
				echo('
				var dsUserImg1 = "'. $urow['UE_dashangImg1'] .'";
				var dsUserImg2 = "'. $urow['UE_dashangImg2'] .'";
				var dsUserImg3 = "'. $urow['UE_dashangImg3'] .'";
				');
			}
		}
	}


	// 检测环境 |username|userpwd|usermail|usercall|scoreStr|recomId
	public static function ChkInfo(){
		// print_r($_SESSION); print_r($_COOKIE);
		echo('
		会员session信息：'. (isset($_SESSION[OT_SiteID .'userID']) ? '存在' : '不存在') .'
		（id：'. strlen(''. @$_SESSION[OT_SiteID . 'userID']) .'；name：'. strlen(''. @$_SESSION[OT_SiteID . 'username']) .'；pwd：'. strlen(''. @$_SESSION[OT_SiteID . 'userpwd']) .'；mail：'. strlen(''. @$_SESSION[OT_SiteID . 'usermail']) .'；nick：'. strlen(''. @$_SESSION[OT_SiteID . 'usercall']) .'；scoreStr：'. strlen(''. @$_SESSION[OT_SiteID . 'scoreStr']) .'；recomId：'. strlen(''. @$_SESSION[OT_SiteID . 'recomId']) .'）
		<br />
		会员cookies信息：'. (isset($_COOKIE[OT_SiteID .'userID']) ? '存在' : '不存在') .'
		（id：'. strlen(''. @$_COOKIE[OT_SiteID . 'userID']) .'；name：'. strlen(''. @$_COOKIE[OT_SiteID . 'username']) .'；mail：'. strlen(''. @$_COOKIE[OT_SiteID . 'usermail']) .'；nick：'. strlen(''. @$_COOKIE[OT_SiteID . 'usercall']) .'；scoreStr：'. strlen(''. @$_COOKIE[OT_SiteID . 'scoreStr']) .'；recomId：'. strlen(''. @$_COOKIE[OT_SiteID . 'recomId']) .'；info：'. strlen(''. @$_COOKIE[OT_SiteID . 'userInfo']) .'）
		<br />
		其他cookies信息：wap_otcms='. @$_COOKIE['wap_otcms'] .'<br /><pre>'. print_r($_COOKIE,true) .'</pre>
		<script language="javascript" type="text/javascript">
		document.write("浏览器cookies信息：<br />"+ document.cookie.replace(/; /g,"; <br />"));
		</script>
		
		');
		
	}


	// 生成二维码图
	public static function MakeQRcode(){
		include_once(OT_ROOT .'inc/phpqrcode.php');
		// include_once(OT_ROOT .'inc/classImages.php');

		$mode = OT::GetInt('mode'); // 模式1缓存图片，0不缓存
		$text = OT::GetStr('text'); // 二维码内容
		$logo = OT::GetStr('logo'); // 二维码logo图
		if (! Is::Url($text)){
			if (strlen($text) > 9 && (substr($text,0,9) == 'weixin://' || substr($text,0,6) == 'wxp://')){
			
			}else{
				die('网址有误.');
			}
		}

		// 表示容错率，也就是有被覆盖的区域还能识别，分别是 L（QR_ECLEVEL_L，7%），M（QR_ECLEVEL_M，15%），Q（QR_ECLEVEL_Q，25%），H（QR_ECLEVEL_H，30%）； 
		$errLevel = OT::GetStr('level');
		if (strpos('|L|M|Q|H|','|'. $errLevel .'|') === false){ $errLevel = 'H'; }

		// 表示生成图片大小，1~10，默认是3；
		$imgSize = OT::GetInt('size');
		if ($imgSize<1){ $imgSize = 10; }

		// 表示二维码周围边框空白区域间距值；
		$imgMargin = OT::GetInt('margin');
		if ($imgMargin<1){ $imgMargin = 1; }

		if ($mode == 1){
			$pngPath = OT_ROOT .'cache/html/qrcode_'. md5($text . $logo . $errLevel . $imgSize . $imgMargin) .'.png';
			if (file_exists($pngPath)){ echo(file_get_contents($pngPath)); }

			//生成二维码图片
			QRcode::png($text, $pngPath, $errLevel, $imgSize, $imgMargin);

			if (strlen($logo) > 3) {
				$imgWaterArr=array();
				$imgWaterArr['upLoadImg']	= $pngPath;
				$imgWaterArr['waterImg']	= $logo;
				$imgWaterArr['waterPos']	= 'centerMiddle';
				Images::Watermark($imgWaterArr);
			}

			echo(file_get_contents($pngPath));
		}else{
			//生成二维码图片
			QRcode::png($text, false, $errLevel, $imgSize, $imgMargin);

		}
	}


	// 友情链接附加属性
	public static function LogoAddi($eventStr, $relAddi=''){
		$retStr = '';
		if (strpos(''. $eventStr,'[nofollow]') !== false){ $retStr .= ' nofollow'; }
		$retStr = ' rel="noopener norefferrer'. $retStr .'"';

		if (strpos(''. $eventStr,'[noOut]') !== false){ $retStr .= ' noOut="true"'; }

		return $retStr;
	}


	// 外部网址安全提醒
	public static function OutUrl($mode='pc'){
		$url = OT::GetStr('url'); // 要跳转的网址
			if (! Is::Url($url)){ die('网址内容不对（'. Str::MoreReplace($url,'html') .'）'); }

		$systemArr = Cache::PhpFile('system');
		$tplSysArr = Cache::PhpFile('tplSys');

		if (strlen($tplSysArr['TS_logo']) < 3){
			$logo = 'template/default/logo.png';
		}else{
			if (Is::HttpUrl($tplSysArr['TS_logo'])){
				$logo = $tplSysArr['TS_logo'];
			}else{
				$logo = ($mode == 'wap' ? WapArea::BeforeURL() : '') .'upFiles/images/'. $tplSysArr['TS_logo'];
				// $systemArr['SYS_URL']
			}
		}

		echo('
		<!DOCTYPE html>
		<html>
		<head>
			<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
			<meta http-equiv="X-UA-Compatible" content="IE=Edge">
			<meta name="viewport" content="width=device-width, initial-scale=1.0">
			<title>跳转网址安全提醒 - '. $systemArr['SYS_title'] .'</title>
			<link href="favicon.ico" rel="shortcut icon" type="image/x-icon">
			<style>
			html,body{background:#F3F4F5;font-family: PingFang SC,Hiragino Sans GB,Arial,Microsoft YaHei,Verdana,Roboto,Noto,Helvetica Neue,sans-serif;padding:0;margin:0;}
			a{text-decoration:none;}
			.urlArea			{ padding-top:50px;width:450px;margin:auto;word-break: break-all; }
			.urlArea .logo img	{ display: block;margin:auto;margin-bottom: 16px; max-width:350px; }
			.urlArea .main		{ background:#fff;padding:24px;border-radius: 12px;border: 1px solid #E1E1E1; }
			.urlArea .flex		{ display:flex;align-items:center; }
			.urlArea .btn		{ display:flex;justify-content:flex-end;align-items: center; }
			.urlArea .tip		{ background:#e8eefa;padding:12px;margin-bottom:16px;border-radius:4px; }
			.urlArea .urlColor	{ color:red; }
			.urlArea .urlBox	{ font-size: 14px;color: #222226;line-height: 24px;margin-bottom:24px; }
			.urlArea .ico		{ width:24px;height:24px; }
			.urlArea .goBtn		{ white-space: nowrap;font-size: 14px;background-color: #408ffa;color:#ffffff;border: 1px solid #408ffa;display:inline-block;box-sizing: border-box;padding:6px 18px;border-radius: 18px;margin-left:8px; }
			.urlArea .icoTxt	{ font-size: 16px;font-weight: 600;color: #222226;line-height: 22px;margin-left:12px;overflow: hidden;text-overflow:ellipsis;white-space: nowrap; }
			@media (max-width: 600px){
				.urlArea	{ padding-top:90px;width:94%; }
			}
			</style>
		</head>
		<body>
			<div class="urlArea">
				<div class="logo"><img src="'. $logo .'" alt="'. $systemArr['SYS_title'] .' LOGO"></div>
				<div class="main">
					<div class="flex tip">
						<img class="ico" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAADWUlEQVRoQ+2YvWsUQRiH33fmOMQiRQor7RQSweB9KAQEg1iYKFaZnJJ/wcTOMhLs7Ez8FwLebikasTGCoJDcHSoYQbHRyiKFhajczCu3SS73sbfzsXNJDnLV3s4y83vm3X12dhAG/IcDnh+OAHpVkITISvg2DYyQjwyVcXGt3o9q960CdZELAWC6ERoRn/CgentgAGimOCVJPmsNzJFfx2DjuW8I7xWg+xMZ9enXRwIaaQ2LgJ/Z2aFzvm8l7wBypjBPpB7FzTQiu8uDypLPKngFIDE+rODPFwIYjgUA2GJw7AyGb7d8QXgFkCK/TEB3ksIh4GMeVucOHQCV8qNKwQcCymgA6ozBGJarmz4gvFWgLvKrAHTNLBS+yITVSbNrk6/yAhCnTV04X1pNDdBLmzoAX1pNDZCkTS2EB62mAtBpUwvgQaupAEy0qYdIp1VnAFNtGgCk0qozgJ02tRjOWnUCoFJxUiqZuLJEgB+AbCWKTmqWAE4mYXDGp7C8sapD7Wy3BjDVJke8iUH1aZS/lL8hFUXHvX6uWrUGMNUmByxiWK1sAxTyUqnoOBHCQatWADbadAJw0KoVgJwpLBEpo5WkC0CjOohsmQeVeV21dtuNAWy16QwAaKVVYwBbbboCbM+s+WrVCMBEm50lTwcAYKpVLYCpNrsALDXa7XezTQAtgKk2Y14wVi+yuIfWZBMgEcBGm6bWsLkODbSaCGCjTZtgNtfqtNoTwFabMffwb0DYWQvBLAEdtwm+5/lkrfYEsNVmazgElIzxcSyvr0dLiVu5opL4joC4C0SSVmMBXLTZBoDwnge1863npMjVCKDtnA1ML612Abhqs70C8JPB6VMYhv+iCgiRVfD1OwGcsAndPim4yUaHxjr3VrsAZCk3RwpS718i4gpjdK8RQil8SESzruGbzwODeV6uLXdM1t7fg9amDjBOq20VOAza1EJ0rFabAGm1qRvYVzt2rFabAHWRa3zjetmv9BU2oZ/VTFibarRHACQuXJZQX9uHgb0NwZFdwaDyKgKQorBAoBa99b4PHSHCAx7UFnYqULikUL0mArYPY6ceInrTA05gWHmz9xCL4kWF6ioAZFOP0NcO8C8jerm746H9HuhrFg+dHwF4mMRUXQx8Bf4DeBHHQHvQneAAAAAASUVORK5CYII=" alt="温馨提醒">
						<div class="icoTxt">请注意您的账号和财产安全</div>
					</div>
					<div class="urlBox">
						<span>
							<div style="font-weight:bold;padding-bottom:8px;">即将跳转到外部网站<span style="color:#c8c8c8;font-weight:bold;">，安全性未知，是否继续？</span></div>
							您将要访问的链接不属于本网站【'. $systemArr['SYS_title'] .'】，请注意您的账号和财产安全。<br />
							前往：<a class="urlColor">'. Str::MoreReplace($url,'html') .'</a>
						</span>
					</div>
					<div class="btn">
						<label style="color:red;font-size:12px;"><input type="checkbox" id="isOk" value="1" />本人已知晓风险，本人自愿访问，与本网站无关。</label>
						<a id="goBtn" class="goBtn" href="#" target="_self" onclick="return CheckGoUrl()">继续访问</a>
						<script language="javascript" type="text/javascript">
						var goUrl = decodeURIComponent("'. urlencode($url) .'");
						document.getElementById("goBtn").href = goUrl;

						function CheckGoUrl(){
							if (document.getElementById("isOk").checked){
								document.location.href = goUrl;
								return true;
							}else{
								alert("请先打钩左侧【本人已知晓风险】项!");	// ，再点击【继续访问】
								return false;
							}
						}
						</script>
					</div>
				</div>
			</div>
		</body>
		</html>
		');
	}


	// 显示积分
	public static function ScoreTitleArr($mode = '', $userSysArr=null){
		if (empty($userSysArr)){ $userSysArr = Cache::PhpFile('userSys'); }

		$retArr = array();
		switch ($mode){
			case 'det':
				$retArr[1] = '<span>积分1（'. $userSysArr['US_score1Name'] .'）</span>';
				$retArr[2] = '<span style="'. ($userSysArr['US_isScore2'] == 1 ? '' : 'text-decoration:line-through;color:#707070;') .'">积分2（'. $userSysArr['US_score2Name'] .'）</span>';
				$retArr[3] = '<span style="'. ($userSysArr['US_isScore3'] == 1 ? '' : 'text-decoration:line-through;color:#707070;') .'">积分3（'. $userSysArr['US_score3Name'] .'）</span>';
				$retArr[4] = '<span style="'. ($userSysArr['US_isScore4'] == 1 ? '' : 'text-decoration:line-through;color:#707070;') .'">积分4（'. $userSysArr['US_score4Name'] .'）</span>';
				$retArr[5] = '<span style="'. ($userSysArr['US_isScore5'] == 1 ? '' : 'text-decoration:line-through;color:#707070;') .'">积分5（'. $userSysArr['US_score5Name'] .'）</span>';
				break;
		
			case 'style':
				$retArr[1] = '';
				if ($userSysArr['US_isScore2'] == 1){ $retArr[2] = ''; }else{ $retArr[2] = 'display:none;'; }
				if ($userSysArr['US_isScore3'] == 1){ $retArr[2] = ''; }else{ $retArr[2] = 'display:none;'; }
				if ($userSysArr['US_isScore4'] == 1){ $retArr[2] = ''; }else{ $retArr[2] = 'display:none;'; }
				if ($userSysArr['US_isScore5'] == 1){ $retArr[2] = ''; }else{ $retArr[2] = 'display:none;'; }
				break;
		
			default :
				$retArr[1] = '<span>'. $userSysArr['US_score1Name'] .'</span>';
				$retArr[2] = '<span style="'. ($userSysArr['US_isScore2'] == 1 ? '' : 'text-decoration:line-through;color:#707070;') .'">'. $userSysArr['US_score2Name'] .'</span>';
				$retArr[3] = '<span style="'. ($userSysArr['US_isScore3'] == 1 ? '' : 'text-decoration:line-through;color:#707070;') .'">'. $userSysArr['US_score3Name'] .'</span>';
				$retArr[4] = '<span style="'. ($userSysArr['US_isScore4'] == 1 ? '' : 'text-decoration:line-through;color:#707070;') .'">'. $userSysArr['US_score4Name'] .'</span>';
				$retArr[5] = '<span style="'. ($userSysArr['US_isScore5'] == 1 ? '' : 'text-decoration:line-through;color:#707070;') .'">'. $userSysArr['US_score5Name'] .'</span>';
				break;
		}

		return $retArr;
	}


	// 列表导航条
	public static function Nav($page, $pageCount, $pageSize, $recordCount, $mode = 'pc'){
		if ($mode == 'wap'){
			return '<center>'. WapList::Nav('page','',0,$page,$pageCount,$pageSize,$recordCount) .'</center>';
		}else{
			return '
				<table cellpadding="0" cellspacing="0" align="center" class="listNavBox"><tr><td>
				'. Nav::Show('',$pageCount,$pageSize,$recordCount,'img','pageNum','get') .'
				</td></tr></table>
				';
		}
	}


	// 获取前台网址
	public static function BeforeURL($mode='', $dirRank=0){
		if ($mode == 'uc'){
			return UcBase::BeforeURL();
		}elseif ($mode == 'wap'){
			return WapArea::BeforeURL();
		}else{
			return GetUrl::CurrDir($dirRank);
		}
	}


	// 下拉选项批量生成
	public static function OptionList($num1=0, $num2=0, $defNum=0, $str1='', $str2=''){
		$retStr = '';
		for ($i=$num1; $i<=$num2; $i++){
			$retStr .= '<option value="'. $i .'" '. Is::Selected($defNum, $i) .'>'. $str1 . $i . $str2 .'</option>';
		}
		return $retStr;
	}


	// 安装信息统计 $step 0进入安装向导 10安装配置 20安装完成
	public static function InstallStati(){
		$step	= OT::GetInt('step');

		$beforeURL	= GetUrl::CurrDir();
		$userIP	= Users::GetIp();
		$config = File::Read(OT_ROOT .'cache/web/config.txt');
		$source = Str::GetMark($config, '<source>', '</source>');

		$url = 'http://check.idccms.com/p.php?m=installStati&type=idc&source='. $source .'&step='. $step .'&db='. OT_Database .'&ver='. OT_VERSION .'&verTime='. OT_UPDATETIME .'&dbTime='. OT_DBTIME .'&phpVer='. PHP_VERSION .'&os='. PHP_OS .'&userIP='. $userIP .'&url='. urlencode($beforeURL) .'';
		$retArr = ReqUrl::UseAuto(0, 'GET', $url .'&fileType=php&rnd='. time());
		if (! $retArr['res']){
			die('
			var script = document.createElement("script");
			script.src = "'. $url .'";
			document.head.appendChild(script);
			');
		}else{
			die('/* CMS安装信息统计 */');
		}
	}

}
?>