Top 10 albums Top 10 albums
 

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

Top 10 albums

Started by Michael-CGC, February 06, 2005, 05:55:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Michael-CGC

Hi there

Is there a way to call top 10 viewed albums ?

In advance thank you
Michael

Nibbler

SELECT aid, SUM(hits) AS numviews FROM {$CONFIG['TABLE_PICTURES']} GROUP BY aid ORDER BY numviews DESC LIMIT 10

Michael-CGC

Quote from: Nibbler on February 07, 2005, 12:32:01 PM
SELECT aid, SUM(hits) AS numviews FROM {$CONFIG['TABLE_PICTURES']} GROUP BY aid ORDER BY numviews DESC LIMIT 10

Where should add that code ? And is it possible just calling text?

Like:

Most viewed albums
1. xxxx
2. xxxx
3. xxxx
4. xxxx

... and so on

Nibbler

Depends where you want it. That's just the db query, you'd need extra code to display stuff. You can use this code if you want it as an anycontent block, just switch that query for the one in my previous post and add formatting to display it as you want.

Michael-CGC

Quote from: Nibbler on February 07, 2005, 02:28:58 PM
Depends where you want it. That's just the db query, you'd need extra code to display stuff. You can use this code if you want it as an anycontent block, just switch that query for the one in my previous post and add formatting to display it as you want.

erhm... Could you please explain in a newbie way ? What should exactly do and where do I add the code you gave me ?

In advance thank you
Michael

Michael-CGC

Nibller, are you there ?  :)

Hein Traag

Patience is a virtue  ;D

Why not trying something out yourself ? Take the anycontent block from the post nibblers suggests and try swapping the db query with the one he gave here. Trial and error is a good way of learning a thing or two about php coding.

Michael-CGC

Quote from: Hein on February 09, 2005, 10:28:01 AM
Patience is a virtue  ;D

Why not trying something out yourself ? Take the anycontent block from the post nibblers suggests and try swapping the db query with the one he gave here. Trial and error is a good way of learning a thing or two about php coding.

If I knew how to that, well... I wouldn't ask for a newbie help. Would I ? :-\\

Joachim Müller

Well, then you have to be more detailed in what you want to accomplish: where exactly are your top 10 meant to appear on what page? Links and illustrations/screenshots can be helpfull too...
Generic questions lead to generic answers, detailed questions usually lead to detailed answers.

Joachim

Michael-CGC

Hi Joachim

What I want to do is. I like to have a top x albums showing on my index.php (like the top viewed images black).

Joachim Müller

then use the query posted above and output the result, using anycontent.php. If this is too difficult for you, then maybe this mod is not meant for you, sorry...

Joachim