第一个方法:
评论生成静态的代码,在arctile_arctile.html 评论那里加上:
<!--显示评论内容开始-->
<div class="commentbox">
<script src="{dede:field name='phpurl'/}/feedback_js.php?arcID={dede:field name='ID'/}"></script>
<div id="commentlist">
{dede:field name='id' runphp='yes'}
$aid = @me;
$dsql = new DedeSql(false);
$tags = '';
$dsql->Execute('t',"select * from `#@__feedback` where aid='$aid' and ischeck='1' order by dtime desc limit 4");
while($row = $dsql->GetArray('t',MYSQL_ASSOC)){
$tags=$tags."<dl>\n";
$tags=$tags."<dt><strong>".$row['username']." 来自(IP:".ereg_replace("[^\.]{1,3}$","*",$row['ip']).")</strong> 发表于:<span>".strftime("%y-%m-%d %H:%M:%S",$row['dtime'])."</span></dt>\n";
$tags=$tags."<dd>".$row['msg']."</dd>\n ";
$tags=$tags."</dl>\n";
}
@me = $tags;
{/dede:field}
</div>
</div>
***********************************************
另一个方法,简单一些,但没有第一个漂亮啊!
在arctile_arctile.html 评论那里加上
<!--评论内容-->
<div id="commentlist">
{dede:field name='id' runphp='yes'}
$aid = @me;
$dsql = new DedeSql(false);
$tags = '';
$dsql->Execute('t',"select * from `#@__feedback` where aid='$aid' and ischeck='1' order by dtime desc limit 4");
while($row = $dsql->GetArray('t',MYSQL_ASSOC)){
$tags=$tags."<dl>\n";
$tags=$tags."<dt><strong>".$row['username']." 来自(IP:".ereg_replace("[^\.]{1,3}$","*",$row['ip']).")</strong> 发表于:<span>".strftime("%y-%m-%d %H:%M:%S",$row['dtime'])."</span></dt>\n";
$tags=$tags."<dd>".$row['msg']."</dd>\n ";
$tags=$tags."</dl>\n";
}
@me = $tags;
{/dede:field}
</div>
这样更新文章的时候,评论都加在html里了.:)
最新评论
By Artisanjcb
By DKLJSAJKFL
By DKLJSAJKFL
By rishi513
By rishi083
By leanbiome supplement