forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Themes/Skins/Templates => Topic started by: cygnus on December 23, 2004, 03:17:08 am

Title: how to make a placeholder for iptc data?
Post by: cygnus on December 23, 2004, 03:17:08 am
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.
Title: Re: how to make a placeholder for iptc data?
Post by: donnoman on December 23, 2004, 05:41:54 am
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:
Code: [Select]
       if (isset($iptc['SubCategories'])) $info[$lang_picinfo['iptcSubCategories']] = trim(implode(" ",$iptc['SubCategories']));

Add after it:
Code: [Select]
       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)
Code: [Select]
 'iptcSubCategories'=>'IPTC Sub Categories', //cpg1.3.0

Add after it:
Code: [Select]
 'iptcAuthor'=>'IPTC Author', //cpg1.3.0
Title: Re: how to make a placeholder for iptc data?
Post by: cygnus on December 23, 2004, 04:49:18 pm
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.

Title: Re: how to make a placeholder for iptc data?
Post by: donnoman on December 23, 2004, 06:29:16 pm
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:
Code: [Select]
   $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
Code: [Select]
   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'],
        );
Title: Re: how to make a placeholder for iptc data?
Post by: 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.
Title: Re: how to make a placeholder for iptc data?
Post by: donnoman on December 23, 2004, 11:18:58 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
Title: Re: how to make a placeholder for iptc data?
Post by: cygnus on December 24, 2004, 02:59:15 pm
displayimage.php:

Code: [Select]
$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:

Code: [Select]
'iptcAuthor'=>'IPTC Author', //cpg1.3.0
theme.php, in the caption block:

Code: [Select]
{PHOTOGRAPHER} <- photographer should echo here
Title: Re: how to make a placeholder for iptc data?
Post by: donnoman on December 24, 2004, 03:34:26 pm
 ??? 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.
Title: Re: how to make a placeholder for iptc data?
Post by: cygnus on December 24, 2004, 05:10:47 pm
Sure. 
Title: Re: how to make a placeholder for iptc data?
Post by: donnoman on December 25, 2004, 01:35:49 am

change to
Code: [Select]
   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.
Title: Re: how to make a placeholder for iptc data?
Post by: cygnus on December 28, 2004, 04:30:54 am
Thanks donnoman!