In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces the Imperial CMS implementation call download ranking method, the article is very detailed, has a certain reference value, interested friends must read it!
How does Imperial CMS call download ranking?
Implementation method:
Step 1: add three fields to the data table: DayHits WeekHits MonthHits is set to field type INT
Step 2: open the file: / eCompact ViewClick.index.phpMagnediDGN add the following code after the stamping number.
The code is as follows:
/ / the number of daily downloads elseif ($down==7) {$ritual download empires-> fetch2 ("select DayHits from {$dbtbpre} ecms_". $cr ['tbname']. " Where id='$id' limit 1 "); $shownum=$r ['DayHits'];} / / number of weekly downloads elseif ($down==8) {$rattled empires-> fetch2 (" select WeekHits from {$dbtbpre} ecms_ ". $cr [' tbname']." Where id='$id' limit 1 "); $shownum=$r ['WeekHits'];} / the number of monthly downloads elseif ($down==9) {$rusted download empires-> fetch2 (" select MonthHits from {$dbtbpre} ecms_ ". $cr [' tbname']." Where id='$id' limit 1 "); $shownum=$r ['MonthHits'];}
Step 3: open / e/class/DownSysFun.php to find, / / total download data increase one.
The code is as follows:
$usql=$empire- > query ("update {$dbtbpre} ecms_". $class_r [$classid] [tbname]. "set totaldown=totaldown+1where id='$id'"); / / replace with: $usql=$empire- > query ("update {$dbtbpre} ecms_". $class_r [$classid] [tbname]. "set totaldown=totaldown+1,DayHits=DayHits+1,WeekHits=WeekHits+1,MonthHits=MonthHits+1 where id='$id'")
Step 4: the content page calls:
Download today:
The code is as follows:
Download this week:
The code is as follows:
Download this month:
The code is as follows:
Step 5:
A new scheduled task is added to the background scheduled task.
Task name: daily download clearance program
It's up to you to choose the time of 0: 00 or 1: 00.
The php file code is as follows:
The code is as follows:
Add new weekly downloads and empty them.
The code is as follows:
Add a new month to download and clear:
The code is as follows:
These are all the contents of the Imperial CMS implementation that calls the download ranking method. Thank you for reading! Hope to share the content to help you, more related 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: 280
*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.