Advanced search  

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

Pages: [1]   Go Down

Author Topic: Showing uploader name when editing images  (Read 2264 times)

0 Members and 1 Guest are viewing this topic.

406man

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 46
Showing uploader name when editing images
« on: August 16, 2023, 12:58:51 pm »

Could I put in a little request to the developers for a minor change to the code in editpics.php in a future release.  This is used in several different places to display images in an album for editing and allow changes to be made. Many pieces of image information are shown but the name of the uploader is only shown when the routine is used for upload approval by an administrator. It’s not shown when images are shown for editing by the administrator. It seems odd to display file size, pixel dimensions and file name when editing file information but not who uploaded it – which can be quite important. To clarify, I’m asking for the uploader name to always be displayed instead of only when images are approved. 

I’ve looked at ways to implement this with a plugin and although it could be done in theory it’s unnecessarily complicated in practice (rewriting the html after the page has been created but before being written to the web browser). A change to the base code would be a lot simpler and I can’t think of any downsides. Any suggestions welcome if I’ve overlooked a potential solution as I'm happy to write a plugin to implement it.

The code change to implement this in editpics.php is shown in the extract below. Just delete the two highlighted lines.  An attached screenshot shows where the uploader name would be displayed.

Thanks in advance

[editpics.php Line 385]
function form_pic_info($text)
{
    global $CURRENT_PIC, $THUMB_ROWSPAN, $CONFIG;
    global $lang_byte_units, $lang_editpics_php, $lang_common, $loop_counter, $row_style_class, $icon_array, $cpg_udb;

    if (!is_movie($CURRENT_PIC['filename'])) {
        $pic_info = sprintf($lang_editpics_php['pic_info_str'], $CURRENT_PIC['pwidth'], $CURRENT_PIC['pheight'], ($CURRENT_PIC['filesize'] >> 10), $CURRENT_PIC['hits'], $CURRENT_PIC['votes']);
    } else {
        $pic_info = sprintf($lang_editpics_php['pic_info_str'], '<input type="text" name="pwidth'.$CURRENT_PIC['pid'].'" value="'.$CURRENT_PIC['pwidth'].'" size="5" maxlength="5" class="textinput" />',
              '<input type="text" name="pheight'.$CURRENT_PIC['pid'].'" value="'.$CURRENT_PIC['pheight'].'" size="5" maxlength="5" class="textinput" />', ($CURRENT_PIC['filesize'] >> 10),
              $CURRENT_PIC['hits'], $CURRENT_PIC['votes']);
    }

    if (UPLOAD_APPROVAL_MODE) {                    <<<<<< DELETE LINE
        if ($CURRENT_PIC['owner_id']) {
            $pic_info .= ' - <a href="profile.php?uid=' . $CURRENT_PIC['owner_id'] . '">' . $cpg_udb->get_user_name($CURRENT_PIC['owner_id']) . '</a>';
        }
    }                                               <<<<<< DELETE LINE

    $thumb_url = get_pic_url($CURRENT_PIC, 'thumb');
    $thumb_link = 'displayimage.php?pid='.$CURRENT_PIC['pid'];
[/size]
« Last Edit: August 16, 2023, 02:17:30 pm by 406man »
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 19 queries.