Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)

Reply
 
Thread Tools Display Modes
  #1  
Old 04-29-2016, 11:34 AM
croft croft is offline
 
Join Date: Aug 2002
Location: Sweden
Posts: 304
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default vBulletin 4 Request - 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, 0 views)
File Type: jpg postbit2.jpg (28.8 KB, 0 views)
Reply With Quote
  #2  
Old 04-29-2016, 12:36 PM
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is offline
 
Join Date: Aug 2013
Location: USA
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

first thing that popped to my mind
https://vborg.vbsupport.ru/showthrea...highlight=clan
Reply With Quote
Благодарность от:
CAG CheechDogg
  #3  
Old 04-29-2016, 07:43 PM
croft croft is offline
 
Join Date: Aug 2002
Location: Sweden
Posts: 304
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 ?
Reply With Quote
  #4  
Old 04-29-2016, 08:02 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Take a look at https://vborg.vbsupport.ru/showthread.php?t=231525
Reply With Quote
  #5  
Old 04-29-2016, 09:17 PM
croft croft is offline
 
Join Date: Aug 2002
Location: Sweden
Posts: 304
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks i will have a look at it
Reply With Quote
  #6  
Old 04-29-2016, 09:35 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 04-29-2016, 10:45 PM
croft croft is offline
 
Join Date: Aug 2002
Location: Sweden
Posts: 304
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This worked great
Is there any hooklocation where the 'TAG' is visible all over the forum and cms ?

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

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.
Reply With Quote
  #8  
Old 04-29-2016, 11:27 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

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.
Reply With Quote
  #9  
Old 04-30-2016, 07:48 AM
croft croft is offline
 
Join Date: Aug 2002
Location: Sweden
Posts: 304
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Now that worked great. Thank you and sorry for all the stupid questions
Reply With Quote
2 благодарности(ей) от:
Dr.CustUmz, MarkFL
  #10  
Old 04-30-2016, 11:21 AM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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.
Reply With Quote
Благодарность от:
Dr.CustUmz
Reply

Thread Tools
Display Modes

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

Forum Jump


All times are GMT. The time now is 06:55 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04146 seconds
  • Memory Usage 2,292KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_html
  • (3)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (4)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (2)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete