Hi there
Is there a way to call top 10 viewed albums ?
In advance thank you
Michael
SELECT aid, SUM(hits) AS numviews FROM {$CONFIG['TABLE_PICTURES']} GROUP BY aid ORDER BY numviews DESC LIMIT 10
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
Depends where you want it. That's just the db query, you'd need extra code to display stuff. You can use this (http://forum.coppermine-gallery.net/index.php?topic=8405.msg61233#msg61233) 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.
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 (http://forum.coppermine-gallery.net/index.php?topic=8405.msg61233#msg61233) 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
Nibller, are you there ? :)
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.
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 ? :-\\
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
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).
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