How to solve the problem of fixed number of clicks on phpcms
This article uses easy-to-understand examples to introduce how to solve the problem of constant number of phpcms clicks, the code is very detailed, interested friends can refer to, hope to be helpful to you.
The solution to the constant number of clicks in phpcms: first, add the statement "" to the corresponding position of the number of clicks in the template; then introduce the official statistics JS; into the template and then find the file "count.php"; finally, set the number of clicks to be called.
The code for the number of clicks to be called on the phpcms article content page
Add the following to the number of clicks on your template:
Also note that the official statistical JS will also be introduced into the template, the code is:
Both are indispensable.
Phpcms v9 ways to increase the number of random clicks on articles:
Find the file count.php (website root / api)
Look for line 50 and find the code $views = $r ['views'] + 1; the 1 here is the default, which means that every time you browse, the number of clicks increases, and you can change it to any number you want.
Or $views = $r ['views'] + rand (10100); randomly increase any integer between 10 and 100
1, the number of clicks called on the home page
{pc:content action= "lists" catid= "$r [catid]" num= "5" order= "id DESC" return= "info"} {php $categorys = getcache ('category_content_'.$siteid,'commons');} {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'= >' cripty.painting modelid.conversation color color. $v [id]); $views = $_ r [views];} {php $comment_tag = pc_base::load_app_class ("comment_tag", "comment"); $comment_total = $comment_tag- > count ('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, the list page calls the number of clicks
{php $db = pc_base::load_model ('hits_model'); $_ r = $db- > get_one (array (' hitsid'= > 'cripty.conversation modelid.conversation modelid.r [id])); $views = $_ r [views];}
Click: {$views}
3. Call the number of clicks on the content page
On how to solve the problem of fixed number of phpcms clicks to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.