修改phpcms中的評論樣式

來源:互聯網
上載者:User

標籤:

phpcms中內建的評論外掛程式很好用!但是樣式個人感覺醜的狠,百度一下也沒能找到解決方式,也許是自己的搜尋方式不對,於是自己就研究了研究,這裡可以使用兩種方法進行修改

方法一:

使用PHPCMS中的get方法進行擷取資料

 1 //拼接評論表的commentid欄位值 2 {php $commentid = ‘content_‘.$catid.‘-‘.$id.‘-‘.$modelid;} 3 //查詢擷取資料 4          {pc:get sql="SELECT * FROM v9_comment_data_1 where commentid = ‘$commentid‘" cache="0" return="data"} 5 //迴圈輸出 6           {loop $data $key $val} 7           <li class="list-group-item"> 8             <div class="media"> 9               <a class="media-left" href="#">10                 <img src="{IMG_PATH}tou.png" class="img-circle" alt="...">11               </a>12               <div class="media-body">13                  <h5 class="media-heading">{$val[username]}</h5>14                 <span style="font-size:10px;">{$val[content]}</span>15               </div>16             </div>17           </li>18            {/loop}19          {/pc}

方法二:

除了使用get方法進行擷取資料之外還有一種最簡單的方式,找到 /phpcms/templates/default/comment/show_list.html 找到如下代碼,進行樣式的修改即可

 1 {pc:comment action="lists" commentid="$commentid" siteid="$siteid" page="$_GET[page]" hot="$hot" num="20"} 2 {if !empty($data)}       3 <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> 4      5 <div class="comment"> 6 {loop $data $r} 7     <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> 8     <div class="content">{$r[content]} 9     <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>)10     </div>11     <div id="reply_{$r[id]}" style="display:none"></div>12     </div>13     14   <div class="bk30 hr mb8"></div>15   {/loop}16 </div>17 18  <div id="pages" class="text-r">{$pages}</div>19  {/if}20  {/pc}

 

修改phpcms中的評論樣式

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.