MyBB Community Forums

Full Version: call group id number
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i am talking about custom page.

i make css for all usergroup color. like user4,user5,user6 etc

but when i try to call usergroup id number its showing who visited the page that group id.

i am using it  user{$mybb->user['usergroup']}

give me the variable please

[Image: c83b05534ef5bd08dbd5571cb36e9c03.png]

admin color showing white as i am viewing from a normal user account. but when i check from my admin account its show in red.
(2020-12-09, 12:20 AM)soumik Wrote: [ -> ]i am talking about custom page.

i make css for all usergroup color. like user4,user5,user6 etc

but when i try to call usergroup id number its showing who visited the page that group id.

i am using it  user{$mybb->user['usergroup']}

give me the variable please

[Image: c83b05534ef5bd08dbd5571cb36e9c03.png]

admin color showing white as i am viewing from a normal user account. but when i check from my admin account its show in red.

I gave you the variable in your first thread.

{$mybb->usergroup['gid']}
i already said thats not work
i use like this way
$user_class = "user" . $mybb->usergroup['gid'];

here its call only user not id
How did you do your custom page ? Probably something is missing in it, but without code, it's hard to know what.
i am using newpoint lottery. and also send you link in pm. as its private code
$mybb->user['usergroup'] holds the group ID of currently logged in users (you / who is viewing the page).
$mybb->usergroup holds the group details (in array) of all the groups the current user is holding (again, you / who is viewing the page).

I am not clear about your target user. Is it about the same person visiting the page or other members as well?
(2020-12-09, 03:43 PM)effone Wrote: [ -> ]$mybb->user['usergroup'] holds the group ID of currently logged in users (you / who is viewing the page).
$mybb->usergroup holds the group details (in array) of all the groups the current user is holding (again, you / who is viewing the page).

I am not clear about your target user. Is it about the same person visiting the page or other members as well?


for example admin win the lottery so its showing like that

[Image: 68747470733a2f2f692e6779617a6f2e636f6d2f...332e706e67]

but admin group colour is red. but when you seeing the page and you are a normal member that time also admin group colour must show.

i make css for all usergroup color. like user4,user5,user6 etc

but when i try to call usergroup id number its showing who visited the page that group id.

i am using it  user{$mybb->user['usergroup']}

i try also
$mybb->user['usergroup']   and   {$mybb->usergroup['gid']}

but still when as i admin showing the page its showing red
<a href="member.php?action=profile&amp;uid=1" class="user4">admin</a>

but when i seeing from registerd member id that time showing this
<a href="member.php?action=profile&amp;uid=1" class="user2">admin</a>
As I said, those variables represents the gid of the person visiting the page, not the target user's.

You can't do it the way you are trying. You need to use a plugin that will parse all the usernames displayed in the page and wrap it with their display usergroup id.
@soumik: seems you want to do that in your newpoints_lottery_stats function. You loop with while($winner = $db->fetch_array($query)) { so you need to use $winner['usergroup'] (which is not in your select).
Add usergroup in your select and use it when filling your template
thanks crazycat its workes