Most popular picts ordered by click per day... Most popular picts ordered by click per day...
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Most popular picts ordered by click per day...

Started by Loïc, February 10, 2006, 11:12:18 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Loïc

Hi!

In order to not handicap new picts I would like to order most popular picts following the number of click per day instead of the total number of click... Is that mod already existing? Or anybody can help me?

Thanx,

Loïc


Nibbler

Not posted afaik, you'd need to add in per day hit tracking to do this.

Loïc

Here's what I tried, without succes:

I found:                $query = "SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES'AND hits > 0 $META_ALBUM_SET $keyword ORDER BY hits DESC, filename  $limit";
and replace by: $now = time();

                $query = "SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES'AND hits > 0 $META_ALBUM_SET $keyword ORDER BY hits/($now-ctime) DESC, filename  $limit";


But all I got is the pict ordered by date...

Then I tried ORDER BY (hits/($now-ctime))
and
ORDER BY (hits*1/($now-ctime*1))
and
ORDER BY (hits*1/($now*1-ctime*1))
and finally
ORDER BY (hits*1/(".$now."-ctime*1))

with always the same result. I wonder if $now = time(); is correct.

Any idea???

Loïc

OK, if someone cares about that, I found why it didn't work. The result was in click per second, and of course < to 0,01, so understood as 0,00. The solution is to multiply the result by 86400 to have the number of click per day...