[分享]笔记:灵动标签if判断语句,调用XX条,第X条和第XX条采用其它样式。很简单的一个判断语句,但是还是很实用,希望对大家有帮助。 比如调用16条,第8条和第16条采用其它样式,与其它14条样式不同。 代码如下: <div class="must"> [e:loop={3,16,0,0}] <?php if($bqno==8||$bqno==16) { echo '<ul style="margin-right:0px;">'; } else { echo '<ul>'; } ?> <h1 class="app_img"><a href="<?=$bqsr[titleurl]?>" title="<?=$bqsr[title]?>" ><span></span><img src="<?=$bqr[titlepic]?$bqr[titlepic]:'[!--news.url--]e/data/images/notimg.gif'?>" alt="<?=$bqsr[title]?>" width="74" height="74" /></a></h1> <h2><a href="<?=$bqsr[titleurl]?>" title="<?=$bqsr[title]?>"><?=esub($bqr[title],6,'')?></a></h2> </ul> [/e:loop] </div> 表示:第8条和第16条为(<ul style="margin-right:0px;">……<ul>),而其它14条是(<ul>……<ul>),ul后面没有了style="margin-right:0px;"样式。
我就不上演示图了,只是把上面标签调用返回的代码粘贴出来,以供大家观摩: <div class="must"> <ul> <h1 class="app_img"><a href="http://www.sxecn.com/soft/269199.htm" title="酷我音乐" ><span></span><img src="http://www.sxecn.com/bigsoftimg/androidimg/simg/270000/269199.png" alt="酷我音乐" width="74" height="74" /></a></h1> <h2><a href="http://www.sxecn.com/soft/269199.htm" title="酷我音乐">酷我音乐</a></h2> </ul> <ul> <h1 class="app_img"><a href="http://www.sxecn.com/soft/249090.htm" title="唱吧" ><span></span><img src="http://img.wdjimg.com/mms/icon/v1/9/79/8fad5c0a7be7cbff4b6c517cf4165799_256_256.png" alt="唱吧" width="74" height="74" /></a></h1> <h2><a href="http://www.sxecn.com/soft/249090.htm" title="唱吧">唱吧</a></h2> </ul> <ul> <h1 class="app_img"><a href="http://www.sxecn.com/soft/112316.htm" title="搜狐新闻" ><span></span><img src="http://www.sxecn.com/2013/0605/thumb_74_74_1370418512774.png" alt="搜狐新闻" width="74" height="74" /></a></h1> <h2><a href="http://www.sxecn.com/soft/112316.htm" title="搜狐新闻">搜狐新闻</a></h2> </ul> <ul> <h1 class="app_img"><a href="http://www.sxecn.com/soft/493987.htm" title="金山电池医生" ><span></span><img src="http://www.sxecn.com/2013/0605/thumb_74_74_1370418336483.png" alt="金山电池医生" width="74" height="74" /></a></h1> <h2><a href="http://www.sxecn.com/soft/493987.htm" title="金山电池医生">金山电池医生</a></h2> </ul> <ul> <h1 class="app_img"><a href="http://www.sxecn.com/soft/225611.htm" title="高德地图" ><span></span><img src="http://www.sxecn.com/2013/0605/thumb_74_74_1370418251131.png" alt="高德地图" width="74" height="74" /></a></h1> <h2><a href="http://www.sxecn.com/soft/225611.htm" title="高德地图">高德地图</a></h2> </ul> <ul> <h1 class="app_img"><a href="http://www.sxecn.com/soft/238242.htm" title="陌陌" ><span></span><img src="http://www.sxecn.com/2013/0605/thumb_74_74_1370418135994.png" alt="陌陌" width="74" height="74" /></a></h1> <h2><a href="http://www.sxecn.com/soft/238242.htm" title="陌陌">陌陌</a></h2> </ul> <ul> <h1 class="app_img"><a href="http://www.sxecn.com/soft/495941.htm" title="爱奇艺" ><span></span><img src="http://www.sxecn.com/2013/0605/thumb_74_74_1370417961301.png" alt="爱奇艺" width="74" height="74" /></a></h1> <h2><a href="http://www.sxecn.com/soft/495941.htm" title="爱奇艺">爱奇艺</a></h2> </ul> <ul style="margin-right:0px;"> <h1 class="app_img"><a href="http://www.sxecn.com/soft/113086.htm" title="美图秀秀" ><span></span><img src="http://www.sxecn.com/2013/0605/thumb_74_74_1370417470967.png" alt="美图秀秀" width="74" height="74" /></a></h1> <h2><a href="http://www.sxecn.com/soft/113086.htm" title="美图秀秀">美图秀秀</a></h2> </ul> <ul> <h1 class="app_img"><a href="http://www.sxecn.com/soft/495290.htm" title="连我" ><span></span><img src="http://www.sxecn.com/2013/0605/thumb_74_74_1370417211643.png" alt="连我" width="74" height="74" /></a></h1> <h2><a href="http://www.sxecn.com/soft/495290.htm" title="连我">连我</a></h2> </ul> <ul> <h1 class="app_img"><a href="http://www.sxecn.com/soft/289039.htm" title="淘宝网" ><span></span><img src="http://www.sxecn.com/2013/0605/thumb_74_74_1370417113360.png" alt="淘宝网" width="74" height="74" /></a></h1> <h2><a href="http://www.sxecn.com/soft/289039.htm" title="淘宝网">淘宝网</a></h2> </ul> <ul> <h1 class="app_img"><a href="http://www.sxecn.com/soft/36514.htm" title="UC浏览器" ><span></span><img src="http://www.sxecn.com/2013/0605/thumb_74_74_1370416932650.png" alt="UC浏览器" width="74" height="74" /></a></h1> <h2><a href="http://www.sxecn.com/soft/36514.htm" title="UC浏览器">UC浏览器</a></h2> </ul> <ul> <h1 class="app_img"><a href="http://www.sxecn.com/soft/27384.htm" title="天天动听" ><span></span><img src="http://www.sxecn.com/bigsoftimg/iosimg/simg/282529_icon.jpg" alt="天天动听" width="74" height="74" /></a></h1> <h2><a href="http://www.sxecn.com/soft/27384.htm" title="天天动听">天天动听</a></h2> </ul> <ul> <h1 class="app_img"><a href="http://www.sxecn.com/soft/101419.htm" title="墨迹天气" ><span></span><img src="http://www.sxecn.com/bigsoftimg/androidimg/simg/110000/101419.png" alt="墨迹天气" width="74" height="74" /></a></h1> <h2><a href="http://www.sxecn.com/soft/101419.htm" title="墨迹天气">墨迹天气</a></h2> </ul> <ul> <h1 class="app_img"><a href="http://www.sxecn.com/soft/111171.htm" title="新浪微博" ><span></span><img src="http://www.sxecn.com/2013/0605/thumb_74_74_1370416373606.png" alt="新浪微博" width="74" height="74" /></a></h1> <h2><a href="http://www.sxecn.com/soft/111171.htm" title="新浪微博">新浪微博</a></h2> </ul> <ul> <h1 class="app_img"><a href="http://www.sxecn.com/soft/110940.htm" title="微信" ><span></span><img src="http://www.sxecn.com/bigsoftimg/iosimg/simg/286807_icon.jpg" alt="微信" width="74" height="74" /></a></h1> <h2><a href="http://www.sxecn.com/soft/110940.htm" title="微信">微信</a></h2> </ul> <ul style="margin-right:0px;"> <h1 class="app_img"><a href="http://www.sxecn.com/soft/262455.htm" title="QQ2013" ><span></span><img src="http://www.sxecn.com/bigsoftimg/iosimg/simg/28525_icon.jpg" alt="QQ2013" width="74" height="74" /></a></h1> <h2><a href="http://www.sxecn.com/soft/262455.htm" title="QQ2013">QQ2013</a></h2> </ul> </div>
|