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: Forum BB code under image on displayimage.php?  (Read 5301 times)

0 Members and 1 Guest are viewing this topic.

Shane

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 76
  • Choose Again
    • The Philmont Forum
Forum BB code under image on displayimage.php?
« on: February 11, 2011, 03:35:54 am »

site:  http://shaneandpamela.com/cpg

I'm looking for a plugin that will create a BB code snippet that can be copied from my CPG and pasted into forums.  This snippet would be populated below the image on the output of displayimage.php.  I would like the code to generate the thumbnail with a direct link to the full sized image.  Something like:

Code: [Select]
[url=link to full size image][img]link to thumbnail image[/img][/url]

example from my site would be:

[url=http://shaneandpamela.com/cpg/albums/userpics/10001/2011_Caddo_Lake_Trip_20110129_024.JPG][img]http://shaneandpamela.com/cpg/albums/userpics/10001/thumb_2011_Caddo_Lake_Trip_20110129_024.JPG[/img][/url]

Is there anything like this out there already?  I can't seem to find it.  Thanks for any help!
Shane
Logged

Shane

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 76
  • Choose Again
    • The Philmont Forum
Re: Forum BB code under image on displayimage.php?
« Reply #1 on: February 11, 2011, 04:25:53 am »

Answered my own post...

Installed the BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x plugin
Enabled "Show pre-built BBCode in file info" on the plugin config

Edited codebase.php to the following:

Code: [Select]
function embed_code($info) {
    global $CONFIG;

    if ($CONFIG['bbcode_control_tag_img_embed_code'] == 1)
    {
        global $CURRENT_PIC_DATA;

        //$url = $CONFIG['ecards_more_pic_target'].'displayimage.php?pid='.$CURRENT_PIC_DATA['pid'];
$url = $CONFIG['ecards_more_pic_target'].get_pic_url($CURRENT_PIC_DATA);
        $thumb = '[img]'.$CONFIG['ecards_more_pic_target'].get_pic_url($CURRENT_PIC_DATA, 'thumb').'[/img]';

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

    return $info;
}
Logged

coconutmilk83

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 22
Re: Forum BB code under image on displayimage.php?
« Reply #2 on: February 17, 2011, 08:36:54 pm »

Thanks for this, but how do I have to change the code if I want the link to get to the intermediate page and not the full size image. Hope you get what I mean. Any help would be appreciated.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Forum BB code under image on displayimage.php?
« Reply #3 on: February 17, 2011, 10:06:51 pm »

Just use the unmodified code.
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 19 queries.