forum.coppermine-gallery.net
Support => cpg1.4.x Support => Older/other versions => cpg1.4 plugins => Topic started by: clothahump on August 14, 2006, 09:00:44 am
-
Continuation of a thread @ http://forum.coppermine-gallery.net/index.php?topic=34354.20
We were discussing the possibility of having a thumbnail show in forums such as phpbb that are clickable, this then shows the full sized image.
I can get this to work but the resulting code in the Gallery stretches the page, is there any way of shortening the code?
<?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);
$thumb_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'].$fullsize_url.'][IMG]'.$CONFIG['ecards_more_pic_target'].$thumb_url.'[/IMG][/url]<br>';
return $pic_data;
}
?>
-
best is to use html textarea (and to clean your code a lilttle bit)
replace your existing function imglnk_add_data with the following
function imglnk_add_data($pic_data){ //$pic_data
global $CONFIG;
$fullsize_url = get_pic_url($pic_data);
$thumb_url = get_pic_url($pic_data, 'thumb');
$pic_data['html'] = $pic_data['html'].'<br><textarea name="bbcode" rows="1" cols="50">[url='.$CONFIG['ecards_more_pic_target'].$fullsize_url.'][IMG]'.$CONFIG['ecards_more_pic_target'].$thumb_url.'[/IMG][/url]</textarea><br>';
return $pic_data;
}
-
That works a treat Stramm, worth adding as another plugin?
Many Thanks. ;D
(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.digitalgalleryhosting.com%2Finebg%2Falbums%2Fuserpics%2F10001%2Fthumb_DSCF6651.jpg&hash=322b598b666e3f536bc889d4a29cfec20efd8509) (http://www.digitalgalleryhosting.com/inebg/albums/userpics/10001/DSCF6651.jpg)