forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: sindbad5 on December 09, 2014, 01:04:08 pm

Title: I don't want to see a URL to the pciture in the preview
Post by: sindbad5 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
Title: Re: I don't want to see a URL to the pciture in the preview
Post by: allvip on December 09, 2014, 02:12:21 pm
What preview?
Can you post a screenshot?

The URL field from the attachment?
Title: Re: I don't want to see a URL to the pciture in the preview
Post by: sindbad5 on December 09, 2014, 04:07:19 pm
Yes, that is the link I don't want to display.

Tom
Title: Re: I don't want to see a URL to the pciture in the preview
Post by: allvip 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.
Title: Re: I don't want to see a URL to the pciture in the preview
Post by: sindbad5 on December 09, 2014, 06:29:59 pm
Thank you. That did it.

Tom
Title: Re: I don't want to see a URL to the pciture in the preview
Post by: allvip 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