I don't want to see a URL to the pciture in the preview I don't want to see a URL to the pciture in the preview
 

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]

Main Menu

I don't want to see a URL to the pciture in the preview

Started by sindbad5, December 09, 2014, 01:04:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sindbad5

I don't want to see a URL to the picture in the preview. How can I make it invisible?

Tom

allvip

What preview?
Can you post a screenshot?

The URL field from the attachment?

sindbad5


allvip

1)  In displayimage.php there is this code:


    // Create the absolute URL for display in info
    $info[$lang_picinfo['URL']] = '<a href="' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') .basename($CPG_PHP_SELF) . "?pid={$CURRENT_PIC_DATA['pid']}" . '" >' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . basename($CPG_PHP_SELF) . "?pid={$CURRENT_PIC_DATA['pid']}" . '</a>';



2) Don't edit displayimage.php. When you will upgrade to a new version displyimage.php will be replaced.
Include it in theme/your_theme_name/theme.php like this:

Copy function  theme_html_picinfo (all functions are in theme/sample/theme.php). Check first if the function is not already in your theme.php.


/******************************************************************************
** Section <<<theme_html_picinfo>>> - START
******************************************************************************/
function theme_html_picinfo(&$info)
{
    global $lang_picinfo, $CONFIG, $CURRENT_PIC_DATA, $LINEBREAK;

    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) {
        $html .= sprintf($template, $key, $value);
    }

    return $html;
}
/******************************************************************************
** Section <<<theme_html_picinfo>>> - END
******************************************************************************/


and add:


    $info[$lang_picinfo['URL']] = '';


before:


    $html = '';


It not removing URL title (is not removing the first field with the title, just the second with the link)
ATTENTION: If you remove it the url field will be gone, but I do not know if is even for other stuffs necessary for displayimage page like ecards and other.

3) Should be a more correct way to do it.

Only coppermine team can help you. I don't know how.

sindbad5


allvip

I just edited the post becuse I found out how to include the code in the theme and not delete it from displayimage.php