how to make a placeholder for iptc data? how to make a placeholder for iptc data?
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

how to make a placeholder for iptc data?

Started by cygnus, December 23, 2004, 03:17:08 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

cygnus

I've read through threads on moving placeholder variables around the page but nobody talks about iptc data.
I'm having trouble taking that iptc data like author from the display/hide layer on displayimage.php and moving it just below the image, outside of the layer that displays/hides.

Not the exif data... iptc.

Actually, I'm having trouble finding out what the variable name or placeholder name is to begin with.

I guessed at defining '{PHOTOGRAPHER}' => $iptc['Author'] in displayimage.php and then putting {PHOTOGRAPHER} in theme.php, but no go.

donnoman

I believe its because the Author information isn't making it to the theme function.

This will allow the Author information to at least show up with the rest of the IPTC info.

Send me a screen shot of where you would like the Author's name to appear. Or quote the section of theme.php where you put {PHOTOGRAPHER}

displayimage.php; find:

       if (isset($iptc['SubCategories'])) $info[$lang_picinfo['iptcSubCategories']] = trim(implode(" ",$iptc['SubCategories']));


Add after it:

       if (isset($iptc['Author'])) $info[$lang_picinfo['iptcAuthor']] = trim($iptc['Author']);


lang/english.php; find: (And in any additional language files if you use them, with appropriate translations)

 'iptcSubCategories'=>'IPTC Sub Categories', //cpg1.3.0


Add after it:

 'iptcAuthor'=>'IPTC Author', //cpg1.3.0

cygnus

http://escape.blogdns.com/gallery/displayimage.php?album=22&pos=0

"author" has a value of "im the author" as set in Photoshop CS.
I put {PHOTOGRAPHER} where I'd like it to appear.


donnoman

You can still do the previous change I posted so that the Author shows up in the PIC_INFO table.

Below is what you will need to do to show that information in the {CAPTION} section.

Note: This forces the system to parse the picture TWICE for IPTC information, I would code this differently If you
are running a really busy site. If your not... it's probably not important.


displayimage.php; function html_picture; find:

   $params = array('{CELL_HEIGHT}' => '100',
       '{IMAGE}' => $pic_html,
       '{ADMIN_MENU}' => $picture_menu,
       '{TITLE}' => $CURRENT_PIC_DATA['title'],
       '{CAPTION}' => bb_decode($CURRENT_PIC_DATA['caption']),
       );


change to

   if ($CONFIG['read_iptc_data']) $iptc = get_IPTC($CONFIG['fullpath'] . $CURRENT_PIC_DATA['filepath'] . $CURRENT_PIC_DATA['filename']);

   $params = array('{CELL_HEIGHT}' => '100',
       '{IMAGE}' => $pic_html,
       '{ADMIN_MENU}' => $picture_menu,
       '{TITLE}' => $CURRENT_PIC_DATA['title'],
       '{CAPTION}' => bb_decode($CURRENT_PIC_DATA['caption']),
       '{PHOTOGRAPHER}' => $iptc['Author'],
       );


cygnus

#4
Followed that to the letter and still nothing.  I mean, it's weird because "author:  iam the author" appears in that file info table.

$IPTC_data['Author'] is defined in iptc.inc.php and I also followed this thread:
http://forum.coppermine-gallery.net/index.php?topic=692.0

The author is stored in $user1.

donnoman

Quote from: cygnus on December 23, 2004, 08:59:52 PM
Followed that to the letter and still nothing. I mean, it's weird because "author: iam the author" appears in that file info table.

$IPTC_data['Author'] is defined in iptc.inc.php and I also followed this thread:
http://forum.coppermine-gallery.net/index.php?topic=692.0

The author is stored in $user1.

No, only in that MOD is the author stored in $user1.

The code I posted doesn't use the $user defined variables, and unless you are using that mod your install isn't using them either.

post a copy of the sections you changed in your theme.php and displayimage.php

cygnus

displayimage.php:

$params = array('{CELL_HEIGHT}' => '100',
        '{IMAGE}' => $pic_html,
        '{ADMIN_MENU}' => $picture_menu,
        '{TITLE}' => $CURRENT_PIC_DATA['title'],
        '{CAPTION}' => bb_decode($CURRENT_PIC_DATA['caption']),
{PHOTOGRAPHER}' => $iptc['Author'],
        );


english.php, in $lang_picinfo:

'iptcAuthor'=>'IPTC Author', //cpg1.3.0

theme.php, in the caption block:

{PHOTOGRAPHER} <- photographer should echo here


donnoman

 ??? Obviously I should have been more clear  :o

I still can't tell which sections of those files you modified.

how about attaching the whole file.

cygnus


donnoman

Quote from: donnoman on December 23, 2004, 06:29:16 PM

change to

   if ($CONFIG['read_iptc_data']) $iptc = get_IPTC($CONFIG['fullpath'] . $CURRENT_PIC_DATA['filepath'] . $CURRENT_PIC_DATA['filename']);

   $params = array('{CELL_HEIGHT}' => '100',
       '{IMAGE}' => $pic_html,
       '{ADMIN_MENU}' => $picture_menu,
       '{TITLE}' => $CURRENT_PIC_DATA['title'],
       '{CAPTION}' => bb_decode($CURRENT_PIC_DATA['caption']),
       '{PHOTOGRAPHER}' => $iptc['Author'],
       );



You didn't put in the "IF" line at the top of my instructions.  Insert that line, and try again. It's working with my installation.

Also FYI, since you put the token in the comments section this will only show up for pictures that have comments.

cygnus