3.10 应用举例 图片集
示例图片
$titlepic='';$morepic='';if($r[titlepic]){$titlepic='<a href="" target="_blank"> <span class="newspic"><img src="[!--titlepic--]" alt="[!--oldtitle--]" /></span></a> <h2 class="newstitle"><a href="[!--titleurl--]" target="_blank">[!--title--]</a></h2>';}if($r[morepic]){$fr=$empire->fetch1("select * from {$dbtbpre}ecms_news where id='$r[id]'");$rexp="/r/n";$fexp="::::::";$rr=explode($rexp,$fr[morepic]);$count=count($rr);for($i=1;$i<5;$i++){$frt=explode($fexp,$rr[$i-1]);$titlepis.=('<li><i><a href="[!--titleurl--]"><img src="'.$frt[0].'"></a></i></li>');}$titlepic=(' <h2 class="newstitle"><a href="[!--titleurl--]" target="_blank">[!--title--]</a></h2><div class="newspicbox"><ul>'.$titlepis.'</ul><div class="count">'.$count.'图</div></div>');} $listtemp='<li class="newslist" data-scroll-reveal="enter bottom over 1s"> '.$titlepic.' <div class="bloginfo"> <ul> <li class="author">[!--writer--]</li> <li class="lmname"><a href="[!--this.classlink--]" title="[!--this.classname--]" target="_blank" class="classname">[!--this.classname--]</a> <li class="timer">[!--newstime--]</li> <li class="view"><span>[!--onclick--]</span></li> </ul> </div> </li>';
单张小图调用方法:
$morepic='';if($r[morepic]){$fr=$empire->fetch1("select * from {$dbtbpre}ecms_news where id='$r[id]'");$rexp="/r/n";$fexp="::::::";$rr=explode($rexp,$fr[morepic]);$count=count($rr);for($i=1;$i<2;$i++){$frt=explode($fexp,$rr[$i-1]);$listtemps.=('<li><i><a href="[!--titleurl--]" title="[!--oldtitle--]"><img src="'.$frt[0].'"></a></i><span class="picture-item">[!--oldtitle--]</span></li>');}}$listtemp=(''.$listtemps.'');
列表页调用所有小图,方法如下:,一定要勾选使用程序代码
$fr=$empire->fetch1("select * from {$dbtbpre}ecms_news where id='$r[id]'");$rexp="/r/n";$fexp="::::::";$rr=explode($rexp,$fr[morepic]);$count=count($rr);$listtemp="";for($i=1;$i<$count+1;$i++){$frt=explode($fexp,$rr[$i-1]);$listtemps.=('<a href="'.$frt[1].'"><img src="'.$frt[0].'"></a>');}$listtemp=('<li>'.$listtemps.'</li>');
如果表是副表,则添加_data_{$r[stb]}
select * from {$dbtbpre}ecms_news_data_{$r[stb]} where id='$r[id]' 红线标注为副表,注意区分
- 上一篇
- 下一篇