PDA

View Full Version : Pull random images to php page...


Daz wilde
07-14-2008, 07:48 PM
Is there a way to pull random images from my gallery to my home page which is a bog standard php page..

Morgan
07-15-2008, 06:53 PM
http://www.photoplog.com/forum/showthread.php?t=10

Daz wilde
07-15-2008, 07:32 PM
This is great but can i ......

Make them slightly bigger than what they display as?

Also grab them from a seperate category?

Cheers

Morgan
07-16-2008, 02:30 PM
Please don't PM me support questions. Posting and PMing doesn't grab my attention or make me work any faster. As to your questions, change $photoplog_imgsize to medium or large and edit the query:
Content visible to registered users only.

Daz wilde
07-16-2008, 11:05 PM
Apologies for the PM...

Great stuff it worked a treat.... how would these random images change though, or do they always stay to that image???

Also did you create this mod for cartplog???? I was wanting to do exactly the same for this mod also??

http://www.vbulletin.org/forum/showthread.php?t=161010

Thanks again

Morgan
07-17-2008, 01:51 PM
1: Look for ORDER BY RAND() on this (http://dev.mysql.com/doc/refman/5.0/en/mathematical-functions.html) page and edit the query.

2: You'll need to check the vBorg thread and see if there is anything there; nothing here for the cart.

Daz wilde
07-17-2008, 11:02 PM
Sorry Morgan im not well up on sql querys i have tried several times could you help us edit this line so i can get the random working...

$query = "SELECT * FROM photoplog_fileuploads WHERE moderate = 0 AND catid IN (2) LIMIT 1";


I think thats the bit i need to edit.

Morgan
07-18-2008, 12:27 PM
Add ORDER BY RAND() before LIMIT - there is an example on this (http://dev.mysql.com/doc/refman/5.0/en/mathematical-functions.html) page.

Daz wilde
07-18-2008, 05:17 PM
Morgan you are a legend!!!!!

Just need to try and do the same for the cartplog now!!!!!!

THANK YOU!!!

;)

starmagh
10-06-2008, 01:13 AM
Content visible to registered users only.

+1
thanks !