Phpcms V9 Realize Home | List Page | content page call number of clicks code

Source: Internet
Author: User

1.PHPCMS V9 First call number of clicks

{pc:content action= "lists" catid= "$r [catid]" num= "5" order= "id DESC" return= "info"} 
{php $categorys = getcache (' Category_content_ '. $siteid, ' Commons ');} 
<ul class= "list lh24 F14" > 
{loop $info $v} 
{php $category = $categorys [$v [CATID]];} 
{php $modelid = $category [' ModelID '];} 
{php $db = Pc_base::load_model (' Hits_model ');   $_r = $db->get_one (Array (' Hitsid ' => ' C '. $modelid. '-'. $v [id])); $views = $_r[views]; 
{php $comment _tag = Pc_base::load_app_class ("Comment_tag", "comment"); $comment _total = $comment _tag->count ( Array (' Commentid ' => ' Content_ '. $v [CATID]. -'. $v [id]. '  -'. $modelid)); 
<li> <a href= ' {$v [' url ']} ' target= ' _blank ' title= ' {$v [' title ']} ' {Title_style ($v [style])}>{str_cut ($v [ ' Title '],40}</a> click: {$views} comment: {if $comment _total}{$comment _total}{else}0{/if}</li> 
{/loop} 
</ul> 

2.PHPCMS V9 List page number of clicks

{php $db = Pc_base::load_model (' Hits_model '); $_r = $db->get_one (Array (' Hitsid ' => ' C '. $modelid. '-'. $r [id])]; $ views = $_r[views]; } 

3.Phpcms v9 content page to adjust the number of clicks

<script type= "Text/javascript" src= "{js_path}jquery.min.js" ></script> 
<script language= " JavaScript "src=" {app_path}api.php?op=count&id={$id}&modelid={$modelid} "></script>


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.