Advertisement:

Author Topic: custom bbc tag 'only_members'  (Read 787 times)

Offline MoonCat

  • Newbie
  • *
  • Posts: 9
custom bbc tag 'only_members'
« 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:

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

Offline MoonCat

  • Newbie
  • *
  • Posts: 9
Re: custom bbc tag 'only_members'
« Reply #1 on: July 25, 2020, 07:24:11 PM »
No ideas or no solution here? I'd really appreciate someone's thoughts on the topic!


Offline MoonCat

  • Newbie
  • *
  • Posts: 9
Re: custom bbc tag 'only_members'
« Reply #3 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!

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 72,951
Re: custom bbc tag 'only_members'
« Reply #4 on: July 27, 2020, 11:59:28 AM »
Um, change the type to parsed_content?