|
#1
|
|||
|
|||
|
Random thumb order on browse page
Hi all..
I just picked up PP yesturday, and already i have managed to construct a really cool page... It's a great tool. One thing i am missing, is a bit of "flexibility" in the way it can be used. For example, random thumb order in the browse page. I have seen many "random" posts here, but most deal with the addon and random page, and not the browse page .. I have tried to use shuffle($something); command, but i am not sure on what variable should i apply it on, and i'm not a Php wiz.. :-) I am sure this is much easier than i immagine... anyone could help maybe? |
|
#2
|
||||
|
||||
|
You want the thumbnails to display randomly instead of chronologically on the browse page?
That's certainly a request i have not heard before as most people use the browse page as it was intended, an archive of photos. Anyway, you're barking up the wrong tree with the shuffle function. Take a look at the SQL queries. What you may want to use is MySQL's RAND() function. Just be aware, the larger the database grows the slower and less efficient this function becomes.
__________________
Pixelpost Documentation | Visual Pixels | My Addons | Transition Bottlerocket Fund |
|
#3
|
|||
|
|||
|
Well..
I just wanted to put some dynamic inside my page, I do not see any importance for the chronologic order of MY photos, after they were posted... so I thought a random page could be less boring , at least for me :-) Code:
$query = mysql_query("SELECT 1,id,headline,image,datetime FROM ".$pixelpost_db_prefix."pixelpost WHERE (datetime<='$cdate') ORDER BY RAND() ");
Thanks :-) |
|
#4
|
||||
|
||||
|
Yup, that should work, looks good to me.
Enjoy
__________________
Pixelpost Documentation | Visual Pixels | My Addons | Transition Bottlerocket Fund |
| Post Reply |
| Thread Tools | |
|
|