Announcement

Collapse
No announcement yet.

Show/hide information in threadbit

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Show/hide information in threadbit

    Is it possible with a template conditional tag to hide or show certain parts of threadbit based on the poster's usergroupid?

    To be more specific, I want to show some text, but only if the user is not in my Banned by Moderators usergroup (usergroupid 8). What would be the left-hand side of the condition?
    Code:
    <if condition="[i]value[/i] != 8">
    ...
    </if>
    --filburt1, vBulletin.org/vBulletinTemplates.com moderator
    Web Design Forums.net: vB Board of the Month
    vBulletin Mail System (vBMS): webmail for your forum users

  • #2
    Hi there, yeah - you can use a if condtional to include or exclude code from the threadbit template.

    The value part would be for $bbuserinfo[]
    And if you want the user who browses that page who is banned not to see threads, you can exclude them with != (is not) and their match against usergroupid 8.

    <if condition="$bbuserinfo['usergroupid'] != 8">If the user who browses is not a member of usergroup with usergroup id 8, they can see this text</if> .. and therefor if he is, they won't see what is inside the conditional.

    You can expand this with <else /> to control that.

    <if condition="$bbuserinfo['usergroupid'] != 8">Thread title<else />*</if>

    The banned user will see *


    You could use such a conditional in situations where you want banned users to view the thread titles, but not the details. Not even being able to click on a link.

    <if ..><a href="link to thread">thread title</a><else />thread title</if>

    Not banned: Thread title
    Banned: Thread title

    Comment


    • #3
      I mean if the person who made the post is banned, not the currently logged in user.
      --filburt1, vBulletin.org/vBulletinTemplates.com moderator
      Web Design Forums.net: vB Board of the Month
      vBulletin Mail System (vBMS): webmail for your forum users

      Comment


      • #4
        Huuum, $post['usergroupid'] instead ?

        Comment


        • #5
          This is for forumdisplay, and I believe the only useful big array there is $thread (and $forum). The keys postusergroupid and usergroupid are not set.
          --filburt1, vBulletin.org/vBulletinTemplates.com moderator
          Web Design Forums.net: vB Board of the Month
          vBulletin Mail System (vBMS): webmail for your forum users

          Comment

          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
          Working...
          X