Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=622)
This mod adds a modbreak-tag to your forum. A modbreak is basically a tool for your moderators to make a clear statement in a topic, using a fieldset with a legend.
Possible usage:
[modbreak]
You aren't allowed to swear on this forum!
[/modbreak]
Will return (HTML):
<fieldset class="modbreak">
<legend>Modbreak</legend>
You aren't allowed to swear on this forum!
</fieldset>
Another possible use is:
[modbreak=Edit by Aaron]
I removed the link to a warez site!
[/modbreak]
Will return (HTML):
<fieldset class="modbreak">
<legend>Edit by Aaron</legend>
I removed the link to a warez site!
</fieldset>
Should you wish to style the modbreak (which isn't done by default), you can add the following lines to your theme's style.css:
.modbreak
{
border: 1px solid #000000;
}
.modbreak legend
{
color: #DD0000;
font-weight: bold;
}
I hope you find this mod useful. ;)
Very nice and usefull mod!
I like it! :) :) :)
Simple and efficient. I like it as welll :)
This looks like it could be very useful thanks. ;)
OK were do you activate this? Installed fine but see no place to make use of it anywhere! :o :( ::) ???
Found it useful. Makes it much easier to see that a mod had changed something. Cheers.
Thanks!
What about if there is a modbreak button, visible only to admin? ;)
Quote from: Skipdawg on January 10, 2007, 10:15:54 PM
OK were do you activate this? Installed fine but see no place to make use of it anywhere! :o :( ::) ???
You don't have to configure or activate it anywhere - you can just use the BBC-code in the post screen. :)
Quote from: Greek on January 11, 2007, 06:39:59 AM
What about if there is a modbreak button, visible only to admin? ;)
I might add that in a newer version.
Well I am not seeing anything from this Mod. Must be conflicting with something else. If you update it for the next version I may take a look at it then. Just don't have the spare time to trouble shoot and figure out what is going on with it. Sounds good though. ;)
Could you try installing it, and then post a message (or preview one) in a random topic, containing:
[modbreak]
You aren't allowed to swear on this forum!
[/modbreak]
Then you *should* see it parsed as a fieldset. :)
Quote from: Aäron on January 11, 2007, 09:05:34 AM
Quote from: Greek on January 11, 2007, 06:39:59 AM
What about if there is a modbreak button, visible only to admin? ;)
I might add that in a newer version.
I think it would be better if we could set the permissons for this bbc-code :)
Can i change the word "ModBreak" anywhere??
very nice mod, thank you
if you can update it with permission and button, would be a perfect one!!
Quote from: cave on January 11, 2007, 02:03:34 PM
I think it would be better if we could set the permissons for this bbc-code :)
I thought about that, but then a user wouldn't be able to quote a modbreak properly, if you get what I mean. :-\
Quote from: aperseghin on January 11, 2007, 02:28:00 PM
Can i change the word "ModBreak" anywhere??
You'd have to manually edit it in Subs.php.
but it means any user can use this tag?
or only moderators?
Quote from: Kris on January 12, 2007, 05:16:12 PM
but it means any user can use this tag?
or only moderators?
Any user. :)
Just only tell your moderators about the mod. Any user dont have to know :D
Thanks for this - i am using it and its really good.
Here is the CSS i use for this mod
.modbreak
{
border: 1px solid #000000;
background-color: #FFFBEF;
border-top: 1px solid #333;
border-left: 1px solid #333;
border-right: 1px solid #ccc;
border-bottom: 1px solid #ccc;
margin: 1px 11px 11px 11px;
padding: 8px;
font-weight: bold;
}
.modbreak legend
{
color: #DD0000;
font-weight: bold;
}
Quote from: Knat on January 13, 2007, 05:38:16 AM
Just only tell your moderators about the mod. Any user dont have to know :D
Very usefull mod, however my users will find out about this tag anyway.
If they just quote a topic, they will see the tags and abuse them.
So make it in your rules that this tag is only to be used by mods and that mods will take actions against any abuse. ;)
Or just dont use it :D
Very nice. Would be great if the use of it could be restricted in the future though.
Quote from: Knat on January 13, 2007, 06:54:38 AM
So make it in your rules that this tag is only to be used by mods and that mods will take actions against any abuse. ;)
Or just dont use it :D
(https://www.simplemachines.org/community/Themes/default/images/post/thumbup.gif)
love this mod
Excellent mod, thank you.
And I agree with Knat and Kris: you can't and shouldn't try to code for every eventuality. A simple rule should be enough.
very useful mod and very useful if will be possible have BBC button for apply it , visible only to Staff
Hi there.
I want this mod but is only normal bbcode.
Can you do it like this mod for phpbb:
Moderation BBCode (http://www.phpbbhacks.com/download/812)
Thanks
yes its needed button which is visible just for moderators and only then this mod will be completely usefull
Aäron, thank you very much for this wonderfull mod, i really love it!!
Quote from: Knat on January 13, 2007, 05:38:16 AM
Just only tell your moderators about the mod. Any user dont have to know :D
Thanks for this - i am using it and its really good.
Here is the CSS i use for this mod
.modbreak
{
border: 1px solid #000000;
background-color: #FFFBEF;
border-top: 1px solid #333;
border-left: 1px solid #333;
border-right: 1px solid #ccc;
border-bottom: 1px solid #ccc;
margin: 1px 11px 11px 11px;
padding: 8px;
font-weight: bold;
}
.modbreak legend
{
color: #DD0000;
font-weight: bold;
}
And thank you for posting this, i only removed the background color, it looks so cool now :D
Any screenshot for this mod ? Thanks :)
screenshot is in Danish but i think you get the picture ;)
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg209.imageshack.us%2Fimg209%2F3697%2Fmodbreakyl6.th.jpg&hash=e4f251c5017881a1a283fd937fe6644544e45b4f) (http://img209.imageshack.us/my.php?image=modbreakyl6.jpg)
Very useful mod, really great - I installed it ages ago but only really used it today... helpful! Thanks for it!
still button is needed
ok so as I understand it, it adds bbc code to enable a mod to add the break thingy in a post as per screenshot, but theres no button, so you have to tell the mods what the code is, and anyone who knows the code, can use it? I suppose that would work as people are less inclined to use something if there's no button, no one is going to use it unless they want to cause trouble right? So a rule about misusing it should suffice.
Quote from: perplexed on February 06, 2007, 10:21:40 AM
ok so as I understand it, it adds bbc code to enable a mod to add the break thingy in a post as per screenshot, but theres no button, so you have to tell the mods what the code is, and anyone who knows the code, can use it? I suppose that would work as people are less inclined to use something if there's no button, no one is going to use it unless they want to cause trouble right? So a rule about misusing it should suffice.
Got it in one - and yes, a rule should suffice. That's the way I'm using the mod.
if (in_array('1',$GLOBALS['user_info']['groups']) || in_array('2',$GLOBALS['user_info']['groups']))
{
before the array to show only to admins mods
sure someone could do that eh
Quote from: Kris on January 14, 2007, 04:10:31 AM
Quote from: Knat on January 13, 2007, 06:54:38 AM
So make it in your rules that this tag is only to be used by mods and that mods will take actions against any abuse. ;)
Or just dont use it :D
(https://www.simplemachines.org/community/Themes/default/images/post/thumbup.gif)
Yeah rite, then my mods have to check if people are abusing this mod. What a stupid idea :o ???
I suppose that would be easy to spot since they should be reading the posts anyway and would see if a non-mod was using it
I would still be happier if it was based on permissions
thnx
I'll see what I can do regarding the feature requests for the next version. I
think I'll implement the following two:
- Usage based on permissions
- Button in post form (only visible for users with appropriate permissions)
I can't promise an exact date, as I'm rather busy in real life, but I'll do my best. :)
cool aaron :)
you can use the BBCode Permission Mod to control which membergroups can use it.
and to change "modbreak" you edit the legend variable in subs.php
Quote from: detportal on March 17, 2007, 05:45:59 AM
you can use the BBCode Permission Mod to control which membergroups can use it.
Nice, thanks for sharing.
Quote from: detportal on March 17, 2007, 05:45:59 AM
and to change "modbreak" you edit the legend variable in subs.php
Not necessarily. Using
[modbreak=Type your legend here]text[/modbreak] will suffice. ;)
Can this mod please be updated for 1.1.2 ? ;) Recently moved to another server and i want to reinstall this mod.
Thnx!
THNX Aäron i first tryed to make one with custom BBC
but this one is much better!!! ;)
I want to thank you again i found a great use for your mod.. THANK YOU ! ;D
I never really used the modbreak because i simply forgot about it.. and i didnt have a bbc button for it..
Anyway i needed a tag for passwords because we post many password protected files on my board..
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fpixfarm.net%2Fupload%2F2%2Foriginals%2Fe1%2Fe1e0ebb829234109a8a7bcd70bfeb9be.jpg&hash=01483794c2327c8af6805e8af78151da513a13ef)
http://pixfarm.net/upload/2/originals/e1/e1e0ebb829234109a8a7bcd70bfeb9be.jpg
So i made my first bbc button :)
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fpixfarm.net%2Fupload%2F2%2Foriginals%2F51%2F51aa937be92d210d916089d9db575e51.jpg&hash=71b0cae089f6f84f2775052bacc852a41e0835b2)
http://pixfarm.net/upload/2/originals/51/51aa937be92d210d916089d9db575e51.jpg
To insert this code
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fpixfarm.net%2Fupload%2F2%2Foriginals%2F04%2F043da3d051f8bb11007aa9574bedc11e.jpg&hash=f9765daeac1fd6012cb1bbe5b7da5fa9f7f3b6db)
http://pixfarm.net/upload/2/originals/04/043da3d051f8bb11007aa9574bedc11e.jpg
And this is how it looks after its posted 8)
Very useful to my community ... :P
somehow this forum makes images smaller so click the links to see original images >:(
Hhm, Tanks, do you have some sort of .htaccess trick to cancel al the images at other pages, because I only see an img with PixFarm.net
And, my problem was: I can't use this in 1.1.3?
it's a great mod but it REALLY needs to work in 1.1.3 , have a button , and be permission based (not for all users to use) ! i hope aaron gets those soon !
it doesn't work for me. ..
It should be working in both SMF 1.1.3 and SMF 1.1.4. Could you give some more information, e.g. errors?
Quote from: MinasC on October 11, 2007, 11:29:37 AM
it's a great mod but it REALLY needs to work in 1.1.3 , have a button , and be permission based (not for all users to use) ! i hope aaron gets those soon !
I definitely agree, but I'm afraid I simply don't have time to look into that now. I'll put it on my todo list for the next version of the mod though. :)
fair enough , thnx !
Quote
I definitely agree, but I'm afraid I simply don't have time to look into that now. I'll put it on my todo list for the next version of the mod though. :)
Yes thank you! Really want to use this mod again :)
Added a package for use with SMF 2.0 beta 3 public to the mod site. Haven't had time for any other updates yet.
Aäron - thank you very much for this mod! (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fs.rimg.info%2F5962bb18d0aff8d7b1a22b492ef7b499.gif&hash=6bbfb4552a10f9bad72106952934027e0fe70e3a)
work in 2.0 Beta 4
thanks!
thx work perfectly look screen ;)
how do i make it so only specified groups can use it like moderator, super moderator and admin.
everyone can use it :/ but its good, thanks mate
Aaron,
Imagine you're still quite busy, but is it possible to look at adding the ability to change the default text? Ideally, I'd like to see the default be something like "Moderation Warning" and perhaps be able to change the css setting via AdminCP. I know I can edit, and it isn't hard to do, but my concern is if I have to back this out for some reason, such as a new version (which is why it might be helpful to have each new version of this MOD include the version number in the package filename, to allow uploading the new version and a quick uninstall old/install new operation).
To be honest, setting the BBC for permissions would be nice, but what happens when a post with a modbreak gets quoted? Would permissions break the quote? Wouldn't the quoter see the BBC? So, as annoying as it may be to some, the easiest solution is to tell members if they use it, they are in BIG trouble.
Now, if a BBC BUTTON only appears if the poster has the permission to use it, THAT would make things much easier for the moderators who don't use it that often. But I don't see how the actual BBC can be restricted. And that may be a lot more work than changing the AdminCP to insert a value into $legend (which will likely need to be redefined globally as $modbreak_legend to avoid anyone walking on it ;) ).
Another great MOD Aaron!
Grazie mille!
Cal
Still hoping for a permission based modbreak.
I've used the BBC Moderation MOD in combination with Modbreak but the permission MOD has a bug (do NOT click to enable all, that disables all). It would be better not to use that MOD.
Aaron,
Hoping to not sound presumptive, but an example of the AdminCP code needed to edit the CSS for Modbreak can be found in the PM Informer MOD located here (http://custom.simplemachines.org/mods/index.php?mod=1202).
Can this mode be update for smf 1.1.8 pls :)
Quote from: d0brin on February 19, 2009, 03:30:36 PM
Can this mode be update for smf 1.1.8 pls :)
It doesn't need to be updated. It'll work just fine on SMF 1.1.8. ;)
Nice feature but can it be called something besides [modbreak]
How about [Moderator Comment]
My users and I speak English and Geek Speak is something we try to avoid.
Quote from: PerryM on February 20, 2009, 01:28:05 PM
Nice feature but can it be called something besides [modbreak]
How about [Moderator Comment]
My users and I speak English and Geek Speak is something we try to avoid.
Sure,
to install it using your tag, unzip and open
install.xml, or if you have it already installed open
Sources/Subs.php:
$legend = 'modbreak';
$legend = 'Moderator Comment';
Execute this twice, as there are two of these pieces:
'tag' => 'modbreak',
'tag' => 'Moderator Comment',
Additionally, if you want it to be only used by Moderators, take a look at this post (http://www.simplemachines.org/community/index.php?topic=293440.msg1935373#msg1935373). This actually erases the tag when a non-moderator tries to edit his/her post. It only works for the normal tag (without equation mark) though.
Greetz
nvm i made this:
// Modbreak function
function get_modbreak($content, $name = null)
{
global $txt, $settings, $context, $modSettings;
$legend = 'Modbreak by ' . $name;
if(empty($name))
return 'Im a noob because i fake a modbreak =)';
return '
<fieldset class="modbreak"><legend>' . $legend . '</legend>' . $content . '</fieldset>';
}
Hello all.
1: Thank Aäron for this great mod.
I have this installed on SMF2.0 RC1 and the moderator's of the board are very happy ;).
2: Many people have question about BBC-Button.
The code at the end, add the BBC-Button in SMF2.0 RC1.
All user with permission "moderate_board" can see the button.
3: You must create a new BBC-Button Image, and copy it to your
./Themes/default/images/bbc directory.
The name of button image must be "modbreak.gif".
I have rename another bbc button for test.
4: Maybe someone can create a new button and post it in thread, thanks.
$sourcedir/Subs-Editor.php
search:
// Show the toggle?
if (empty($modSettings['disable_wysiwyg']))
{
$context['bbc_tags'][1][] = array();
$context['bbc_tags'][1]['unformat'] = array('code' => 'unformat', 'before' => '', 'description' => $txt['unformat_text']);
$context['bbc_tags'][1]['toggle'] = array('code' => 'toggle', 'before' => '', 'description' => $txt['toggle_view']);
}
add after:
// ######## BBC Button for MODBREAK ######################################################################################################
if (allowedTo('moderate_board'))
{
$context['bbc_tags'][1][] = array();
$context['bbc_tags'][1]['modbreak'] = array('code' => 'modbreak', 'before' => '[modbreak]', 'after' => '[/modbreak]', 'description' => $txt['modbreak']);
}
// #######################################################################################################################################
./Themes/default/languages/post.english.php
search:
$txt['unformat_text'] = 'Remove Formatting';
add after:
$txt['modbreak'] = 'Moderator Break';
./Themes/default/languages/Post.german-utf8.php
search:
$txt['unformat_text'] = 'Formatierung entfernen';
add after:
$txt['modbreak'] = 'Moderator Kommentar';
Sorry for my bad english. ;)
How could that 'moderate_board" conditional be added to the 1.1.x code?
The bloody PERMISSIONS MOD keeps breaking other mods that utilise permissions and the only reason I installed the blasted PERMISSIONS MOD is to protect MODBREAK from abuse. If this "moderate_board" check could be implemented I could get rid of PERMISSIONS MOD and not get frantic emails that all the formatting tags are disabled (because PERMISSIONS felt like it).
Grazie,
Cal (using 1.1.8)
HI Cal,
you can it make so. I have testet with SMF 1.1.8.
./Themes/default/Post.template.php
search:
'list' => array('code' => 'list', 'before' => '[list]\n[li]', 'after' => '[/li]\n[li][/li]\n[/list]', 'description' => $txt[261]),
);
add after:
// ######## BBC Button for MODBREAK ######################################################################################################
if (allowedTo('moderate_board'))
{
$context['bbc_tags'][1][] = array();
$context['bbc_tags'][1]['modbreak'] = array('code' => 'modbreak', 'before' => '[modbreak]', 'after' => '[/modbreak]', 'description' => $txt['modbreak']);
}
// #######################################################################################################################################
Hello,
I'm sorry, I didn't make clear what I needed to do.
Your fix certainly does take care of not displaying a MODBREAK BBC icon unless one is authorised to moderate that board.
Unfortunately, someone NOT a moderator can type the characters "[modbreak]I am not authorised but here is a MODBREAK BOX anyway![/modbreak]" and create the MODBREAK anyway.
But perhaps the allowedTo logic can be used where the MODBREAK BBC tag gets processed?
In the meantime it looks like the PERMISSION MOD continues to be used... foo...
Cal
And now I turn around and say grazie mille TheDeath!
I took the allowedTo logic and made an absurdly simple fix to limit MODBREAK making boxes only where the author is allowed to do it. And where they can't, such as moderators trying to do it in a board they don't moderate, it resolves to an error message.
This is in Sources/Subs.php
// Modbreak function
function get_modbreak($content, $legend = null)
{
global $txt, $settings, $context, $modSettings;
if (empty($legend))
$legend = 'Modbreak';
if (allowedTo('moderate_board'))
return '
<fieldset class="modbreak"><legend>' . $legend . '</legend>' . $content . '</fieldset>';
else return '<span style="color: red;">Sorry, you are not authorised to use MODBREAK here.</span>
';
I'm pretty sure this is solid, after testing with users, moderators, and global moderators, but if anyone wants to double-check.
Aaron, if this meets with your approval, would you consider integrating it formally into MODBREAK? (This didn't work right... it hides MODBREAKs from regular members)
Many thanks to Aaron for creating MODBREAK and TheDeath for giving me the pieces to find a fix.
Now I can get rid of PERMISSIONS MOD!!!
Cal
Hi Cal,
then I use your change, the user that can't moderate board see "Sorry, you are not authorised to use MODBREAK here" and not the Modbreak that have a moderator wrote.
About your code, you can it write so:
if (empty($legend))
$legend = 'Moderator Comment';
if (!allowedTo('moderate_board'))
return '<span style="color: red;">Sorry, you are not authorised to use MODBREAK here.</span>';
return '<fieldset class="modbreak"><legend>' . $legend . '</legend>' . $content . '</fieldset>';
This is what I get for not testing every permutation. Regular members can't see the MODBREAK.
There is clearly a way to prevent posters from using the modbreak tag. I suspect that if the allowedTo test can be performed where the modbreak tag is defined into 2 arrays, then I can stop regular members from using it.
Here is the MODBREAK BBC definition code in the Subs.php file:
array(
'tag' => 'modbreak',
'type' => 'unparsed_content',
'content' => '$1',
'block_level' => true,
'validate' => create_function('&$tag, &$data, $disabled', '$data = get_modbreak(parse_bbc($data, ' . ($smileys ? 'true' : 'false') . ',\'' . $cache_id . '\'));'),
),
array(
'tag' => 'modbreak',
'type' => 'unparsed_equals_content',
'content' => '$1',
'block_level' => true,
'validate' => create_function('&$tag, &$data, $disabled', '$data[0] = get_modbreak(parse_bbc($data[0], ' . ($smileys ? 'true' : 'false') . ',\'' . $cache_id . '\'), $data[1]);'),
),
I don't know PHP well enough to edit the array entries to add the allowedTo logic.
However, it seems the place to use the allowedTo is on the 'validate' line in the create_function. But just adding 'if (!allowedTo('moderate_board'))' before '$date[0]=' or after it breaks the code, so I know there is a bit more (global allowedTo()?).
Does that make sense? Will this stop people trying to create posts from using MODBREAK but still allow everyone to see the MODBREAK?
I do appreciate all the time you are spending on this.
Grazie,
Cal
Hello Cal,
in the File "./Sources/Subs-Post.php" is a function with name
function preparsecode(&$message, $previewing = false)
The function Parses some bbc before sending into the database.
A other good position is in "./Sources/Post.php".
Search for:
// Check the subject and message.
if (!isset($_POST['subject']) || $func['htmltrim']($_POST['subject']) === '')
$post_errors[] = 'no_subject';
if (!isset($_POST['message']) || $func['htmltrim']($_POST['message']) === '')
$post_errors[] = 'no_message';
elseif (!empty($modSettings['max_messageLength']) && $func['strlen']($_POST['message']) > $modSettings['max_messageLength'])
$post_errors[] = 'long_message';
else
{
// Prepare the message a bit for some additional testing.
$_POST['message'] = $func['htmlspecialchars']($_POST['message'], ENT_QUOTES);
// Preparse code. (Zef)
if ($user_info['is_guest'])
$user_info['name'] = $_POST['guestname'];
preparsecode($_POST['message']); // <-- her is the function, that check BBC-Code !!!!
// Let's see if there's still some content left without the tags.
if ($func['htmltrim'](strip_tags(parse_bbc($_POST['message'], false), '<img>')) === '')
$post_errors[] = 'no_message';
}
How can parse messagetext for modbreak an can generate a errormessage.
When I have time, I show how can eliminate modbreak tag for regular members.
@Cal O'Shaw:
Did you take a look at this mod?
http://www.simplemachines.org/community/index.php?topic=293440.0
Works for me, allowing only moderators to use the modbreak tag.
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]);
}
}
@Mr. Jinx,
That did the trick! Grazie!
So, now...
Aaron, would you consider adding the code to modify Subs-post.php as given in Reply #72 above? It would be greatly appreciated.
Cal
The above code in Reply #72 is good but it doesn't have the additional ability to filter out [modbreak=title] comments.
while (strpos($parts[$i], '[modbreak]') !== false)
$parts[$i] = preg_replace('~\##/]?modbreak\]~i', '', $parts[$i]);
$parts[$i] = preg_replace('~\##/]?modbreak(=[^\]]*)?\]~i', '', $parts[$i]);
Note: the two # symbols should be replaced with [ symbols - the wiki links mod prevented me from posting otherwise.
I understand all that but where in the style.css do you add the code
this part
.modbreak
{
border: 1px solid #000000;
}
.modbreak legend
{
color: #DD0000;
font-weight: bold;
}
Quote from: Arantor on June 02, 2009, 10:49:45 AM
$parts[$i] = preg_replace('~\##/]?modbreak(=[^\]]*)?\]~i', '', $parts[$i]);
Thanks Arantor!
I was looking for a way to restrict non admins or mods using the modbreak tag (I haven't bothered with a button yet). I read through a bunch of posts and thought "there must be an easier way".
Did anyone try this mod - http://custom.simplemachines.org/mods/index.php?mod=449 ? It installed just fine on 1.1.9 (although it says 1.1.2). I simply unticked modbreak from the list of BBCode in the permissions for my main membergroups and that was it. Simple.
Forgive me if this has been discussed already, I didn't notice it.
Blinker - the modifications I mention above do just that.
Was that the subs-post edits? Cool.
The BBC Permissions mod also works for [modbreak=Custom Title] instances and I guess the added benefit is I can use it for any future custom BBC I choose to add.
Quick question Arantor - does the subs-post edit option simply show the unparsed code or does it stop the user with an error message? Stopping them entirely would be preferable so let me know and I may switch to that hack instead.
It strips it, exactly as it would if the user tried to use [ html ] in their post.
Blinker,
Regarding the BBC Permissions MOD... WARNING
The BBC permissions MOD has known bugs:
1) NEVER, EVER click on the 'select all' checkbox. That will DISABLE ALL BBcodes for that group.
2) If you add or remove a MOD that involves permissions, check all groups BY TESTING, not by looking at Permissions, to see if the BBCodes are disabled for one or more groups. If so, you must then uninstall the BBC Permissions MOD, install the MOD that you are adding that uses permissions, and then install the BBC Permissions MOD.
This is why, back at Reply 72, and updated by Arantor's adjustment in Reply 74, you see the work that was done trying to find a way to assign permissions within the MOD itself, rather than using the BBC Permissions MOD (and hoping that when Aaron has the opportunity, he'll integrate this already developed code into the official version of this MOD).
You really do NOT want to use the BBC Permissions MOD unless you have the time to make sure it does not break permissions for other groups whenever you alter any Permissions.
Just trying to save you a lot of pain...
Cal
Hey Cal
Thanks for the heads up. I hate it when things are too good to be true.
In an effort to avoid everything you mentioned I think I'll uninstall the BBC Permissions mod and update the subs code from those posts.
To be honest no one has actually tried to use modbreak, in fact, only those members who may have clicked modify on their posts AFTER I'd used modbreak on it would even know about the tag in the first place. LOL, I guess I was just launching a pre-emptive strike...;)
Thanks
Blinker
how to change the <modbreak></modbreak to just <mod> </mod>
It depends; are you using the basic version of the BBcode as per the mod itself, or are you looking to use the additional tweaks others have included (such as my modification that blocks non-admin and non-moderator use)?
Quote from: Arantor on August 16, 2009, 10:29:00 AM
It depends; are you using the basic version of the BBcode as per the mod itself, or are you looking to use the additional tweaks others have included (such as my modification that blocks non-admin and non-moderator use)?
Urm, i use latest smf 2 version and just installed your modbreak.. customised it a bit though, visually. so not sure at the mo we type <modbreak>fefe</modbreak> but really is long winded.
i want it the same thing just change from <modbreak> to <mod>. i want the mod to work the same, just what we type, different
superb mod btw :)
sorted was in subs.php :) just changed bbc code cheers.
I haven't touched this mod. I simply pointed out a few changes to it that might help stop users abusing it.
The reason I specifically asked if you were using the patches I suggested - that delete the tag should a non-admin/non-mod use it - is because it requires another change elsewhere in SMF's source.
Quote from: Arantor on June 02, 2009, 10:49:45 AM
The above code in Reply #72 is good but it doesn't have the additional ability to filter out [modbreak=title] comments.
$parts[$i] = preg_replace('~\##/]?modbreak(=[^\]]*)?\]~i', '', $parts[$i]);
Note: the two # symbols should be replaced with [ symbols - the wiki links mod prevented me from posting otherwise.
I just noticed that users can still use the [modbreak=message]text[/modbreak] tag.
Should the above preg_replace syntax be the correct one?
Yes. That patch would also fix [modbreak=message] syntax from being broken.
Alternatively, you could try my variation, Moderator and Administrator Comment Tags (http://custom.simplemachines.org/mods/index.php?mod=2104), which creates three tags, [mod], [gmod] and [admin] and gives permissons to each (the first is a board specific permission, for individual board moderators, the other two are general usergroup permisisons), as well as enforcing the permissions in this way.
Quote from: Mr. Jinx on September 28, 2009, 08:26:25 AM
Quote from: Arantor on June 02, 2009, 10:49:45 AM
The above code in Reply #72 is good but it doesn't have the additional ability to filter out [modbreak=title] comments.
$parts[$i] = preg_replace('~\##/]?modbreak(=[^\]]*)?\]~i', '', $parts[$i]);
Note: the two # symbols should be replaced with [ symbols - the wiki links mod prevented me from posting otherwise.
I just noticed that users can still use the [modbreak=message]text[/modbreak] tag.
Should the above preg_replace syntax be the correct one?
Were did i have to put that? Can you write all? Find? Replace?
Quote from: Relemar on August 16, 2009, 03:28:37 PM
sorted was in subs.php :) just changed bbc code cheers.
i wanted that to, my mods cant remember the word modbreak, what did you change exactly in:
// The current time with offset.
function forum_time($use_user_offset = true, $timestamp = null)
{
Add Before: [Selecteer]
// Modbreak function
function get_modbreak($content, $legend = null)
{
global $txt, $settings, $context, $modSettings;
if (empty($legend))
$legend = 'Modbreak';
return '
<fieldset class="modbreak"><legend>' . $legend . '</legend>' . $content . '</fieldset>';
}
Find: [Selecteer]
array(
'tag' => 'white',
'before' => '<span style="color: white;">',
'after' => '</span>',
),
Add After: [Selecteer]
array(
'tag' => 'modbreak',
'type' => 'unparsed_content',
'content' => '$1',
'block_level' => true,
'validate' => create_function('&$tag, &$data, $disabled', '$data = get_modbreak(parse_bbc($data, ' . ($smileys ? 'true' : 'false') . ',\'' . $cache_id . '\'));'),
),
array(
'tag' => 'modbreak',
'type' => 'unparsed_equals_content',
'content' => '$1',
'block_level' => true,
'validate' => create_function('&$tag, &$data, $disabled', '$data[0] = get_modbreak(parse_bbc($data[0], ' . ($smileys ? 'true' : 'false') . ',\'' . $cache_id . '\'), $data[1]);'),
),
Thanx!
Quote from: Welb on November 08, 2009, 11:52:12 AM
Were did i have to put that? Can you write all? Find? Replace?
First take a look at this: http://www.simplemachines.org/community/index.php?topic=141374.msg2073924#msg2073924
And then this reply: http://www.simplemachines.org/community/index.php?topic=141374.msg2090204#msg2090204
I did actually do an updated version that included these fixes, plus made it permissions driven, but in a fit of madness last night I removed it from the mod site. I'll get it re-added ASAP.
I'm removing this mod from the mod site, as I don't have enough time to keep maintaining it, and Arantor's Moderator and Administrator Comment Tags (http://custom.simplemachines.org/mods/index.php?mod=2104) mod is a much more complete alternative anyway.
Thanks to all who've used this mod, and Arantor for developing its successor. :)