Forum BB code under image on displayimage.php? Forum BB code under image on displayimage.php?
 

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

Forum BB code under image on displayimage.php?

Started by Shane, February 11, 2011, 03:35:54 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Shane

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:


[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

Shane

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:


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;
}

coconutmilk83

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.

ΑndrĂ©