three-part BBCODE ? three-part BBCODE ?
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

Main Menu

three-part BBCODE ?

Started by doppler, May 01, 2012, 04:09:50 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

doppler

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>


Αndré

Open include/functions.inc.php, find
$text = CPGPluginAPI::filter('bbcode', $text);
and below, add
$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.

doppler

thank you - working perfectly

QuoteBetter 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.

Αndré

Please
Quote from: Joachim Müller on September 28, 2008, 12:46:26 PM
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.