View Full Version : mod bbcode
zero5854
03-26-2009, 11:39 AM
Does anyone know how to get custom bbcode to appear not just on a new post but on edit a post?
I use this mod message bbcode along withbbcode permissions so only admins and mods can use the mod message bbcode BUT it only shows up whena new post is made?
thanks
TigerC10
03-26-2009, 12:15 PM
How do you mean it "shows up" ?? You mean like a button in the editor?
zero5854
03-26-2009, 01:11 PM
yes but when I edit a post the mod bbcode doesnt show up? Only when I make a new post?
TigerC10
03-26-2009, 01:26 PM
If your bbCode is defined to have a graphic image, it will only automatically display in the full editor. Furthermore, the button will display for all users. Even if you have advanced permissions to prevent the use, the button still displays.
View this article about adding buttons to the editor:
https://vborg.vbsupport.ru/showthread.php?t=97295
You will use a slight modification... The button code for you will change
<if condition="can_moderate(0,'',$bbuserinfo[userid])">
<td><div class="imagebutton" id="{$editorid}_cmd_wrap0_BBCODE"><img src="$stylevar[imgdir_editor]/YOURBUTTONIMAGE" width="21" height="20" alt="$vbphrase[YOURALTPHRASE]" /></div></td>
</if>
This will hide the button from people who can't moderate.
You will also want to edit more than just the editor_toolbar_on template, since this is the full editor. You will also edit postbit_quickedit.
Note: If you edit these templates this way, you should remove the image in the bbcode manager that is associated with the bbcode (or else the button will appear 2 times in your full editor).
zero5854
03-26-2009, 01:55 PM
ok ill look into this thanks! BTW it doesnt show in the full editor either when editing a post!
where do I add that code u posted?
EDIT getting error with ur code
The following error occurred when attempting to evaluate this template:
Parse error: syntax error, unexpected '/', expecting ']' in /home/*******/public_html/includes/adminfunctions_template.php(3938) : eval()'d code on line 157
This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.