Advertisement:

Author Topic: Modbreak tag  (Read 49181 times)

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Modbreak tag
« Reply #80 on: July 05, 2009, 07:48:14 AM »
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

Offline Cal O'Shaw

  • Full Member
  • ***
  • Posts: 444
  • SMF 1.1.14 & 2.0 Sites
Re: Modbreak tag
« Reply #81 on: July 06, 2009, 01:02:47 AM »
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
« Last Edit: July 06, 2009, 01:52:02 AM by Cal O'Shaw »

Offline Blinker

  • Full Member
  • ***
  • Posts: 472
  • Gender: Male
Re: Modbreak tag
« Reply #82 on: July 06, 2009, 02:56:34 AM »
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

Offline Relemar

  • Full Member
  • ***
  • Posts: 406
Re: Modbreak tag
« Reply #83 on: August 16, 2009, 10:12:33 AM »
how to change the <modbreak></modbreak to just <mod> </mod>

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Modbreak tag
« Reply #84 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)?
No good deed goes unpunished
All helpful urges should be circumvented

Offline Relemar

  • Full Member
  • ***
  • Posts: 406
Re: Modbreak tag
« Reply #85 on: August 16, 2009, 03:01:37 PM »
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 :)

Offline Relemar

  • Full Member
  • ***
  • Posts: 406
Re: Modbreak tag
« Reply #86 on: August 16, 2009, 03:28:37 PM »
sorted was in subs.php :) just changed bbc code cheers.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Modbreak tag
« Reply #87 on: August 16, 2009, 04:07:49 PM »
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

Offline Mr. Jinx

  • Full Member
  • ***
  • Posts: 475
  • Gender: Male
    • Ziggo Forum Chelloo
Re: Modbreak tag
« Reply #88 on: September 28, 2009, 08:26:25 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?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Modbreak tag
« Reply #89 on: September 28, 2009, 08:28:40 AM »
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

Offline simplebeer

  • Jr. Member
  • **
  • Posts: 311
  • Gender: Male
Re: Modbreak tag
« Reply #90 on: November 08, 2009, 11:52:12 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?

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:

Code: [Select]
// 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 :)

Offline Mr. Jinx

  • Full Member
  • ***
  • Posts: 475
  • Gender: Male
    • Ziggo Forum Chelloo
Re: Modbreak tag
« Reply #91 on: November 08, 2009, 02:34:12 PM »

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Modbreak tag
« Reply #92 on: November 08, 2009, 02:36:17 PM »
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

Offline Aaron

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,711
  • Gender: Male
    • Aaronweb.net
Re: Modbreak tag
« Reply #93 on: November 09, 2009, 02:14:46 PM »
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. :)