Howdy,
Right now, I have a random number generated in the php_include_start template in
VB that is used to reference an image which I then link to from my CMPS portal page.
Quote:
$totalfrontpage = 99;
$randomindex2 = rand(1, $totalfrontpage);
$frontpageimage = "http://www.twtex.com/forums/images/misc/frontpage$randomindex2.JPG";
|
I cannot figure out how to derive the image id corresponding to the filename for use with the showphoto.php link. I would like to embed a link like this:
http://www.twtex.com/photopost/showphoto.php?photo=386
So that both links are for the same image. While the filenames are sequential, image ids are not as the files were not all uploaded at the same time. What I was thinking is that perhaps I could add a query in the php_include_start to get the id after I have found the filename. I have no clue how to actually structure the query as I have done zip SQL stuff. I'm thinking something like:
$frontid = ppmysql_query("SELECT id FROM {$Globals['pp_db_prefix']}favorites WHERE bigimage=frontpage$randomindex2.JPG);
[I lifted that out of the showphoto.php]
Then I would link to it like this:
http://www.twtex.com/photopost/showphoto.php?photo=$frontid
Am I even in the ballpark?
My images are not stored in the database if that matters.