PhotoPost Photo Gallery Sales PhotoPost Sales Toll Free Phone Number
Mon-Fri 9am-4pm EST
  PhotoPost Photo Sharing Photo Gallery    Visualize community tm
| | | | | | | | |
Old May 25th, 2005, 01:37 PM   #1 (permalink)
Member
Verified Customer
 
Join Date: May 2004
Posts: 35
How do I pull the thumbnail from the database?

Hey guys, I'm a little new to PHP and while I understand most of what everything does and how it works, I can't figure this out. I've been trying new things all day.

Basically, I have added this code to a file that I want to display the users last added image to the gallery:
Code:
Content visible to verified customers only.
That will obviously pull the image title, url, and the date added.
I can pull thumbname the same way, but how would I go about finding where the thumb is located on the server? ( gallery/files/1/5/image_thumb.jpg ) is what I'm talking about to be exact.

I'm assuming the first folder would be the userid, but what about the second?
Sorry if this is confusing.. and I'm sure there are other ways to go about this, but I'm new like I said and this seemed easy at first.

Thanks,
xbleed is offline   Reply With Quote
Old May 25th, 2005, 01:39 PM   #2 (permalink)
Member
Verified Customer
 
Join Date: May 2004
Posts: 35
Re: How do I pull the thumbnail from the database?

Wait, now I'm even more confused. The second folder would be the second integer in the userid if there is one, right? So say someones userid is 76 their images would be located in:
gallery/files/7/6/image_name.jpg

Correct?

Yeah, I think I'm going to have to go about this a different way then.
xbleed is offline   Reply With Quote
Old May 25th, 2005, 03:52 PM   #3 (permalink)
Brian
Guest
 
Posts: n/a
Re: How do I pull the thumbnail from the database?

Yes, it is stored with each number of the userid split up into a different folder. If you look at the gallery functions then you should see one to help you get the correct URL.
  Reply With Quote
Old May 25th, 2005, 04:49 PM   #4 (permalink)
Member
Verified Customer
 
Join Date: May 2004
Posts: 35
Re: How do I pull the thumbnail from the database?

Quote:
Originally Posted by Brian
Yes, it is stored with each number of the userid split up into a different folder.
That's an interesting way to do that. Is there a specific reason it was done that way? Just curious.


After looking further into it, I think I know what to do but I tried it a bit and had no luck. Would I just have to add something like:

Code:
Content visible to verified customers only.
?? Cause I got close with this, but no cigar. The image url is not showing up correctly.
xbleed is offline   Reply With Quote
Old May 25th, 2005, 05:45 PM   #5 (permalink)
Brian
Guest
 
Posts: n/a
Re: How do I pull the thumbnail from the database?

Quote:
Originally Posted by xbleed
That's an interesting way to do that. Is there a specific reason it was done that way? Just curious.
Mostly because that's about the best way to do it.
Seriously though, that's about the only way to do it without the posibility of some systems not allowing more than a specific number of sub-folders under one.


Quote:
After looking further into it, I think I know what to do but I tried it a bit and had no luck. Would I just have to add something like:
Try replacing the $vba_options['gallery_homeurl'] with just /gallery, or whatever folder your gallery files are in.
  Reply With Quote
Old May 25th, 2005, 07:01 PM   #6 (permalink)
Member
Verified Customer
 
Join Date: May 2004
Posts: 35
Re: How do I pull the thumbnail from the database?

Hah, well.. I'm obviously doing something very wrong then. I guess it shows I've never worked with anything outside of basic database pulling/entry..

If I right click on where the thumbnail is supposed to be, the properties have it linked to "misc.php?do=downloadfile&i=" instead of the image file folder it's in.

If anyone has a quick minute, here is the code I have so far. I'm pretty sure I have just overlooked something or something is not lined up correctly.. or maybe I'm completely wrong with the approach of this. :x

Code:
Content visible to verified customers only.
I have required the functions_gallery.php file, so the construct_image_url should work according to what I checked out so far.

Code:
Content visible to verified customers only.
And here is what I have as the html template:

Code:
Content visible to verified customers only.
So basically, everything is working so far except the fact that the "$latestimagebits" is linking to "misc.php?do=downloadfile&i=" instead of the thumbnail file itself and I'm not quite sure why.

Any assistance would be greatfully appreciated.
Thanks,
xbleed is offline   Reply With Quote
Old May 26th, 2005, 11:40 PM   #7 (permalink)
Member
Verified Customer
 
Join Date: May 2004
Posts: 35
Re: How do I pull the thumbnail from the database?

Well, I figured it out. Hours later.. haha. Oh well, we all learn somewhere, right?
Thanks for the help Brian.
xbleed 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



All times are GMT -5. The time now is 09:33 AM.

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