Get the App
SLTechnology News&Howtos  ›  Servers  › 

Imperial CMS implementation calls the method of downloading ranking

Shulou Source: shulou.com Published: 2022-06-02 03:40:20 10月03日 Update

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!

Tags: Code download ranking method Empire Task content data Field Datasheet File Daily different three value interest background Guy buddy time more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Xiaomi MySQL vpn Shulou Information