Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > DEVELOPMENT > Hacks and Modifications

Post Reply
 
Thread Tools
  #1  
Old 10-29-2007, 09:14 AM
krembo99 Offline
forum loafer
 
Join Date: Oct 2007
Location: Here and There
Posts: 8
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?
Reply With Quote
  #2  
Old 10-29-2007, 02:49 PM
Dkozikowski's Avatar
Dkozikowski+ Offline
Team Pixelpost
 
Join Date: Oct 2005
Posts: 1,855
Send a message via AIM to Dkozikowski
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.
Reply With Quote
  #3  
Old 10-29-2007, 06:14 PM
krembo99 Offline
forum loafer
 
Join Date: Oct 2007
Location: Here and There
Posts: 8
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() ");
This worked for the main category ...

Thanks :-)
Reply With Quote
  #4  
Old 10-29-2007, 06:22 PM
Dkozikowski's Avatar
Dkozikowski+ Offline
Team Pixelpost
 
Join Date: Oct 2005
Posts: 1,855
Send a message via AIM to Dkozikowski
Yup, that should work, looks good to me.

Enjoy
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 08:41 PM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. | Style Design: d3 designs