Log in

View Full Version : without editing or use plugin can phrase or html show usergroup name ?


Connector
04-30-2006, 12:41 AM
Hello

i was wondring we have a few html code where we can display the user info example

$bbuserinfo[username]
$bbuserinfo[rank]
$bbuserinfo[post]
$bbuserinfo[pmunread]
$bbuserinfo[avatar]

is there anything we can show the usergroup .. example i'm admin i need to use something like the above code to show me that i'm in this group .. is there any code to do this that already done with vB without modify or doing any edit ?

example i try to use this $bbuserinfo[usergroup] but it dont work.. i hope someone can help me on this

thankyou

Connector
05-01-2006, 01:31 AM
bump.!

Xenium
05-01-2006, 02:55 AM
Try $bbuserinfo[usergroupid] :)

Connector
05-01-2006, 06:14 AM
Thanks alot.. this show me the UserGroup ID i also was looking for this .. so how can i show the Groupname ?

kall
05-01-2006, 06:21 AM
Doubtful..

Where do you want to show it?

Connector
05-01-2006, 06:27 AM
i'm think know to Display it in the forum home page the welcome msg

"Welcome Username you are in the usergroup etc".. but i also think to show it in anther custom page i have created with vB maybe with vBa.. :)

Xenium
05-01-2006, 08:13 AM
Best way to do this, though it would be specific for your forums, would be to create an array with all your usergroupids and their corresponding user titles, and output the correct string based on their usergroupid.

A generic one would add one extra query on forumhome page.

Connector
05-01-2006, 08:21 AM
i was think to do this already but i was think maybe there is such code like usergroupid that going to display the name of the group ..?

Thanks alot for the info :)

Xenium
05-01-2006, 02:04 PM
i was think to do this already but i was think maybe there is such code like usergroupid that going to display the name of the group ..?



Nope, you would need to query title from the usergroup table.

amykhar
05-01-2006, 02:09 PM
Not true anymore. It's stored in the cache. Go look at my who's online legend plugin for examples on how to do it.

Xenium
05-01-2006, 02:53 PM
Not true anymore. It's stored in the cache. Go look at my who's online legend plugin for examples on how to do it.

Took a look at your code.. Nice idea :) Saves a query

Connector
05-02-2006, 03:11 AM
Hello Amy thanks for the Tips i try to look in the who online Legend but i still dont understand how can i get the usergroupname showing for each user .. example admin will see his own group name etc.. ?

could you please post some example code here .. it may help me alot

Thanks :)

Adrian Schneider
05-02-2006, 03:25 AM
{$vbulletin->usergroupcache[$vbulletin->userinfo['usergroupid']]['title']} will work (note the braces!)

Connector
05-02-2006, 07:14 AM
Thanks alot . and what is the html code when i add in the template ?

it should look like this ?

$userinfo['usergroupid']]['title']}

Adrian Schneider
05-02-2006, 01:40 PM
Thanks alot . and what is the html code when i add in the template ?

it should look like this ?
Use my above example. $userinfo['usergroupid'] is just an integer - not an array.

Connector
05-03-2006, 01:12 AM
Hello

Thanks SirAdrian i try this one before and it only showing the usergroup ID example i'm admin it will show 6 ..

Greatz :)