BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x - Page 4 BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x - Page 4
 

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

Main Menu

BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x

Started by Αndré, January 05, 2009, 02:14:00 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

doppler

Quote from: Αndré on May 02, 2012, 01:17:24 PM
Open codebase.php, find
return $text;
and add your custom codes right above that line.
working - very thank you again :)
one question more:
is the possibility tu show this in config list ? (I put my bbcodes in the list of "available tags" little below - and also add tag in language file - my bbcode was shown on the list - but bbcodes didn't work)

Αndré

I assume you need to uninstall/install the plugin again after you applied your changes to insert required rows to the database.

doppler

works!

In thank I add polish language translation

Αndré

Added Polish language file in SVN revision 8388. Thank you for your contribution.

hamgah


Αndré

Added Persian language file in SVN revision 8547. Thank you for your contribution.

Aziz108

Hello! I don't know should I post this here or at forum plugin thread. I've installed forum plugin and bbcode control plugin. But bbcodes do not work with forum whenever I click their buttons - and I get this error in Opera and Chrome console:

Opera:
QuoteUncaught exception: ReferenceError: Undefined variable: insert_bbcode_tag
Chrome:
QuoteUncaught ReferenceError: insert_bbcode_tag is not defined

Every other instances of bbcode (photo comments, etc) work fine, only forum is affected. Seems as some JavaScripts are not included. Where should I include them and which one?

I have latest  cpg1.5.28. Please help.

Tankertom


Αndré

Should be quite easy, but I'd suggest to use the HTML5 "audio" tag instead of a Flash based solution: http://www.w3schools.com/html/html5_audio.asp

Tankertom


Αndré

You need to add the tag at least to the available BBCode tags list and add a replacement code. You should also add a new language string to the plugin's language file(s) and you also add a new icon mp3.png. Here (and attached) is a patch proposal:
Index: codebase.php
===================================================================
--- codebase.php (revision 8783)
+++ codebase.php (working copy)
@@ -188,6 +188,10 @@
         $text = preg_replace("/\[youtube\].*(youtube\.com\/watch\?v=|youtu\.be\/)(.*)\[\/youtube\]/Usi", $youtube_embed_code_replacement, $text);
     }

+    if (!in_array('mp3', $bbcode_tags_disabled)) {
+        $text = preg_replace("/\[mp3](.*)\[\/mp3\]/Usi", "<audio controls><source src=\"\\1\" type=\"audio/mpeg\">Your browser does not support the audio element.</audio>", $text);
+    }
+
     // insert quote
     if (!in_array('quote', $bbcode_tags_disabled)) {
         $style = "style=\"background-image:url(plugins/bbcode_control/images/quote_show.png); background-repeat:no-repeat; background-position:top right; padding-right:40px;\"";
@@ -244,6 +248,7 @@
         'url', // cpg standard
         'img', // cpg standard
         'youtube',
+        'mp3',
         'pid', // cpg special for internal referencing
         'aid', // cpg special for internal referencing
         'cid', // cpg special for internal referencing
Index: lang/english.php
===================================================================
--- lang/english.php (revision 8783)
+++ lang/english.php (working copy)
@@ -44,6 +44,7 @@
$lang_plugin_bbcode_control['size'] = 'Font size';
$lang_plugin_bbcode_control['quote'] = 'Quote';
$lang_plugin_bbcode_control['youtube'] = 'Youtube video';
+$lang_plugin_bbcode_control['mp3'] = 'MP3 audio file';
$lang_plugin_bbcode_control['tt'] = 'Teletype';
$lang_plugin_bbcode_control['hr'] = 'Horizontal rule';
$lang_plugin_bbcode_control['pid'] = 'Picture in this gallery';



Maybe I'll add this to the next plugin version. If so, the tag's name will probably be "audio" and will support all supported HTML5 audio file types (mp3, ogg, wav).

Αndré

Quote from: Aziz108 on April 21, 2014, 05:13:28 PM
Hello! I don't know should I post this here or at forum plugin thread. I've installed forum plugin and bbcode control plugin. But bbcodes do not work with forum whenever I click their buttons - and I get this error in Opera and Chrome console:

Opera:Chrome:
Every other instances of bbcode (photo comments, etc) work fine, only forum is affected. Seems as some JavaScripts are not included. Where should I include them and which one?

I have latest  cpg1.5.28. Please help.

Works as expected for me (cpg1.5.36, BBCode control 1.10, Forum 2.1), regardless which plugin comes first in the plugin list. Have you installed any other plugins or mods to your gallery? Sorry for the late reply.

Αndré

Quote from: Αndré on June 02, 2015, 09:04:30 PM
Maybe I'll add this to the next plugin version. If so, the tag's name will probably be "audio" and will support all supported HTML5 audio file types (mp3, ogg, wav).

Added in version 1.11 (attached to initial post).

pjhsGeorge

The BBCode does not show for editing Pictures Coppermine Gallery??  The plugin shows installed and I have the admin capability.  What did I miss?

Αndré

The plugin has been created to display the buttons while adding/editing comments:
// bbcode buttons
$thisplugin->add_filter('theme_add_comment', 'buttons_add_comment');
$thisplugin->add_filter('theme_edit_comment', 'buttons_edit_comment');


If you want to display it elsewhere, the plugin needs to be modified accordingly.

wilk

Polish translation for 1.11 (this is my private translation I've used on my gallery - now updated to 1.11, not updated doppler's one, it differs a bit).

I've also attached a patch for bug when index.php is redirected to /:


-echo "<form action=\"index.php?file=bbcode_control/admin\" method=\"post\">";
+echo '<form action="'.$superCage->server->getEscaped('REQUEST_URI').'" method="post">';

PM me for Polish translations (new/update)

Αndré


twoclones

This plugin looks as if it could be 'enhanced' to allow using PayPal buttons in the description area.  I tried adding support for 'form' and 'input' to codebase.php but failed because the PayPal button code required type, name, value and the URL in the tags. 

I'd think someone more skilled than myself could make the plugin use the contents of the form and input tags.
Below is an example of a PayPal button in case someone would like to help. :)

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="43DNKJHUDBB8G">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

Αndré

If the button has always the same code, there's probably a better way to add that functionality than modifying this plugin. Please post more details.

twoclones

IF I always select the same options (which is fine for me), the only change to the button code is one of the input tags.  It's value changes with every new item and all of my items are unique.

This is the line that must have a different value every time.
<input type="hidden" name="hosted_button_id" value="VQBCE2PMJQPLL">