帝国CMS万能标签调用随机文章的方法

时间:2023年09月22日

/

来源:网络

/

编辑:佚名

方法一:
按表随机调用:
[ecmsinfo]"select * from phome_ecms_news order by rand() desc limit 6 ",6,18,0,24,2,0[/ecmsinfo]
随机调用本栏目:
[ecmsinfo]"select * from phome_ecms_news where classid='$GLOBALS[navclassid]' order by rand() desc limit 6",6,18,0,24,2,0[/ecmsinfo]
注:
1、news为表名,两个6表示调用的数量为6条,18表示标题取18个字符,第一个0表示不显示栏名名,随机调用的操作类型固定为24,2表示模板ID,第二个0标题图片不存在也调用。
2、如果要求只调用有标题图片的内容直接把第二个0换成1
[ecmsinfo]"select * from phome_ecms_news order by rand() desc limit 6 ",6,18,0,24,2,1[/ecmsinfo]
3、多栏目内容随机调用where classid='1,2,3,6,13,14,15,17,18' order by
[ecmsinfo]"select * from phome_ecms_news where classid='1,2,3,6,13,14,15,17,18' order by rand() desc limit 6",6,18,0,24,2,0[/ecmsinfo]
方法二:
使用万能标签,把标签排序参数'newstime ASC'、'newstime DESC'、'id DESC'等换成'rand()'即可。
猜你需要

豫ICP备2021026617号-1  豫公网安备:41172602000185   Copyright © 2021-2028 www.78moban.com/ All Rights Reserved

本站作品均来自互联网,转载目的在于传递更多信息,并不代表本站赞同其观点和对其真实性负责。如有侵犯您的版权,请联系 1565229909#qq.com(把#改成@),我们将立即处理。