vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   vBulletin 4 Request - Postbit edit 'member name' (https://vborg.vbsupport.ru/showthread.php?t=322481)

croft 04-29-2016 11:34 AM

vBulletin 4 Request - Postbit edit 'member name'
 
1 Attachment(s)
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/showthrea...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 ?

Dave 04-29-2016 08:02 PM

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":

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 ?

Quote:

Originally Posted by MarkFL (Post 2569855)
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":

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

Quote:

Originally Posted by croft (Post 2569859)
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:

HTML Code:

<span class="group6" style="font-weight: bold; color: #FF8000;">
Closing tag:

HTML Code:

</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":

PHP Code:

$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

Quote:

Originally Posted by croft (Post 2569892)
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. :)


All times are GMT. The time now is 03: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.01083 seconds
  • Memory Usage 1,748KB
  • 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
  • (2)bbcode_html_printable
  • (3)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete