📄 global.php
字号:
<?php
define('Mpath',dirname(__FILE__).'/');
define( 'Mdirname' , preg_replace("/(.*)\/([^\/]+)/is","\\2",str_replace("\\","/",dirname(__FILE__))) );
require_once(Mpath."../inc/common.inc.php");
require_once(Mpath."php168/config.php"); //本系统全局变量值
require_once(Mpath."php168/all_fid.php"); //部分栏目的名称变量值
@include_once(PHP168_PATH."php168/ad_cache.php"); //全站广告变量缓存文件
@include_once(Mpath."php168/ad_cache.php"); //本系统广告变量值
@include_once(Mpath."php168/htmltype.php"); //列表页与内容页的静态HMTL样式变量值
require_once(PHP168_PATH."php168/label_hf.php"); //标签的头与底的变量值
@include_once(PHP168_PATH."php168/module.php"); //模块系统的参数变量值
require_once(Mpath."function.php");
$Murl=$webdb[www_url].'/'.Mdirname; //本模块的访问地址
$Mdomain=$ModuleDB[mv][domain]?$ModuleDB[mv][domain]:$Murl;
$STYLE=$webdb[Mv_style]?$webdb[Mv_style]:"default";
if(!$webdb[Mv_webOpen]){
$webdb[Mv_closeWhy]=str_replace("\r\n","<br>",$webdb[Mv_closeWhy]);
showerr("网站暂时关闭:$webdb[Mv_closeWhy]");
}
$ch=intval($ch);
$fid=intval($fid);
$id=intval($id);
$page=intval($page);
function getTpl($html,$tplpath=''){
global $STYLE;
if($tplpath&&file_exists($tplpath)){
return $tplpath;
}elseif(file_exists("template/$STYLE/$html.htm")){
return "template/$STYLE/$html.htm";
}else{
return "template/default/$html.htm";
}
}
/**
*伪静态功能函数
**/
function fake_html_Function($filename,$fid,$id,$page=1,$P=''){
$dirid=floor($id/1000);
eval("\$filename=\"$filename\";");
return "$P$filename";
}
/**
*伪静态功能函数
**/
function fake_html($content){
global $webdb;
$listpath=$webdb[Mv_list_filename2];
$bencandypath=$webdb[Mv_bencandy_filename2];
$content=preg_replace("/bencandy\.php\?fid=([\d]+)&(aid|id)=([\d]+)&page=([\d]+)/eis","fake_html_Function('$bencandypath','\\1','\\3','\\4','')",$content); //有分页的最终页
$content=preg_replace("/([a-z0-9-\.:\/]{0,})bencandy\.php\?fid=([\d]+)&(id|aid)=([\d]+)/eis","fake_html_Function('$bencandypath','\\2','\\4','1','\\1')",$content); //无分页的最终页
$content=preg_replace("/list\.php\?fid=([\d]+)&page=([\d]+)/eis","fake_html_Function('$listpath','\\1','','\\2','')",$content); //有分页的列表页
$content=preg_replace("/([a-z0-9-\.:\/]{0,})list\.php\?fid=([\d]+)/eis","fake_html_Function('$listpath','\\2','','1','\\1')",$content); //无分页的列表页
return $content;
}
/**
*真静态功能函数
**/
function make_html_Function($fid,$id,$page=1,$P=''){
global $webdb,$HtmlType,$WEBURL,$db,$pre,$Mdomain,$Murl;
if($id){
if($HtmlType['bencandy'][$fid]){
$filename=$HtmlType['bencandy'][$fid];
}else{
$filename=$webdb[Mv_bencandy_filename];
}
$dirid=floor($id/1000);
if(strstr($filename,'$time_')){
$rs=$db->get_one("SELECT posttime FROM {$pre}mv_video WHERE id='$id'");
$time_Y=date("Y",$rs[posttime]);
$time_y=date("y",$rs[posttime]);
$time_m=date("m",$rs[posttime]);
$time_d=date("d",$rs[posttime]);
$time_W=date("W",$rs[posttime]);
$time_H=date("H",$rs[posttime]);
$time_i=date("i",$rs[posttime]);
$time_s=date("s",$rs[posttime]);
}
}else{
if($HtmlType['list'][$fid]){
$filename=$HtmlType['list'][$fid];
}else{
$filename=$webdb[Mv_list_filename];
}
if($page==1)
{
$filename=preg_replace("/(.*)\/([^\/]+)/is","\\1/",$filename);
}
}
if($P&&$P!='/'){
$weburl=preg_replace("/(.*)\/([^\/]+)/is","\\1/",$WEBURL);
if(!ereg($P,$weburl)&&$P!="$Murl/"&&$P!="$Mdomain/"){
if($id){
return "{$P}bencandy.php?fid=$fid&id=$id";
}else{
return "{$P}list.php?fid=$fid";
}
}
}
$dirid=floor($id/1000);
eval("\$filename=\"$filename\";");
if(!$P){
$P="$Mdomain/";
}
return "$P$filename";
}
/**
*真静态功能函数
**/
function make_html($content,$pagetype=''){
global $fid,$id,$fidDB,$webdb,$page,$rsdb;
$content=preg_replace("/bencandy\.php\?fid=([\d]+)&(aid|id)=([\d]+)&page=([\d]+)/eis","make_html_Function('\\1','\\3','\\4','')",$content); //有分页的最终页
$content=preg_replace("/([a-z0-9-\.:\/]{0,})bencandy\.php\?fid=([\d]+)&(id|aid)=([\d]+)/eis","make_html_Function('\\2','\\4','1','\\1')",$content); //无分页的最终页
$content=preg_replace("/list\.php\?fid=([\d]+)&page=([\d]+)/eis","make_html_Function('\\1','','\\2','')",$content); //有分页的列表页
$content=preg_replace("/([a-z0-9-\.:\/]{0,})list\.php\?fid=([\d]+)/eis","make_html_Function('\\2','','1','\\1')",$content); //无分页的列表页
if($pagetype=='index')
{
$filename='index.htm';
}
elseif($id)
{
if($fidDB[bencandy_html]){
$filename=$fidDB[bencandy_html];
}else{
$filename=$webdb[Mv_bencandy_filename];
}
$dirid=floor($id/1000);
if(strstr($filename,'$time_')){
$time_Y=date("Y",$rsdb[full_posttime]);
$time_y=date("y",$rsdb[full_posttime]);
$time_m=date("m",$rsdb[full_posttime]);
$time_d=date("d",$rsdb[full_posttime]);
$time_W=date("W",$rsdb[full_posttime]);
$time_H=date("H",$rsdb[full_posttime]);
$time_i=date("i",$rsdb[full_posttime]);
$time_s=date("s",$rsdb[full_posttime]);
}
}
else
{
if($fidDB[list_html]){
$filename=$fidDB[list_html];
}else{
$filename=$webdb[Mv_list_filename];
}
if($page==1)
{
$filename=preg_replace("/(.*)\/([^\/]+)/is","\\1/index.htm",$filename);
}
}
eval("\$filename=\"$filename\";");
$HtmlDir=dirname($filename);
if(!is_dir(PHP168_PATH.Mdirname."/$HtmlDir")){
makepath(PHP168_PATH.Mdirname."/$HtmlDir");
}
if($pagetype!='index')
{
write_file($filename,$content);
}
return $content;
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -