Well I'm using SMF 2.0 BETA 4 (I don't want to upgrade yet, for various reasons), and I have a few BBCodes (ModBreak specificly) that I want to restrict to just Moderators and Administrators to use, but how exactly can I do this, I don't want to let other regular members use it, just Mods...
You can try that
Sources/Subs-Post.php
if (!$previewing && strpos($parts[$i], '[html]') !== false)
{
if (allowedTo('admin_forum'))
$parts[$i] = preg_replace('~\[html\](.+?)\[/html\]~ise', '\'[html]\' . strtr(un_htmlspecialchars(\'$1\'), array("\n" => \' \', \' \' => \'  \')) . \'[/html]\'', $parts[$i]);
// We should edit them out, or else if an admin edits the message they will get shown...
else
{
while (strpos($parts[$i], '[html]') !== false)
$parts[$i] = preg_replace('~\[[/]?html\]~i', '', $parts[$i]);
}
}
if (!$previewing && strpos($parts[$i], '[html]') !== false)
{
if (allowedTo('admin_forum'))
$parts[$i] = preg_replace('~\[html\](.+?)\[/html\]~ise', '\'[html]\' . strtr(un_htmlspecialchars(\'$1\'), array("\n" => \' \', \' \' => \'  \')) . \'[/html]\'', $parts[$i]);
// We should edit them out, or else if an admin edits the message they will get shown...
else
{
while (strpos($parts[$i], '[html]') !== false)
$parts[$i] = preg_replace('~\[[/]?html\]~i', '', $parts[$i]);
}
}
if (!$previewing && strpos($parts[$i], '[modbreak]') !== false)
{
if (allowedTo('moderate_board'))
$parts[$i] = preg_replace('~\[modbreak\](.+?)\[/modbreak\]~ise', '\'[modbreak]\' . strtr(un_htmlspecialchars(\'$1\'), array("\n" => \' \', \' \' => \'  \')) . \'[/modbreak]\'', $parts[$i]);
// We should edit them out, or else if an admin edits the message they will get shown...
else
{
while (strpos($parts[$i], '[modbreak]') !== false)
$parts[$i] = preg_replace('~\[[/]?modbreak\]~i', '', $parts[$i]);
}
}
Thanks alot, I'll try that later and tell ya if it works ^_^
So I'll just replace "ModBreak" with the name of the BBCode for another one? Great!
That didn't work :'(
Bump.
Quote from: ~Killer~ on February 17, 2009, 11:59:16 AM
That didn't work :'(
But it should work,i've tested it on my test forum,it's worked flawless
:S Well it's not working... Could you do it for me, I swear it's not working.
Thanks Duncan85. This works very nice (SMF 1.1.8!) in combination with the modbreak mod. 8)
Would it also be possible to filter things like [modbreak=test]bla bla[/modbreak] ?
Currently it filters [modbreak]bla bla[/modbreak]
What about disabling a tag like (url)(/url) either by membergroup or for a specific board?
Quote from: Mr. Jinx on March 30, 2009, 02:08:32 PM
Thanks Duncan85. This works very nice (SMF 1.1.8!) in combination with the modbreak mod. 8)
Would it also be possible to filter things like [modbreak=test]bla bla[/modbreak] ?
Currently it filters [modbreak]bla bla[/modbreak]
Anyone please?
The best place to ask about modbreak mod is the author in the support/comment topic. Please post your issue here (http://www.simplemachines.org/community/index.php?topic=141374.60).