Adding extra note to "Your PM box is 90% full." for certain user group only?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jdebler
    Member
    • May 2001
    • 49

    Adding extra note to "Your PM box is 90% full." for certain user group only?

    Here's what I want to do and I am having a hard time making it work right.

    When a member of a certain user group sees the "Your PM box is XX% full" message, I want to add a quick note under it reminding them why.

    So, here is the code in the navbar that I tried using but for some reason I cannot get it to work right...

    Code:
    <if condition="$show['pmwarning'] AND is_member_of($post, 2)"><br />
    	<strong><phrase 1="$vbphrase[pmpercent_nav_compiled]">$vbphrase[your_pm_box_is_x_full]</phrase></strong><br />
    	<a href="/link_to_explanation.html">(Why am I seeing this?)</a>
    <else />
    	<if condition="$show['pmwarning']"><br /><strong><phrase 					
    	1="$vbphrase[pmpercent_nav_compiled]">$vbphrase[your_pm_box_is_x_full]</phrase></strong>
    </if>
    What am I doing wrong or what am I missing? Thanks!
    -Jason
  • Jake Bunce
    Senior Member
    • Dec 2000
    • 46598
    • 3.6.x

    #2
    Your code looks ok to me. Note that the warning is only shown if your PM box is at least 90% full. If you are trying to test this then you need a user with an almost full inbox.

    Comment

    • jdebler
      Member
      • May 2001
      • 49

      #3
      Originally posted by Jake Bunce
      Your code looks ok to me. Note that the warning is only shown if your PM box is at least 90% full. If you are trying to test this then you need a user with an almost full inbox.
      Thanks for the reply. Yep, I am trying it on a test account with a 90% full PM box.

      I just realized that I forgot an additional < /if> statement at the end of the above code, but when I fix it and apply it, the extra line still doesn't show up, although the "Your PM box is 90% full." still does.

      I did some testing, and I discovered something...

      When using this code...

      Code:
      <if condition="$show['pmwarning'] AND is_member_of($post, 2)"><br />
        <strong>MESSAGE 1</strong><br />
      <else />
      <if condition="$show['pmwarning']"><br />
        <strong>MESSAGE 2</strong>
      </if>
      </if>
      Only MESSAGE 2 shows up. I'll bet this is something very simple that I am missing. Is my is_member_of($post, 2) (with 2 being the user group ID that I want the extra line to be shown to) the proper way to do it? I could swear I have seen an alternate way of doing it once, but I may be mistaken.

      Thanks again!
      -Jason

      Comment

      • peterska2
        Senior Member
        • Oct 2003
        • 8869
        • 3.7.x

        #4
        Personally I would do it like this.....

        Replace

        Code:
        <if condition="$show['pmwarning']"><div><strong><phrase 1="$vbphrase[pmpercent_nav_compiled]">$vbphrase[your_pm_box_is_x_full]</phrase></strong></div></if>
        with

        Code:
        <if condition="$show['pmwarning']"><div><strong><phrase 1="$vbphrase[pmpercent_nav_compiled]">$vbphrase[your_pm_box_is_x_full]</phrase></strong></div>
        [COLOR=Red] <if condition="is_member_of($usergroupid, 2)"><div class="smallfont">
        <a href="/link_to_explanation.html">(Why am I seeing this?)</a></div></if>
        [/COLOR]</if>
        The red bit is the added code.

        Comment

        • jdebler
          Member
          • May 2001
          • 49

          #5
          Thanks Kerry-Anne, but I tried that as well and the extra added line does not display. I checked and rechecked that the test user account that I am using this for and it is indeed user group ID 2. This doesn't make any sense, I am surely missing somethat that I fear I will be slightly embarrassed about soon... I'll keep working on it.
          -Jason

          Comment

          • Jake Bunce
            Senior Member
            • Dec 2000
            • 46598
            • 3.6.x

            #6
            Is this in the navbar? Are you wanting to check the currently logged in user? In that case you need to use $bbuserinfo instead of $post:

            Code:
            is_member_of($bbuserinfo, 2)

            Comment

            • jdebler
              Member
              • May 2001
              • 49

              #7
              Originally posted by Jake Bunce
              Is this in the navbar? Are you wanting to check the currently logged in user? In that case you need to use $bbuserinfo instead of $post:

              Code:
              is_member_of($bbuserinfo, 2)
              AH! That did it. Thanks to all!

              What is the difference between is_member_of($post, 2) like I was originally trying to use (which I use elsewhere on my board in the postbit) and is_member_of($bbuserinfo, 2) that worked in this case? Is the $bbuserinfo used when it is only shown to the logged in user and the $post used when everyone can see it?
              -Jason

              Comment

              • Jake Bunce
                Senior Member
                • Dec 2000
                • 46598
                • 3.6.x

                #8
                $bbuserinfo is the current logged in user. $post is the post author.

                Comment

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