Member
Member
SimonD   2009-01-01, 22:33
#1

Hi.

Fantastic software and one I'm busy using to fine tune a website gallery for my photography.

I noticed that upon import (I FTP to folders on my server) that ZenPhoto very cleverly populated certain fields with information from the IPTC data I embed in each file. I LOVE IT. However I'd love to embed this on the image.php pages that display my images.

So far I have used the following codes, but for some reason it defaults to each having it's own line (which I dont want).

``

For copyright for example. I also use the Location, State, Country codes and would love to have them display something like this:

[strong]Picture taken at :[/strong] Location, State, Country to display on one line.

How do I do this??

I know which codes to use (I think), but no idea how to put this code into the image.php file.

Any help would be appreciated. I've read the functions in the documentation, but not really knowing PHP very well (still learning) it's a bit tough with things like VOID etc.. which I do not understand, especially the arguments and structure.

Regards,

Simon

Member
Member
sbillard   2009-01-01, 23:00
#2

In general, for each print type function there also exists a get equivalent. In this case getImageData(). (See the functions guide on the Zenphoto WEB site.) The get functions return the raw data from the field which you can format howerver you want.

So: echo '[b]Picture taken at:"[/b] '.getImageData('location').', '.getImageData('state').', '.getImageData('Country');

Member
Member
SimonD   2009-01-02, 11:40
#3

Thank you!

This works perfectly!

Your help and gallery are really appreciated!

Member
Member
SimonD   2009-01-02, 17:49
#4

The above is working perfectly, but I am wondering whether the IPTC codes are only limited to those fields I can see in the image edit window?

Do tags such as Event, Category, Usage Rights Terms, URL, etc get stripped out of the JPEG?

Which of the IPTC tags remain, and what are their "codes" to use in the getImageData code?

Thanks!

Member
Member
sbillard   2009-01-03, 00:31
#5

You can use the getImageData() function to retrieve any item in the database. However, not all IPTC fields are captured by zenphoto. If you look at the table defininition of the image table you will see all the fields.

Member
Member
SimonD   2009-01-03, 17:12
#6

Thanks! Slowly getting to grips with this.

I have another question.

I've used the code `` to display the pixel dimensions of the file below the photo on the image.php page. Is there a similar code to display the file size in MB?

Thanks!

Member
Member
sbillard   2009-01-03, 19:47
#7

You would have to use the PHP filesize() function to get the size. Use the image localpath parameter.

Member
Member
SimonD   2009-01-04, 22:52
#8

Thanks sbillard.

I'm still learning PHP, so where would I insert this? And what tags do I put this inbetween?

And last question (promise!!) is there a PHP tag that I can drop in to display the filename of the picture being displayed?

I have read through the functions and still not always sure how to put these into my template I'm building! Slow, but with your help learning more each day.

Many thanks!! (again)

Simon

Administrator
Administrator
acrylian   2009-01-05, 12:09
#9

You can get the file name of each image by using the object of the current image $_zp_current_image->filename.

Member
Member
SimonD   2009-01-05, 16:57
#10

Thanks acrylian, but as a total newbie where would, and how would I implement this on the code?

I've started by tweaking the default theme (still learning, so best for me). So where abouts would I insert this?

All your help (especially sbillard) is much appreciated!

Administrator
Administrator
acrylian   2009-01-05, 17:26
#11

Just put `` where you want the file name to be printed. May I recommend to read our theming tutorial on our user guide section, too?

Member
Member
SimonD   2009-01-06, 19:26
#12

Hi Acrylian.

Many thanks.

I have downloaded the document and printed it! :-) I am new to this and learning so much so quickly. It's just slow as I have to edit on my machine, then FTP the php file back to the server, then refresh the page to see the changes. Sometimes I just want to run and I can only walk!

Will post a link when I'm done. I am really loving ZenPhoto. I'm sure there will be lots of questions still!

Administrator
Administrator
acrylian   2009-01-06, 20:24
#13

I recommend to install a local server on your machine using some of the LAMP, WAMP or MAMP packages (depending on your OS). That is much more convenient for learning and testing.

Member
Member
SimonD   2009-01-07, 22:48
#14

Thanks. I run on Apple Mac OSX 10.5. I know it's linux based, but no idea how to set up a database etc.

I will ask my friend.

Thank you again.

Simon

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.