Profile field's

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gardarika
    Member
    • Apr 2009
    • 88

    Profile field's

    How to make visible the profile field's under avatar, in the left side of posting?
  • Mark.B
    vBulletin Support
    • Feb 2004
    • 24287
    • 6.0.X

    #2
    THIS article shows you how to do that in vB5.
    MARK.B
    vBulletin Support
    ------------
    My Unofficial vBulletin 6.0.0 Demo: https://www.talknewsuk.com
    My Unofficial vBulletin Cloud Demo: https://www.adminammo.com

    Comment

    • Gardarika
      Member
      • Apr 2009
      • 88

      #3
      Where in new conversation template I should put the code for the field's in profile?

      And for the version 5.1. I haven't found on the server the file text.php, there was only content.php.

      Comment

      • Mark.B
        vBulletin Support
        • Feb 2004
        • 24287
        • 6.0.X

        #4
        You don't need to worry about the code fix part of the post.....it's obsolete.

        These are the bits you need to worry about:

        First make sure your hook system is active (it is turned off by default). Go to Admincp > Settings > Products/Hook System > Enable/Disable Hook System > Yes.

        Now, go to Admincp > Products & Hooks > Manage Hooks and click the link that says "[Add New Hook]". In that new hook, set the following:
        Hook is Active: Yes
        Hook Location: conversation_userstats
        Title: Show Profile Fields in Postbit
        Template Name: conversation_fields
        Hook Arguments: conversation=conversation
        SAVE

        Now go to Admincp > Styles & Templates > Style Manager > Add New Template and on that page, set the following:
        Title: conversation_fields
        Template:
        Code:
        {vb:data userInfo, user, fetchProfileInfo, {vb:raw conversation.userid}}


        For each field you want shown, you will need to add this code under that line:
        Code:
        <vb:if condition="$userInfo['fieldX']"><li><label>{vb:phrase fieldX_title}:</label> <span>{vb:raw userInfo.customFields.default.fieldX_title.val}</span></li></vb:if>


        Replace the X in "FieldX" (three times) with the fieldid and, if your field is in a Category other than Uncategoried, then replace "default" with "categoryY_title" where Y is the category id.

        So, for instance, say I have the following I want to add:
        Name Category
        field5 (uncategoried)
        field7 New Cat(id 1)


        Then my template would look like this:
        Code:
        {vb:data userInfo, user, fetchProfileInfo, {vb:raw conversation.userid}}
        
        <vb:if condition="$userInfo['field5']"><li><label>{vb:phrase field5_title}:</label> <span>{vb:raw userInfo.customFields.default.field5_title.val}</span></li></vb:if>
        
        <vb:if condition="$userInfo['field7']"><li><label>{vb:phrase field7_title}:</label> <span>{vb:raw userInfo.customFields.category1_title.field7_title.val}</span}</li></vb:if>


        That's it!
        MARK.B
        vBulletin Support
        ------------
        My Unofficial vBulletin 6.0.0 Demo: https://www.talknewsuk.com
        My Unofficial vBulletin Cloud Demo: https://www.adminammo.com

        Comment

        • Gardarika
          Member
          • Apr 2009
          • 88

          #5
          All above I understood, I don't understand where to write this code...

          Comment

          • Mark.B
            vBulletin Support
            • Feb 2004
            • 24287
            • 6.0.X

            #6
            The details are all in the instructions. There's two parts to it: adding a hook, and adding a new template.

            The new template is called conversation_fields, and you put the code in that it states in the instructions.

            You need to replace x in the code with the id of your profile field, which you can find by looking in the profile field manager.
            The original link I posted has some screenshots about finding the id number.

            There is an example bit of code in the instructions too.
            MARK.B
            vBulletin Support
            ------------
            My Unofficial vBulletin 6.0.0 Demo: https://www.talknewsuk.com
            My Unofficial vBulletin Cloud Demo: https://www.adminammo.com

            Comment

            • Gardarika
              Member
              • Apr 2009
              • 88

              #7
              I've got new template 'conversation_fields' completely like default template, concerning of the content. Which subtitle in new template I should choose to write there the code.

              Here is a part of my code:

              {vb:data userInfo, user, fetchProfileInfo, {vb:raw conversation.userid}}


              <vb:if condition="$userInfo['field4']"><li><label>{vbhrase field4_Beruf}:</label> <span>{vb:raw userInfo.customFields.default.field4_Beruf.val}</span></li></vb:if>

              <vb:if condition="$userInfo['field7']"><li><label>{vbhrase field7_Weltanschauung}:</label> <span>{vb:raw userInfo.customFields.default.field7_Weltanschauung.val}</span></li></vb:if>

              <vb:if condition="$userInfo['field8']"><li><label>{vbhrase field8_Politische Ansichten}:</label> <span>{vb:raw userInfo.customFields.default.field8_Politische Ansichten.val}</span></li></vb:if>

              Comment

              • Gardarika
                Member
                • Apr 2009
                • 88

                #8
                Here is the template conversation_fields.

                Comment

                • Gardarika
                  Member
                  • Apr 2009
                  • 88

                  #9
                  I've resolved the problem with help of a mod from Glenn.

                  Comment

                  • glennrocksvb
                    Former vBulletin Developer
                    • Mar 2011
                    • 4020
                    • 5.7.X

                    #10
                    Originally posted by Gardarika
                    I've resolved the problem with help of a mod from Glenn.
                    I assume it was my mod If so, I'm glad it helped you. For those who wants the same, you can go to vb org at

                    Show Thread Enhancements - [vBMods.rocks] Add Custom Profile Fields in Postbit vBulletin 5.x Products & Extensions


                    and also in my site

                    By default, vBulletin 5 only displays the Join Date and Post count in the postbit area (avatar and username section) in the thread view of a topic. There may be other tutorials out there to add custom fields in postbit but some require you to edit the existing postbit template. Editing existing templates is not good for


                    The mod does not require editing existing templates. You just have to upload the XML file and configure what custom fields to show and you're done.


                    Flag Icon Postbit Insert GIPHY Impersonate User BETTER INITIALS AVATAR Better Name Card Quote Selected Text Bookmark Posts Post Footer Translate Stop Links in Posts +MORE!

                    Comment

                    • Gardarika
                      Member
                      • Apr 2009
                      • 88

                      #11
                      Yes, Glenn, it was your mod from your site. Thank you for the mod!

                      Comment

                      Related Topics

                      Collapse

                      Working...