vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Profile Enhancements - Personal User Badges (https://vborg.vbsupport.ru/showthread.php?t=300604)

Jordan S Smith 07-29-2013 10:00 PM

Personal User Badges
 
1 Attachment(s)
This is something I came up with for a site I help manage. It gives users the option to set a custom badge that is displayed in the postbit_legacy. Sorry if I got the prefix wrong, I couldn't think which one this best belonged in.

Anyway, this is going to take advantage of template modification and profile field creation.

So, for starters, we're going to make the profile field that will be used for the badges. Open up your ACP and click on 'Add New User Profile Field'. Select 'Single-Line Text Box'. Title 'Personal User Badge'. Description can be whatever. Put it in the appropriate Profile Field Category.

Leave the default value blank. Make sure the field length is high, I use 100. That's for long image links. Set field length to 50. Don't mess with display order. Make sure field required is set to no. Field editable by user should be set to yes. Private field should be set to yes. This makes it so users can't see each others links. It makes the profile page look bad. Staff will still be able to see the links.

Field searchable on members list and show on members list should both be set to no. That's it, now click save. You should be redirected to the profile field manager.

When finished, it should look something like this when you click on edit:
https://vborg.vbsupport.ru/external/2013/07/8.png

Take note in the field manager of the 'name' column. This is important and will be needed later on. Find the 'name' for the newly created profile field.

Next your going to want to open your master style so this template edit will inherit. If it will not inherit you will have to add this manually to each individual style.

Find and open the template: postbit_legacy

Find this code:
Code:

<dl class="userinfo_extra">
You're going to want to place this before the closing tag:
Code:

<vb:if condition="$post['fieldxx']"><p style="text-align:center; margin-top:3px;"><img src="{vb:raw post.fieldxx}" alt="Badge" width="180" height="26"></p></vb:if>
So it will look like this:
Code:

<dl class="userinfo_extra">
    *stuff that's already here*
    <vb:if condition="$post['fieldxx']"><p style="text-align:center; margin-top:3px;"><img src="{vb:raw post.fieldxx}" alt="Badge" width="180" height="26"></p></vb:if>
</dl>

Now take the 'name' mentioned earlier. Replace the red text with that. Save your template and you're done!! Users can now add their own personal badges. Resolution is 180x26 by default. If you'd like to change that simply edit the green portions of the code.

If this receives enough attention I'll update with the personal links option. This allows users to set a link for their badges so that when users click on the image they'll be redirected.

EDIT: Here's a demo site.

I've directed you to a post by me. As you can see there are two badges. I used this feature to make one for staff only. That's how it will appear though.

EDIT2: Here's a screen capture of what it would look like for those of you who don't or can't view the demo site.

Jordan S Smith 07-30-2013 06:49 AM

Reserved.

K4GAP 07-30-2013 07:24 AM

Demo or images?

Jordan S Smith 07-30-2013 07:35 AM

Quote:

Originally Posted by GaryT (Post 2436060)
Demo or images?

Sorry about that. I've added the demo link.

Skyrider 08-02-2013 07:14 AM

Demo's tend to go down in the future though (like the demo is down now), would be nice to show images in the main post uploaded on vbulletin.

Amaury 08-02-2013 04:49 PM

Quote:

Originally Posted by FF|Skyrider (Post 2436665)
Demo's tend to go down in the future though (like the demo is down now), would be nice to show images in the main post uploaded on vbulletin.

The site's working fine.

STR8H8TEx 08-02-2013 06:08 PM

down for me

Amaury 08-02-2013 06:30 PM

Quote:

Originally Posted by STR8H8TEx (Post 2436766)
down for me

Well, it's working here.

It's most likely just you, so check and see what Down for Everyone or Just Me says.

Jordan S Smith 08-06-2013 10:59 PM

Once again, I have updated the OP. This time with a screen of how the modification would appear. Note, there are two in this screen because I used it twice. If you only want one, that's what this modification will give you. Lest you have the ingenuity to figure out how to place two within the postbit.

The link is not solely a demo site. It is an actual live forum. The site is currently working, I see no issues. As Amaury said, check to make sure that it's not something wrong on your end. I uploaded the image anyway for ease of access.

If you have any more issues viewing what this modification would look like, you'll have to try it out and see because I don't have any more options. I'm afraid anything short of a youtube video will not do any better.

Any further questions, please do not be afraid to PM me instead of flooding the thread with questions about what it looks like. If you do run into a problem using the modification, however, feel free to post in the thread.

Thank you.

xFuZioNx 08-09-2013 03:45 PM

I know this may not be about this mod but can you tell me what size your avatars are for the unicorn? also can you tell me what mod you used for the online on that posts its pink and all that information, and what award system do you use?

Amaury 08-09-2013 03:58 PM

Quote:

Originally Posted by xFuZioNx (Post 2438030)
I know this may not be about this mod but can you tell me what size your avatars are for the unicorn? also can you tell me what mod you used for the online on that posts its pink and all that information, and what award system do you use?

You couldn't ask him in a PM?
  1. 200 x 200
  2. Status Online Postbit Text
  3. Yet Another Awards System

Jordan S Smith 09-03-2013 03:38 PM

Quote:

Originally Posted by xFuZioNx (Post 2438030)
I know this may not be about this mod but can you tell me what size your avatars are for the unicorn? also can you tell me what mod you used for the online on that posts its pink and all that information, and what award system do you use?

As Amaury stated, I would've been more than happy to answer you via PM. It doesn't really matter though, I suppose.

And Amaury was right on all accounts.

The avatar was 200x200 in size.
Simple template edits for the Online status.
We use YAAS for our awards.

Spangle 09-08-2013 08:29 PM

Ok I must be a little thick :

Quote:

Take note in the field manager of the 'name' column. This is important and will be needed later on. Find the 'name' for the newly created profile field.

I can't see a "name" column ?

The other thing I can't understand is why you would want to duplicate a "badge" that is already there, I noticed in the thread I landed on in your forum that hardly any of your members are actually using this feature.

Surely if someone wants a "custom badge" they can use their avatar to display it, isn't that what it is ?

ozzy47 09-08-2013 08:34 PM

The name column is in the User Profile Field Manager, third one from the left

Jordan S Smith 09-30-2013 09:48 PM

Quote:

Originally Posted by Spangle (Post 2444241)
Ok I must be a little thick :

I can't see a "name" column ?

The other thing I can't understand is why you would want to duplicate a "badge" that is already there, I noticed in the thread I landed on in your forum that hardly any of your members are actually using this feature.

Surely if someone wants a "custom badge" they can use their avatar to display it, isn't that what it is ?

It looks like Ozzy already got to your first question.

As for your second one, avatars are used to display most commonly images that are perfectly square or sometimes rectangular. The point of this modification is for users to be able to add a custom badge, which is smaller than an avatar by far, and even a custom link. Could you make a profile field to just display a link, yes, but it's not as fun.

Hardly any of the users use it because they aren't as active as I'd like. Most just pop in for sip of tea and then leave.

And I'd also like to say that, no an avatar is not a badge. An avatar is an avatar. A badge is a badge.

This is simply a fun modification for whomever would like to use it. If you think it's pointless or redundant then simply don't use it. I'm not forcing anyone's hand here. I discovered a neat little feature and decided to share it out of the kindness of my heart.

tbworld 09-30-2013 10:00 PM

My daughter might have fun with this. Thanks for sharing.

kaizokuhime 10-03-2013 08:14 PM

This looks awesome! Thank you for sharing. I'm not quite ready for my forum to have a full blown achievements system yet, so this sounds like it will work. I'll install and let you know how it works out.

MikeBeams 12-01-2013 08:45 PM

Can you tell me if and how to add an option where I can set it so only certain usergroups can use this?

OUTL4W 12-02-2013 01:33 PM

Quote:

Originally Posted by MikeBeams (Post 2465058)
Can you tell me if and how to add an option where I can set it so only certain usergroups can use this?

I to would like to know....but in the field marked "field editable by user" that currently has the options "yes, no, at registration" then add the option "by Admin/Mod" would be great. Perhaps the all powerful OZZ....can do it.

ozzy47 12-02-2013 02:36 PM

Your not in Kansas anymore.......

OUTL4W 12-05-2013 12:57 PM

Quote:

Originally Posted by ozzy47 (Post 2465191)
Your not in Kansas anymore.......

not sure if that means its in your backlog or not but figured it out. I use this method now instead of creating numerous usergroups.

Before finding this mod we created custom user-groups when member paid with vbcredits for requesting a custom user-title/badge....currently we have 110+ user-groups on one forum, using vb3.8.7, that only contain 1 member in order to show these custom ranks/badges/usertitles under avatar in posts....and it's becoming very convoluted.

We now use this mod(personal user badge) but set the "field editable by user" to "no" and set the "Display Page" to "Options: other" and then insert the url link into the field via the ACP when viewing the member's profile via "search for users". Have set up 4 custom user-titles profile fields this way. And now mods can accomplish this without admin intervention of creating specific usergroup.

But its beyond me on how to display it on "MEMBERINFO" template where the ranks/usertitle's show up across from member name currently.

Jordan S Smith 12-11-2013 01:51 PM

Quote:

Originally Posted by MikeBeams (Post 2465058)
Can you tell me if and how to add an option where I can set it so only certain usergroups can use this?

The easiest way would be to simply add a few lines of code that say 'only this usergroup may display a userbadge' while the option would still appear under other usergroups, the images wouldn't display.

I'll update this post later when I have the time to work out the code. I might also try and update with how to make the option usergroup specific. I'm currently at university right now and have finals today. I apologize for the inconvenient wait.

A vb condition should take care of this. Try this:

Code:

<vb:if condition="is_member_of($bbuserinfo, x,x,x)">Wrap these around the userbadge code.</vb:if>
If you only need one usergroup then remove the second and third 'x' replacing the first with the usergroup id you want. This will allow users of a single or multiple usergroups to display their user badge.

Jordan S Smith 12-12-2013 03:26 PM

Quote:

Originally Posted by OUTL4W (Post 2465932)
not sure if that means its in your backlog or not but figured it out. I use this method now instead of creating numerous usergroups.

Before finding this mod we created custom user-groups when member paid with vbcredits for requesting a custom user-title/badge....currently we have 110+ user-groups on one forum, using vb3.8.7, that only contain 1 member in order to show these custom ranks/badges/usertitles under avatar in posts....and it's becoming very convoluted.

We now use this mod(personal user badge) but set the "field editable by user" to "no" and set the "Display Page" to "Options: other" and then insert the url link into the field via the ACP when viewing the member's profile via "search for users". Have set up 4 custom user-titles profile fields this way. And now mods can accomplish this without admin intervention of creating specific usergroup.

But its beyond me on how to display it on "MEMBERINFO" template where the ranks/usertitle's show up across from member name currently.

What exactly is your issue? You want the user badge to appear where? Currently I've only coded it to appear in the postbit.

OUTL4W 12-12-2013 05:19 PM

I adapted this for a 3.8.7 forum I help admin & finally figured out how to show it on the MEMBERINFO template by using:
Code:

<if condition="$userinfo[field19]"><img src="$userinfo[field19]"<p style="float:right; margin-top:0px;"></if>


All times are GMT. The time now is 02:18 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01330 seconds
  • Memory Usage 1,804KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (11)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (24)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete