The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
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? ## |
#2
|
|||
|
|||
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.
|
#3
|
||||
|
||||
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? ## |
#4
|
|||
|
|||
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. |
#5
|
||||
|
||||
Yep, that's almost identical to what I had tried earlier. Doesn't work.
# |
#6
|
|||
|
|||
Oh, right...try this instead:
Code:
if ( $vbulletin->userinfo['usergroupid'] == "6" ) {$usergroupname = "Site Administrators";} |
Благодарность от: | ||
porschegruven |
#7
|
|||
|
|||
For Usergroup Title, Use this variable
Code:
$vbulletin->usergroupcache[$vbulletin->userinfo[usergroupid]][title] |
Благодарность от: | ||
porschegruven |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|