Need some help. Probably easy. PostBit? UserGroups?

Discussion in 'vBulletin Discussions' started by Runekeep, Feb 22, 2010.

  1. Runekeep

    Runekeep Newcomer

    Joined:
    Feb 22, 2010
    Messages:
    10
    Likes Received:
    0
    Hi, I'm new here and to vBulletin. I am using vBulletin 4.0.2. I find it somewhat confusing but I'm making little progress. My issue evolves around two things, which, for one, I know works for my IPB board, but doesn't seem to work on the vBulletin board, but I could just be stupid. So, hopefully someone can shed some light on this for me. I am running this on a closed network using localhost, just so you know.

    Problem 1:

    After setting up a usergroup, such as Donator for example. I am trying to use one of the usergroup images sets, that I got from here. I go down to
    Code:
    User Title (Use this to override the default 'ladder' of user_title)
    
    and enter the following.
    HTML:
    <img src="http://localhost/png/donator.png">
    but yet, no image appears for the usergroup inside posts or their profiles, however when I add it straight to the "Title" box, it displays it as my usergroup name in AdminCP. So, instead of it using a "Name - Text Field" I want it to use the "Image Field". Thanks in advance.

    Problem 2:

    How do I go about adding in different postbits to the user information box inside of posts; such as, right now it has Posts:, Reputation:, and so on so fourth. I need to add in custom integer field that calls from the database such as; this for exsample, Character Level: then have it add in my integer for that field which is saved inside my database, I pretty much want it to do the same thing as how it counts up posts and displays them. Using a postbit field to display the integer. Also, I have created new database tables in my vbulletin database, the one I need called is the "accounts" table, which is where the information I need called is stored. Thinking it would be something like this in postbit_legacy, but it doesn't display the integer and only displays

    Combat Level: $post[combat_lvl]


    Code:
        <accounts:if condition="$show['combat_lvl']">
    Character Level: $show[combat_lvl]
    </accounts:if>
    awww.adminaddict.net_data_MetaMirrorCache_fef27171240dca08a8ee9320936555b4.jpg
    Thanks in advance.

    I hope I explained my problems good enough :(
     
  2. Runekeep

    Runekeep Newcomer

    Joined:
    Feb 22, 2010
    Messages:
    10
    Likes Received:
    0
    I fixed problem 1, now I need getting problem 2 solved. I've read docs and everything relating to postbits, but yet, my problem still persists. Any help is appreciated.

    OT: I would have edited my original post, but the edit button is not there no more.
     
  3. Abomination

    Abomination Zealot

    Joined:
    Jun 1, 2009
    Messages:
    1,514
    Likes Received:
    102
    I'd like to help, but do not know how those things work. Hopefully someone else will help out.

    Just wanted to make sure you knew someone was reading your thread.
     
    2 people like this.
  4. Runekeep

    Runekeep Newcomer

    Joined:
    Feb 22, 2010
    Messages:
    10
    Likes Received:
    0
    Thanks, however, I'm still unable to get it to read the proper information, I know the db field is "accounts" and I'm calling that field, but I'm missing something that makes it show correctly. I do know the field is working, as if I do like

    Code:
    <vb:if condition="$show['combat_lvl']">
    Character Level: $show[combat_lvl]
    </vb:if>
    The field doesn't show up in postbit period. No text, no nothing. But by adding

    Code:
    <accounts:if condition="$show['combat_lvl']">
    Character Level: $show[combat_lvl]
    </accounts:if>
    It now displays it in the post bit, but it's not displaying the integer and only the code for the integer ($show combat_lvl). So, there's a problem with it reading the integer. I know I'm missing something, but i don't know what it can be. I'm really new with vBulletin. Problem wouldn't be having this problem if I was using IPB lol, but I need to get familiar with this software and be able to do everything I can on it as I can with IPB.
     
  5. Runekeep

    Runekeep Newcomer

    Joined:
    Feb 22, 2010
    Messages:
    10
    Likes Received:
    0
    Still looking for help. Don't mean to double post. Any help would be appreciated.
     
  6. Webmist

    Webmist Champion

    Joined:
    Jan 30, 2008
    Messages:
    305
    Likes Received:
    18
    Location:
    US
    First Name:
    Jen
    It would be better to add the field in ACP->User Profile Fields--> Add New Profile Field. This is assuming if the member has access to edit their character level. Then this.

    <vb:if condition="$post['fieldX']">
    Character Level: $post[fieldX]
    </vb:if>

    Where X is the number of the field. That's how the rank, rep, and other custom fields work in vB.
     
  7. Webmist

    Webmist Champion

    Joined:
    Jan 30, 2008
    Messages:
    305
    Likes Received:
    18
    Location:
    US
    First Name:
    Jen
    As an added bonus to the above you can have only certain profile field be displayed for certain usergroups.

    Code:
     
    <vb:if condition="is_member_of($bbuserinfo, 1,2,3)">Character Level: $post[fieldX]
    </vb:if>
    
    Where the number represents the usergroup id.
     
  8. Ryan Ashbrook

    Ryan Ashbrook Regular Member

    Joined:
    Jun 29, 2009
    Messages:
    343
    Likes Received:
    25
    Location:
    Cincinnati, Ohio
    You need to be using the new way vB handles variables within a template.

    So, in the code posted above replace $post[fieldx] with {vb:raw post.fieldx}

    Note: This does not apply when being used inside <vb:if>
     
  9. Runekeep

    Runekeep Newcomer

    Joined:
    Feb 22, 2010
    Messages:
    10
    Likes Received:
    0
    Thank you guy's very much for the responses, I will test it out and reply with the results.
     
  10. Runekeep

    Runekeep Newcomer

    Joined:
    Feb 22, 2010
    Messages:
    10
    Likes Received:
    0
    My edit button keeps disappearing lol. Anyhow. It does exactly as you said and does work, but I need it to called the character level from the database without the user manually adding it in, as there character level in game can be 10, but the user can enter 60. the question is, How can I get the character information to pull from the database and display it into the postbit? such as how it does with posts.
     

Share This Page