if ($boardid > 0 && $boardinfo['allowpost'] == 1){
$lang = load_lang($lang, 'index.list' );
$_sql = $topicmode && is_numeric($topicmode) ? ' AND mode='.$topicmode : '';
$colorstr = array('','','red','blue','green');
if( $fsetting['forum_alltopnum'] != '' ){
if( trim($boardinfo['boardtopstr']) !== '' ){
$boardtopstr = $boardinfo['boardtopstr']. ',' .$fsetting['forum_alltopnum'];
}else{
$boardtopstr = $fsetting['forum_alltopnum'];
}
}else{
if( $boardinfo['boardtopstr'] != '' ){
$boardtopstr = $boardinfo['boardtopstr'];
}
}
if ($page == '' || !is_numeric($page) || $page <= 0){
$page = 1;
}
$result1_hasmore = true;
if ( $boardtopstr != '' && $page == 1 ){
$boardtop_str=explode(",",$boardtopstr);
$boardtop_num=count($boardtop_str);
for($btopid=0;$btopid<$boardtop_num;$btopid++){
if($boardtop_str[$btopid]!=''){
$board_topstr.=$boardtop_str[$btopid].",";
}
}
$boardtopstr=substr($board_topstr,0,-1);
$query1=$db->query("Select /*!40001 SQL_CACHE */ topicid,boardid,title,postusername,postuserid,dateandtime,child,hits,votetotal,lastpost,lastposttime,istop,isvote,isbest,locktopic,expression,topicmode,mode,getmoney,getmoneytype,usetools,issmstopic,hidename From {$dv}topic Where topicid in ({$boardtopstr}) AND istop>0 AND boardid NOT IN (444,777){$_sql} Order By istop Desc,lastposttime Desc");
$boardtopstr = explode(',',$boardtopstr);
$boardtopcount = count($boardtopstr);
}else{
$boardtopcount = 0;
$result1_hasmore = false;
}
if ($board_settings[60] <= 0) {
$board_settings[60] = 30;
}
if ($page == 1){
$query2=$db->query("Select /*!40001 SQL_CACHE */ topicid,boardid,title,postusername,postuserid,dateandtime,child,hits,votetotal,lastpost,lastposttime,istop,isvote,isbest,locktopic,expression,topicmode,mode,getmoney,getmoneytype,usetools,issmstopic,hidename From {$dv}topic /*!32312 USE INDEX(board_topic_list) */ Where istop=0 And boardid={$boardid}{$_sql} Order By lastposttime Desc Limit ".$board_settings[60]);
}else{
$query2=$db->query("Select /*!40001 SQL_CACHE */ topicid,boardid,title,postusername,postuserid,dateandtime,child,hits,votetotal,lastpost,lastposttime,istop,isvote,isbest,locktopic,expression,topicmode,mode,getmoney,getmoneytype,usetools,issmstopic,hidename From {$dv}topic /*!32312 USE INDEX(board_topic_list) */ Where istop=0 And boardid={$boardid}{$_sql} Order By lastposttime Desc",array('absolutePage'=>$page,'pageSize'=>$board_settings[60]));
}
$result = false;
while( true ){
if( $result1_hasmore === true && $page == 1 ){
$result = $db->fetch_array($query1);
}
if( $result === false ){
$result1_hasmore = false;
}
if( $result1_hasmore === false ){
$result = $db->fetch_array($query2);
}
if( $result === false ){
break;
}
if ($result['istop'] > 0){
switch($result['istop']){
case 1:
$result['istop'] = 0;
break;
case 2:
$result['istop'] = 1;
break;
case 3:
$result['istop'] = 2;
break;
}
}else{
if ($result['isbest'] == 1){
$result['istop'] = 3;
}elseif($result['locktopic'] == 1){
$result['istop'] = 4;
}elseif($result['isvote'] == 1){
$result['istop'] = 5;
}elseif($result['child'] > $fsetting['hottopicreply']){
$result['istop'] = 6;
}else{
$result['istop'] = 7;
}
}
$result['title'] = ChkBadWords($result['title']);
$result['locktopic'] = htmlspecialchars($result['title']);
if( $result['topicmode'] != 1 ){
if ( strlen($result['title']) > intval($board_settings[59]) ){
$result['title'] = substr($result['title'],0,$board_settings[59]).'...';
}
}
if( $result['topicmode'] == 0 ){
//$result['title']=preg_replace("/\<(.+?)\>/is","",$result['title']);
//$result['title'] = htmlspecialchars($result['title']);
$result['topicmode'] = '';
}elseif($result['topicmode'] > 1){
//$result['title'] = htmlspecialchars($result['title']);
$result['topicmode'] = ' style="color:' .$colorstr[$result['topicmode']]. ';"';
}elseif($result['topicmode'] == 1){//暂时关闭html
$result['title'] = preg_replace( '/<([^<>]*?)>/i' ,'' ,$result['title']);
$result['topicmode'] = '';
}else{
$result['topicmode'] = '';
}
$_topics[] = $result;
}
//Start 版面在线用户总数计算
$tmpnowtime = date('Y-m-d H:i:s');
$totalonline = intval(get_cookie('totalonline'));
$boardtotalonline = intval(get_cookie('boardtotalonline'));
$boardmemberonline = intval(get_cookie('boardmemberonline'));
$boardonlinecachetime = get_cookie('boardonlinecachetime');
//每隔15秒更新一次版面在线总数
if (($totalonline <= 0 OR $boardtotalonline <= 0) OR !$boardonlinecachetime OR dateDiff('s', $boardonlinecachetime, $tmpnowtime) > 15) {
if ($tmpquery = $db->query("SELECT /*!40001 SQL_CACHE */ COUNT(1) AS total_online, COUNT(CASE WHEN {$boardid}>0 AND boardid='{$boardid}' THEN 1 ELSE NULL END) AS board_total_online, COUNT(CASE WHEN {$boardid}>0 AND boardid='{$boardid}' AND userid>0 THEN 1 ELSE NULL END) AS board_member_online FROM {$dv}online")) {
if ($tmpboardonline = $db->fetch_row($tmpquery)) {
$totalonline = $tmpboardonline[0];
$boardtotalonline = $tmpboardonline[1];
$boardmemberonline = $tmpboardonline[2];
if ($totalonline > intval($fsetting['maxonline'])){
$db->query("Update {$dv}setup Set forum_maxonline={$totalonline},forum_maxonlinedate='".date('Y-m-d H:i:s')."'");
include_once ROOT_PATH.'inc/BoardCache.class.php';
$mycache =& new BoardCache($db);
$mycache->createForumSetting();
}
}
}
$boardonlinecachetime = $tmpnowtime;
}
if ($boardtotalonline <= 0 ) {
$boardtotalonline = 1;
$boardmemberonline = ($userid > 0 ? 1 : 0);
}
$boardguestonline = $boardtotalonline - ($boardmemberonline < 0 ? 0 : $boardmemberonline);
set_cookie('totalonline', $totalonline);
set_cookie('boardonlinecachetime', $boardonlinecachetime);
set_cookie('boardtotalonline', $boardtotalonline);
set_cookie('boardmemberonline', $boardmemberonline);
//End 版面在线用户总数计算
require_once printout('index.list');
}set_cookie('leftbarsign', '', -31536000);footer();?>

解决方案 »

  1.   

    没有加密加密了都是乱码了,比如々Ж等等你根本看不出写的是a还是不。给出的代码使用了模版技术。所有的html都在另外一个文件夹里。
    使用printout()来读取的。
      

  2.   

    还有一部分html直接写在函数里,比如footer()
      

  3.   

    别扭??如果你认为jsp和html写一块不别扭的话我没话可说...
      

  4.   

    楼上的说用了一种模板技术,那请问使用了哪种模板?或者说如何将它以正常的html语言显示出来?我的问题可能有点过于简单,还劳烦各位大哥给于解答,不胜感激!
    另外:itian:将jsp代码写在html里,好像只有初学的人才这么做!我只是初次接触php,说出我的第一感觉而已。
      

  5.   

    另外,别的文件夹里有很多的index.html文件,但是什么也没有,是空的,楼上说的模板文件在哪里?
      

  6.   

    我又看了一下:有很多“print <<<EOT”是不是主要是这句话来进行输出的?各位帮帮忙了!
      

  7.   

    有很多index.html是安全需要,跟程序无关。看函数名似乎不是用的通用模版类,是自己写的。一般都会存在某个template目录下,有很多html文件的。
      

  8.   

    itian:
         我找了一下:在template文件夹下:有两个文件夹是这样的:
         lang:下面的都是对应上面的,比如index.php,里面就有一个index.lang.php,里面都是一些   变量
         default:下面的都是对应上面的,比如index.php,里面就有一个index.tpl.php
         我应该怎么做呢?
      

  9.   

    lang,估计是语言文件。应该是那个default文件夹。至于你该怎么做?你想做什么?
    你可以看看index.tpl.php,里边是不是有html代码了?