Your ultimate PunBB resource!
You are not logged in.
## Mod title: Modern BBcode ## ## Mod version: 1.0.0 ## Works on PunBB: 1.2.x ## Release date: 29.03.2006 ## Author: neutral ## ## Description: Adds some new bbcodes and toolbar to post/quickpost/edit forms with bbcode buttons. ## New bb codes: ## - strikeout text ## - monospace text ## - center aligned text ## - right aligned text ## - fontsize ## - list (ordered, unordered) ## - spoiler ## ## Affects DB: No ## ## Affected files: header.php ## post.php ## edit.php ## viewtopic.php ## /include/parser.php ## /style/imports/base.css ## /style/imports/<style_name>_cs.css ## ## Notes: This mod is based on Rikard Anderson's "Easy BBcode". ## So installation is similar, excepting update of styles, since all ## toolbars, buttons and popups are based on CSS. ## ## ## DISCLAIMER: Please note that 'mods' are not officially supported by ## PunBB. Installation of this modification is done at your ## own risk. Backup your forum database and any and all ## applicable files before proceeding. ##
Offline
look nice i havent installed it yet cuz i have mob_easy_bbcode and this other thing that makes bbocde easy to post but i forget the name so i first need to uninstall them
Offline
I've installed this an must say I like it a lot, however I have come across one bug so far dealing with smilies. When using Firefox (1.5) and you edit an existing post and attempt to add a smilie using the 'more...' link for the smilie popup, any selected smilie will not be inserted. Nothing happens at all, it works ok in Internet Explorer though.
Anyway I tracked it down to the Javascript function insert_text() inside smilies.php
The line...
msgfield = (docOpener.all) ? docOpener.all.req_message : docOpener.forms['post']['req_message'];
Does not work with Firefox, at this point execution of the script halts and hence nothing happens. However if you change this line to...
msgfield = docOpener.getElementsByName("req_message").item(0);
Then it works fine in Firefox and Internet Explorer. Obviously a better hack would be to give the form element req_message an ID tag and use getElementById(<idtag>) rather than taking liberties with the returned elements list (in this case assuming there will only ever be a single element with the name req_message).
I havn't tested this with Opera or Safari etc as I don't have them available to me at present, though it should work.
Ajandurah
Thanks for bugfix
I have tested it on Opera, FireFox and IE - and it works. I will update the mod soon.
Offline
I got this mod into Pun Frontpage, and I love it! This is easily the absolute best BBcode mod for PunBB so far.
The only thing is, I have a bunch of styles installed, and I'm not any good with css. Do you have any tips on how to easily integrate your mod into styles other than the default included ones?
Thanks it looks really good!
Last edited by nrwilk (2006-04-22 09:34:40)
Offline
hi, i have installed everything but i get this where the bbcode images should be...
http://img91.imageshack.us/img91/6072/picture15nh.png
*edit* nvm i got it to work ![]()
Last edited by Vibrant (2006-04-28 19:42:33)
Offline
Very awesome, now if only someone could write a line to replace the current one for the PMS mod ![]()
Offline
Great Mod!
Couple of bugs..
Still had that Javascript error, maybe you should update the file ![]()
Then when I add smileys over 15px x 15px.. it wouldn,t show right.. so I removed the widt="15" height="15" from the regexp here:
$text = preg_replace("#(?<=.\W|\W.|^\W)".preg_quote($smiley_text[$i], '#')."(?=.\W|\W.|\W$)#m", '$1<img src="img/smilies/'.$smiley_img[$i].'" alt="'.substr($smiley_img[$i], 0, strrpos($smiley_img[$i], '.')).'" />$2', $text;Line 429 for me.. after adding the script..
Last edited by freakerz (2006-05-14 10:37:39)
There is an error showing on the top in mainpage, userlist, etc.
viewtopic.php, edit.php and post.php will work well without the notice.
Did I miss something?
Notice: Undefined variable: modern_bbcode_enabled in /home/****/public_html/header.php on line 145
near that line are:
if ($modern_bbcode_enabled)
{
$tpl_main = str_replace('<body onload="', '<body onClick="documentClickHandler(event.target);" onload="fixOperaWidth();', $tpl_main);
$tpl_main = str_replace('<body>', '<body onClick="documentClickHandler(event.target);" onload="fixOperaWidth();">', $tpl_main);
}
Last edited by mdfh (2006-07-01 20:11:28)
Offline
i guess french language file would be
<?php // Language definitions used in various scripts $lang_modern_bbcode = array( // Prompt message for list tag message box 'List tag prompt' => 'Veuillez saisir le texte de l\'item à lister. Cliquer \"Annuler\" ou laisser le champs de saisie vide pour terminer.', // Buttons texts 'Bold' => 'B', 'Italic' => 'I', 'Underline' => 'U', 'Strikeout' => 'S', 'URL' => 'Lien', 'Mail' => '@', 'Code' => '#', 'Quote' => '»»', 'Color' => 'Couleur', 'Smiley' => 'Smiley', 'Inc text field height' => '+', 'Dec text field height' => '-', 'Monospace text' => 'Mono', 'Center' => 'Centre', 'Right' => 'Droite', 'Fontsize' => 'Taille', 'Image' => 'Image', 'List' => 'Liste', 'Spoiler' => 'Spoiler', 'Help' => '?', // Buttons titles 'Bold title' => 'Gras', 'Italic title' => 'Italique', 'Underline title' => 'Souligné', 'Strikeout title' => 'Strikeout', 'URL title' => 'Lien', 'Mail title' => 'E-mail', 'Code title' => 'Code', 'Quote title' => 'Citation', 'Color title' => 'Couleur', 'Smiley title' => 'Smilies', 'Inc text field height title' => 'Augmenter la zone de saisie de texte', 'Dec text field height title' => 'Réduire la zone de saisie de texte', 'Monospace text title' => 'Texte monospace (code)', 'Center title' => 'Aligner le texte au centre', 'Right title' => 'Aligner le texte à droite', 'Fontsize title' => 'Taille de la police de caractères', 'Image title' => 'Image', 'List title' => 'Liste', 'Spoiler title' => 'Spoiler (text caché)', 'Help title' => 'Aide au BBCode', // Fontsizes 'Very small' => 'Très petit texte', 'Small' => 'Petit texte', 'Big' => 'Grand texte', 'Large' => 'Très grand texte', // Image kinds 'No float' => 'Image ancrée', 'Float to left' => 'Image flottante sur la gauche', 'Float to right' => 'Image flottante sur la droite', // Image kind titles 'No float title' => 'Le texte ne flotte pas autours de l\'image', 'Float to left title' => 'Le texte flotte autours de l\'image depuis la gauche', 'Float to right title' => 'Le texte flotte autours de l\'image depuis la droite', // List kinds 'Unordered' => 'Liste non ordonnée', 'Ordered' => 'Liste ordonnée', // List kind titles 'Unordered title' => 'Créer une liste non-ordonnée', 'Ordered title' => 'Créer une liste ordonnée', 'More text' => 'Plus...', // Smilies popup window string constants 'Smilies table' => 'Liste de smilies', 'Smiley text' => 'Texte', 'Smiley image' => 'Smiley' );
GreenPun style css code to add could be (better for sure) :
/****************************************************************/
/* MOD MODERN BB-CODE STYLE INDICATORS */
/****************************************************************/
/****************************************************************/
/* MOD MODERN BBCODE: OVERRIDES FOR STANDART PUNBB STYLE INDICATORS */
/****************************************************************/
#post textarea, #post input.longinput, #edit textarea, #edit input.longinput {
border: 1px #0d4d0a solid;
}
/****************************************************************/
/* MOD MODERN BBCODE: TOOLBAR AND TOOLBUTTON STYLE INDICATORS */
/****************************************************************/
DIV.toolbar {
background: #387735;
border-left: 1px #0d4d0a solid;
border-top: 1px #0d4d0a solid;
border-right: 1px #0d4d0a solid;
}
DIV.toolbar .draghandle {
border-left: 2px #0d4d0a dotted;
}
DIV.toolbar .separator {
border-left: 1px #0d4d0a solid;
}
DIV.toolbar a.tool_btn, DIV.toolbar a.dropdown, DIV.toolbar a.dropdown_opened {
border: 1px #68aa65 solid;
color: #DEDFDF;
}
DIV.toolbar a.tool_btn:visited, DIV.toolbar a.dropdown:visited, DIV.toolbar a.dropdown_opened:visited {
color: #DEDFDF;
}
DIV.toolbar a.tool_btn:hover, DIV.toolbar a.dropdown:hover {
border: 1px #6cb26a solid;
color: #FFF;
background: #0d4d0a;
}
DIV.toolbar a.dropdown {
background: url(/../../img/modern_bbcode/greenpun_arrow.png) no-repeat top right;
}
DIV.toolbar a.dropdown_opened, DIV.toolbar a.dropdown_opened:hover, DIV.toolbar a.dropdown_opened:visited {
color: #FFF;
border: 1px #0d4d0a solid;
background: #68aa65 url(/../../img/modern_bbcode/greenpun_arrow_opened.png) no-repeat top right;
}
DIV.toolbar a.dropdown:hover {
background: #0d4d0a url(/../../img/modern_bbcode/greenpun_arrow_hover.png) no-repeat top right;
}
/****************************************************************/
/* MOD MODERN BBCODE: POPUP PALETTE INDICATORS */
/****************************************************************/
/* 0. Common popup panel indicators */
#colorpalette #colorbtn, #smilespanel #smilesbtn, #sizepanel #sizebtn, #imgpanel #imgbtn, #listpanel #listbtn {
border-left: 1px #0d4d0a solid;
border-right: 1px #0d4d0a solid;
color: #68aa65;
background: #68aa65;
}
#colorpalette #colorcontent, #smilespanel #smilescontent, #sizepanel #sizecontent, #imgpanel #imgcontent, #listpanel #listcontent {
border: 1px #0d4d0a solid;
background: #68aa65;
}
/* 1. Smileys popup panel indicators */
#smilespanel #adv a, #smilespanel #adv a:visited {
color: #FFF;
}
#smilespanel #adv a:hover {
color: #0d4d0a;
}
/* 2. Colors popup panel indicators */
#colorpalette #colorcontent a {
border: 1px #387735 solid;
}
#colorpalette #colorcontent a:hover {
border: 1px #6cb26a solid;
}
/* 3. Font-sizes, Images and Lists popup panel indicators */
#sizepanel #sizecontent a, #imgpanel #imgcontent a, #listpanel #listcontent a {
border: 1px solid #387735;
color: #FFF;
background: #387735;
}
#sizepanel #sizecontent a:hover, #imgpanel #imgcontent a:hover, #listpanel #listcontent a:hover {
border: 1px #0d4d0a solid;
color: #FFF;
background: #68aa65;
}
/****************************************************************/
/* MOD MODERN BBCODE: ADDITIONAL BBCODE INDICATORS */
/****************************************************************/
code {
color: #B42000;
}
div.postmsg li {
color: #666;
}
DIV.spoilerbox p {
color: #F1F1F1;
}
DIV.spoilerbox p:hover {
color: #333;
}
IMG.postimg {
padding: 1px;
margin: 2px 5px;
border: 1px solid #0d4d0a;
background: #FFF;
}
DIV.postmsg a:hover IMG.postimg {
border: 1px solid #B42000;
}and images would be :


Sreenshot (nottez que la faute sur le mot 'Taille' est corrigée dans le code proposé ci-dessus :
Last edited by agravetoncas (2006-07-05 11:26:57)
Offline
I'm having a problem with the drop boxes moving left or right from where they are supposed to appear when you resize the window, a popupbox will remain fixed once its opened but if you resize the window and open it again it will be right or wheres its supposed to be. Is this some kind of complication with my overall site styling?
Image
Last edited by CowMix (2006-07-26 18:41:48)
Offline
Vibrant wrote:
hi, i have installed everything but i get this where the bbcode images should be...
http://img91.imageshack.us/img91/6072/picture15nh.png
*edit* nvm i got it to work
I have the same truble in Opera.
Did you make all changes once again or were it something else?
Offline
I have just installed it, and it works 100% ok. Thanks!
If you want to see a test of this mod: http://www.compradoresonline.com.ar/viewtopic.php?id=10
Last edited by lsantoro (2006-08-27 13:14:08)
Offline
i'm not having any luck making this work for sending PM's... any help?
Offline
also, the code to add this to the Quick Post doesn't seem to work under IE
Offline
Weird thing ... Everything works exept the little arrows
Offline
Theberge43 wrote:
Weird thing ... Everything works exept the little arrows
That's because you have the forum on a subir and not the root (like me).
Just replace the url(/../../img/modern_bbcode/ with url(../../img/modern_bbcode/ and it'll be fine. Or if you prefer use the css below that has been altered already.
/****************************************************************/
/* MOD MODERN BB-CODE STYLE INDICATORS */
/****************************************************************/
/****************************************************************/
/* MOD MODERN BBCODE: OVERRIDES FOR STANDART PUNBB STYLE INDICATORS */
/****************************************************************/
#post textarea, #post input.longinput, #edit textarea, #edit input.longinput {
border: 1px #0d4d0a solid;
}
/****************************************************************/
/* MOD MODERN BBCODE: TOOLBAR AND TOOLBUTTON STYLE INDICATORS */
/****************************************************************/
DIV.toolbar {
background: #387735;
border-left: 1px #0d4d0a solid;
border-top: 1px #0d4d0a solid;
border-right: 1px #0d4d0a solid;
}
DIV.toolbar .draghandle {
border-left: 2px #0d4d0a dotted;
}
DIV.toolbar .separator {
border-left: 1px #0d4d0a solid;
}
DIV.toolbar a.tool_btn, DIV.toolbar a.dropdown, DIV.toolbar a.dropdown_opened {
border: 1px #68aa65 solid;
color: #DEDFDF;
}
DIV.toolbar a.tool_btn:visited, DIV.toolbar a.dropdown:visited, DIV.toolbar a.dropdown_opened:visited {
color: #DEDFDF;
}
DIV.toolbar a.tool_btn:hover, DIV.toolbar a.dropdown:hover {
border: 1px #6cb26a solid;
color: #FFF;
background: #0d4d0a;
}
DIV.toolbar a.dropdown {
background: url(../../img/modern_bbcode/greenpun_arrow.png) no-repeat top right;
}
DIV.toolbar a.dropdown_opened, DIV.toolbar a.dropdown_opened:hover, DIV.toolbar a.dropdown_opened:visited {
color: #FFF;
border: 1px #0d4d0a solid;
background: #68aa65 url(../../img/modern_bbcode/greenpun_arrow_opened.png) no-repeat top right;
}
DIV.toolbar a.dropdown:hover {
background: #0d4d0a url(../../img/modern_bbcode/greenpun_arrow_hover.png) no-repeat top right;
}
/****************************************************************/
/* MOD MODERN BBCODE: POPUP PALETTE INDICATORS */
/****************************************************************/
/* 0. Common popup panel indicators */
#colorpalette #colorbtn, #smilespanel #smilesbtn, #sizepanel #sizebtn, #imgpanel #imgbtn, #listpanel #listbtn {
border-left: 1px #0d4d0a solid;
border-right: 1px #0d4d0a solid;
color: #68aa65;
background: #68aa65;
}
#colorpalette #colorcontent, #smilespanel #smilescontent, #sizepanel #sizecontent, #imgpanel #imgcontent, #listpanel #listcontent {
border: 1px #0d4d0a solid;
background: #68aa65;
}
/* 1. Smileys popup panel indicators */
#smilespanel #adv a, #smilespanel #adv a:visited {
color: #FFF;
}
#smilespanel #adv a:hover {
color: #0d4d0a;
}
/* 2. Colors popup panel indicators */
#colorpalette #colorcontent a {
border: 1px #387735 solid;
}
#colorpalette #colorcontent a:hover {
border: 1px #6cb26a solid;
}
/* 3. Font-sizes, Images and Lists popup panel indicators */
#sizepanel #sizecontent a, #imgpanel #imgcontent a, #listpanel #listcontent a {
border: 1px solid #387735;
color: #FFF;
background: #387735;
}
#sizepanel #sizecontent a:hover, #imgpanel #imgcontent a:hover, #listpanel #listcontent a:hover {
border: 1px #0d4d0a solid;
color: #FFF;
background: #68aa65;
}
/****************************************************************/
/* MOD MODERN BBCODE: ADDITIONAL BBCODE INDICATORS */
/****************************************************************/
code {
color: #B42000;
}
div.postmsg li {
color: #666;
}
DIV.spoilerbox p {
color: #F1F1F1;
}
DIV.spoilerbox p:hover {
color: #333;
}
IMG.postimg {
padding: 1px;
margin: 2px 5px;
border: 1px solid #0d4d0a;
background: #FFF;
}
DIV.postmsg a:hover IMG.postimg {
border: 1px solid #B42000;
}Last edited by MrMister (2006-10-01 10:19:59)
Offline
I have noticed that the popup divs work fine in the post/edit pages, but the quick post is messed up (the popups actually appear at the bottom of the page not on the icon itself).
Has anyone else noticed this behavior?
Offline
i see this error Parse error: syntax error, unexpected T_FUNCTION, expecting '{' in /web/htdocs/www.xxx.com/home/board/include/parser.php on line 291
i have try this mod in 2 punbb but i see the same error help me please!!!
Last edited by porcaeva (2006-10-21 11:38:08)
Offline
FSX wrote:
How can I make this work on the Private message page?
Not certain but try this anyhoo...
Open message_send.php
Find:
<label><strong><?php echo $lang_common['Subject'] ?></strong><br /><input class="longinput" type='text' name='req_subject' value='<?php echo $subject ?>' size="80" maxlength="70" tabindex='<?php echo $cur_index++ ?>' /><br /></label>
After add:
<?php require(PUN_ROOT.'mod_modern_bbcode.php'); ?>
I'm not totally positive but it works for easy bbcode ![]()
Offline
FSX wrote:
It doesn't work.
Did you not find that line of code or did the require just not work period?
Offline
Is there a way to add mmore things to the toolbar? Like the youtube and googlevid BB-codes.
Offline