溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

怎么在phpcms中修改評論的樣式

發(fā)布時間:2021-01-13 15:57:00 來源:億速云 閱讀:176 作者:Leah 欄目:開發(fā)技術

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

方法一:

使用PHPCMS中的get方法進行獲取數(shù)據(jù)

//拼接評論表的commentid字段值
{php $commentid = 'content_'.$catid.'-'.$id.'-'.$modelid;}
//查詢獲取數(shù)據(jù)
{pc:get sql="SELECT * FROM v9_comment_data_1 where commentid = '$commentid'" cache="0" return="data"}
//循環(huán)輸出
{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方法進行獲取數(shù)據(jù)之外還有一種最簡單的方式,找到 /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中修改評論的樣式有進一步的了解嗎?如果還想了解更多知識或者相關內容,請關注億速云行業(yè)資訊頻道,感謝大家的支持。

向AI問一下細節(jié)

免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng)、轉載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權內容。

AI