Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 09 Oct 2007, 09:14
Derekclarke's Avatar
Derekclarke Derekclarke is offline
 
Join Date: Dec 2005
Location: N.Devon
Bunny! random Image in first & Second Alternating color

Hi,

I want to have images of my members cars, and have them displayed as a fixed watermark on the first and second alternating color.

I already have an image their now, but would like to have random Images......

can someone tell me how to do this?

Thanks
Derek
Reply With Quote
  #2  
Old 09 Oct 2007, 10:40
DivisionByZero's Avatar
DivisionByZero DivisionByZero is offline
 
Join Date: Dec 2002
the poor man's way to do this is to write an uploader that will generate the filenames like: userid_photonumber.jpg (10034_3.jpg), where "photonumber" autoincrements with every upload by that user.

create some heavy queries that determines the largest photonumber for that user.

generate a random number with "photonumber" as the high end. rand(1,$photonumber);

then, in your templates, use an img tag with a URL like this:
/path/to/photos/$post[userid]_$randomnumber.jpg
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


New To Site? Need Help?

All times are GMT. The time now is 22:39.

Layout Options | Width: Wide Color: