POO好 404页面 问题解决了 但是点每一项都没内容 是不是ID哪里我设置的不对啊 <?php /*********************/ /* */ /* Version : 5.1.0 */ /* Author : RM */ /* Comment : 071223 */ /* */ /*********************/
function repbq( $indextext ) { global $empire; global $dbtbpre; $sql = $empire->query( "select bq,funname from ".$dbtbpre."enewsbq where isclose=0 order by bqid" ); while ( $r = $empire->fetch( $sql ) ) { $preg_str = "/\\[".$r[bq]."\\](.+?)\\[\\/".$r[bq]."\\]/is"; $indextext = preg_replace( $preg_str, "<?php echo @".$r[funname]."(\\1);?>", $indextext ); } return $indextext; }
function replistinfovars( $listtemp, $url, $pagetitle, $classid, $listpage ) { global $public_r; global $class_r; global $class_zr; $listtemp = str_replace( "[!--news.url--]", $public_r[newsurl], $listtemp ); $listtemp = str_replace( "[!--newsnav--]", $url, $listtemp ); $listtemp = str_replace( "[!--pagetitle--]", $pagetitle, $listtemp ); $listtemp = str_replace( "[!--self.classid--]", $classid, $listtemp ); $listtemp = str_replace( "[!--show.listpage--]", $listpage, $listtemp ); $listtemp = str_replace( "[!--show.page--]", $listpage, $listtemp ); $path = $public_r['newsurl']."d/js/class/class".$classid."_"; $listtemp = str_replace( "[!--hotnews--]", "<script src=".$public_r[newsurl]."d/js/js/hotnews.js></script>", $listtemp ); $listtemp = str_replace( "[!--self.hotnews--]", "<script src=".$path."hotnews.js></script>", $listtemp ); $listtemp = str_replace( "[!--page.stats--]", "<script src=/e/public/onclick?enews=doclass&classid=".$classid."></script>", $listtemp ); $listtemp = str_replace( "[!--newnews--]", "<script src=".$public_r[newsurl]."d/js/js/newnews.js></script>", $listtemp ); $listtemp = str_replace( "[!--self.newnews--]", "<script src=".$path."newnews.js></script>", $listtemp ); $listtemp = str_replace( "[!--goodnews--]", "<script src=".$public_r[newsurl]."d/js/js/goodnews.js></script>", $listtemp ); $listtemp = str_replace( "[!--self.goodnews--]", "<script src=".$path."goodnews.js></script>", $listtemp ); $listtemp = str_replace( "[!--hotplnews--]", "<script src=".$public_r[newsurl]."d/js/js/hotplnews.js></script>", $listtemp ); $listtemp = str_replace( "[!--self.hotplnews--]", "<script src=".$path."hotplnews.js></script>", $listtemp ); $listtemp = str_replace( "[!--firstnews--]", "<script src=".$public_r[newsurl]."d/js/js/firstnews.js></script>", $listtemp ); $listtemp = str_replace( "[!--self.firstnews--]", "<script src=".$path."firstnews.js></script>", $listtemp ); return $listtemp; }
require( "../../class/connect.php" ); include( "../../class/db_sql.php" ); include( "../../class/config.php" ); include( "../../class/classfun.php" ); include( "../../class/q_functions.php" ); include( "../../class/t_functions.php" ); include( "../".loadlang( "pub/fun.php" ) ); $page = ( integer )$_GET['page']; $start = ( integer )$_GET['start']; $classid = ( integer )$_GET['classid']; if ( empty( $classid ) ) { printerror( "ErrorUrl", "history.go(-1)", 1 ); } $area = $_GET['myarea']; $navclassid = $classid; foreach ( $GLOBALS['_GET'] as $key => $mvalue ) { $md5key .= $key."=".$mvalue."&"; } $mymd5 = md5( $md5key ); $listtimes = "0"; $file = "../../data/tmp/classtmp_".$classid."_".$page."_".$area.".php"; $filen = "../../data/tmp/fclasstmp_".$classid."_".$page."_".$area.".php"; @$htmlfp = @file( $filen."" ); if ( $htmlfp ) { $pasum = count( $htmlfp ) - 1; $html = explode( "<!--", $htmlfp[$pasum] ); $html1 = explode( "-->", $html[1] ); $filetime = strtotime( $html1[0] ); $thistime = strtotime( date( "Y-m-d H:i:s" ) ); $cha = $thistime - $filetime; if ( $cha < $listtimes ) { foreach ( $htmlfp as $string ) { echo $string; } } else { $link = db_connect( ); $empire = new mysqlquery( ); $editor = 1; $search = "&classid=".$classid; $page_line = 16; $line = $class_r[$classid]['lencord']; $offset = $start + $page * $line; $add = ""; $tbname = $class_r[$classid][tbname]; $modid = $class_r[$classid][modid]; if ( empty( $tbname ) || empty( $modid ) ) { printerror( "ErrorUrl", "history.go(-1)", 1 ); } if ( !$class_r[$classid]['listtempid'] || !$class_r[$classid]['dtlisttempid'] ) { printerror( "ErrorUrl", "history.go(-1)", 1 ); } $ret_r = returnaddf( $modid, 2 ); if ( $class_r[$classid][islast] ) { $add .= " and classid='".$classid."'"; $have_class = 0; } else { $where = returnclass( $class_r[$classid][sonclass] ); $add .= " and (".$where.")"; $have_class = 1; } $pagetitle = $class_r[$classid]['classname']; if ( empty( $class_r[$classid][reorderf] ) ) { $addorder = ",newstime desc"; } else { $addorder = ",".$class_r[$classid][reorderf]." ".$class_r[$classid][reorder]; } if ( !empty( $ret_r['listandf'] ) || $_GET['ph'] == 1 ) { $andor = $_GET['andor'] == "or" ? "or" : "and"; $search .= "&ph=1&andor=".$andor; $listandf = ""; $andr = explode( ",", $ret_r['listandf'] ); $count = count( $andr ); $i = 1; for ( ; $i < $count - 1; ++$i ) { $andval = $_GET[$andr[$i]]; if ( !empty( $andval ) ) { $doandor = empty( $listandf ) ? "" : " ".$andor." "; if ( empty( $ret_r['setandf'] ) ) { $listandf .= $doandor.$andr[$i]."='".reppostvar2( $andval )."'"; } else { $listandf .= $doandor.$andr[$i]." like '%".reppostvar2( $andval )."%'"; } $search .= "&".$andr[$i].( "=".$andval ); } } if ( $listandf ) { $add .= " and (".$listandf.")"; } } $url = "<!--empire.url-->".returnclasslink( $classid )."<!--empire.url-->"; $totalnum = ( integer )$_GET['totalnum']; if ( empty( $totalnum ) ) { $totalquery = "select count(*) as total from ".$dbtbpre."ecms_".$tbname." where checked=1".$add; $num = $empire->gettotal( $totalquery ); } else { $num = $totalnum; } $search .= "&totalnum=".$num; $query = "select * from ".$dbtbpre."ecms_".$tbname." where checked=1".$add; $query .= " order by istop desc".$addorder.( ",id desc limit ".$offset.",{$line}" ); $sql = $empire->query( $query ); $listpage = page1( $num, $line, $page_line, $start, $page, $search ); $listtempid = $class_r[$classid]['dtlisttempid'] ? $class_r[$classid]['dtlisttempid'] : $class_r[$classid]['listtempid']; $tempr = $empire->fetch1( "select temptext,subnews,listvar,rownum,showdate,modid,subtitle from ".gettemptb( "enewslisttemp" )." where tempid='".$listtempid."'" ); if ( $public_r['searchtempvar'] ) { $tempr[temptext] = replacetempvar( $tempr[temptext] ); } $listtemp = replistinfovars( $tempr[temptext], $url, $pagetitle, $classid, $listpage ); $rownum = $tempr[rownum]; if ( empty( $rownum ) ) { $rownum = 1; } $formatdate = $tempr[showdate]; $subnews = $tempr[subnews]; $subtitle = $tempr[subtitle]; $modid = $tempr[modid]; $listvar = $tempr[listvar]; $list_exp = "[!--empirenews.listtemp--]"; $list_r = explode( $list_exp, $listtemp ); $listtext = $list_r[1]; $no = $offset; $changerow = 1; while ( $r = $empire->fetch( $sql ) ) { $repvar = replacelistvars( $no, $listvar, $subnews, $subtitle, $formatdate, $url, $have_class, $r, $ret_r ); $listtext = str_replace( "<!--list.var".$changerow."-->", $repvar, $listtext ); $odate = round( ( strtotime( $r[gqtime] ) - strtotime( date( "Y-m-d" ) ) ) / 86400, 0 ); if ( 0 < $odate ) { $diffTime = ""; } else if ( $odate == 0 ) { $diffTime = "今天到期"; } else { $diffTime = "<span class=\"expire\">已过期</span>"; } $listtext = str_replace( "[!--diffTime--]", $diffTime, $listtext ); $changerow += 1; if ( $rownum < $changerow ) { $changerow = 1; $string .= $listtext; $listtext = $list_r[1]; } ++$no; } if ( $changerow <= $rownum && $listtext != $list_r[1] ) { $string .= $listtext; } $string = $list_r[0].$string.$list_r[2]; $string = repbq( $string ); $string = str_replace( "[!--list.pageno--]", $page, $string ); $string = str_replace( "selfinfo", $classid, $string ); $filetime = date( "Y-m-d H:i:s" ); $t = "\r\n<!--".$filetime."-->"; $string .= $t; writefiletext( $file, $string ); @ob_start( ); @include( $file ); $string = @ob_get_contents( ); @ob_end_clean( ); db_close( ); $empire = null; echo stripslashes( $string ); writefiletext( $filen, $string ); } } else { $filetime = date( "1970 00:00:00" ); $t = "\r\n<!--".$filetime."-->"; writefiletext( $filen, $t ); $url_this = "http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']."?".$md5key; header( "Location: ".$url_this ); } ?>
|
|
|