Displaying Comment on the Edit One Picture Page Displaying Comment on the Edit One Picture Page
 

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

Displaying Comment on the Edit One Picture Page

Started by GarryS, September 22, 2012, 05:46:40 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

GarryS

My site URL is http://www.victoriacameraclub.org/vcccompetitions/.

Thanks to this forum, great progress has been made in tweaking Coppermine as our camera club's competitions management software. Here is one additional item that I am grappling with.

Our judges will enter a single comment under each submitted image. It will include a score, a placement and the judge's remarks.

Our competitions admin group will use those comments to enter keywords for display of winning images, etc. Currently, the comment appears on the display image page and the function to add keywords on the edit one picture page.

It is our desire to display the comment (the only one that will be present) on the edit one picture (edit file information) page to facilitate the entry of appropriate keywords and the copy and past of certain information to a separate spreadwheet.

This is similar to a previous query regarding placing the owner name on the edit one picture page. That solution was applied.

I look forward to your assistance on this one.




Jeff Bailey

This should be possible but a few questions:
Will it always be the same member judging or at least the same group of members?
Will there be any other comments on the images?
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

GarryS

Judge's will be registered to the gallery, each with their unique usernames and passwords. Most will be from outside the club and they will change from month to month. A couple will be club members and will serve throughout the year. There could be from six to eight individuals serving as judges during a given month (to deal with 18 different competitions spread over three levels).

Scores and placements will be used to prefix title for sorting wihin albums (what we call categories).

Keywords will be used to show images in additional albums for collected slide shows of entries by level.

The nub of it is that reading this info on the image diaplay page and remembering it once on the edit file information page is a challenge. Having it in front of one would be the answer.

Given that edits will also be required to some of the judge's comments, it would be a very desirable secondary benefit if the comments themselves could also be edited on the same edit file information page.

There will be no additional comments on any of the images, just the one original comment by a judge.

Thanks for help on this one.

Jeff Bailey

This will display the first comment made on an image.

Edit edit_one_pic.php
find:

print <<< EOT

    <tr>
        <td class="tableh2" colspan="3">
            <strong>{$filename}</strong>
            &nbsp;&nbsp;-&nbsp;&nbsp;
            <a href="modifyalb.php?album={$CURRENT_PIC['aid']}" class="admin_menu">
                {$icon_array['album_properties']}{$lang_editpics_php['album_properties']}
            </a>
            &nbsp;&nbsp;-&nbsp;&nbsp;
            <a href="thumbnails.php?album={$CURRENT_PIC['aid']}" class="admin_menu">
                {$icon_array['thumbnail_view']}{$lang_editpics_php['thumbnail_view']}
            </a>
        </td>
    </tr>
    <tr>
        <td class="tableb" style="white-space:nowrap;">
            {$icon_array['file_info']}{$lang_editpics_php['pic_info']}
        </td>
        <td class="tableb">
            $pic_info
        </td>
        <td class="tableb" align="center" rowspan="$THUMB_ROWSPAN">
            <a href="$thumb_link">
                <img src="$thumb_url" class="image" border="0" alt="{$CURRENT_PIC['title']}"/>
            </a>
            <br />
        </td>
    </tr>
EOT;

replace with:

$comments_query = cpg_db_query("SELECT msg_body FROM {$CONFIG['TABLE_COMMENTS']} WHERE pid='{$pid}'");
$comments_row = mysql_fetch_array($comments_query);
$comments = $comments_row[msg_body];
print <<< EOT

    <tr>
        <td class="tableh2" colspan="3">
            <strong>{$filename}</strong>
            &nbsp;&nbsp;-&nbsp;&nbsp;
            <a href="modifyalb.php?album={$CURRENT_PIC['aid']}" class="admin_menu">
                {$icon_array['album_properties']}{$lang_editpics_php['album_properties']}
            </a>
            &nbsp;&nbsp;-&nbsp;&nbsp;
            <a href="thumbnails.php?album={$CURRENT_PIC['aid']}" class="admin_menu">
                {$icon_array['thumbnail_view']}{$lang_editpics_php['thumbnail_view']}
            </a>
        </td>
    </tr>
    <tr>
        <td class="tableb">
            <span>Judges Comment:</span>
        </td>
        <td class="tableb">
            {$comments}
        </td>
    </tr>
    <tr>
        <td class="tableb" style="white-space:nowrap;">
            {$icon_array['file_info']}{$lang_editpics_php['pic_info']}
        </td>
        <td class="tableb">
            $pic_info
        </td>
        <td class="tableb" align="center" rowspan="$THUMB_ROWSPAN">
            <a href="$thumb_link">
                <img src="$thumb_url" class="image" border="0" alt="{$CURRENT_PIC['title']}"/>
            </a>
            <br />
        </td>
    </tr>
EOT;


You have to make sure to add the changes back for displaying the owners name.
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

GarryS

Thank you once again, Jeff. Tested it out and it works as advertised. I also managed to retain the first mod to place the owner's name on the page.

Thumbs up to you and the Coppermine forum.

Jeff Bailey

Glad it worked and thank you for resolving your thread.
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford