Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: bbcode URL below intermediate image  (Read 4562 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
Re: bbcode URL below intermediate image
« Reply #2 on: August 14, 2006, 09:30:18 am »

That works a treat Stramm, worth adding as another plugin?
Many Thanks.  ;D

(http://www.digitalgalleryhosting.com/inebg/albums/userpics/10001/thumb_DSCF6651.jpg)
« Last Edit: August 14, 2006, 09:46:27 am by clothahump »
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 19 queries.