The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Email notification when users online
I'm running a vBulletin board and it would be great if I could be notified by email when certain users come online. I guess it would be like a email notification if your buddies are online, but for moderators only ie this isn't a feature that everyone needs to have on the board. I've been trying to workout how to do it, I have some db skills but little PHP skills so I'm finding it tough going. Would be very grateful if someone could give me some pointers.
TIA |
#2
|
|||
|
|||
I'll look into it this weekend unless somebody else wants to pounce.
|
#3
|
|||
|
|||
Thanks for that - really appreciate any help you have time to give.
|
#4
|
|||
|
|||
I've reached a sticking point - I think I've found the section in the members.php file which creates the session entry in the db session table so I've added the following code as a test to send an email but it doesn't seem to do anything (ie I never get an email). Here's the code with my additional code at the end (I haven't included the full original code).
Really appreciate any pointers: Bob // ############################### start login ############################### if ($action=="login") { $templatesused = 'redirect_login,error_wrongpassword,error_wronguse rname'; include("./global.php"); $userid = 0; if (isset($username)) { // get userid for given username if ($user=$DB_site->query_first("SELECT userid,username,password,cookieuser FROM user WHERE username='".addslashes(htmlspecialchars($username) )."'")) { if ($user['password']!=md5($password)) { // check password eval("standarderror(\"".gettemplate("error_wrongpa ssword")."\");"); exit; } $userid=$user[userid]; } else { // invalid username entered eval("standarderror(\"".gettemplate("error_wrongus ername")."\");"); exit; } if ($user['cookieuser']==1) { vbsetcookie("bbuserid",$user['userid']); vbsetcookie("bbpassword",$user['password']); } $DB_site->query("DELETE FROM session WHERE sessionhash='".addslashes($session[dbsessionhash])."'"); $session['sessionhash']=md5(uniqid(microtime())); $session['dbsessionhash']=$session['sessionhash']; $DB_site->query("INSERT INTO session (sessionhash,userid,host,useragent,lastactivity,st yleid) VALUES ('".addslashes($session['sessionhash'])."','".intval($userid)."','".addslashes($sessio n['host'])."','".addslashes($session['useragent'])."','".time()."','$session[styleid]')"); vbsetcookie("sessionhash",$session['sessionhash'],0); $username = $user['username']; } // ########################### hack to email if certain user come online ################# vbmail("bob@bob.com","VBTest","Online"); |
#5
|
||||
|
||||
It would be best to run it from sessions.php, because not all members have to login in order to be considered online. Most are "cookied" so they can just drop by the forums and be "online".
I can get this hack done in a few minutes, but it seems filburt has this one. Good luck with it. |
#6
|
|||
|
|||
Thanks for the tip I'll put in inthe session.php file as well - I could do with a little help - whenever I run this on the server I get the error: call to undefined fuction vbmail:
I can see that the function is stored in /admin/functions.php and referenced by global.php However if I include global.php just before I make the call the vbmail I get the error: Fatal error: Cannot redeclare regstring - previously declaired in... Any pointers anyone. Seems like I can't use the vbmail function as it hasn;t been included but when I try and include the library that has it - it tells me that it can't as other members of the library have already been declaired - confused TIA Bob |
#7
|
|||
|
|||
Finally go it to work but ended up using just the mail command rather than the vbmail. Would still be interested why I had the vbmail problems if anyone knows.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|