No announcement yet.

is_member_of Problem

  • Filter
  • Time
  • Show
Clear All
new posts

  • is_member_of Problem

    So I am using a bunch of conditionals in my postbit_legacy that show titles based on usergroup. As well as a couple icons and menus based on usergroup.

    "is_member_of($post,35)" and "is_member_of($post,32,6,27)" etc (inside <IF statements of course)

    Herein lies the problem. This works excellent in the general forum posts however, if I receive a PM from someone their titles and icons are MY titles and icons. So VB is showing me what my titles are and not the sender. I looked around a bit and I am unsure what the solution would be - anyone encountered this before?

    I would assume (although I have not tried) the same thing would happen in USERINFO if I posted it there.

  • #2
    It sounds like you are using $bbuserinfo[] when you should be using $post[].


    • #3
      You mean the other way around? I am using $post for the template.


      • #4
        When I replace $post with $bbuserinfo it then shows me MY information on everyone's post even outside of PM.

        Inside the PM it shows me my own information when someone sends me a PM as well. Is there a variable somewhere that does not rely on the post information? PM isn't really a post.


        • #5
          $post[] contains the information of the post author, not the logged in user. I cannot explain the problem otherwise. Can you post the entire block of code that you are using? Not just the conditional pieces.


          • #6
            Last edited by Hamma; Thu 11th Jan '07, 7:49pm.


            • #7
              It is difficult to troubleshoot this problem when the code uses variables that are defined elsewhere, possibly with different scopes. I cannot see any obvious problems without getting in there and systematically troubleshooting specific pieces of code. I recommend you post on if you need help with this custom code.


              • #8
                I have gone that route also but where this is built in stuff it doesn't make much sense. I have also tried by just manually inserting that code and not using the Variables too.


                • #9
                  Way to pass the buck. It's obivously a bug in the code, is there another variable I can use to determine poster/senders group? I am using all built in vB variables.


                  • #10
                    Jake, here is the process.

                    1. Created a custom template, template_info.

                    template_info contains:
                    <if condition="is_member_of($post,6)">Staff,</if>
                    <if condition="is_member_of($post,18)">Supporter,</if>
                    <if condition="is_member_of($post,25)">Supporter++,</if>
                    <if condition="$post[field17] == 'VS'">VS,</if>
                    <if condition="$post[field17] == 'TR'">TR,</if>
                    <if condition="$post[field17] == 'NC'">NC,</if>
                    <if condition="$post[field29] == 'true' && is_numeric($post[field20]) && is_numeric($post[field19])">Played,</if>
                    <if condition="$post[field31] == 'true' && $post[field30] != 'no'">TS,</if>
                    <if condition="is_member_of($post,30,31)">Donated</if>
                    2. Created plugin, postbit_display_start

                    eval('$psu_info = "' . fetch_template('template_info') . '";');
                    3. Edit postbit_legacy include $psu_info.

                    Now this works normally in general forums, however when you view a pm is_member_of returns your own info.

                    This is all within the scope of the vBulletin software.
                    Me: Gryphon | My vBulletin Hacks
                    Sites: Allied Tribal Forces | The Hounds of Zeus | PlanetSide-Universe


                    • #11
                      Originally posted by Blackjack View Post
                      Now this works normally in general forums, however when you view a pm is_member_of returns your own info.

                      This is all within the scope of the vBulletin software.
                      I just tested this on my test forum. It does not return your own info, but rather it returns the info of the PM author.

                      I cannot confirm your bug report.


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