Results 1 to 2 of 2

Thread: Add a costum user field in postbit

  1. #1
    Administrator Eqvaliser's Avatar
    Join Date
    Nov 2004
    Location
    Esbjerg, Denmark
    Posts
    351
    Downloads
    19
    Uploads
    29

    Default Add a costum user field in postbit

    1) AdminCP > User Profile Fields > Add new user profile field (click)

    2) Profile field type, (in this case we use single-line text box) > continue

    3) Fill in information you want ; i used as exsample
    ---
    Title : OS
    Description : Operating system
    Profile Field cat. : Uncategorized
    Default value : win
    Max length : 10
    Field length : 25
    Display order : 6
    Title : OS
    Required : No
    Editable : Yes
    Private : No
    On members list : Yes
    Expression :
    Display page : Edit profile


    > save

    4) See what the name of your field is in the colum Name.. fieldX (red x is the number)

    5) Styles and templates > Dropdownbox > Edit templates >
    5a) Postbit Templates >> Postbit (OR) postbit_legacy depending on your forum setup.
    This style on evisystems.org is "postbit_legacy" with userinfo left of the post..

    6) open it, in search enter
    Code:
    {vb:rawphrase join_date}
    and click find.

    below that entire line which ends with </vb:if>
    make a new lin and enter this code
    Code:
    <br /><vb:if condition="$post['fieldX']">OS : {vb:raw post.fieldX}</br></vb:if>
    Replace the red X's with the field number..

    And if you look in the user info to the left you can see the costum user field,
    and can change it in UserCP

    Eqvaliser
    Last edited by Eqvaliser; 22-12-2009 at 10:38 PM.
    Administrator and Creator
    Vb Pc suite 4 - 3D Sculptor (carrara 7 pro)
    Xbox and MS platform - indie game developer

  2. #2
    Administrator Eqvaliser's Avatar
    Join Date
    Nov 2004
    Location
    Esbjerg, Denmark
    Posts
    351
    Downloads
    19
    Uploads
    29

    Default

    Plugin Update.

    If you dont want to Edit your templates, you can add it in a plugin instead.
    also easyer to remove and allows upgrade seamlessly.

    After you have created your costum userfield from the post above..
    Head to

    AdminCP > Plugins & Products > Add New Plugin

    Add following :








    Product : vbulletin (or costum)
    Hook : postbit_display_complete
    Title : Costum OS field
    Execution Order : 5, or whatever you prefer
    Plugin php code :
    Code:
    if (!empty($post["fieldX"]))
    {
    $template_hook['postbit_userinfo_right_after_posts'] .=
     '<dd>' . 'Test : ' . $post["fieldX"] . '</dd>';
    }
    Plugin active : Yes


    And your all set, head to a forumpost and see how it looks..
    Look in the left, the "Test : Testcontent" is added via plugin.

    Enjoy.
    Last edited by Eqvaliser; 22-12-2009 at 10:38 PM.
    Administrator and Creator
    Vb Pc suite 4 - 3D Sculptor (carrara 7 pro)
    Xbox and MS platform - indie game developer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •