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: bbcode URL below intermediate image  (Read 4487 times)

0 Members and 1 Guest are viewing this topic.

clothahump

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
bbcode URL below intermediate image
« 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?

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);
      
$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
}
?>
« Last Edit: August 14, 2006, 09:41:39 am by GauGau »
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: bbcode URL below intermediate image
« Reply #1 on: August 14, 2006, 09:02:07 am »

best is to use html textarea (and to clean your code a lilttle bit)

replace your existing function imglnk_add_data with the following
Code: [Select]
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;
}

clothahump

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
« Last Edit: August 14, 2006, 09:46:27 am by clothahump »
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 19 queries.