很多时候我们在文章模型字会加上各种的自定义字段,那么如何把这些相同字段的文章调用出来呢?其实很简单,具体方法如下:
字段值数组:$navinfor
调用方法:$navinfor[‘字段名’],比如要显示"信息ID字段",那在模板里用:<?=$navinfor[‘id’]?>即可输出(单引号加不加均可)
灵动标签调用与当前信息的标题相同的下载信息:
[e:loop={'download',10,18,0,"title='$navinfor[title]'"}]
<a href="<?=$bqsr[titleurl]?>" rel="external nofollow" ><?=$bqr[title]?></a>  
[/e:loop]
实例: 调用news表相同字段ftitle信息
<?php
$ftitle=$navinfor[ftitle]; //取得本栏目副标题
?>
[e:loop={"select * from phome_ecms_news where ftitle ='$navinfor[ftitle]' and ftitle!='' limit 1",10,24,0}]
						<div class="art_show_game">
						<div class="bd">
							<div class="bd-item">
								<p class="pic">
									<a href="<?=$bqr['titleurl']?>" rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  target="_blank">
										<img src="<?=$bqr['titlepic']?>" alt="<?=$bqr['title']?>">
									</a>
								</p>
								<div class="info">
									<p class="tit"><a href="<?=$bqr['titleurl']?>" rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  target="_blank"><?=$bqr['title']?></a></p>
									<p class="attr">
										<span>大小:<?=$bqr['dx']?></span>
										<span>评分:<?=$bqr['pingfen']?></span>
									</p>
									<p class="attr">
										<span>类型:<?=$bqsr[classname]?></span>
										<span><em>版本:</em><?=$bqr['banben']?></span>
									</p>
								</div>
<div class="btns">
									<a class="btn" href="<?=$bqr['titleurl']?>" rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  target="_blank">立即下载</a>
									<a class="btn btn-view" href="<?=$bqr['titleurl']?>" rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  target="_blank">查看详情</a>
								</div>
								</div>
							</div>
						</div>
[/e:loop]		
排除当前文章
id <> '$navinfor[id]'

1.本站大部分内容均收集于网络!若内容若侵犯到您的权益,请发送邮件至:115904045@qq.com,我们将第一时间处理!
2.资源所需价格并非资源售卖价格,是收集、整理、编辑详情以及本站运营的适当补贴,并且本站不提供任何免费技术支持
3.所有资源仅限于参考和学习,版权归原作者所有,更多请阅读网站声明。
    



