when you've got something like include($Configuration['SomePath'] . 'someFile.php'); and that $Configuration['SomePath'] is set in an other file, you should add at the top of the file:if (!defined('IN_VANILLA')) exit(); or you extension will be vulnerable when register_globals is on.
Hey! This is a total godsend. I had no idea how to override the default BBCode formatting. Just one question, probably a dumb one... where do I go to set the default formatter?
There is a settings.php file (or I hope so!) in the distribution.
By the way, I have a problem: I don't know (yet) how to hide an item in the preference form of the account.php page. So whether users will choose to display the selector, his/her choice will be overriden.
I'll try to overrive the AddPreference function of the PreferencesForm class...
Would there be a way to set different default formatters for different roles? I'm looking for a way to force BBCode for everyone, except for administrators who could choose between BBCode and HTML.
sweet
EDIT:
with DefaultFormatter, it preselects bbcode for me, even though none of the "automatically select _______" are checked in the roles page, and I have the "can see the formatter selector", and "can format the comments with any formatter" checked for admin role.I didn't have any of the previous versions installed.
It must be your prefs. As we decided by email, we should rename Can format the comments with any formatter to Ignore DefaultFormatter extension for this role, and those few related settings below Because it's simply what this check box does. Gonna wait a bit for other glitches before the change (and maybe a better idea to replace Can format the comments with any formatter).
Anyway this will occur if the 'Add your comments' textarea is displayed to guests (as in Guest Post). I must find a way to solve it. But what line were you missing? I don't quite understand...
I got the same until I made a selection in 'Roles & Permissions'. However I'm still getting it for guest users, even though they can't see the 'Add your comments' textarea.
One oddity. If I disable this extension I'm left with these in the 'Roles & Permissions' list:
# PERMISSION_FORMATTERS_ALL
# PERMISSION_FORMATTERS_SHOW
# PERMISSION_FORMATTERS_Text
# PERMISSION_FORMATTERS_Markdown
Although whether or not they're checked seems to make no difference. (As you can see, I have the Markdown extension installed but it's the same when that's disabled.)
yes, if you enable an extension that adds a permission, theres almost no possible way to get rid of it. they don't do anything once the extension is disabled.
Sorry, I was quite busy these days. I'm gonna try to find something smart to deal with guests. Like the first version, I'm gonna add few lines of conf at the top of the default.php file, just for the guests.
after adding that, i get this error:
Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/xx/public_html/messageboard/extensions/DefaultFormatter/default.php on line 44
Very good add-on, makes things easier and more simple for end users. Noticed that when this add-on is installed, in user profiles option for formatter is still visible and might be confusing. So I commented that out from the source but guess it would be better if DefaultFormatter would do it somehow automatically.
Meanwhile if somebody is willing to do what I did (and don't blame me if it breaks something ;) ), formatter-line to comment out is in Vanilla.Control.Preferences.Form.php
Hello,
I am using Vainilla 1.1.8 and I had some errors: not defined PERMISSION_FORMATTERS_ALL ...
I just changed each condition:
if (!$Context->Session->User->Permissions['PERMISSION_FORMATTERS_ALL'] )
adding isset function
if ( isset($Context->Session->User->Permissions['PERMISSION_FORMATTERS_ALL']) &&
! $Context->Session->User->Permissions['PERMISSION_FORMATTERS_ALL'] )
And it works perfectly...
I dont know if this apply to other versions, It would be nice to update the code.
Best,
Yo
Comments
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •include($Configuration['SomePath'] . 'someFile.php');and that $Configuration['SomePath'] is set in an other file, you should add at the top of the file:if (!defined('IN_VANILLA')) exit();or you extension will be vulnerable when register_globals is on.- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •By the way, I have a problem: I don't know (yet) how to hide an item in the preference form of the account.php page.
So whether users will choose to display the selector, his/her choice will be overriden.
I'll try to overrive the AddPreference function of the PreferencesForm class...
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Would there be a way to set different default formatters for different roles? I'm looking for a way to force BBCode for everyone, except for administrators who could choose between BBCode and HTML.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •You should find
- Can format the comments with any formatter
- Can see the formatter selector
- Will see the ??? formatter pre-selected
in the permissions list.- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Can format the comments with any formatter
to
Ignore DefaultFormatter extension for this role, and those few related settings below
Because it's simply what this check box does.
Gonna wait a bit for other glitches before the change (and maybe a better idea to replace Can format the comments with any formatter).
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Notice: Undefined index: PERMISSION_FORMATTERS_ALL in /home/robom3/public_html/forum/extensions/DefaultFormatter/default.php on line 46
Notice: Undefined index: PERMISSION_FORMATTERS_Text in /home/robom3/public_html/forum/extensions/DefaultFormatter/default.php on line 51
Notice: Undefined index: PERMISSION_FORMATTERS_Text in /home/robom3/public_html/forum/extensions/DefaultFormatter/default.php on line 51
Notice: Undefined index: PERMISSION_FORMATTERS_Html in /home/robom3/public_html/forum/extensions/DefaultFormatter/default.php on line 51
Notice: Undefined index: PERMISSION_FORMATTERS_SHOW in /home/robom3/public_html/forum/extensions/DefaultFormatter/default.php on line 64
I'm really not good with a lot of code. Is there something I need to fix?
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •But what line were you missing? I don't quite understand...
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Like the first version, I'm gonna add few lines of conf at the top of the default.php file, just for the guests.
Something better to suggest ?
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •"I added that to my file, and the errors still appear for guests. Does it have to be added to a specific place in the code? Am I missing something?"Sorry, haven't been back here for a while.
I added it at the top of default.php, after
<?php<br />/*...
...*/
and before
if (!defined('IN_VANILLA')) exit();
"Something better to suggest ?"My suggestion works for me (although, of course, it's hiding the error messages rather than fixing the error).
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •&& $Context->Session->UserID > 0
to the if condition in line 44 to exclude guests of the permissions mesh
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Very good add-on, makes things easier and more simple for end users. Noticed that when this add-on is installed, in user profiles option for formatter is still visible and might be confusing. So I commented that out from the source but guess it would be better if DefaultFormatter would do it somehow automatically.
Meanwhile if somebody is willing to do what I did (and don't blame me if it breaks something ;) ), formatter-line to comment out is in Vanilla.Control.Preferences.Form.php
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •