Modify the comment style in Phpcms

Source: Internet
Author: User
Tags urlencode

Phpcms in the comments plugin is very useful! But the style of personal feeling ugly ruthless, Baidu can not find a solution, perhaps their own search method is not right, so they studied the research, here can be used in two ways to modify

Method One:

Get data using the Get method in Phpcms

1 //Commentid field value for stitching comment table2 {php $commentid = ' content_ '. $catid. ' -'. $id. ' -'. $modelid;}3 //Query get Data4 {pc:get sql= "select * from v9_comment_data_1 where Commentid = ' $commentid '" cache= "0" return= "data"}5 //Cyclic output6 {loop $data $key $val}7           <Liclass= "List-group-item">8             <Divclass= "Media">9               <aclass= "Media-left"href="#">Ten                 <imgsrc= "{img_path}tou.png"class= "Img-circle"alt="..."> One               </a> A               <Divclass= "Media-body"> -                  <h5class= "Media-heading">{$val [username]}</h5> -                 <spanstyle= "font-size:10px;">{$val [content]}</span> the               </Div> -             </Div> -           </Li> - {/loop} +{/PC}

Method Two:

In addition to using the Get method to get the data in the simplest way, find/phpcms/templates/default/comment/show_list.html find the following code, to modify the style can be

1 {pc:comment action= "lists" commentid= "$commentid" siteid= "$siteid" page= "$_get[page]" hot= "$hot" num= "20"} 2 {if!empty ($data)}3 <Divclass= "Comment_button"><ahref= "{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}>Latest</a> <ahref= "{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}>Hottest</a></Div>4     5 <Divclass= "comment">6 {loop $data $r}7     <h5class= "title fn">{direction ($r [direction])}<FontColor= "#FF0000">{format::d ate ($r [creat_at], 1)}</Font>{if $r [UserID]} {Get_nickname ($r [userid])} {Else} {$r [username]} {/if}</h5>8     <Divclass= "Content">{$r [content]}9     <Divclass= "RT"><ahref= "javascript:void (0)"onclick= "Reply ({$r [id]}, ' {$commentid} ')">Reply</a>  <ahref= "javascript:void (0)"onclick= "Support ({$r [id]}, ' {$commentid} ')">Support</a>(<FontID= "support_{$r [id]}">{$r [support]}</Font>)Ten     </Div> One     <DivID= "reply_{$r [id]}"style= "Display:none"></Div> A     </Div> -      -   <Divclass= "Bk30 hr mb8"></Div> the {/loop} - </Div> -  -  <DivID= "pages"class= "Text-r">{$pages}</Div> + {/if} -{/PC}

Modify the comment style in Phpcms

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.