![]() |
Admin/Mod BBcodes
this is an easy hack for admins and mods who edit their users' posts and always wanna leave a msg at the bottom of it!
check the screenshots! download the zip file for installation instructions! For those who are looking to restrict the use of these bbcodes for normal users, please use this hack: Advanced BBcode Permissions http://www.oneforum.org |
Awesome! Thanks for this :)
|
Say a regular user knows, or finds out about this certain tag, what will stop he/she from using it?
Because if it's somehow restricted to admins/mods, I'd like to use it! :) |
Quote:
I want to know that too, so ill wait. |
Quote:
Very nice hack, but imho a bit unusable without restriction. |
you could use the "permission bbcode" hack release somewhere in here!
you're right about what you said, my suggestion is to use the hack I mentioned along with this one, you will restrict normal users from using certain bbcodes along with this one! |
Great mod. Very handy for mods and admins, and makes it harder for members to pretend they never saw an admin/mod edit.
I'd say it would be pretty ballsy for a user to use these tags in their own posts. Obviously imitating a mod or admin would be grounds for punishment. |
Nice addition!
|
have been looking for this! is it possible to make the text be alligned to the center of the [!] sign? right now it's on top and it looks rather odd.
|
Looks very nice, i will be giving this a try :)
|
Quote:
HTML Code:
<valign="center">{param} |
Quote:
|
|
Quote:
Quote:
So I'm afraid you can't restrict these two custom bbcodes :( |
its a pain in the ass to restrict them you have to hard code them. damn.
heres the code go to class_bbcode add theses some where Code:
/** { // Code:
$tag_list['no_option']['code'] = array( [CODE]if ($vbulletin->options['allowedbbcodes'] & ALLOW_BBCODE_ADMINWARN) { //[CODE] $tag_list['no_option']['admin'] = array( 'callback' => 'handle_bbcode_admin', 'strip_empty' => true, 'disable_smilies' => true, 'disable_wordwrap' => true, 'strip_space_after' => 1 ); } if ($vbulletin->options['allowedbbcodes'] & ALLOW_BBCODE_MODWARN) { // Code:
$tag_list['no_option']['mod'] = array( Code:
define('ALLOW_BBCODE_HTML', 512); Code:
define('ALLOW_BBCODE_MODWARN', 1024); open class_bbcode_alt.php find: Code:
function handle_bbcode_code($code) Code:
function handle_bbcode_admin($code) |
i figured it out
|
Wild-Wing - thanks.... I think!
I understand the file edits but after editing the files how do you create a tag that can only be used by an admin or mod? |
Wild-Wing - I realise what you meant - create templates called bbcode_admin and bbcode_mod for the code to display a "moderator box".
However I see that you add this: define('ALLOW_BBCODE_MODWARN', 1024); define('ALLOW_BBCODE_ADMINWARN', 2048); So I presume somehow once I've made the modifications I would need to give permission to the admin and mod groups so they could use the tags? |
oh i forgot to add that part damn.
you have to be in developer mode to to the next step go to the bbcode settings where the Enabled Built-in BB Codes area is you should see a edit and delete links (note: you will only see this if you are in developer mode.) add this to the bottom of the option code box above the span tag Code:
<label for=\"bb1024\"><input type=\"checkbox\" name=\"setting[$setting[varname]][]\" id=\"bb1024\" value=\"1024\" tabindex=\"1\" " . iif(bitwise($setting['value'],1024), 'checked="checked"') . " />[MOD]</label><br /> |
Thanks.
I've now done that however now if I try to display a post that uses one the tags the page just doesn't display (I just get a completely blank page and the browser indicates it is busy). If I switch off the mod and admin bbcodes in the vBulletin options page then the page displays but of course the tag is just shown as text. (For testing purposes all my template is a single <div> with the words TEST ADMIN TAG in it.) Any ideas? |
did u turn on debug mode in the config.php file? that turns on developer mode. when i get home ill post the templates i used.
i used this for the admin template and the admin_printthread make sure you name them bbcode_admin and bbcode_admin_printthread Code:
<style> |
Just tried with your templates and the same problem, switch the tags on and a blank page, switch them off and the page displays fine.
I've double checked the edits of the files you've listed and my edits are correct - could it be you've missed an edit instruction? |
damn thats something i dont know whats wrong. i am not at home right now so i cant double check all my steps i might have forgoten something i dont know maybe i posted all the steps.
|
Wow quiet simple really!
|
Quote:
|
Installed and working! Very nice!
|
worked like a dream, thanks =)
|
Damn! Why isn't it working for me? I've even disabled every other plugin and product just to be on the safe side! Frustrating to say the least!
|
uhm.. anyone can just go check these out and use them. In the BB code FAQ.
Solution please?? (pretty worthless if not) without doing what some other members wrote above, I have no clue in that area of modding. |
well,
nice addition BUT it has a serious security hole.*anybody* with a username can go to www.yourboard.com/forum/misc.php?do=bbcode this generates a list of bbcode tags your board uses.The "advanced bbcode permissions hack" only handles permissions for bbcode build into vbulletin not custom bbcode tags so without some way to restrict this it is pretty useless also ...... DO NOT TURN ON DEBUG MODE ON LIVE SITES danger Will Robinson danger ..... |
Quote:
|
Quote:
[high]* Smiry Kin's going to uninstall, unless a fix is made soon[/high] |
Quote:
|
well,
you could add a plugin on hook location bbcodeparse_start which checks the individual permissions using the bitfields from the advanced bbcode permissions hack.But you need to modify this hack a bit. i'll have a look later no time for it now :D |
Although I can't get it to work you can alter the Advanced bbcode permissions mod to control the usergroups that can use the new tags.
Download the Advanced permission add-on and edit the bitfield_advancedbbcodepermissions.xml file to add these two lines to the group options: <bitfield name="allow_bbcode_admin" group="advanced_bbcode_permissions" phrase="allow_bbcode_admin">1024</bitfield> <bitfield name="allow_bbcode_mod" group="advanced_bbcode_permissions" phrase="allow_bbcode_mod">2048</bitfield> Save that. Then open the product-advancedbbcodepermissions.xml file and add these two lines: <phrase name="allow_bbcode_admin"><![CDATA[[ADMIN]]]></phrase> <phrase name="allow_bbcode_mod"><![CDATA[[MOD]]]></phrase> Save that file. Then install the Advanced permissions product as per the instructions and you can then use that to control permissions to the new "admin" and "mod". (Word of warning - I can't at the moment test this but it should work!) |
I've got this working now - rather embarrassing I'd been mucking around class_bbcode a little while ago on my test forum to see if I could implement this and forgot about them, once I started from original files it all worked first time!
I've modified the advanced bbcode permissions to handle the new tags and that works so the codes can only be used by a mod or admin however if I use more then one mod box in the thread only the first one is parsed correctly the subsequent ones are ignored as if I didnt have permission to use the tag, |
well,
if u use that hack called "advanced bbcode permissions" then something like this should work PHP Code:
|
I've got the advanced bbcode hack installed and working but if I post more then one tag in a thread only the first one is correctly parsed, the subsequent tags are ignored as if I had no permission.
|
Quote:
Quote:
Details please ! |
Quote:
Quote:
|
All times are GMT. The time now is 05:15 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|