导航菜单

帝国总文章和栏目调用:如何指定文章id顺序排列和栏目调用

  一,调用栏目id

 <h2 class="htitle">分类名称1</h2>
    <ul class="site_tj site_yx">
[e:loop={"select * from [!db.pre!]enewsclass where classid in (76,77,71,81,97,98) order by myorder asc ",0,24,0}]
<?php
$classurl=sys_ReturnBqClassname($bqr,9);//取得栏目地址
?>
      <li><a href="<?=$classurl?>" target="_self"><?=$bqr[classname]?></a></li>
 [/e:loop]  
    </ul>


二。帝国随机调用

[e:loop={'news',10,18,0,'','rand()'}]

 <li><a href="<?=$bqsr['titleurl']?>" target="_blank"><?=$bqr['title']?></a ></li>

[/e:loop]

三。文章Id调用

[e:loop={"select * from [!db.pre!]ecms_news where id in (213,226,233,234,509,238,235) order by id desc ",0,24,0}]
[/e:loop]

四,按指定文章id顺序

[e:loop={"select * from [!db.pre!]ecms_news where id in (435,437,436,384,341,490,279,189,328,385,187,197,470) 

order by instr('189,470,385,187,435,437,436,384,341,490,279,328,197',id) ",0,24,0}]

 <li><a href="<?=$bqsr['titleurl']?>" target="_blank"><?=$bqr['title']?></a ></li>
  
   <li><a href="<?=$bqsr['titleurl']?>" target="_self"><b><?=$bqr['title']?></b></a ><br><span><?=esub($bqr[smalltext],225,'...')?></span></li> 
  
[/e:loop]

五,不调用哪些栏目和文章

[e:loop={'select * from ym_ecms_news where classid not in (1,14,20,28,29,30,31,32,73) and id not in(462) order by rand() limit 10',0,24,0}]

 <li><a href="<?=$bqsr['titleurl']?>" target="_blank"><?=$bqr['title']?></a ></li>

[/e:loop]

六,指定哪些栏目随机调用

 [e:loop={'select * from phome_ecms_news where classid  in (34,35) order by rand() limit 10',0,24,0}]

 <li><a href="<?=$bqsr['titleurl']?>" target="_blank"><?=$bqr['title']?></a ></li>

[/e:loop]
收藏此文 赞一个 ( )

相关推荐:

留言与评论(共有 0 条评论)
   
验证码: