Page 1 of 2

PHP Web Gallery - printing image name

Posted: Sat Oct 09, 2004 5:53 pm
by ShineDesign
Hello Everybody,

I'm doing a website which has two files, a PHP file and a text file. The PHP file defines everything for the web gallery, (all the maintainer does is add images to a folder and the php makes the thumbnails / displayes them in a frame on the site) and the text file has all the html on how the site looks. My question is, how do I make the php and text file display the image name underneath it's respective thumbnail? (for ordering purposes...customer calls up "I'd like to order picture "bla bla bla".)

Anybody know how this can be done? For a demo, go to:
http://www.shinedesign.org/other/gallery
and for the source files:
http://www.shinedesign.org/other/gallery/zip.zip

Thanks

Posted: Sat Oct 09, 2004 5:55 pm
by feyd
[devnet]+templat* +engine[/devnet]

Posted: Sat Oct 09, 2004 6:17 pm
by ShineDesign
I'm thiking I can just echo the file name once an array is set to store all filenames.

But...

How would I do this?

I just need to echo the filename of each thumbnail underneath it's respective thumnail. My code is in the zip file http://www.shinedesign.org/other/gallery/zip.zip
two files in there.

Posted: Sat Oct 09, 2004 6:19 pm
by feyd
We're not going to do the work for you.. you get to figure it out with our help. We usually won't go out and unzip files to look at them. We like them posted.

Posted: Sat Oct 09, 2004 6:26 pm
by ShineDesign
I tried posting the php, and the server gave an error everytime I submitted the post. The php is 487 lines.

Believe me, I did try to figure it out beforehand, for nearly 3 hours everyday the past 4 days. This site is due tomorrow and I need help asap.

Without posting 4 different times with the code, I made a web page listing it. If that could be looked at, it would be very much appreciated. The code can be found at:
http://www.shinedesign.org/other/gallery/php.html

From what I can gather, the image thumbs are being stored in an array when they're displayed in the html. I just don't know how to echo each individual thumb filename from the array.

Posted: Sat Oct 09, 2004 6:29 pm
by John Cartwright
make the extra effort and copy and paste the code inside the appropriate tags.... jesus...

Posted: Sat Oct 09, 2004 6:31 pm
by feyd
sounds like homework.. we can't ethically help all that much with homework.

Posted: Sat Oct 09, 2004 6:52 pm
by ShineDesign
I don't understand the "ethics" behind your decision to not help.

If a schoolroom teacher were to tell a student who had a question "I can't ethically help you with your homework" after the student had done hours upon hours of research to try and solve it himself, what good is the teacher? This forum acts as a teacher in the world of free technical advice. The least a teacher could do is point the student in the right direction, or tell him/her what topics to look under for the answer...

I find it amazing, no good deed goes unpunished. You decide to do a web gallery for free for a photographer who's displaying his work of our United States military to download and print for free, all because it's for those who put their lives on the line for our country, and yet I still can't get any help with one question that allows our soldiers to order a print from the photographer. Show some patriotism.

Posted: Sat Oct 09, 2004 6:54 pm
by jabbaonthedais
He didn't say we won't help. He said we can't ethically help "all that much". Teachers assign work for you to learn. If someone solved it all for you, you wouldn't learn it like you would with a little help.

Posted: Sat Oct 09, 2004 6:55 pm
by feyd
don't get snappy and jump to conclusions.. we'll point you in the directions we think are right, but we will not do the work for you.

As it was, I posted a link to our search that should show you several threads that talk about how to accomplish what you are asking about.

Posted: Sat Oct 09, 2004 6:58 pm
by ShineDesign
And a little help is all I'm asking for. I've stated I know the background in what I'm trying to do, it's just formulating the code to reflect those procedures that I don't yet know how to do. Just pointing me in the direction of where I can go to figure out the answer is more than enough. I hardly ever ask for help, only when it's critical and on the line. This site is due tomorrow (as the United States soldiers get shipped back out to the middle east on monday) and I've exhausted all the resources I know of so far.

I apologize if I'm asking for too much...I'm just at the point where I need "lamans" terms help with this. After 55 hours of work per week at my normal job, and doing this on the side (I first was asked to do it on wednesday) I'm extremely tired and have a headache like you wouldn't believe. The monitor doesn't help that either.

Posted: Sat Oct 09, 2004 6:59 pm
by ShineDesign
Thank you Feyd for your initial response with the search....I did in fact browse through many of those posts. The only problem is...I don't know what to look for in the code...so I don't know what I'm looking for in those posts.

Posted: Sat Oct 09, 2004 7:07 pm
by feyd
viewtopic.php?t=21887
viewtopic.php?t=23269

Were the ones I was imagining in particular. The basics of a template engine are:

A text file containing replacable "tags" of sorts where ~dynamic content can be filled in by the scripting language.

The first thread, Templating Engine, has some talk of where the template (text) file contains simple strings like {USERNAME} and {U_HOME}. You can simply use php to replace these using [php_man]str_replace[/php_man]() or if you are feeling fiesty, [php_man]preg_replace[/php_man]().

Loading the template is a simple [php_man]file_get_contents[/php_man]() like call, usually. The substitution is done normally in a linear sequence, only one time (as needed).

Posted: Sat Oct 09, 2004 7:20 pm
by ShineDesign
Thanks for the response. I've looked through the posts, but with the combination of lack of sleep mixed with a week-long headcold and a bad headache...I just can't take in all the coding to formulate the solution right now. I swear my IQ goes down at least 30 points when I'm sick...

I'll try to pick it up later if this headache goes away.

Posted: Sat Oct 09, 2004 7:22 pm
by feyd
you could potentially use smarty as well, although I haven't ever really used it.