custom bbc tag 'only_members'

Started by MoonCat, January 19, 2020, 06:53:54 PM

Previous topic - Next topic

MoonCat

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

MoonCat

No ideas or no solution here? I'd really appreciate someone's thoughts on the topic!

shadav

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

MoonCat

Thanks, Shadav!
I reviewed practically all BBCode mods but didn't find any that somewhat resembles my problem.
Anyway, appreciate your attention!

Arantor

Um, change the type to parsed_content?

Advertisement: