• Welcome to Simple Machines Community Forum. Please login or sign up.
December 04, 2021, 07:33:24 PM

News:

SMF 2.1 RC4 has been released! Try it out and help us test! :) Read more.


Modbreak tag

Started by Aaron, January 10, 2007, 12:43:06 PM

Previous topic - Next topic

Arantor

It strips it, exactly as it would if the user tried to use [ html ] in their post.
No good deed goes unpunished
All helpful urges should be circumvented

Cal O'Shaw

July 06, 2009, 01:02:47 AM #81 Last Edit: July 06, 2009, 01:52:02 AM by Cal O'Shaw
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

Blinker

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

Relemar

how to change the <modbreak></modbreak to just <mod> </mod>

Arantor

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)?
No good deed goes unpunished
All helpful urges should be circumvented

Relemar

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 :)

Relemar

sorted was in subs.php :) just changed bbc code cheers.

Arantor

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.
No good deed goes unpunished
All helpful urges should be circumvented

Mr. Jinx

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.
Code (replace with) Select

$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?

Arantor

Yes. That patch would also fix [modbreak=message] syntax from being broken.

Alternatively, you could try my variation, Moderator and Administrator Comment Tags, 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.
No good deed goes unpunished
All helpful urges should be circumvented

simplebeer

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.
Code (replace with) Select

$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!
Sorry for my poor English, but i think it's probably better then your Dutch :)


Arantor

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.
No good deed goes unpunished
All helpful urges should be circumvented

Aaron

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 mod is a much more complete alternative anyway.

Thanks to all who've used this mod, and Arantor for developing its successor. :)

Advertisement: