Helpful Information
 
 
Category: vBulletin 3.0 Beta Releases
Email notification of usergroup join requests

I put this together to help my board usergroup leaders keep track of incoming join requests, and thought it might be useful to others.

I just added some code to profile.php immediately above the line "// insert the request":


$leaders = $DB_site->query("
SELECT ugl.userid, username, email
FROM " . TABLE_PREFIX . "usergroupleader AS ugl
INNER JOIN " . TABLE_PREFIX . "user AS user USING(userid)
WHERE ugl.usergroupid = $usergroupid
");
while ($leader = $DB_site->fetch_array($leaders))
{
vbmail($leader["email"], "new forums usergroup join request",
"A Forums user has asked to join a usergroup that you lead.\nPlease handle it at http://www.domain.com/forums/profile.php?do=editusergroups",
true);
}


This is rather quick and dirty, but it does seem to work well for our purposes. Perhaps others can improve on it.

this is really cool, but for my purposes would be better if it could send a PM

Would someone consider a modification to this to make that happen?

Thanks for this efoo, really useful submission!

Nice work!

nice.. looks like i might have some use for this

Is there a way to get the Forums complete url instead of hard-coding it?

SH

Very nice, I was searching for something like that.

Forgive me if this is a silly question - I'm new! But can I add this code at one of the vB hooks? And if so, which one should I be using? Thanks!

Has anybody considered writing this as a plug-in for 3.6??

Note, I had to slightly modify the above code to work on 3.6...
$usergroupid = $vbulletin->input->clean_gpc('p', 'usergroupid', TYPE_UINT);

$leaders = $db->query_read("
SELECT ugl.userid, username, email
FROM " . TABLE_PREFIX . "usergroupleader AS ugl
INNER JOIN " . TABLE_PREFIX . "user AS user USING(userid)
WHERE ugl.usergroupid = $usergroupid
");

while ($leader = $db->fetch_array($leaders))
{
vbmail($leader["email"], "new forums usergroup join request",
"A Forums user has asked to join a usergroup that you lead.\nPlease handle it at http://www.domain.com/forums/profile.php?do=editusergroups", true);
}

Has anybody considered writing this as a plug-in for 3.6??

Note, I had to slightly modify the above code to work on 3.6...

[/php]

This code is exactly what I need. I have vBulletin 3.6.4 for a few weeks now. I am a novice so is there a way to put userid and usergroup in the text of the email? I see that ugl.userid and ugl.usergroupid are defined so how would I put that in the text of the email. Please include all <>, "", etc 'cause I am a novice.

I agree this should be a standard option in vBulletin, but I am so thankful as a newbie you guys offer these hacks! Thanks.

P.S. I have no idea why my text changed to green. I tried to change it back to blackhttps://www.vbulletin.org/forum/external/2010/01/19.gif










privacy (GDPR)