Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 29 Apr 2016, 14:34
croft croft is offline
 
Join Date: Aug 2002
Real name: Ulric Spaak
Question Postbit edit 'member name'

Im running vbulletin 4.2.2 and need to edit the postbit a tad.

When i add a member to a specific usergroup i would like to be able to add a custom 'tag' infront of the member name. Like clan tag.

In postbit1 image attached is how it looks now.
In postbit2 image is how i want it to look when i have added a member to a specific usergroup.

Is this possible to make happen ?
Attached Images
File Type: jpg postbit1.jpg (27.8 KB, 16 views)
File Type: jpg postbit2.jpg (28.8 KB, 18 views)
__________________
Dark Angel Battalion
Reply With Quote
  #2  
Old 29 Apr 2016, 15:36
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is offline
 
Join Date: Aug 2013
Real name: Ryan
first thing that popped to my mind
http://www.vbulletin.org/forum/showt...highlight=clan
__________________
12/12/2020 - My PC has crashed, I have narrowed it down to the PSU, MB, or CPU. I believe it is the PSU (EVGA NEX750B) This is my job, creating free products and offering my services. With a daughter to be here any day I have very limited cash flow right now. If you wish to help me get a new PSU I would be greatly appreciative. PM me or read more here Dirt RIF CustUmz
Reply With Quote
  #3  
Old 29 Apr 2016, 22:43
croft croft is offline
 
Join Date: Aug 2002
Real name: Ulric Spaak
That didnt work at all.

Was thinking more of something like <if usergroup 10 [DAB] ellse.......

Or mayby if statements doesnt work on vbulletin 4 ?
__________________
Dark Angel Battalion
Reply With Quote
  #4  
Old 29 Apr 2016, 23:02
Dave Dave is offline
 
Join Date: Jun 2010
Real name: Dave
Take a look at https://www.vbulletin.org/forum/showthread.php?t=231525
__________________
https://technidev.com - security, development, exploits, vBulletin
dave[at]technidev[dot]com

Contact me for custom vBulletin 3/4 work & server/website management.
Reply With Quote
  #5  
Old 30 Apr 2016, 00:17
croft croft is offline
 
Join Date: Aug 2002
Real name: Ulric Spaak
Thanks i will have a look at it
__________________
Dark Angel Battalion
Reply With Quote
  #6  
Old 30 Apr 2016, 00:35
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
You could also do this with a plugin...create a plugin with the "Hook Location" of "postbit_display_complete" with the following "Plugin PHP Code":


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Replace X and Y with the usergroupids of the usergroups you wish to have custom tags and the strings "tagX" and "tagY" with the tag text itself. If you have more than two groups, then simply add cases as needed within the switch block.

I would use an execution order of 0 for the plugin to make sure this gets done before other plugins have a chance to alter the marked up name.
__________________
Former vBulletin.org Staff Member



Support for my products (as well as updates/new product publishing) has been moved to MHB - vBulletin Products and TAZ - Add-ons
Reply With Quote
  #7  
Old 30 Apr 2016, 01:45
croft croft is offline
 
Join Date: Aug 2002
Real name: Ulric Spaak
This worked great
Is there any hooklocation where the 'TAG' is visible all over the forum and cms ?

Originally Posted by MarkFL View Post
You could also do this with a plugin...create a plugin with the "Hook Location" of "postbit_display_complete" with the following "Plugin PHP Code":


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Replace X and Y with the usergroupids of the usergroups you wish to have custom tags and the strings "tagX" and "tagY" with the tag text itself. If you have more than two groups, then simply add cases as needed within the switch block.

I would use an execution order of 0 for the plugin to make sure this gets done before other plugins have a chance to alter the marked up name.
__________________
Dark Angel Battalion
Reply With Quote
  #8  
Old 30 Apr 2016, 02:27
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
Originally Posted by croft View Post
This worked great
Is there any hooklocation where the 'TAG' is visible all over the forum and cms ?
Okay, if you want it to show up everywhere, try the following approach. Suppose I want the tag "[Admin]" to show up before those whose displaygroupid is 6. And I want this tag to be red.

First, I go to the Usergroup Manager, and edit the HTML markup to give the span element containing the username a classname:

In the "Username HTML Markup" fields, I enter:

Opening tag:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Closing tag:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Of course, you would use the "style" attributes you want, on my dev site, admins' names are in bold orange. I simply added the class attribute.

Now, we can inject a CSS selector on all pages with the following plugin, hook location "parse_templates":


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Now, everywhere an admin whose displaygroupid is 6 has their marked up username shown, the tag will be present.
__________________
Former vBulletin.org Staff Member



Support for my products (as well as updates/new product publishing) has been moved to MHB - vBulletin Products and TAZ - Add-ons
Reply With Quote
  #9  
Old 30 Apr 2016, 10:48
croft croft is offline
 
Join Date: Aug 2002
Real name: Ulric Spaak
Now that worked great. Thank you and sorry for all the stupid questions
__________________
Dark Angel Battalion
Reply With Quote
  #10  
Old 30 Apr 2016, 14:21
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
Originally Posted by croft View Post
Now that worked great. Thank you and sorry for all the stupid questions
You're welcome, and please don't think your questions are "stupid"...you stated a legit request, and that's what this forum is for.
__________________
Former vBulletin.org Staff Member



Support for my products (as well as updates/new product publishing) has been moved to MHB - vBulletin Products and TAZ - Add-ons
Reply With Quote
  #11  
Old 03 May 2016, 01:34
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is offline
 
Join Date: Aug 2013
Real name: Ryan
Originally Posted by croft View Post
Now that worked great. Thank you and sorry for all the stupid questions
Oh geeze, dont feel stupid =) I ask stuff ALL THE TIME (take a look in the vb3 programming forum lol) I pretty much own it most the time I find myself answering my own questions because I go about things to quick and get side tracked A LOT, but the only stupid question is the question you didn't bother to ask. There is no such thing as a stupid question, only stupid answers lol.

Glad you got what you were looking for though =)
__________________
12/12/2020 - My PC has crashed, I have narrowed it down to the PSU, MB, or CPU. I believe it is the PSU (EVGA NEX750B) This is my job, creating free products and offering my services. With a daughter to be here any day I have very limited cash flow right now. If you wish to help me get a new PSU I would be greatly appreciative. PM me or read more here Dirt RIF CustUmz
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 08:57.

Layout Options | Width: Wide Color: