In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you how to add statistical functions to phpcms, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
How does phpcms count?
PHPCMS adds the whole site access statistics function
The current PHPCMS V9 version does not have the function of site-wide access statistics, but what if you do not want to use a third-party plug-in? Here is attached for you a PHPCMS implementation of the site-wide page access statistics tutorial.
The first step is to customize the function code of access statistics
1. Open the extention.func.php file
File path: phpcms/libs/functions/extention.func.php
2. Type the following code in extention.func.php
Function getNewsContent ($id) {session_start (); $log = 'log.txt';if (! $handle = fopen ($log, "a +)) {echo' log file opening failed'; exit ();} if (! fwrite ($handle,session_id (). Chr (13)) {echo 'data write failure'; exit ();} fclose ($handle); $file = file_get_contents ($log); $content = explode (chr (13), $file) Echo "visit Statistics:". (count ($content)-1). ";}
The second step is to invoke the tag in the html template.
If I need to add visit statistics to the bottom of the website:
Open file path: phpcms/templates/default/content/footer.html
Add {getNewsContent ($r ['id'])} to footer.html
The effect of access statistics can be realized.
The above are all the contents of the method of adding statistical functions to phpcms. Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.