Copyright notice with every image Copyright notice with every image
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Copyright notice with every image

Started by PeteW1959, April 05, 2012, 04:53:24 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

PeteW1959

I have just installed Coppermine it seems to do everything I am looking for, great product and thank you!

The only thing I want to do and can't find out how is copyright notices for each image. I am going to have several albums, one for each of several photographers. I want to have a copyright notice displayed with each image, but it needs to be different for each album e.g. Fred Bloggs' album will have "Image copyright Fred Bloggs" and John Doe's album will have "Image copyright John Doe".

Is there a way to do this with just a single entry for each album, or do I have to add it to each image manually?


Αndré

Do you want to apply a watermark to each album's image, or do you just want to display that text somewhere in the thumbnail/intermediate-view pages?

PeteW1959

I just want a message displayed somewhere on the intermediate view page. The images already have the photographer's watermark; I just want a reminder that the watermark must stay with the image.

Αndré

I cannot create a mod where that notice is displayed 'somewhere' ;) Please choose a location.

Additionally, how should the
QuoteImage copyright Fred Bloggs
be generated? Is the photographer's name their user name? If so, we can generate it automatically for each page. If not, I need to know how your gallery is structured more detailed. Do they upload their images themselves? Does every photographer have a (or several) separate albums or are there albums which contain pictures from several photographers? A link to your gallery will also help to find the best solution.

PeteW1959

The gallery isn't live yet and only has one test album in it. When we go live there will be an album for each photographer, but the album name won't necessarily be the photographer's name, and in addition there will be some general albums that won't need the message. The message is likely to be totally different for each album.

If the message could be displayed under each intermediate image in the album that would be great. It could be set when creating the album in the album properties page (where the album description etc. is entered), that way there can be a custom message for each album, or none at all.

In case it makes a difference I am using a theme, acidtechpurple V2.0.

Regards
Pete

Αndré

The easiest way would be to abuse the album keyword field (or even better the album description box) and then add a simple mod to display its content next to each album's pictures. Using the album keyword field may cause some unwanted behavior, displaying pictures from other albums in the current album (please read the docs to understand what the album keyword feature does), so it's recommended to use the album description field.

Is it possible in your gallery to use one of the fields to store that information?

PeteW1959

The album description box will be needed for album descriptions; there will be sub-albums within each photographer's album and will require a description.

We are unlikely to be using keywords so it could go in there, but as you say it may cause strange behaviour so it is probably not a good idea.

This is turning out to be far more complicated than I thought!

Αndré

So we either have to add a new field to the albums' properties or we disable the album keyword feature, if you won't use/need it in your gallery.

PeteW1959

Obviously the easiest way is to modify an existing field, and I have no plans at the moment to use the keyword field, but it would be good to still have the option in the future.

Putting a new field in would also make the mod useful to a wider range of users, as it could be used for more than just copyright notices.

Αndré

#9
1. Download the attached file, upload its extracted content to your gallery root and access the file with your browser while logged in as admin

2. Open modifyalb.php, find
array($icon_array['keyword'].$lang_modifyalb_php['alb_keyword'].$help['album_keywords'], 'keyword', 0),
and below, add
array('Copyright info', 'copyright_info', 0),

3. Open db_input.php, find
$query = "UPDATE {$CONFIG['TABLE_ALBUMS']} SET title = '$title', description = '$description', category = $category, thumb = $thumb, comments = '$comments', votes = '$votes', visibility = $visibility, alb_password = '$password', alb_password_hint = '$password_hint', keyword = '$keyword'";
and replace with
$query = "UPDATE {$CONFIG['TABLE_ALBUMS']} SET title = '$title', description = '$description', category = $category, thumb = $thumb, comments = '$comments', votes = '$votes', visibility = $visibility, alb_password = '$password', alb_password_hint = '$password_hint', keyword = '$keyword', copyright_info = '".$superCage->post->getEscaped('copyright_info')."'";

4. Copy the function theme_html_picture from the sample theme to your theme's theme.php file if it doesn't exist. Then, find
$CURRENT_PIC_DATA['footer'] = '';
and replace with
$CURRENT_PIC_DATA['footer'] = mysql_result(cpg_db_query("SELECT copyright_info FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid = {$CURRENT_PIC_DATA['aid']}"), 0);

PeteW1959

Hi Αndré,

Thanks so much for this. I have followed the instructions but there is a slight problem.

The box to enter the copyright message appears on the album properties screen, but if I enter anything in it and click update I get a message 'No update needed' and the message is not displayed.

If I enter the message directly in the table field it displays correctly.

PeteW1959

Also just noticed that the © symbol does not display

Αndré

Please apply step 3 again, I just updated the code.

PeteW1959

Hi Αndré,

That did the trick! Thank you so much for your work on this. My gallery is now ready to go live.

Pete

PeteW1959

Hi Αndré,

I have made a minor modification to your modification to allow multiple lines for the copyright notice.

Step 2. Changed
array('Copyright info', 'copyright_info', 0),
To
array('Copyright info', 'copyright_info', 3),

Added Step 5. Open theme.php and find
$params = array('{CELL_HEIGHT}' => '100',
        '{IMAGE}' => $CURRENT_PIC_DATA['header'].$CURRENT_PIC_DATA['html'].($CURRENT_PIC_DATA['footer']),

Replace with
$params = array('{CELL_HEIGHT}' => '100',
        '{IMAGE}' => $CURRENT_PIC_DATA['header'].$CURRENT_PIC_DATA['html'].bb_decode($CURRENT_PIC_DATA['footer']),


Not sure if this is the best way to do it, but it works.

PeteW1959

Hi Αndré,

Whoops, hadn't tested it properly and the changes are a little more extensive

Database table cpg15x_albums field copyright_info: Changed field type to Text

Step 2. Changed
array('Copyright info', 'copyright_info', 0),
To
array('Copyright info', 'copyright_info', 10),

Find
function form_textarea($text, $name)
{
    global $ALBUM_DATA;

    $value = $ALBUM_DATA[$name];

    echo <<< EOT
    <tr>
        <td valign="top">
            $text
        </td>
        <td valign="top">
            <textarea name="$name" rows="5" cols="40" class="textinput" style="width: 98%;">{$ALBUM_DATA['description']}</textarea>
        </td>
    </tr>

EOT;
}

Insert after
function form_copyrighttextarea($text, $name)
{
    global $ALBUM_DATA;

    $value = $ALBUM_DATA[$name];

    echo <<< EOT
    <tr>
        <td valign="top">
            $text
        </td>
        <td valign="top">
            <textarea name="$name" rows="5" cols="40" class="textinput" style="width: 98%;">{$ALBUM_DATA['copyright_info']}</textarea>
        </td>
    </tr>

EOT;
}

Find
case 9:
                form_password_protect($element[0], $element[1]);
                break;

Insert after
case 10:
form_copyrighttextarea($element[0], $element[1]);
                break;


Added Step 5. Open theme.php and find
$params = array('{CELL_HEIGHT}' => '100',
        '{IMAGE}' => $CURRENT_PIC_DATA['header'].$CURRENT_PIC_DATA['html'].($CURRENT_PIC_DATA['footer']),

Replace with
$params = array('{CELL_HEIGHT}' => '100',
        '{IMAGE}' => $CURRENT_PIC_DATA['header'].$CURRENT_PIC_DATA['html'].bb_decode($CURRENT_PIC_DATA['footer']),


Not sure if this is the best way to do it, but it works.