Highly efficient random calls:
<?php
$num=$empire->num("select tagid from {$dbtbpre}enewstags");
$randnum=100;
$randids='';
$randdh='';
for($i=1;$i<=$randnum;$i++)
{
$randids.=$randdh.rand(1,$num);
$randdh=',';
}
?>
[e:loop={"select tagname,tagid from phome_enewstags where tagid in ($randids) limit $randnum",32,24,0}]
<a target="_blank" href="/tag/<?=$bqr['tagid']?>/" title="<?=$bqr['tagname']?>"><?=$bqr['tagname']?></a> |
[/e:loop]The code is here, you can use it by modifying the url and style, random high-efficiency code
Normal call:
[e:loop={"select tagname,tagid from phome_enewstags limit 12 ",32,24,0}]
<a target="_blank" href="/e/tags/?tagname=<?=$bqr['tagname']?>" title="<?=$bqr['tagname']?>"><?=$bqr['tagname']?></a> |
[/e:loop]Random call:
[e:loop={"select tagname,tagid from phome_enewstags order by rand() limit 12 ",32,24,0}]
<a target="_blank" href="/e/tags/?tagname=<?=$bqr['tagname']?>" title="<?=$bqr['tagname']?>"><?=$bqr['tagname']?></a> |
[/e:loop]Content page call:
[e:loop={"select a.*,b.* from [!db.pre!]enewstags a LEFT JOIN [!db.pre!]enewstagsdata b ON a.tagid=b.tagid where b.classid='$navinfor[classid]' and b.id='$navinfor[id]' group by b.tagid order by a.num desc limit 10",0,24,0}]
<a href='<?=$public_r['newsurl']?>e/tags/?tagname=<?=$bqr['tagname']?>' title='<?=$bqr['num']?>个'><?=$bqr['tagname']?>(<?=$bqr['num']?>)</a>
[/e:loop]