vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   List Usergroup in Postbit Legacy? (https://vborg.vbsupport.ru/showthread.php?t=153392)

Jubei 07-25-2007 08:05 PM

List Usergroup in Postbit Legacy?
 
Is there a way to list the Usergroup in the postbit legacy, say in the format:

Class: Full Member/Moderator/Admin (etc)

I don't want this to be in usertitle, as the two will be kept separate.

Thanks.

SCRIPT3R 07-25-2007 08:15 PM

sure. you could edit the display properties and place the following where needed repsectively within your postbit template.

PHP Code:

                <if condition="$post['usertitle']"><div class="smallfont">$post[usertitle]</div></if>
                <if 
condition="$post['rank']"><div class="smallfont">$post[rank]</div></if> 


Jubei 07-25-2007 09:33 PM

That's User ranks though and not Usergroups right? I'm after the latter, since these classes would change via the promotion system.

Kirk Y 07-25-2007 09:43 PM

I'm not sure if the Usergroup name is accessible via a variable. If I'm right in there not being one, you could use a set of conditional statements to create one.

Code:

<if condition="is_member_of($post, 6)">Administrator</if>
It might be simpler to do it via a Plugin, as nested template conditionals can get kind of messy.

Create a new plugin at hook location "postbit_display_start" with the following:
Code:

if (is_member_of($post, 6)){
$usergroup = "Administrator";
}
elseif (is_member_of($post, 5)){
$usergroup = "Usergroup 5";
}
elseif (is_member_of($post, 4)){
$usergroup = "Usergroup 4";
}
elseif (is_member_of($post, 3)){
$usergroup = "Usergroup 3";
}

Then place $usergroup in your postbit template wherever you'd like their Usergroup name to show up.

In the above codes, the integer after "$post," represents the Usergroup ID we're matching against.

Jubei 07-25-2007 09:50 PM

I've seen it done on a few other boards, so I don't imagine it being that difficult.

Can you direct me to said plugin please?

Kirk Y 07-25-2007 09:55 PM

You must've posted while I was editing -- look at my post above.

Edit: Just ran across an alternative solution. Use the following in your postbit template wherever you'd like the Usergroup name displayed (No plugin needed):

Code:

{$GLOBALS[vbulletin]->usergroupcache[$post[usergroupid]][title]}

Jubei 07-25-2007 10:00 PM

Okay, gotcha. I'll give this a try and get back to you.

Thanks a lot!

King Kovifor 07-25-2007 10:07 PM

User group is located within the $userinfo array, which should be available in the postbit, but don't quote me on the availability part.

Kirk Y 07-25-2007 10:39 PM

No $userinfo is only available in the MEMBERINFO templates, to my knowledge.

King Kovifor 07-25-2007 11:21 PM

Reason I said don't quote me on it. I know it is stored in the userinfo though.


All times are GMT. The time now is 12:05 AM.

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.01060 seconds
  • Memory Usage 1,735KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_php_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