vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   show public usergroup in postbit (https://vborg.vbsupport.ru/showthread.php?t=69738)

mfacer 09-22-2004 02:11 PM

show public usergroup in postbit
 
I've already seen one post here which suggests to use:

Code:

Crew: <if condition="is_member_of($post, 63)">Such and Such group</if><if condition="is_member_of($post, 64)">Such and Such Other group</if>
to display which public usergroup the user is in, in the postbit.
I don't want to hard code this as above, I'd like to somehow get the usergroup they are in, and display the title of the group - and maybe a hyperlink to the join page of that group.

Is this possible?
thanks.

Berethorn 02-05-2005 10:36 PM

Yes, I would like to know this too. :)

Zachery 02-05-2005 11:03 PM

Quote:

Originally Posted by Berethorn
Yes, I would like to know this too. :)

Would require quite abit of overhead i think....

Andreas 02-05-2005 11:11 PM

*** Untested spinoff ***

In functions_showthread.php FIND
PHP Code:

static $gotrank$sigcache$checkperms$postelement$month$day$year$counter

REPLACE that with
PHP Code:

static $gotrank$sigcache$checkperms$postelement$month$day$year$counter$gotpgroups

FIND
PHP Code:

// get rank 

ABOVE that ADD
PHP Code:

if (!$gotpgroups[$post['userid']])
{
    
$membergroups explode(','$post['membergroupids']);
    foreach (
$membergroups as $membergroupid)
    {
        
$usergroup $usergroupcache[$membergroupid];
        if (
$usergroup['ispublicgroup'])
        {
            
$pgroups[] = "<a href=\"profile.php?$session[sessionurl]do=joingroup&amp;usergroupid=$membergroupid\">$usergroup[title]</a>";
        }
    }
    if (
is_array($pgroups))
    {    
        
$post['pgroupstr'] = implode(','$pgroups);
        
$gotpgroups[$post['userid']] = $post['pgroupstr'];
    }
    else
    {
        
$gotpgroups[$post['userid']] = '';

    }
}
else
{
    
$post['pgroupstr'] = $gotpgroups[$post['userid']];



Then you can use $post[pgroupstr] in Template postbit.

Rukas 05-31-2005 03:48 AM

^^ That doesnt work, it doesnt show up in the postbit :(

Andreas 05-31-2005 08:45 AM

Fixed a small typo, should work now


All times are GMT. The time now is 01: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.01129 seconds
  • Memory Usage 1,738KB
  • 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
  • (1)bbcode_code_printable
  • (4)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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