forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: GarryS on August 26, 2012, 07:59:47 pm

Title: Wish to display owner name on 'Edit file information' page
Post by: GarryS on August 26, 2012, 07:59:47 pm
My site URL is: http://www.victoriacameraclub.org/vcccompetitions/

On the displayimage.php page with file info toggled on, the owner's name is displayed (with link to profile). The 'Edit file information' button is available only to administration. Screenshot attached.

On the 'edit_one_pic.php' page, that information is not displayed. Screenshot attached.

My desire is to display the owner's name there, preferably in a text format which could readily be copied and pasted into the title field. This is to facilitate competition reporting after judging.

I have tried various hacks to the 'edit_one_pic.php' file, but with no success thus far.

Thank you for any help you may be able to offer.
Title: Re: Wish to display owner name on 'Edit file information' page
Post by: Joe Carver on August 27, 2012, 02:37:26 am
What exactly are you trying to do (exactly)?

Show the owners name in the title block for visitors only?

Do you want / need to do this by hand for each file?
     - a plugin or theme mod. should allow for an automatic display

Title: Re: Wish to display owner name on 'Edit file information' page
Post by: GarryS on August 27, 2012, 03:02:04 am
The competitions will involve a two-stage porocess. Initially, owners names will be hidden from judges and other competitors. Only image titles will be shown.

After judging, competitions admin will edit the titles by adding the owners names. Those images will ultimately be shown during the presntation of compeititon results.

To facilitate this, short of creating a plugin (which I am not capable of doing - at least I don't think I am) a simple display of the owners name in a white background field, just above the row which displays the title on the current edit_one_pic.php page, would meet our needs well.

I hope that clarifies what I am after for now.

Thanks for your early reply and any follow-up.
Title: Re: Wish to display owner name on 'Edit file information' page
Post by: GarryS on August 29, 2012, 11:24:35 pm
I'm still grappling with this one. I see, in edit_one_pic.php, the a database query is made and that the variable owner_id is returned. That is the variable I am interested in (the actual name, not just the integer) when working on the 'Edit file information' page.

I see, in the same edit_one_pic.php file, that a table is used to create the "editonepicform".

My dilemma is that I lack sufficient knowldege to place a row into the table to display (not to edit) the owner_id (the actual name). The purpose of displaying the name here would be to facilitate copying it into the image title field, following the title provided by the photographer. This would be done on an album by album basis following competitions judging as the year unfolds.

The ability to copy and paste this information would be a significant bonus.

Perhaps this will offer just a bit more clarity to this thread.
Title: Re: Wish to display owner name on 'Edit file information' page
Post by: Jeff Bailey on August 30, 2012, 02:15:42 am
Try this.

Find:
Code: [Select]
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:
Code: [Select]
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>Owner Name:</span>
        </td>
        <td class="tableb">
            {$cpg_udb->get_user_name($CURRENT_PIC['owner_id'])}
        </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;
Title: Re: Wish to display owner name on 'Edit file information' page
Post by: GarryS on August 30, 2012, 04:59:36 pm
Wonderful! That was exactly what I was looking for and it works like a charm.

Thank you, Jeff, and to Coppermine.
Title: Re: Wish to display owner name on 'Edit file information' page
Post by: Jeff Bailey on August 30, 2012, 05:08:04 pm
Thank you for resolving your thread.