今天就跟大家聊聊有關怎么在phpcms中修改評論的樣式,可能很多人都不太了解,為了讓大家更加了解,小編給大家總結了以下內容,希望大家根據這篇文章可以有所收獲。

方法一:
使用PHPCMS中的get方法進行獲取數據
//拼接評論表的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">
<h6 class="media-heading">{$val[username]}</h6>
<span >{$val[content]}</span>
</div>
</div>
</li>
{/loop}
{/pc}方法二:
除了使用get方法進行獲取數據之外還有一種最簡單的方式,找到 /phpcms/templates/default/comment/show_list.html 找到如下代碼,進行樣式的修改即可
{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}
<h6 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} </h6>
<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]}" ></div>
</div>
<div class="bk30 hr mb8"></div>
{/loop}
</div>
<div id="pages" class="text-r">{$pages}</div>
{/if}
{/pc}看完上述內容,你們對怎么在phpcms中修改評論的樣式有進一步的了解嗎?如果還想了解更多知識或者相關內容,請關注創新互聯行業資訊頻道,感謝大家的支持。
網頁名稱:怎么在phpcms中修改評論的樣式-創新互聯
標題鏈接:http://www.yijiale78.com/article28/djjsjp.html
成都網站建設公司_創新互聯,為您提供搜索引擎優化、建站公司、網站制作、網站建設、定制開發、微信公眾號
聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯