PhotoPost Photo Gallery Sales PhotoPost Sales Toll Free Phone Number
Mon-Fri 9am-4pm EST
  PhotoPost Photo Sharing Photo Gallery    Visualize community tm
| | | | | | | | |

Go Back   PhotoPost Community > PhotoPost Support > PhotoPost Pro Support Forums > Photopost Pro How Do I...?

Photopost Pro How Do I...? Wondering how to do things in PhotoPost?

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old February 18th, 2006, 12:26 AM   #1 (permalink)
Member
Verified Customer
 
Join Date: Dec 2005
Location: Texas
Posts: 30
How to get photo number based on filename?

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.
Tourmeister is offline   Reply With Quote
Old February 18th, 2006, 08:11 AM   #2 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,665
Thats just how to get a link you still need to grab the cat and bigimage fields to be able to build the thumbnails

$datadir/$cat/thumbs/$bigmage
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old February 18th, 2006, 08:03 PM   #3 (permalink)
Member
Verified Customer
 
Join Date: Dec 2005
Location: Texas
Posts: 30
I'm not sure what you mean by building the thumbnails? All I want to do is link to the full sized image like this:

http://www.twtex.com/photopost/showphoto.php?photo=386

But I need a way to determine the number on the end of that link based on the filename. Thanks.
Tourmeister is offline   Reply With Quote
Old February 18th, 2006, 08:56 PM   #4 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,665
Do whatever you like. As long as you query the database bigimage field on a filename you can grab an id

Code:
Content visible to verified customers only.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old February 27th, 2006, 10:13 PM   #5 (permalink)
Member
Verified Customer
 
Join Date: Dec 2005
Location: Texas
Posts: 30
Hi Chuck,

I added these two lines to the phpinlcude_start template:

Quote:
$frontid = ppmysql_query("SELECT id FROM {$Globals['pp_db_prefix']}photos WHERE bigimage='frontpage$randomindex2.JPG');

$frontidlink = "http://www.twtex.com/photopost/showphoto.php?photo=$frontid&cat=512";
Then in my Portal template:

Quote:
<tr>
<td class="$bgclass" align="center">Click image to see comments<br><a href="$frontidlink" target="blank"><img src="$frontpageimage" /></a><br>
</td>
</tr>
The idea is that if they click the image, they are taken to the gallery where the full sized image is shown with the comments.

What I get now is no image showing, just a blue outline around a small empy box indicating a link, the mouseover indicating the link to be "http://www.twtex.com/?" Not sure why it is dropping the rest of the link or failing to display the image when I put the link to the gallery in place? If I remove the link to the gallery, the image displays fine.

I noticed that there is a single double quote in front of the SELECT in the line I copied from your post. I added one at the end of the line after the single quite and before the ) and that caused the entire forum to crash hehe. I removed it and the forum is fine.

If you try to visit the site, I have changed it back the way I had it before adding the info above (where it links to the album instead of the individual image).

Last edited by Tourmeister; February 27th, 2006 at 10:24 PM.
Tourmeister is offline   Reply With Quote
Old February 27th, 2006, 10:24 PM   #6 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,665
frontpage$randomindex2.JPG

I think your issue would have to do with the logic here. Where is there in your photos table an image named this?

I don't get the logic of that photo name. In PHP $random would be treated as a variable so I can only assume the image is not named what your searching for and thus your query results are NULL.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old February 27th, 2006, 10:32 PM   #7 (permalink)
Member
Verified Customer
 
Join Date: Dec 2005
Location: Texas
Posts: 30
all of the images that are in the album that I pull images from are named like this:

frontpage1.JPG
frontpage2.JPG
etc...

The $randomindex2 is a variable generated by the PHP random function to provide the number to tack on the end of "frontpage". I plug that into my image link in the phpinclude_start template like this:

Quote:
$frontpageimage = "http://www.twtex.com/photopost/data/512/frontpage$randomindex2.JPG";
Then in the Portal template, I link to the image like this:

Quote:
<tr>
<td class="$bgclass" align="center">Click image to see Gallery<br><a href="http://www.twtex.com/photopost/showgallery.php?cat=512" target="blank"><img src="$frontpageimage" /></a><br>
</td>
</tr>
That is how I have it setup at the moment if you would like to look at the page. www.twtex.com It just randomly rotates through the images in the album.

Last edited by Tourmeister; February 27th, 2006 at 10:57 PM.
Tourmeister is offline   Reply With Quote
Old February 28th, 2006, 09:33 AM   #8 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,665
What I am saying is look at your coding.

If your doing an absolute query as noted above any issue has to do with how your defining frontpage$randomindex2.JPG if the query is returning no results.

Probally best above the query to first define the random image code and change your query like so

WHERE bigimage='$randomindex');
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Reply


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

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to set number of thumbnails for photo details? keymistress General Discussion 9 June 24th, 2006 09:10 PM
Photo Previews and Number of thumbnails kisii Photopost Pro How Do I...? 2 April 18th, 2005 12:14 PM
Corrupt tumbnames, mismatch between server filename, and dB filename imported_tamarian Installs and Upgrade - vBulletin 3.0.X 3 March 7th, 2005 11:06 AM
Moderators based on usergroups imported_theMusicMan How Do I? - vBulletin 3.0.X 2 January 1st, 2005 11:28 AM
Number of most popular photo problem. iloco General Discussion 2 July 6th, 2004 07:49 AM


All times are GMT -5. The time now is 06:57 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0