I'm not sure what you edited (in Default) but if you are just doing embed codes, use 'advanced' options and place {1} everywhere you want the url... Or is the parameter the URL to the video...?Like this add-on.
Just one usability flaw, at least for me.
I need a bbCode to integrate local video (video tutorials) in forum posts.
I had to hard-code in the /library/KingK/BbCodeManager/BbCode/Formatter/Default.php file to get it to work. Well, I'm pretty proud that I managed to do it, but I don't feel very well, hard-coding in an add-on file, since this makes future updates more tricky.
Let's assume the following, as an example for explanation:
[vid]folder/subfolder[/vid]
This would be the bbCode I need and the parameter inside the tag has to appear in more than one place of the HTML that is generated by the bbCode. Impossible to achieve with the options in AdminCP, so I'm forced to edit the above file.
I wonder if there's a way to make file edits obsolete ... like using a multiline text field in the bbCode settings and an easy standard for parameters and options like for example $param[0], ¶m[1], $option[0], $option[1], etc.
<!-- Your approach -->
some html code in simple replacement start line $param[0] some more code in simple replacement end
<!-- my wish -->
html code $param[0] in a multiline text $param[0] field
where I can place the $param[0] where I want and
$param[0] as often as I want.
[/quote]Simple Replacement Start and Simple Replacement End as separate single line text fields looks somewhat unnecessarily complicated and unflexible to me. I'll try to demonstrate:
Hope this makes is more obvious, what I'm talking about.
<?php
class KingK_BbCodeManager_BbCode_Formatter_lbx
// unique class name (see lbx at the end)
{
public static function parseTagTraining(array $tag, array $rendererStates, &$parentClass)
{
$src = $tag['children'][0];
return 'this is my html code with the tag child #0 appearing here: ' . $src . ' and here: ' . $src;
}
}
?>
Speaking from the development point of view, this is a bad way to accomplish this. Place this in a file called "MyBbCode.php":Wow, looks like I figured it out on my own after you gave me the hint.
Let me show you ... and correct me please, if I'm wrong.
I created a new PHP file inside /library/KingK/BbCodeManager/BbCode/Formatter/
This new file (say lbx.php) contains the following (dummy code):
Code:<?php class KingK_BbCodeManager_BbCode_Formatter_lbx // unique class name (see lbx at the end) { public static function parseTagTraining(array $tag, array $rendererStates, &$parentClass) { $src = $tag['children'][0]; return 'this is my html code with the tag child #0 appearing here: ' . $src . ' and here: ' . $src; } } ?>
And this file and the class inside are auto-detected by your bbCode Manager, so that's all I have to do.
class MyBbCode
{
public static function parseTagTraining(array $tag, array $rendererStates, &$parentClass)
{
$src = $tag['children'][0];
return 'blah';
}
}
That would be assTagTraining for any American readers![]()
That would be assTagTraining for any American readers![]()
Wow, looks like I figured it out on my own after you gave me the hint.
Let me show you ... and correct me please, if I'm wrong.
I created a new PHP file inside /library/KingK/BbCodeManager/BbCode/Formatter/
This new file (say lbx.php) contains the following (dummy code):
Code:<?php class KingK_BbCodeManager_BbCode_Formatter_lbx // unique class name (see lbx at the end) { public static function parseTagTraining(array $tag, array $rendererStates, &$parentClass) { $src = $tag['children'][0]; return 'this is my html code with the tag child #0 appearing here: ' . $src . ' and here: ' . $src; } } ?>
And this file and the class inside are auto-detected by your bbCode Manager, so that's all I have to do.
I lef it as default, I haven't made any changes to it. But when I use your code the message got messed up:
![]()
I haven't messed with this in awhile. Try editing your float bbc. Then remove the: "<div style="clear:both"></div>" in the simple replacement end. Mine looks like so:
Simple Replacement Start: <div style="float: %s;">
Simple Replacement End: </div>
From there add margin as you see fit. Perhaps <div style="float: %s; margin: 7px;">
public static function parseTagDown(array $tag, array $rendererStates, &$parentClass)
{
$content = $parentClass->renderSubTree($tag['children'], $rendererStates);
$adsense= '<script type="text/javascript"><!--
google_ad_client = "pub-7333699328110653";
/* 468x60, date de création 01/01/09 */
google_ad_slot = "9561263875";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>';
return '<center><div class="bbcodedown"><div class="title">télécharger</div><div class="img"></div><br><span>'. $adsense .'<br>'. $content .'</span></div></center>';
}
We use essential cookies to make this site work, and optional cookies to enhance your experience.