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: I don't want to see a URL to the pciture in the preview  (Read 2718 times)

0 Members and 1 Guest are viewing this topic.

sindbad5

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: de
  • Offline Offline
  • Posts: 214
    • My Images - medienarchiv.com
I don't want to see a URL to the pciture in the preview
« on: December 09, 2014, 01:04:08 pm »

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

Tom
Logged

allvip

  • Global Moderator
  • Coppermine addict
  • *****
  • Country: 00
  • Offline Offline
  • Posts: 1291
Re: I don't want to see a URL to the pciture in the preview
« Reply #1 on: December 09, 2014, 02:12:21 pm »

What preview?
Can you post a screenshot?

The URL field from the attachment?
« Last Edit: December 09, 2014, 03:08:39 pm by allvip »
Logged

sindbad5

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: de
  • Offline Offline
  • Posts: 214
    • My Images - medienarchiv.com
Re: I don't want to see a URL to the pciture in the preview
« Reply #2 on: December 09, 2014, 04:07:19 pm »

Yes, that is the link I don't want to display.

Tom
Logged

allvip

  • Global Moderator
  • Coppermine addict
  • *****
  • Country: 00
  • Offline Offline
  • Posts: 1291
Re: I don't want to see a URL to the pciture in the preview
« Reply #3 on: December 09, 2014, 05:19:24 pm »

1)  In displayimage.php there is this code:

Code: [Select]
    // 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.

Code: [Select]
/******************************************************************************
** 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:

Code: [Select]
    $info[$lang_picinfo['URL']] = '';

before:

Code: [Select]
    $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.
« Last Edit: December 09, 2014, 08:41:41 pm by allvip »
Logged

sindbad5

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: de
  • Offline Offline
  • Posts: 214
    • My Images - medienarchiv.com
Re: I don't want to see a URL to the pciture in the preview
« Reply #4 on: December 09, 2014, 06:29:59 pm »

Thank you. That did it.

Tom
Logged

allvip

  • Global Moderator
  • Coppermine addict
  • *****
  • Country: 00
  • Offline Offline
  • Posts: 1291
Re: I don't want to see a URL to the pciture in the preview
« Reply #5 on: December 09, 2014, 08:40:37 pm »

I just edited the post becuse I found out how to include the code in the theme and not delete it from displayimage.php
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 21 queries.