The solution to the problem that the click volume of phpcms does not change: First, add the statement "<span id="hits"></span>" to the corresponding position of the template click volume; then introduce the official statistical JS into the template; then find the file "count .php"; finally set the call click volume.
phpcms article content page calls the code for clicks
Add it to the corresponding position of the clicks in your template :
<span id="hits"></span>
Also note that the official statistical JS should be introduced into the template. The code is:
<script language="JavaScript" src="{APP_PATH}api.php?op=count&id={$id}&modelid={$modelid}"></script>
Both of these two are indispensable.
Recommended: "phpcms tutorial"
How to increase the number of random clicks on an article in phpcms v9:
Find the file count.php (website root directory/api)
Find line 50 and find this code $views = $r['views'] 1; 1 here is the default, indicating that every Browse once, the number of clicks increases once, you can modify it to any number you want
Or $views = $r['views'] rand(10,100); Randomly increase any number between 10 and 100 The integer;
1, the home page calls the click volume
{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'=>'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)} 点击:{$views} 评论:{if $comment_total}{$comment_total}{else}0{/if} {/loop} {/pc}
2, the list page calls the 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 , the content page retrieves 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>
The above is the detailed content of What should I do if the click volume of phpcms does not move?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

SublimeText3 Linux new version
SublimeText3 Linux latest version

SublimeText3 Mac version
God-level code editing software (SublimeText3)

SublimeText3 English version
Recommended: Win version, supports code prompts!

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.