forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: altenae on October 26, 2011, 01:33:24 pm

Title: Absolute URL under the picture.
Post by: altenae on October 26, 2011, 01:33:24 pm
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
Title: Re: Absolute URL under the picture.
Post by: Αndré on October 26, 2011, 04:20:21 pm
Please read http://forum.coppermine-gallery.net/index.php/topic,73794.0.html
Title: Re: Absolute URL under the picture.
Post by: altenae on October 26, 2011, 04:47:36 pm
Wow very nice plugin..

One question:

This is de BBCODE right now:

(http://www.wildlife-photos.org/gallery/albums/userpics1/10004/thumb_FO6F1724-2~5.jpg) (http://www.wildlife-photos.org/gallery/displayimage.php?pid=11652)

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

(http://www.wildlife-photos.org/gallery/albums/userpics1/10004/thumb_FO6F1724-2~5.jpg)

Is this easy to modify ?

Thanks,

Edward
Title: Re: Absolute URL under the picture.
Post by: altenae on October 26, 2011, 05:00:52 pm
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.
Title: Re: Absolute URL under the picture.
Post by: altenae on October 26, 2011, 05:27:59 pm
Found it....

I have changed this in de codebase.php.

Thanks,

Edward
Title: Re: Absolute URL under the picture.
Post by: Αndré on October 27, 2011, 10:36:10 am
I guess you found and applied that change:
In codebase.php, find
Code: [Select]
$thumb = '[img]'.$CONFIG['ecards_more_pic_target'].get_pic_url($CURRENT_PIC_DATA, 'thumb').'[/img]';and replace with
Code: [Select]
$thumb = '[img]'.$CONFIG['ecards_more_pic_target'].get_pic_url($CURRENT_PIC_DATA, 'fullsize').'[/img]';
Title: Re: Absolute URL under the picture.
Post by: altenae on October 30, 2011, 04:08:28 pm
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>';
Title: Re: Absolute URL under the picture.
Post by: Αndré on November 03, 2011, 04:33:29 pm
If the file doesn't exist, the script returns
Code: [Select]
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.
Title: Re: Absolute URL under the picture.
Post by: altenae on November 03, 2011, 06:16:59 pm
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

Title: Re: Absolute URL under the picture.
Post by: Αndré on November 04, 2011, 11:45:03 am
Find
Code: [Select]
        $normal = '[img]'.$CONFIG['ecards_more_pic_target'].get_pic_url($CURRENT_PIC_DATA, 'normal').'[/img]';and replace with
Code: [Select]
        $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]';
        }
Title: Re: Absolute URL under the picture.
Post by: altenae on November 04, 2011, 03:38:17 pm
Works...

Thanks.

Edward
Title: Re: Absolute URL under the picture.
Post by: altenae on November 10, 2011, 08:55:06 pm
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 ?
Title: Re: Absolute URL under the picture.
Post by: Αndré on November 14, 2011, 04:20:15 pm
Find
Code: [Select]
        $normal = '[img]'.$CONFIG['ecards_more_pic_target'].get_pic_url($CURRENT_PIC_DATA, 'normal').'[/img]';and replace with
Code: [Select]
        // 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]';
        }
Title: Re: Absolute URL under the picture.
Post by: altenae on November 14, 2011, 07:06:29 pm
Yes that did the trick...thanks