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: three-part BBCODE ?  (Read 2308 times)

0 Members and 1 Guest are viewing this topic.

doppler

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
three-part BBCODE ?
« on: May 01, 2012, 04:09:50 pm »

I need to prepare BBCode with three parts - [xx]{number}[/xx]   - htmlhtmlmth{number}htmlhtmlhtml{number}htmlhtmlhtml
Can U help me please?

It is example
[minipic]12345[minipic]
should give html like this
<a href=http://my_gyllery/displayimage.php?pid={NUMBER}><img src="http://my_gallery/thumb.php?id={NUMBER}" border="0" align="left" style="margin-right: 5px"></a>

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: three-part BBCODE ?
« Reply #1 on: May 02, 2012, 11:40:05 am »

Open include/functions.inc.php, find
Code: [Select]
$text = CPGPluginAPI::filter('bbcode', $text);and below, add
Code: [Select]
$text = preg_replace('/\[minipic\]([0-9]+)\[\/minipic\]/Usi', '<a href="displayimage.php?pid=\\1"><img src="thumb.php?id=\\1" border="0" align="left" style="margin-right: 5px" /></a>', $text);
Better approach: create a plugin using the above plugin hook to add that functionality.
Logged

doppler

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: three-part BBCODE ?
« Reply #2 on: May 02, 2012, 12:28:50 pm »

thank you - working perfectly

Quote
Better approach: create a plugin using the above plugin hook to add that functionality.
I would like - but I have to learn how to do this right.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: three-part BBCODE ?
« Reply #3 on: May 02, 2012, 01:12:49 pm »

Please
tag your answer as "solved" by clicking on the "Topic Solved" button on the bar at the left hand side at the bottom of your thread.
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 19 queries.