Announcement

Collapse
No announcement yet.

Add Custom Profile Fields in Postbit

Collapse
X
Collapse
First Prev Next Last
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Free Mod Add Custom Profile Fields in Postbit

    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 maintenance reasons as you would have to resolve template merge conflicts every time you upgrade. Or some might require you to create a template hook and repeatedly copy/paste template code for adding multiple fields and change instances of profile field variable names. Another maintenance nightmare.

    Don't look any further, here's the mod that is simple but rocks! Simply download the zip file, uncompress it and upload the XML in AdminCP > Products & Hooks > Manage Products > [Add/Import Product] and you're good to go. By default, it adds Location and Occupation profile fields. You can configure what profile fields to add in AdminCP > Settings > Options > Custom Profile Fields in Postbit Settings.

    As a bonus, the mod also adds "Send PM" link to the postbit to make it easier for users to send a private message to a user while reading a thread. You can also configure that in the Custom Profile Fields in Postbit Settings.

    Demo:
    Look at the postbit section on this thread.

    Upgrade Instructions:
    If you are upgrading this mod from an older version, choose Yes in the "Allow Overwrite" radio button when importing the XML file.

    Customizations:
    To add the existing envelope icon in the default icon sprite image to the Send PM link, add the below custom CSS in css_additional template in AdminCP or in Sitebuilder > Style > CSS Editor.
    Code:
    .send-pm-in-postbit:before {
        content: '';
        width: 15px;
        height: 14px;
        position: relative;
        bottom: -1px;
        background: transparent url('images/css/sprite_icons_vb_ltr.png') no-repeat scroll -16px -176px;
        display: inline-block;
        margin-right: 3px;
    }
    For dark colored themes, you can use the light colored envelope icon by changing -16px to 0 in the background value above.

    [Feb 21, 2022 Update]: The sprite image containing all the icons used in vB5 has changed since this mod was posted. That's why the image icon will not show up using the sprite_icons_vb_ltr.png image path in the above code. To find where the new location of the sprite image file is, right-click any of the icons on your forum and then choose Inspect. Observe the background used and locate the image path inside the "url(" and ")". Copy that path and use it to replace the image path in the above code.

    Version History:
    v1.1
    • Added rel="nofollow" to Send PM link to prevent search engines to follow the link and get Access denied error.
    v1.0
    • Initial version.

    NOTE: With recent updates from vBulletin 5, you can now show profile fields on postbit without a third-party plugin. This is done by setting "Show on Post" to Yes when creating/updating a profile field in the User Profile Field Manager and it will show on postbit.

    But if you want to show icons instead of text, then you still need a plugin to do that. I just released new mods for displaying
    Gender icons and Country Flag icons on postbit.​
    Attached Files
    Last edited by glennrocksvb; 01-21-2023, 08:41 PM.
    Helpful? Donate. Thanks!
    Buy me a coffeePayPal QR Code
    Fast VPS Host for vBulletin:
    A2 Hosting & IONOS

    #2
    I got database errors! Please help… Problems with posting!

    1) with photos

    Database error in vBulletin 5.2.2:

    Invalid SQL:
    INSERT INTO closure (`parent`,`child`,`depth`,`publishdate`)
    VALUES(38,38,0,1469506299)
    /**closure**/;

    MySQL Error : Duplicate entry '38-38' for key 'closure_uniq'
    Error Number : 1062
    Request Date : Tuesday, July 26th 2016 @ 06:11:39 AM
    Error Date : Tuesday, July 26th 2016 @ 06:11:39 AM
    Script : http:///forums/create-content/gallery
    Referrer : http://wfcfotovisie.be/forums/new-content/19
    IP Address : <removed>
    Username : <removed>
    Classname : vB_Database_MySQLi
    MySQL Version : 5.6.23

    2) With text only

    Database error in vBulletin 5.2.2:

    Invalid SQL:
    INSERT INTO closure (`parent`,`child`,`depth`,`publishdate`)
    VALUES(44,44,0,'1469507583')
    /**closure**/;

    MySQL Error : Duplicate entry '44-44' for key 'closure_uniq'
    Error Number : 1062
    Request Date : Tuesday, July 26th 2016 @ 06:33:03 AM
    Error Date : Tuesday, July 26th 2016 @ 06:33:03 AM
    Script : http:///forums/create-content/text/
    Referrer : http://wfcfotovisie.be/forums/new-content/16
    IP Address : <removed>
    Username : <removed>
    Classname : vB_Database_MySQLi
    MySQL Version : 5.6.23
    Last edited by glennrocksvb; 07-25-2016, 10:30 PM. Reason: Removed server info for security reasons

    Comment


      #3
      Uninstalled the MOD...

      Restarted with a fresh install ==> no errors were reported now. Seems to be ok now

      Comment


        #4
        Glad you figured it out.

        The database error seems to be related to something else and not to this mod.

        Btw, I removed something from your posted SQL error as you posted too much information.
        Helpful? Donate. Thanks!
        Buy me a coffeePayPal QR Code
        Fast VPS Host for vBulletin:
        A2 Hosting & IONOS

        Comment


          #5
          Installed and working thanks Glenn.
          Btw do you have any plans Glenn to add the option into your mod to add both images and text so that we can put for example a country flag or a gender image in the postbit?

          Comment


            #6
            Originally posted by Megabink View Post
            Installed and working thanks Glenn.
            Btw do you have any plans Glenn to add the option into your mod to add both images and text so that we can put for example a country flag or a gender image in the postbit?
            Thanks for using my mod. Please make a request for that in the New Modification Requests/Suggestions forum and I'll think about it.
            Helpful? Donate. Thanks!
            Buy me a coffeePayPal QR Code
            Fast VPS Host for vBulletin:
            A2 Hosting & IONOS

            Comment


              #7
              Ok will do buddy.

              Comment


                #8
                Thanks for this mod !
                possible to make it show reputation ?

                Comment


                  #9
                  Originally posted by Kira86 View Post
                  ossible to make it show reputation ?
                  Which reputation you were referring to?
                  Helpful? Donate. Thanks!
                  Buy me a coffeePayPal QR Code
                  Fast VPS Host for vBulletin:
                  A2 Hosting & IONOS

                  Comment


                    #10
                    Originally posted by glennrocksvb View Post
                    Which reputation you were referring to?
                    Hi this

                    and is it possible to rename the reputation to something else ?

                    Comment


                      #11
                      Those orange bars in postbit represent the reputation of the user.
                      Helpful? Donate. Thanks!
                      Buy me a coffeePayPal QR Code
                      Fast VPS Host for vBulletin:
                      A2 Hosting & IONOS

                      Comment


                        #12
                        Originally posted by glennrocksvb View Post
                        Those orange bars in postbit represent the reputation of the user.
                        yup
                        i wanted to create something like a virtual currency using the reputation points.
                        so users can see it

                        Comment


                          #13
                          Originally posted by Kira86 View Post

                          yup
                          i wanted to create something like a virtual currency using the reputation points.
                          so users can see it
                          Yes it is possible to get the reputation points of a user in postbit. I could add this functionality on top of this mod but this will require a custom mod for you that fits exactly to your needs. Let's discuss in PM.
                          Helpful? Donate. Thanks!
                          Buy me a coffeePayPal QR Code
                          Fast VPS Host for vBulletin:
                          A2 Hosting & IONOS

                          Comment


                            #14
                            Hi Glenrocksvb I just registered and confirmed through email, but still lack the ability to download your attachment. Can you help?

                            Comment


                            • glennrocksvb
                              glennrocksvb commented
                              Editing a comment
                              Let me check.

                            • glennrocksvb
                              glennrocksvb commented
                              Editing a comment
                              Your usergroup looks good. When was the last time you checked? Sometimes you have to wait for 5 mins or so before your usergroup change takes effect. Let me know if you still have the issue.

                            #15
                            Hi Glenrocksvb if you select a profile field, can it not be a drop down menu that the member selects from? I wanted occupation to be in the postbit, but it translates on the page to be "occupation.1" Also, it is possible to display a website link?

                            Comment

                            Users Viewing This Page

                            Collapse

                            There is 1 user viewing this forum topic.

                            • Guest Guest

                            Latest Posts

                            Collapse

                            Working...
                            X
                            Searching...Please wait.
                            An unexpected error was returned: 'Your submission could not be processed because you have logged in since the previous page was loaded.

                            Please push the back button and reload the previous window.'
                            An unexpected error was returned: 'Your submission could not be processed because the token has expired.

                            Please push the back button and reload the previous window.'
                            An internal error has occurred and the module cannot be displayed.
                            There are no results that meet this criteria.
                            Search Result for "|||"