forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 plugins => Topic started by: martheijnens on November 13, 2016, 03:04:40 pm

Title: Plugin for filtering file information in cpg1.5.44
Post by: martheijnens 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
Title: Re: Plugin for filtering file information in cpg1.5.44
Post by: ron4mac 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.
Title: Re: Plugin for filtering file information in cpg1.5.44
Post by: martheijnens 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?
Title: Re: Plugin for filtering file information in cpg1.5.44
Post by: ron4mac 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.