帝国cms开发过程中会遇到各种各样的问题,有位朋友需要某些文章不在列表页显示,其他照常处理。下面分享一下cms大学小编的处理方法。
1、首先我们确定一个专有字段用来存放特征,例如在数据表中新建一个字段,字段名openlist,类型int。
2、修改/e/class/function.php文件,将下面的代码
折叠展开PHP 代码
    - $query="select ".ReturnSqlListF($mid)." from {$dbtbpre}ecms_".$class_r[$classid][tbname]." where ".$yhadd."classid='$classid' order by ".ReturnSetTopSql('list').$addorder.$limit;  
 
    - $totalquery="select count(*) as total from {$dbtbpre}ecms_".$class_r[$classid][tbname]." where ".$yhadd."classid='$classid'";  
 
 
 
修改为
折叠展开PHP 代码
    - $query="select ".ReturnSqlListF($mid)." from {$dbtbpre}ecms_".$class_r[$classid][tbname]." where ".$yhadd."classid='$classid' and openlist<>'1' order by ".ReturnSetTopSql('list').$addorder.$limit;  
 
    - $totalquery="select count(*) as total from {$dbtbpre}ecms_".$class_r[$classid][tbname]." where ".$yhadd."classid='$classid' and openlist<>'1'";  
 
 
 
这样我们将不需要显示在列表页的文章openlist字段设为1,就不会在列表页中显示了。