MyBB Hacks

Full Version: XThreads
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Uh no, I mean, my "News" forum has four kind of moderators (Administrators, Global moderators, Moderators, and Journalists). If I select "Moderators" in the "Editable by / Required Field?" then any moderator can use the tool, but that I don't want.

Is there any way to pick custom groups (Editable by / Required Field? -> Custom -> Editable by Usergroups) but also to limit it to moderators (i.e: a "Needs to be a moderator" kind of setting).

Editable by / Required Field? -> Custom
Editable by Usergroups - > Journalists|Administrators
Needs to be a moderator -> Yes
Unfortunately it doesn't have such tight control.  You may be able to do something with secondary usergroups (ie make sectional moderators Journalists).
Will need to try, thanks.
I want to be able to use:

Code:
{$GLOBALS['object']->method($arg)}


Or:

Code:
<?=($GLOBALS['object']->method($arg))?>


In the display format input box, but I can't. I don't want to create multiple independent functions to fallback to the object methods. Is there anyway to accomplish this?

Either have PHP in Templates installed, or enable all PHP by editing the option in cache/xthreads.php

Alternatively, you can try adding it to inc/xthreads/phptpl_allowed_funcs.txt although you may wish to take a bit of care with that.
For $obj->my_method, add the line

Code:
->my_method

I really want to avoid the use of (full?) PHP in templates and anywhere and that solutions seems to require me adding new lines for every method.

So I added just one function to the allowed list file and now I can use the following:

Code:
<?=function('method' [, $arg [, $arg [, ...]]])?>


Ugly, but works. Thanks nonetheless!

Is it possible to filter where a thread field does not start with whatever?

I tried filtertf_key!=value, key_value, key-value - pretty much anything listed in the filtering mode setting that looked like it would work.
Unfortunately no.
Is there a way to have an active filter with odd characters, such as parentheses or slash in it?

This gives a security error:

{$filters_set['style']['active']['Gyaru(o)']}
XThreads doesn't care, but MyBB's template filtering is rather crap.
You could try editing that into the database directly, or remove the security check.

EDIT: if you have template conditionals, you could also use the following workaround:

Code:
<setvar foo>$filters_set['style']['active']['Gyaru(o)']</setvar>
{$GLOBALS['tplvars']['foo']}

Reference URL's