![]() |
Show usergroup name in emails?
In one of the email templates (in languages), the following variables are available:
$bbuserinfo[username] $vboptions[bburl]/showthread.php?t=$threadinfo[threadid] $threadinfo[prefix_plain]$threadinfo[title] $post[message] I want to show not just the username, but the usergroup, too. This way, for example, a person receiving the email will know right away if the posted reply was from a moderator, admin, or a specific member group -- without having to go to the forum first. But what's the variable to add this? ## |
I don't think there is an existing variable. You could write a plugin using hook location newpost_notification_start that sets a variable, then insert it in the phrase. I took a look at that code (in function exec_send_notification() in includes/functions_newpost.php), but it doesn't look like the group of the replying user is available, or even the userid in some cases, so you might have to do a query to look up the information by username.
|
I can use $bbuserinfo[usergroupid], and it'll echo the number in the emails.
But I can't seem to find a way to make it echo the name of the group. I tried to write a plugin, but it did nothing. This is where I started... PHP Code:
Any ideas on what plugin syntax would need to be? ## |
Hmm...OK, fair enough. I guess I just didn't understand what was going on in that function, because it didn't look like all the info in $bbuserinfo was always the user who replied. Anyway, try this:
Code:
if ( $bbuserinfo['usergroupid'] == "6" ) {$usergorupname = "Site Administrators";} Then put $usergroupname in the phrase somewhere. |
Yep, that's almost identical to what I had tried earlier. Doesn't work. :(
# |
Oh, right...try this instead:
Code:
if ( $vbulletin->userinfo['usergroupid'] == "6" ) {$usergroupname = "Site Administrators";} |
For Usergroup Title, Use this variable
Code:
$vbulletin->usergroupcache[$vbulletin->userinfo[usergroupid]][title] |
All times are GMT. The time now is 04:07 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|