if(empty($r[titlepic])){$r[titlepic]='[!--news.url--]static/images/rand/'.rand(1,5).'.jpg';} $listtemp='<li class="col-md-6 news-6"> <div class="fh5co-food-desc"> <figure> <img src="[!--titlepic--]" class="img-responsive" alt="最新新闻" /> </figure> <div> <h3><a class="int" href="[!--titleurl--]">[!--title--]</a></h3> <p>[!--smalltext--]</p> </div> </div> <div class="fh5co-food-pricing"> [!--newstime--] </div> </li>';tips:在/static/images/rand/目录下,放1.jpg,2.jpg,3.jpg……5.jpg.即可实现内容无图片时,调用随机图片功能。列表内容模板需要勾选“使用程序代码”
|
|
|
|
|
|
精彩评论 (0)