" to the corresponding position of the template clicks; then introduce the official statistical JS into the template; then find the file "count .php"; finally set the call click volume."/> " to the corresponding position of the template clicks; then introduce the official statistical JS into the template; then find the file "count .php"; finally set the call click volume.">
search
HomeCMS TutorialPHPCMSWhat should I do if the click volume of phpcms does not move?

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.

What should I do if the click volume of phpcms does not move?

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(&#39;category_content_&#39;.$siteid,&#39;commons&#39;);}
{loop $info $v}
{php $category = $categorys[$v[catid]];}
{php $modelid = $category[&#39;modelid&#39;];}
{php $db = pc_base::load_model(&#39;hits_model&#39;);   $_r = $db->get_one(array(&#39;hitsid&#39;=>&#39;c-&#39;.$modelid.&#39;-&#39;.$v[id])); $views = $_r[views]; }
{php $comment_tag = pc_base::load_app_class("comment_tag", "comment"); $comment_total = $comment_tag->count(array(&#39;commentid&#39;=>&#39;content_&#39;.$v[catid].&#39;-&#39;.$v[id].&#39;-&#39;.$modelid));}
·{str_cut($v[&#39;title&#39;],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!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.