View Full Version : vBulletin 4 Request - Postbit edit 'member name'
croft
04-29-2016, 11:34 AM
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 ?
Dr.CustUmz
04-29-2016, 12:36 PM
first thing that popped to my mind
https://vborg.vbsupport.ru/showthread.php?t=273551&highlight=clan
croft
04-29-2016, 07:43 PM
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 ?
Take a look at https://vborg.vbsupport.ru/showthread.php?t=231525
croft
04-29-2016, 09:17 PM
Thanks i will have a look at it :)
MarkFL
04-29-2016, 09:35 PM
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":
switch($post['displaygroupid'])
{
case X:
$tag = '[tagX]';
break;
case Y:
$tag = '[tagY]';
break;
}
$post['musername'] = $tag . $post['musername'];
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.
croft
04-29-2016, 10:45 PM
This worked great :)
Is there any hooklocation where the 'TAG' is visible all over the forum and cms ?
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":
switch($post['displaygroupid'])
{
case X:
$tag = '[tagX]';
break;
case Y:
$tag = '[tagY]';
break;
}
$post['musername'] = $tag . $post['musername'];
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.
MarkFL
04-29-2016, 11:27 PM
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:
<span class="group6" style="font-weight: bold; color: #FF8000;">
Closing tag:
</span>
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":
$template_hook['headinclude_css'] .= '<style>.group6::before{content: "[Admin] "; color: red;}</style>';
Now, everywhere an admin whose displaygroupid is 6 has their marked up username shown, the tag will be present. :)
croft
04-30-2016, 07:48 AM
Now that worked great. Thank you and sorry for all the stupid questions :)
MarkFL
04-30-2016, 11:21 AM
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. :)
Dr.CustUmz
05-02-2016, 10:34 PM
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 =)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.