In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
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.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.