bbcode URL below intermediate image bbcode URL below intermediate image
 

News:

CPG Release 1.6.28
added submissions from {406man}
cleaned up a few PHP (8.4) deprecations
fixed PHP deprecation in calendar
removed security vulnerability
(please upgrade when possible)

Main Menu

bbcode URL below intermediate image

Started by clothahump, August 14, 2006, 09:00:44 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

clothahump

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

Stramm

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