抱歉,您的浏览器无法访问本站
本页面需要浏览器支持(启用)JavaScript
了解详情 >

Emlog不同分类的内容页使用不同的模板

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

添加以下代码

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

最后直接加在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即可.

无评论

既然来了就吐个槽吧

撰写评论~

单词 5x4gnt第四个字符是什么?
还没有人吐槽,快抢沙发
Music Icon🎵 未加载歌曲
00:00
00:00
暂无歌词
Power by 疯狂老司机