Most Viewed, but not random Most Viewed, but not random
 

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 Viewed, but not random

Started by die2nite, July 09, 2007, 01:57:50 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

die2nite

Is there anyway to get the Most Viewed images, but not have them be randomly displayed and instead from highest viewed to lowest viewed?

Thanks,

vuud

Quote from: die2nite on July 09, 2007, 01:57:50 AM
Is there anyway to get the Most Viewed images, but not have them be randomly displayed and instead from highest viewed to lowest viewed?

Thanks,

That may be in the next version... That is a tough one to work out.  Not programmatically but theory wise?

Lets say you have 100 pictures or varying views.  From which subset should the random be picked?  See the problem?
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

die2nite

Well let's say you have the following file set with the views following it.

File 1 - 7 Views
File 2 - 11 Views
File 3 - 7 Views
File 4 - 9 Views
File 5 - 2 Views

Then it should display like this:

File 2
File 4
File 1
File 3
File 5

But since Files 1 and 3 have the same views it could do one of the following to choose which one to show first: make it random for just those two, so positions three and four in the list would be random, or just put the first one the script encounters in the database in position three and the other one in position four.  Personally I would prefer the second way, just so users wouldn't be confused about why they keep interchanging. 

The reason I'm asking for this is begin I'm putting a section on my site for the "Most Popular Files" and I want them to be measured by the views and in descending order so users will immediately know what is the most popular file.

Thanks for the quick response vuud

vuud

Quote from: die2nite on July 09, 2007, 05:24:20 AM
Well let's say you have the following file set with the views following it.

File 1 - 7 Views
File 2 - 11 Views
File 3 - 7 Views
File 4 - 9 Views
File 5 - 2 Views

Then it should display like this:

File 2
File 4
File 1
File 3
File 5

But since Files 1 and 3 have the same views it could do one of the following to choose which one to show first: make it random for just those two, so positions three and four in the list would be random, or just put the first one the script encounters in the database in position three and the other one in position four.  Personally I would prefer the second way, just so users wouldn't be confused about why they keep interchanging. 

The reason I'm asking for this is begin I'm putting a section on my site for the "Most Popular Files" and I want them to be measured by the views and in descending order so users will immediately know what is the most popular file.

Thanks for the quick response vuud

Ah sorry, I read it quick and thought you wanted the random.

Yeah, I think that is actually in the works.  Thing is what to do if they are all 0 views?  I plan on letting the query run and have mysql do whatever it does in that instance :D

Check the next dev release when it comes out.

Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

die2nite