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

📄 common.inc.php

📁 asp新闻网站源码
💻 PHP
📖 第 1 页 / 共 2 页
字号:
					$md5=md5($md5str);

					if($str!=$md5){
						echo "ERROR:003";
						exit;
					}
					


					//判断时间
					$ifex=0;
					if(file_exists("license.php")){
						include("license.php");
						$ifex=1;
					}
					if(file_exists("../license.php")){
						include("../license.php");
						$ifex=1;
					}
					if(file_exists("../../license.php")){
						include("../../license.php");
						$ifex=1;
					}

					if($ifex!=1){
						echo "ERROR:004";
						exit;
					}

					$md5=md5($lic_exp.$lic_stat.$lic_dsk."aS09(1!)0xzW3^zxMlaKiuy*89z~sdkjl");

					if($md5!=$lic_sev){
						echo "Invalied website status";
						exit;
					}
					$now=time();
					if($lic_exp<$now){
						echo "WebSite Expired";
						exit;
					}
					if($lic_stat!="1"){
						echo "WebSite Closed";
						exit;
					}
					//站点开关	



		}else{
		
				$ifex=0;
				if(file_exists("license.php")){
					include("license.php");
					$ifex=1;
				}
				if(file_exists("../license.php")){
					include("../license.php");
					$ifex=1;
				}
				if(file_exists("../../license.php")){
					include("../../license.php");
					$ifex=1;
				}

				if($ifex!=1){
					echo "License Not Found";
					exit;
				}

				
				$HTTP_HOST=$_SERVER["HTTP_HOST"];


				$str=$lic_4.$lic_1.$lic_2.$lic_3."{TxCMediProCMS~5gBas7ZLkaC(7)^DSKxV5YuV(*)~6DXVHjaLP06}";
				$sev=base64_encode($str);
				$sev=strrev($sev);
				$sev=md5($sev);
				if($sev!=$lic_5){
					echo "Invalied License";
					exit;
				}
				
				$use_server=$lic_4;
				$use_start=$lic_1;
				$use_end=$lic_2;
				$use_type=$lic_3;
				$now_time=time();
				$cha_time=$use_end-$now_time;
				$cha_day=$cha_time/60/60/24;
				$cha_day=number_format($cha_day);

				$www_use_server="www.".$use_server;
				if($use_server!=$HTTP_HOST && $www_use_server!=$HTTP_HOST){
					echo "Invalied License For This Domain Name";
					exit;
				}

				if($use_type!="nolimit"){
					if($now_time>$use_end){
					echo "Expired License";
					exit;
					}
				}
		
		}


		
		
}

function OrdSc($ord,$need,$sc){

	if($ord==$need){
		if($sc=="desc" || $sc==""){
			echo "<img src='images/arrowdown.gif'>";
		}else{
			echo "<img src='images/arrowup.gif'>";
		}
	}

}

///////////显示类型图片(图片或FLASH)

function ShowTypeImage($src,$type,$width,$height,$border){
	
	if($width!="" && $width!="0"){
		$wstr=" width=".$width." ";
	}
	if($height!="" && $height!="0"){
		$hstr=" height=".$height." ";
	}
	if ($type=="swf") {
			
			$ImageStr= "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\"  ".$wstr." ".$hstr."  border=".$border."><param name=movie value=\"" . $src . "\"><param name=quality value=high><embed src=\"" . $src . "\"  pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\"  ".$wstr." ".$hstr."  border=".$border."></embed></object>";
	
	} else {
			
			$ImageStr="<img src=" . $src. " ".$wstr." ".$hstr."  border=".$border.">";
	}
	return $ImageStr;
}


///////////上传图片或FLASH函数

function UploadImage($jpg,$jpg_type,$jpg_size,$path){

	
	global $strUploadNotice1,$strUploadNotice2,$strUploadNotice3;

	if ($jpg_size == 0) {

		err($strUploadNotice1,"","");

	}
	
	if ($jpg_size > 200000) {

		err($strUploadNotice2,"","");

	}

	if ($jpg_type != "image/pjpeg" && $jpg_type!= "image/gif" && $jpg_type != "image/x-png" && $jpg_type != "application/x-shockwave-flash") {
				err($strUploadNotice3,"","");
	}
		
	switch ($jpg_type) {

			case "image/pjpeg" : 
			$extention = ".jpg";
			$UploadImage[2]="gif";
			break;

			case "image/gif" : 
			$extention = ".gif";
			$UploadImage[2]="gif";
			break;

			case "image/x-png" : 
			$extention = ".png";
			$UploadImage[2]="gif";
			break;

			case "application/x-shockwave-flash" : 
			$extention = ".swf";
			$UploadImage[2]="swf";
			break;
	}
			 
		$fname=time();
		$fname=$fname.$extention;
		$file_path = "../".$path."/".$fname;
		$UploadImage[3] = $path."/".$fname;
		
		copy ($jpg,$file_path);
		chmod ($file_path,0666);
		
		$size = GetImageSize($file_path);
		if($size[0]>0 && $size[1]>0){
			
			$UploadImage[0]=$size[0];
			$UploadImage[1]=$size[1];
	
		}else{

			$UploadImage[0]=50;
			$UploadImage[1]=50;

		}
		return $UploadImage;

}

///////////上传文件函数

function UploadFile($jpg,$jpg_type,$fname,$jpg_size,$path){

	global $strDownNotice9,$strDownNotice11,$strDownNotice12; 

	if ($jpg_size == 0) {

		err($strDownNotice9,"","");

	}
	if (substr($fname,-4)==".php" || substr($fname,-4)==".exe") {
			err($strDownNotice11,"","");
	}
	
	
	$hzarr=explode(".",$fname);
	$num=sizeof($hzarr)-1;
	$UploadImage[2]=$hzarr[$num];
		
 
		
		$file_path = "../".$path."/".$fname;
		$UploadImage[3] = $path."/".$fname;
		
		copy ($jpg,$file_path);
		chmod ($file_path,0666);
		

		$UploadImage[0]=0;
		$UploadImage[1]=0;

		return $UploadImage;

}


function Url2Path($string){

	global $SiteUrl;
	$string=str_replace($SiteUrl."pic/gif/","RP/pic/gif/",$string);
	$string=str_replace($SiteUrl."pic/swf/","RP/pic/swf/",$string);
	return $string;

}

function Path2Url($string){

	global $SiteUrl;
	$string=str_replace("RP/pic/gif/",$SiteUrl."pic/gif/",$string);
	$string=str_replace("RP/pic/swf/",$SiteUrl."pic/swf/",$string);

	return $string;

}


function TblInsert($tbl,$vars){

	global $msql;

	$scl="";
	while (list($key,$val)=each($vars)){
	 
	
			$scl.="`".$key."`='".$val."',";
		

	}
	$scl=substr($scl,0,-1);
	
	$msql->query("insert into $tbl set $scl");


}

function ListFold($imagefold,$fp){

	if(file_exists($imagefold)){
		$handle=opendir($imagefold);
		
		while ($image_file = readdir($handle)) {
			$nowfile=$imagefold."/".$image_file;
    		if($image_file!="." && $image_file!=".."){
				if(!is_dir($nowfile)){
					echo $nowfile."<br>";
				}else{
					ListFold($nowfile,$fp);
				}
    		}
		}
		closedir($handle); 
		
	}

}

function ReadTemp($tempfile,$path){

	$fname=$path.$tempfile;
	$fd=fopen($fname,"r");
	$con=fread($fd,filesize($fname));
	fclose($fd);
	echo $con;

}

function CreatPage($pagefile,$str){

	$fd=fopen($pagefile,"w");
	fwrite($fd,$str,strlen($str));
	fclose($fd);

}



function TblCheckCF($tbl,$colname,$var){

	global $msql;
	$msql->query("select * from $tbl where `".$colname."`='".$var."' ");
	if($msql->next_record()){
		return "1";
	}else{
		return "0";
	
	}


}


function SelColType(){

	global $fsql,$tbl_menu;

	$menuid=$_REQUEST["menuid"];

    echo "<select name='col' onChange='window.location=this.form.col.options[this.form.col.selectedIndex].value'>";

    $fsql->query("select * from $tbl_menu where pub='menu'");
	while($fsql->next_record()){
	$lmenu=$fsql->f('menu');
	$lmenuid=$fsql->f('menuid');
		if($lmenuid==$menuid){
			echo "<option value='".$PHP_SELF."?menuid=".$lmenuid."' selected>".$lmenu."</option>";
		}else{
			echo "<option value='".$PHP_SELF."?menuid=".$lmenuid."' >".$lmenu."</option>";
		}

	}
     echo "</select>";


}

//完整日期表单

function DayList($nameY,$nameM,$nameD,$nowY,$nowM,$nowD){

	global $strYear,$strMonth,$strDay;

	if(!isset($nowY) || $nowY==""){
		$nowY=date("Y",time());
	}
	if(!isset($nowM) || $nowM==""){
		$nowM=date("n",time());
	}
	if(!isset($nowD) || $nowD==""){
		$nowD=date("j",time());
	}
	

	$AllfromY=date("Y",time())-5;
	$AlltoY=date("Y",time());
	
	$String="<select name=$nameY>";
            
	for($i=$AllfromY;$i<=$AlltoY;$i++){
		if($i==$nowY){
			$String.="<option value=".$i."  selected>".$i.$strYear."</option>";
		}else{
			$String.="<option value=".$i.">".$i.$strYear."</option>";
		}
		
	}
		
     $String.="</select>"; 

	 $String.="<select name=$nameM>";
            
	for($i=1;$i<=12;$i++){
		if(strlen($i)<2){
			$ii="0".$i;
		}else{
			$ii=$i;
		}

		if($ii==$nowM){
			$String.="<option value=".$ii."  selected>".$i.$strMonth."</option>";
		}else{
			$String.="<option value=".$ii.">".$i.$strMonth."</option>";
		}
		
	}
		
     $String.="</select>"; 

	$String.="<select name=$nameD>";
            
	for($i=1;$i<=31;$i++){
		if(strlen($i)<2){
			$ii="0".$i;
		}else{
			$ii=$i;
		}

		if($ii==$nowD){
			$String.="<option value=".$ii."  selected>".$i.$strDay."</option>";
		}else{
			$String.="<option value=".$ii.">".$i.$strDay."</option>";
		}
		
	}
		
     $String.="</select>"; 

	return $String;

}

//显示是或否

function ShowYN($str){
	
	if($str=="1" || $str=="yes"){
		echo "<img src='images/toolbar_ok.gif'>";
	}else{
		echo "<img src='images/toolbar_no.gif'>";
	
	}

}

function CpFolder($FromPath,$ToPath){

	if(!is_writable($ToPath)){
			echo "Error: Fold (".$ToPath.") is not writable";
			exit;
	}
	if(file_exists($FromPath)){
		$handle=opendir($FromPath);
		while ($ifile = readdir($handle)){
			$nowfile=$FromPath."/".$ifile;
			$tofile=$ToPath."/".$ifile;

    		if($ifile!="." && $ifile!=".."){
    			if(!is_dir($nowfile)){
					copy($nowfile,$tofile);
					chmod($tofile,0755);
				}else{
					if(!file_exists($tofile)){
					   mkdir($tofile,0777);
					}
					
					CpFolder($nowfile,$tofile);
			
				}
    		
    	
    		}
      		
     	}
      	closedir($handle); 

	}
		
}

function DelFold($imagefold){

	if(file_exists($imagefold)){
		$handle=opendir($imagefold);
		while ($image_file = readdir($handle)) {
			$nowfile="$imagefold/$image_file";
    		if($image_file!="." && $image_file!=".."){
				if(!is_dir($nowfile)){
					unlink($nowfile);
				}else{
					DelFold($nowfile);
				
			
				}
    		}
		}
		closedir($handle); 
		rmdir($imagefold); 
	}

}

function ShowMenu($menuid){
	global $msql,$tbl_menu;
	$msql->query("select menu from $tbl_menu where menuid='$menuid'");
	if($msql->next_record()){
		$menu=$msql->f('menu');
	}
	echo $menu;
}

function ReadSkins($nowskin){

	global $strDefault;

	$skstr="";
	$fd=fopen("../templates/skin.dat","r");
	$str=fread($fd,2000);
	fclose($fd);
	
	$arr=explode("\n",$str);
	$nums=sizeof($arr)-1;

	for($i=0;$i<=$nums;$i++){
		
		$lskin=str_replace("\r","",$arr[$i]);
		$lskin=str_replace("\n","",$lskin);
		$lskin=trim($lskin);

		if($lskin!=""){


			$sk=explode("|",$lskin);
			if(sizeof($sk)==3){
				
				if($sk[2]=="default"){
					$skinsay=$strDefault;
				}else{
					$skinsay=$sk[0];
				}
				if($nowskin==$sk[2]){
					$skstr.="<option value='".$sk[2]."' selected>".$skinsay."</option>";
				}else{
					$skstr.="<option value='".$sk[2]."'>".$skinsay."</option>";
				
				}
			}

		}
	
	}

	return $skstr;


}

?>

⌨️ 快捷键说明

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