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

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

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...