<?php $v= mb_substr($navinfor[title],0,5,'UTF-8'); $id=$navinfor[id];?>
[e:loop={"select * from phome_xwenw.com/tag/ecms" target="_blank">ecms_xiazai where (title like '%$v%') and id<>$id order by rand() desc limit 8",10,24,0}]
<li>
<span class="span_tt"><a href="<?=$bqsr['titleurl']?>" target="_blank" class="tit"><?=$bqr['title']?></a></span>
<em class="ico1 xin<?=$bqr['pingfen']?>"></em>
<span class="span_dx"><?=$bqr['daxiao']?></span>
<a href="<?=$bqsr['titleurl']?>" target="_blank">查看详情</a>
</li>
[/e:loop]
说明:
第一行使用PHP函数”mb_substr”从”$navinfor[title]”中提取了前5个字符,并将结果赋值给变量”$v”。然后将”$navinfor[id]”的值赋给变量”$id”。
用灵动标签从”phome_ecms_xiazai”的数据表中查询符合特定条件like ‘%$v%’,也就是包含标题前5个字符的记录,并随机抽取8条记录进行展示。
<?php $v= mb_substr($navinfor[title],0,5,'UTF-8'); ?>
[e:loop={"select * from phome_ecms_xiazai where title like '%$v%' UNION select * from phome_ecms_azsoft where title like '%$v%' UNION select * from phome_ecms_azgame where title like '%$v%' order by rand() desc limit 1",10,24,0}]
<div class="s_news">
<a href="<?=$bqsr['titleurl']?>"><img class="" src="<?=$bqr['titlepic']?>"></a>
<div class="t">
<div class="t-c">
<a href="<?=$bqsr['titleurl']?>"><?=$bqr['title']?></a>
</div>
<div class="t-b">
<span>
<em>类型:<i>操作系统</i></em>
<em>大小:<?=$bqr['daxiao']?></em>
</span>
<span>
<em>评分:<i class="stars star<?=$bqr['pingfen']?>"></i></em>
<em>时间:<i><?=date('Y-m-d',$bqr[newstime])?></i></em>
</span>
</div>
</div>
<div class="xz">
<a rel="nofollow" href="<?=$bqsr['titleurl']?>">立即下载</a>
</div>
</div>
[/e:loop]
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。
评论(0)