详情页

帝国cms灵动标签设置没有缩略图则显示指定目录下的/随机缩略图随机图片地址

时间:2024年04月24日

编辑:佚名

帝国cms灵动标签设置没有缩略图则显示指定目录下的/随机缩略图随机图片地址代码:
[e:loop={0,8,3,1,'','rand()'}]
<?php $style = rand(1,9); ?>
<li><a href="<?=$bqsr['titleurl']?>"><img src="<?=$bqr[titlepic]?$bqr[titlepic]:'<?=$public_r['add_zhann_cn_url']?>/random/'.$style.'.jpg'?>" /><p><?=esub($bqr[title],21)?></p></a></li>
[/e:loop]
[e:loop={0,3,3,0,'isgood=1','newstime DESC'}]
                <a target="_blank" title="<?=$bqr['title']?>" href="<?=$bqr['titleurl']?>">
<?php $style = rand(1,3); ?>
                    <img loading="lazy" src="/skin/zhann/images/ttp<?=$style?>.png?>" alt="<?=$bqr['title']?>">
                    <h2><?=$bqr['title']?></h2>
                    <span><?=date("m-d",$bqr[newstime])?></span>
                    <p><?=$bqr['smalltext']?></p>
                    <font>立即阅读</font>
                    <em>w</em>
                </a>
[/e:loop]
说明:
PHP设置变量,随机1-100之内任意一个数字,并且在缩略图标签中设定好的图片路径输出随机变量.$style.’
相关文章
猜你需要