[php]代码库
<?
require_once("global.php");
$jump=Index.DreamNews_ext;
if(file_exists($jump)&&(time()-filemtime($jump)<3600)&&empty($page)){
ObHeader($jump);
}else{
require_once("menu.php");
_eval("NewsDir",NewsDir);
_eval("menu",$menu);
foreach ($menu as $key =>$v){
if($v['url']==$page && !empty($page)){
if(empty($date)){
GetNews($v['h'],$v['n'],$v['url']);
}else{
$startdate=strtotime($date);
$enddate=strtotime($date+1);
$hquery=$db->query("SELECT * FROM `dn_news` WHERE `pubDate`>'$startdate' AND `pubDate`<'$enddate' AND `type`='hot' AND `sort`='$page' ORDER BY `pubDate` DESC ");
while($hrs=$db->fetch_array($hquery)){
$hrs['pubDate']=get_date('Y-m-d H:i',$hrs['pubDate']);
$hotlist[]=$hrs;
}
$nquery=$db->query("SELECT * FROM `dn_news` WHERE `pubDate`>'$startdate' AND `pubDate`<'$enddate' AND `type`='new' AND `sort`='$page' ORDER BY `pubDate` DESC ");
while($nrs=$db->fetch_array($nquery)){
$nrs['pubDate']=get_date('Y-m-d H:i',$nrs['pubDate']);
$newslist[]=$nrs;
}
_eval("hot",$hotlist);
_eval("list",$newslist);
}
_eval("title",$v['name']."新闻");
_eval("title2",$v['name']."新闻");
_eval("keywords",$v['name']."新闻");
$pd=$db->get_one("SELECT `dates` FROM `dn_date` WHERE `sort`='$page'");
$pn=explode("|",$pd['dates']);
$pagenav="<ul>";
foreach($pn as $p){
$pagenav.='<li><a href="'.NewsDir.'/index.php?page='.$page.'&date='.str_replace("-","",$p).'">'.$p.'</a></li>';
}
$pagenav.="<ul>";
_eval("pagenav", $pagenav);
_eval("i", 1);
$htm=GetHtml("index_tpl");
_eval("main",$htm);
break;
}else{
GetNews($v['h'],$v['n'],$v['url'],1,10,1);
_eval("title2",$v['name']."新闻");
_eval("keywords","国内新闻,国际新闻,财经新闻,互联网新闻,房产新闻,汽车新闻,体育新闻,国际足球新闻,国内足球新闻,NBA新闻,国内篮球新闻,综合赛事新闻,娱乐新闻,游戏新闻,教育新闻,健康新闻,科技新闻,手机新闻,数码新闻,电脑新闻,科普新闻,社会新闻");
_eval("i", $key);
$htm.=GetHtml("index_tpl");
}
}
_eval("main",$htm);
if((!file_exists($jump)||(time()-filemtime($jump)>3600))&&empty($page)){
$output = preg_replace(
"/\<a(\s*[^\>]+\s*)href\=([\"|\']?)([^\"\'>\s]+\.php\?[^\"\'>\s]+)([\"|\']?)/ies",
"Htm_cv('\\3','<a\\1href=\"')",
GetHtml("index"));
writefile($jump,$output);
ObHeader($jump);
}
if(!empty($page)){
_print("index");
_rewiter_url();
}
}
?>
[源代码打包下载]