Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Plugin for filtering file information in cpg1.5.44  (Read 10533 times)

0 Members and 1 Guest are viewing this topic.

martheijnens

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Plugin for filtering file information in cpg1.5.44
« on: November 13, 2016, 03:04:40 pm »

Hi! I upgraded to cpg 1.5.44. Now, too much file information is exposed like file name, album name, file size and so on. I found a plugin to filter the file information exposed but that plugin is written for cpg 1.4.x. Can I still use that plugin?

Thanks for your response, Mathew
Logged

ron4mac

  • Administrator
  • Coppermine addict
  • *****
  • Country: us
  • Offline Offline
  • Posts: 2026
Re: Plugin for filtering file information in cpg1.5.44
« Reply #1 on: November 14, 2016, 01:41:08 pm »

Assuming that you are referring to cpg1.4.x_plugin_display-fields_v1.3, it would need to be modified for GPG 1.5.
Logged

martheijnens

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: Plugin for filtering file information in cpg1.5.44
« Reply #2 on: November 14, 2016, 02:30:14 pm »

Thanks for your response! Yes, That's the one. Which modifications are needed? Is there another way to filter file information?
Logged

ron4mac

  • Administrator
  • Coppermine addict
  • *****
  • Country: us
  • Offline Offline
  • Posts: 2026
Re: Plugin for filtering file information in cpg1.5.44
« Reply #3 on: November 14, 2016, 03:18:25 pm »

Add the following to the theme.php file for your theme:

Code: [Select]
function theme_html_picinfo(&$info)
{
    global $lang_picinfo, $CONFIG, $CURRENT_PIC_DATA, $LINEBREAK;

$filter = array('Dimensions','Filesize'); //titles of fields that you don't want

    if ($CONFIG['picinfo_movie_download_link']) {
        $path_to_pic = $CONFIG['fullpath'] . $CURRENT_PIC_DATA['filepath'] . $CURRENT_PIC_DATA['filename'];
        $mime_content = cpg_get_type($CURRENT_PIC_DATA['filename']);
        if ($mime_content['content']=='movie') {
            $info[$lang_picinfo['download_URL']] = '<a href="' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . $path_to_pic.'">'. $lang_picinfo['movie_player'] .'</a>';
        }
    }

    $html = '';
    $html .= '        <tr><td colspan="2" class="tableh2">'.$lang_picinfo['title'].'</td></tr>' . $LINEBREAK;
    $template = '        <tr><td class="tableb tableb_alternate" valign="top" >%s:</td><td class="tableb tableb_alternate">%s</td></tr>' . $LINEBREAK;
    foreach ($info as $key => $value) {
    if (in_array($key, $filter)) continue;
        $html .= sprintf($template, $key, $value);
    }

    return $html;
}

Add titles to $filter for the items that you don't want displayed.
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 20 queries.