coppermine-gallery.com/forum

Support => Older/other versions => cpg1.1.X Support (standalone) => Topic started by: johnnyt on October 29, 2003, 11:29:54 AM

Title: Extracting one random pic for display on another page...
Post by: johnnyt on October 29, 2003, 11:29:54 AM
I'm just playing around with your FANTASTIC gallery (I'm very very impressed with it). I'm looking at using it for an ID Parade page that I have on my site. Its just a collection of photos that people have sent me.

My question is this...

I would like to be able to display one random pic on the front page of the site with a link along the lines of "Have a look at the ID Parade" and then a pic.

How do I access the database to extract one picture from it ? I'm no expert with php and sql but I'm not a complete newbie either. I can connect to the database etc but what query do I need to run and on which table in order to get a random picture ?

Any help is greatly appreciated.

Cheers

JT

PS. Keep up the excellent work with the script  :wink:
Title: Extracting one random pic for display on another page...
Post by: hyperion on October 29, 2003, 06:09:50 PM
do a search for ssi.php
Title: Extracting one random pic for display on another page...
Post by: johnnyt on October 29, 2003, 06:43:46 PM
Thanks for the advice but you could you expand a little ? Do a search where for ssi.php ? On Google or on this site ? I've searched on this site and found a similar problem posted by someone else and they were attempting to resolve it. The admin said something about anycontent.php ??

Could you give me a bit more info please ?

My main page is a .php file and I just want to add a random picture from my database (ie. out of the coppermine database) into a table.

What would the query look like ?

Any help much appreciated.

Thanks  :)
Title: Extracting one random pic for display on another page...
Post by: hyperion on October 30, 2003, 02:56:54 AM
Don't mind me, I'm just babbling on about a module that I just remembered we don't suggest using anymore.  :) SInce you know something about php, go look at the code for the random picture block.  You'll see how to construct the query.  :)
Title: Extracting one random pic for display on another page...
Post by: johnnyt on October 30, 2003, 09:35:04 AM
Okeedokee, will do. Thanks for your help matey.

Keep up the good work with the gallery.

Cheers

JT  :lol: