Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: MoonCat on January 19, 2020, 06:53:54 PM

Title: custom bbc tag 'only_members'
Post by: MoonCat on January 19, 2020, 06:53:54 PM
Hi SMF developers,

I have created bbc tag 'only_members' which hides parts of the text from the guest (inviting them to register) or showing the whole text for the registered members. The problem is that within those tags I can't include other tags, as the content is unparsed.

here is the relevant code:

        array(
                'tag' => 'only_members',
                'type' => 'unparsed_content',
                'content' => $context['user']['is_logged'] ? '$1' : '<br /><span class="topslice"><span></span></span> <div class="padding">' . $txt['guestview_not_allowed'] . '</div>
<span class="botslice"><span></span></span>',
        ),


any ideas, how I can control the content, but at the same time get it parsed?

Thanks
Title: Re: custom bbc tag 'only_members'
Post by: MoonCat on July 25, 2020, 07:24:11 PM
No ideas or no solution here? I'd really appreciate someone's thoughts on the topic!
Title: Re: custom bbc tag 'only_members'
Post by: shadav on July 25, 2020, 08:18:32 PM
sorry I can't really help other than to say try and look at how other bbcode mods work....

also this mod might be more useful to you
https://custom.simplemachines.org/mods/index.php?mod=2861
Title: Re: custom bbc tag 'only_members'
Post by: MoonCat on July 26, 2020, 10:14:08 PM
Thanks, Shadav!
I reviewed practically all BBCode mods but didn't find any that somewhat resembles my problem.
Anyway, appreciate your attention!
Title: Re: custom bbc tag 'only_members'
Post by: Arantor on July 27, 2020, 11:59:28 AM
Um, change the type to parsed_content?