找回密码
 立即注册
搜索

途迹耕耘

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

GMT+8, 2025-12-22 01:14 , Processed in 0.093519 second(s), 14 queries .

判断当前栏目是否有设置标题分类并调用

[复制链接]
admin 发表于 2018-12-29 15:40:32 | 显示全部楼层 |阅读模式
  1. <?php
  2. //判断当前栏目是否有设置标题分类
  3. $tr=$empire->fetch1("select ttids from phome_enewsclassadd where classid=$GLOBALS[navclassid]");
  4. //上面这句如果用在标题分类列表页需要改为$tr=$empire->fetch1('select ttids from phome_enewsclassadd where ttids like "%'.$GLOBALS[navclassid].'%"');

  5.                 if ($tr[ttids]){
  6.                 ?>
  7.                 <div class="am-panel-bd" style=" padding:15px 5px; overflow:hidden;">
  8.                 <?
  9.                 $ttids=explode(',',trim($tr[ttids],","));
  10.                          foreach($ttids as $id){
  11.                                 $ttname_sql=sys_ReturnEcmsLoopBq("select * from [!db.pre!]enewsinfotype where typeid=$id",0,24,0);
  12.                                 while($bqr2=$empire->fetch($ttname_sql)){
  13.                                         $tturl=sys_ReturnBqInfoTypeUrl($bqr2[typeid]);
  14.                 ?>
  15.                                 <a class="ys4" href="<?=$tturl?>" target="_blank"><?=$bqr2[tname]?></a>
  16.                 <?php
  17.                                 }//endwhile
  18.                         }//endfor
  19. ?>
  20.                 </div>
  21. <?
  22.                 }//ENDIF
  23. ?>
复制代码