1, in the page load "
2, call the statistics click the tag::
3, finally, in writing this sentence: "
Phpcms V9 Increase the number of random clicks on the article
Locate file count.php(Web root/api)
Find the 50th line, find this code $views = $r [' views '] + 1; Here the 1 is the default, indicating that each time you browse, the amount of clicks increases once, we can change into any number we want
or $views = $r [' views '] + rand (10,100); randomly adds an arbitrary integer between 10 and 100
PHPCMS v9 Implementation first page, list page, content page call the click-to-volume method
Everyone good, imitation station network today a bit busy, see a lot of friends often ask Phpcmsv9 home, List page, content page call Click How to make, plan to take time to sum up the code, so that we can use later, as follows:
1, home call clicks
{PC: Content action= "lists" catid= "$r [catid]" num= "5" order= "Iddesc" return= "info"}
{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));}
- · {str_cut ($v [' title '],40)} click: {$views} comment: {if$comment_total}{$comment _total}{else}0{/if}
{/loop}
{/PC}
2, List page, click Volume
{php $db = Pc_base::load_model (' Hits_model '); $_r = $db->get_one (Array (' hitsid ' = ' C '. $modelid. '-'. $r [id]); $ views = $_r[views]; }
Click: {$views}
3, content page fetch clicks
<\script type= "Text/javascript" src= "{js_path}jquery.min.js" >
<\span id= "hits" ><\script language= "JavaScript" src= "{app_path}api.php?op=count&id={$id}&modelid ={$modelid} "><\/span>
Phpcms v9 article page call-to-click Method