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
|