Absolute URL under the picture. Absolute URL under the picture.
 

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

Absolute URL under the picture.

Started by altenae, October 26, 2011, 01:33:24 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

altenae

Hi,

I want the absolute URL underneath the picture. (example : www.domain.com/coppermine/userpics/name.jpg)
I want this extra info underneath the "Favorites" field.

If possible I want this info only available when logged in.

I bought myself a PHP learning guide...
So I hope in the future I can do this myself..

Thanks again,

Edward


altenae

Wow very nice plugin..

One question:

This is de BBCODE right now:

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.wildlife-photos.org%2Fgallery%2Falbums%2Fuserpics1%2F10004%2Fthumb_FO6F1724-2%7E5.jpg&hash=718060ff06cce5d55edaa2fa0889ff07f0971931)

However I want this BBCODE beneath the picture (because we hotlink fullsize pictures):

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.wildlife-photos.org%2Fgallery%2Falbums%2Fuserpics1%2F10004%2Fthumb_FO6F1724-2%7E5.jpg&hash=718060ff06cce5d55edaa2fa0889ff07f0971931)

Is this easy to modify ?

Thanks,

Edward

altenae

Hmm

It already converted my BBCODE..

What I want is only the url to the large picture:

http://www.wildlife-photos.org/cpg132/albums/userpics1/10018/thumb_IMG_3505.jpg and this between the  IMG  brackets.

altenae

Found it....

I have changed this in de codebase.php.

Thanks,

Edward

Αndré

I guess you found and applied that change:
Quote from: Αndré on October 15, 2010, 04:01:16 PM
In codebase.php, find
$thumb = '[img]'.$CONFIG['ecards_more_pic_target'].get_pic_url($CURRENT_PIC_DATA, 'thumb').'[/img]';
and replace with
$thumb = '[img]'.$CONFIG['ecards_more_pic_target'].get_pic_url($CURRENT_PIC_DATA, 'fullsize').'[/img]';

altenae

I have one issue with this plugin.

Some uploaded pictures don't have a intermediate size other have.

I have :

Thumbnail and the 1024px width picture
Thumbnail and the 1024px width picture and full size 1600px


When using this code (sse below) the normal returns an empty png file.
This is because there is a normal_ image when uploaded with 1600 width, but there is no normal_ image when uploaded with 1024 width, because in this case this is the full size one.


How can I solve this

$url = $CONFIG['ecards_more_pic_target'].'displayimage.php?pid='.$CURRENT_PIC_DATA['pid'];

$thumb = '(http://'.$CONFIG['ecards_more_pic_target'].get_pic_url($CURRENT_PIC_DATA, 'thumb').')';
$normal = '(http://'.$CONFIG['ecards_more_pic_target'].get_pic_url($CURRENT_PIC_DATA, 'normal').')';



$info['BBCode full size'] = '<textarea onfocus="this.select();" onclick="this.select();" class="textinput" rows="1" cols="64" wrap="off" style="overflow:hidden; height:15px;">'.$full.'</textarea>';

$info['BBCode thumb size'] = '<textarea onfocus="this.select();" onclick="this.select();" class="textinput" rows="1" cols="64" wrap="off" style="overflow:hidden; height:15px;">'.$normal.'</textarea>';

Αndré

If the file doesn't exist, the script returns
images/thumbs/thumb_nopic.png

Just check the return value and use the fullsize file if no normal file exists. Please post a link to an affected file (the link to the intermediate-sized view of your gallery, not to the file itself) and attach your modified codebase.php file.

altenae

Hi,

Here a correct link where the BBCODE is displayed correctly, because there is an internediate picture:

http://www.aviationphotos.org/gallery/displayimage.php?album=lastup&cat=0&pid=11689#top_display_media

Here a not correct link where the BBCODE is displayed incorrectly, because there is no internediate picture (normal_ prefix):

http://www.aviationphotos.org/gallery/displayimage.php?album=lastup&cat=0&pid=11692#top_display_media

I am looking for a workaround.
Attached the codebase.php of this plugin.

Thanks,

Edward


Αndré

Find
        $normal = '[img]'.$CONFIG['ecards_more_pic_target'].get_pic_url($CURRENT_PIC_DATA, 'normal').'[/img]';
and replace with
        $normal = '[img]'.$CONFIG['ecards_more_pic_target'].get_pic_url($CURRENT_PIC_DATA, 'normal').'[/img]';
        if (strpos($normal, 'images/thumbs/thumb_nopic.png')){
            $normal = '[img]'.$CONFIG['ecards_more_pic_target'].get_pic_url($CURRENT_PIC_DATA, 'fullsize').'[/img]';
        }

altenae


altenae

Hi Andre,

Your suggested solution works finr, however every click on a picture is an error in de weblog about an image not found:

•Nov 10, 2011 at 08:52 PM - File albums/userpics1/10019/normal_Lockheed_Martin_F-16CJ_Polish_Air_Force_4061.jpg is missing.
•Nov 10, 2011 at 08:52 PM - File albums/userpics1/10008/normal_6165_A7-CEF_BD700_Qatar_Executive_BRU.jpg is missing.
•Nov 10, 2011 at 08:52 PM - File albums/userpics1/10008/normal_6163_N493EV_B747-400F_Saudia_BRU.jpg is missing.
•Nov 10, 2011 at 08:52 PM - File albums/userpics1/10008/normal_6166_G-BUUR_ATP_Atlantic_Airlines_BRU.jpg is missing.
•Nov 10, 2011 at 08:53 PM - File albums/userpics1/10008/normal_6161_B-6133_A330-200_Hainan_Airlines_BRU.jpg is missing.
•Nov 10, 2011 at 08:53 PM - File albums/userpics1/10019/normal_Lockheed_Martin_F-16CJ_Polish_Air_Force_4061.jpg is missing.
•Nov 10, 2011 at 08:54 PM - File albums/userpics1/10019/normal_Daussault_Falcon_20ECM_Norway_Air_Force_053.jpg is missing.
etc.

Is there a way to fix this ?

Αndré

Find
        $normal = '[img]'.$CONFIG['ecards_more_pic_target'].get_pic_url($CURRENT_PIC_DATA, 'normal').'[/img]';
and replace with
        // The weird comparision is because only picture_width is stored
        $resize_method = $CONFIG['picture_use'] == "thumb" ? ($CONFIG['thumb_use'] == "ex" ? "any" : $CONFIG['thumb_use']) : $CONFIG['picture_use'];
        if ($resize_method == 'ht' && $CURRENT_PIC_DATA['pheight'] > $CONFIG['picture_width']) {
            $use_intermediate = true;
        } elseif ($resize_method == 'wd' && $CURRENT_PIC_DATA['pwidth'] > $CONFIG['picture_width']) {
            $use_intermediate = true;
        } elseif ($resize_method == 'any' && max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width']) {
            $use_intermediate = true;
        } else {
            $use_intermediate = false;
        }

        if ($use_intermediate) {
            $normal = '[img]'.$CONFIG['ecards_more_pic_target'].get_pic_url($CURRENT_PIC_DATA, 'normal').'[/img]';
        } else {
            $normal = '[img]'.$CONFIG['ecards_more_pic_target'].get_pic_url($CURRENT_PIC_DATA, 'fullsize').'[/img]';
        }

altenae