先将echo_log.php中顶部php代码?>之后的所有代码清空,
这里echo_log.php在此处用作中转用,
不做模板使用,

添加以下代码

  1. <?php   
  2. if($sortid == "1"){  
  3.     //分类id为1时用模板echo_log1.php  
  4.     require_once View::getView('echo_log1');  
  5. }else if($sortid == "2"){  
  6.     //分类id为2时用模板echo_log2.php  
  7.     require_once View::getView('echo_log2');  
  8. }else if($sort == "$log"){  
  9.     //其它分类用模板echo_log3.php  
  10.     require_once View::getView('echo_log3');  
  11. }  
  12. ?>  

最后直接加在echo_log.php中if(!defined('EMLOG_ROOT')) {exit('error!');}的后面,

  1. if($sortid==1){include View::getView('echo_log1');exit;}  
  2. if($sortid==3){include View::getView('echo_log3');exit;}  

分类id为1时使用模板echo_log1.php,
为3时使用模板echo_log3.php,
否则仍使用echo_log.php,

温馨提示

不同作者也可以使用此方法,
只需要把其中的sortid改为author即可.