vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Show the Usergroup AND Member Groups in postbit (https://vborg.vbsupport.ru/showthread.php?t=61305)

Gary King 02-07-2004 10:00 PM

Show the Usergroup AND Member Groups in postbit
 
This hack will show what usergroups and membergroups a user is a part of, in the postbit.

This is a very simple hack to install, will take only 1 minute or less :)

Screenshot attached below.

NOTE: There are modifications for both postbit and postbit_legacy templates!

Anyways let's get started! :D

Open includes/functions_showthread.php and find
PHP Code:

    $show['messageicon'] = iif($post['iconpath'], truefalse); 

Above, add:
PHP Code:

    $show[usergroup] = 1;
    
$show[member_groups] = 1;
    
$membergroupids explode(',',$post[membergroupids]);
    
$membergroups '';
    
    foreach (
$membergroupids as $group)
    {
        if (
$membergroups == '')
        {
            
$membergroups .= $usergroupcache[$group][title];
        }
        else
        {
            
$membergroups .= ', '.$usergroupcache[$group][title];
        }
    } 

Open postbit template and find:
PHP Code:

                        <if condition="$show['reputation']">$post[reputationdisplay]</if> 

Below, add
PHP Code:

                        <if condition="$show[usergroup]"><br />$vbphrase[usergroup]: $post[displaygrouptitle]</if>
                        <if 
condition="$show[member_groups]"><br />$vbphrase[member_groups]: $membergroups</if> 

And just add one new phrase, member_groups, with the following content:
Code:

Member Groups
NOTE: If you are using postbit_legacy instead of postbit then add the new code for postbit, to wherever you want to show up in postbit_legacy, that's all!

Please click install if you installed this, thanks! :)

AN-net 02-08-2004 04:59 AM

very cool hack ill install later;)

gmarik 02-08-2004 07:07 AM

Not very cool just normal ...

Dean C 02-08-2004 10:33 AM

Nice us of the cache :)

Gary King 02-08-2004 01:04 PM

Quote:

Originally Posted by Mist
Nice us of the cache :)

Thanks I always try to use my resources ;) Saves me one query :D

Gary King 02-08-2004 01:06 PM

Quote:

Originally Posted by gmarik
Not very cool just normal ...

Eh? :p

Hialls 02-08-2004 01:55 PM

Hmm just spent few hours yesterday coding this :D. Nice job all the same

Gary King 02-08-2004 02:06 PM

Quote:

Originally Posted by Hialls
Hmm just spent few hours yesterday coding this :D. Nice job all the same

Thanks :D

seth044_x 02-09-2004 02:09 AM

weee my request!!! thanks man you rock.

Ocean 03-29-2004 12:20 PM

Hi, Gary!

Same question.... <grin>


How's this hack for vB 3.0 Gold?


Also, which part needs to be surrounded by:

Code:

<if condition="is_member_of($bbuserinfo,6)">
 
<!-- code goes here -->
 
</if>


... in order to make this hack viewable by admins only?


Thanks, and again - Great Hack! (Hmm... I seem to keep saying this to you.... :) )

Gary King 03-29-2004 07:11 PM

Quote:

Originally Posted by Ocean
Hi, Gary!

Same question.... <grin>


How's this hack for vB 3.0 Gold?


Also, which part needs to be surrounded by:

Code:

<if condition="is_member_of($bbuserinfo,6)">
 
<!-- code goes here -->
 
</if>


... in order to make this hack viewable by admins only?


Thanks, and again - Great Hack! (Hmm... I seem to keep saying this to you.... :) )

Hack works perfectly for Gold, and put the conditionals around the code that you are required to add.

Ocean 03-29-2004 07:34 PM

Quote:

Originally Posted by Gary W
Hack works perfectly for Gold, and put the conditionals around the code that you are required to add.

In the postbit template, or the functions_showthread.php file?

Gary King 03-29-2004 07:45 PM

Quote:

Originally Posted by Ocean
In the postbit template, or the functions_showthread.php file?

<if condition=""></if> only goes in templates :)

Ocean 03-29-2004 07:51 PM

Quote:

Originally Posted by Gary W
<if condition=""></if> only goes in templates :)

Well that just shows what I know, doesn't it? But I learned something new, so for that - thank you. :)

Stray 03-31-2004 12:38 AM

Could this be changed to show usergroup ranks or rank images?
I'd like to show multiple rank images in the postbit.

Ocean 04-14-2004 12:05 AM

Gary, I just noticed something odd...

I have a bunch of users whom I Mass Moved into another UserGroup. However, although in the "User" Table, the "usergroupid" field shows the correct New Group - the "displaygroupid" field still has their old UserGroup.

Now, I don't know if this is what is supposed to happen or not - however, this hack seems to pull from the "displaygroupid" field, instead of the "usergroupid" field.

As such, a large number of users now show up with the wrong Group info in the Postbit!


Assuming that this is not a problem with vB (in other words, assuming that the "displaygroupid" field is *supposed* to show the old Group) - than what needs to be changed in this hack to reflect the correct field being used?

Gary King 04-14-2004 12:56 PM

Replace
HTML Code:

$post[displaygrouptitle]
with
HTML Code:

$usergroupcache[$post[usergroupid]][title]

Ocean 04-14-2004 01:18 PM

Gary, I tried the replacement you suggested, and I got a Parse Error.



Parse error: parse error, unexpected '[', expecting ']' in C:\WebSite\forums\includes\adminfunctions_template .php(3037) : eval()'d code on line 74

Gary King 04-14-2004 11:42 PM

In the includes/functions_showthread.php find
PHP Code:

$show['messageicon'] = iif($post['iconpath'], truefalse); 

Above, add $usergroupname = $usergroupcache[$post[usergroupid]][title];

Then put $usergroupname in the postbit template wherever you want the usergroup to showu p.

Ocean 04-15-2004 12:47 AM

Thanks, Gary! That did the trick perfectly!

Caiman 08-16-2004 11:28 AM

Quote:

Originally Posted by Stray
Could this be changed to show usergroup ranks or rank images?
I'd like to show multiple rank images in the postbit.

Works great, clicked install. Thanks!

Caiman 08-16-2004 11:36 AM

Hope you're still around Gary :) Would it be possible for the usergroups to be displayed with the colour assigned to them too?

forumsoup.com 02-07-2006 07:30 PM

Does this work on 3.5.3? Open includes/functions_showthread.php? I dont have a functions_showthread.php.

JohnBee 02-09-2007 12:56 PM

I love this modification! any chance it would be coded for 3.6.4?

ShannonRawls 05-04-2007 02:37 PM

I would like this mod for 3.6.4 as well.

Hamednet 11-18-2007 07:54 AM

thanks

How do I this ?

https://vborg.vbsupport.ru/external/2007/11/16.gif

Hamednet 11-22-2007 05:29 PM

no body ?


All times are GMT. The time now is 04:46 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.01209 seconds
  • Memory Usage 1,790KB
  • 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
  • (2)bbcode_html_printable
  • (5)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (27)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete