forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 plugins => Topic started by: ryan on June 11, 2008, 08:19:56 am

Title: create hotlink back to page not image
Post by: ryan on June 11, 2008, 08:19:56 am
somone made the imglnk plugin, but it only creates bb code to the image.

I'd like to show the image and have it link back to my displayimage page.  Everyone just talks about linking it back directly to the image.

Code: [Select]
<?php
if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');

// Add a filter
$thisplugin->add_filter('file_data','imglnk_add_data');


function 
imglnk_add_data($pic_data){ //$pic_data

global $CONFIG;
//$fullsize_url = get_pic_url($pic_data);
//you can grab intermediate and thumb URL to just comment out what you need and add the var below
//$thumb_url = get_pic_url($pic_data, 'thumb');
$normal_url get_pic_url($pic_data'normal');
    
$pic_data['html'] = $pic_data['html'].'<br>[IMG]'.$CONFIG['ecards_more_pic_target'].$normal_url.'[/IMG]<br>';
return $pic_data;
}
?>


Title: Re: create hotlink back to page not image
Post by: Hein Traag on June 11, 2008, 08:32:11 am
And which plugin is this exactly ? can't find it.
Title: Re: create hotlink back to page not image
Post by: ryan on June 13, 2008, 03:22:21 pm
It's in the plugin pack zip file.  It's called img_lnk

bbcode URL below intermediate image

this plugin adds the fullsize image url below the intermediate image in bbcode img tags
check the code... you can let it display bbcode for thumb/ intermediate too


http://coppermine-gallery.net/forum/index.php?topic=34354.0
Title: Re: create hotlink back to page not image
Post by: Nibbler on June 13, 2008, 03:29:20 pm
Try:

Code: [Select]
<?php
if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');

// Add a filter
$thisplugin->add_filter('file_data','imglnk_add_data');


function 
imglnk_add_data($pic_data){ //$pic_data

global $CONFIG;
//$fullsize_url = get_pic_url($pic_data);
//you can grab intermediate and thumb URL to just comment out what you need and add the var below
//$thumb_url = get_pic_url($pic_data, 'thumb');
$normal_url get_pic_url($pic_data'normal');
    
$pic_data['html'] = $pic_data['html'].'<br>[URL='.$CONFIG['ecards_more_pic_target'].'displayimage.php?pos=-'.$pic_data['pid'].'][IMG]'.$CONFIG['ecards_more_pic_target'].$normal_url.'[/IMG][/URL]<br>';
return $pic_data;
}
?>

Title: Re: create hotlink back to page not image
Post by: Joachim Müller on June 13, 2008, 06:03:06 pm
It's in the plugin pack zip file.
The plugin pack goes unsupported...
Title: Re: create hotlink back to page not image
Post by: sranje on June 14, 2008, 08:49:44 am
Hi,
Attached zip file is the modified bbcode plugin which expands to show the texarea with html thumbnail linking to intermediate page (thanks Nibbler).
It does appear to break the captcha plugin (verification image does not get generated) on my site http://sliderpix.com/displayimage-21.html (http://sliderpix.com/displayimage-21.html) (demo).
This is great plugin for getting traffic!!!

Any ideas for broken captcha are welcome!

Title: Re: create hotlink back to page not image
Post by: sranje on June 14, 2008, 09:14:40 am
Well, capcha issue solved, there was some empty lines at the end of codebase.php
This is the fixed version.