gpt4 book ai didi

phpcms中的评论样式修改方法

转载 作者:qq735679552 更新时间:2022-09-27 22:32:09 25 4
gpt4 key购买 nike

CFSDN坚持开源创造价值,我们致力于搭建一个资源共享平台,让每一个IT人在这里找到属于你的精彩世界.

这篇CFSDN的博客文章phpcms中的评论样式修改方法由作者收集整理,如果你对这篇文章有兴趣,记得点赞哟.

phpcms中自带的评论插件很好用!但是样式个人感觉丑的狠,百度一下也没能找到解决方式,也许是自己的搜索方式不对,于是自己就研究了研究,这里可以使用两种方法进行修改 。

方法一:

使用PHPCMS中的get方法进行获取数据 。

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//拼接评论表的commentid字段值
{php $commentid = 'content_' . $catid . '-' . $id . '-' . $modelid ;}
//查询获取数据
{pc:get sql= "SELECT * FROM v9_comment_data_1 where commentid = '$commentid'" cache= "0" return = "data" }
//循环输出
{loop $data $key $val }
<li class = "list-group-item" >
<div class = "media" >
<a class = "media-left" href= "#" >
<img src= "{IMG_PATH}tou.png" class = "img-circle" alt= "..." >
</a>
<div class = "media-body" >
<h5 class = "media-heading" >{ $val [username]}</h5>
<span style= "font-size:10px;" >{ $val [content]}</span>
</div>
</div>
</li>
{/loop}
{/pc}

方法二:

除了使用get方法进行获取数据之外还有一种最简单的方式,找到 /phpcms/templates/default/comment/show_list.html 找到如下代码,进行样式的修改即可 。

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{pc:comment action= "lists" commentid= "$commentid" siteid= "$siteid" page= "$_GET['page']" hot= "$hot" num= "20" }
{ if ! empty ( $data )}
<div class = "comment_button" ><a href= "{APP_PATH}index.php?m=comment&c=index&a=init&commentid={$commentid}&title={urlencode(($comment[title] ? $comment[title] : $title))}&url={urlencode(($comment[url] ? $comment[url] : $url))}&hot=0&iframe=1" { if empty ( $hot )} class = "on" {/ if }>最新</a> <a href= "{APP_PATH}index.php?m=comment&c=index&a=init&commentid={$commentid}&title={urlencode(($comment[title] ? $comment[title] : $title))}&url={urlencode(($comment[url] ? $comment[url] : $url))}&hot=1&iframe=1" { if $hot } class = "on" {/ if }>最热</a></div>
<div class = "comment" >
{loop $data $r }
<h5 class = "title fn" >{direction( $r [direction])} <font color= "#FF0000" >{format:: date ( $r [creat_at], 1)}</font> { if $r [userid]}{get_nickname( $r [userid])}{ else }{ $r [username]}{/ if } </h5>
<div class = "content" >{ $r [content]}
<div class = "rt" ><a href= "javascript:void(0)" onclick= "reply({$r[id]}, '{$commentid}')" >回复</a> <a href= "javascript:void(0)" onclick= "support({$r[id]}, '{$commentid}')" >支持</a>(<font id= "support_{$r[id]}" >{ $r [support]}</font>)
</div>
<div id= "reply_{$r[id]}" style= "display:none" ></div>
</div>
<div class = "bk30 hr mb8" ></div>
{/loop}
</div>
<div id= "pages" class = "text-r" >{ $pages }</div>
{/ if }
{/pc}

以上所述是小编给大家介绍的phpcms中的评论样式修改方法,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对我网站的支持! 。

原文链接:http://www.cnblogs.com/itsuibi/archive/2016/10/20/5983017.html 。

最后此篇关于phpcms中的评论样式修改方法的文章就讲到这里了,如果你想了解更多关于phpcms中的评论样式修改方法的内容请搜索CFSDN的文章或继续浏览相关文章,希望大家以后支持我的博客! 。

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com