I'm not sure why I'm having so many issues tonight. I've searched the forums and the documentation, but am hitting a brick wall.
For reference, I'm using the Stopdesign theme and am dealing with image.php
I can figure out two different ways to display the title of a image:
<?php printImageTitle(true); ?>
or
<?php echo getImageTitle();?>
But I can't figure out for the life of me how to display other fields like city, state, copyright, and date (well, specifically, I only want to display year).
I'm sorry if this has been covered here before... I've looked and didn't find any answers. But I'm also burnt out right now so who knows.
Thanks!
Comments
But when I call this in the same manner that I see getImageTitle() called I get the following error:
Fatal error: Call to undefined function: getcopyright() in /home/abc/public_html/xyz/zenphoto/themes/stopdesign/image.php on line 22
which I assume means the function set needs to be required but i'm not savvy enough to be SURE this is what i need to do, nor where in image.php i should be doing such (other than somewhere near the top)
But you can do that even easier, simply use the template function `getImageData()`. This `echo getImageData("copyright")` prints the copyright field value (just noticed that the values are missing from our doc...)
3 to be exact:
1)
while
echo getImageData("copyright")
echo getImageData("city")
echo getImageData("state")
echo getImageData("credit")
all seem to work correctly,
getImageData("title")
getImageData("date")
getImageData("description")
all return nothing. is there something I'm missing? I think there are other functions I can call to get this data (since the Stopdesign theme already has them showing elsewhere) but why doesn't this function work across the board?
2)
Also, what IPTC field maps to Location?
3)
And, last but not least... while I can store quote marks in my IPTC data, ZenPhoto truncates at the ". Is this a bug? Is there a workaround (I'm trying to store size, as in the size of a painting, so, say: 3"x5"
(NOTE: I can actually store quotes in the comment/description field... but I actually need to use that for a comment. Best case I figure out how to map to Location and use that for size.)
2) That is a question for sbillard.
3) Don't really now maybe it gets "killed" for MySQL reasons. Did you try escaping it with \"? Or couldn't you just write "3 x 5 inch"?
The problem with the quotes is a deficiency in the implementation. We will fix it.
1) Ah, yes, I knew about these alternative functions for these three fields - I was just surprised getImageData() didn't handle all fields so that all could be accessed in one uniform way.
2) Hmm. I'm using Exifer to edit IPTC data and don't see it listed (and I think I've tested every field but will try again). I'll look around for something different. (I would normally use something like Adobe Bridge but I need to pass this off to someone who will require a solution that is a) freeware and b) incredibly easy to use.)
3) Do I need to report it anywhere or is this already taken care of? And thanks!
jlang: I guess that is because the exif stuff was added later. title, date and description are the most important fields and have been there for ever.
All themes use printImageMetaData for displaying all the exif data at once.
Perhaps we could indeed clean up that a little sometime...
One last, semi-related question.
Can anyone explain this time travel problem?
CODE:
Date: <?php echo getImageDate() ?>
Year: <?php echo date("Y",getImageDate());?>
RESULT
Date: 1974-12-30 00:00:00
Year: 1969
?! What ?!
ALSO - I just filed a bug report in the forum for two bugs I discovered while setting this all up.
thanks so much!
The "get" functions return the raw data. It may have quotation marks in it. Before displaying it you need to expunge these characters. Use the php function `htmlspecialchars()' function to convert characters to something that can be displayed via html.