|
Joined: Apr 2001
Posts: 3,266
Member
|
Member
Joined: Apr 2001
Posts: 3,266 |
Mod Name / Version: Staff Notification of New Registration Description: Okay Threads only alerts you of new registrations if you click approve all registrations. Now I know I dont want this. However I might want to know when someone new registers without having to go approve them so they can use the board. This is a quick and dirty hack: Open adduser.php <br />Find:<br /><br />// -------------------------------------<br />// Now we need to mail them the password<br /> if ( ($Loginname) && ($Email) ) {<br /> $to = $Email;<br /> $subject = "{$ubbt_lang['PASS_SUB']}";<br /> eval ("\$msg = \"{$ubbt_lang['PASS_BODY']}\";");<br /> if ($config['verify']) {<br /> $msg .= " " . $ubbt_lang['DOVERIFY'] ." {$config['phpurl']}/verifyemail.php?verify=$Uid-$key&Cat=$Cat";<br /> }<br /> elseif ($config['userreg']) {<br /> $msg .= " " . $ubbt_lang['NEEDAPPROVAL'];<br /> }<br /> $mailer -> send_mail("","","$to","$subject","$msg");<br /><br /> }<br /><br />Place after it this:<br /><br />// ---------------------------------------------------------------------<br />// Now if we want to notify staff of new user registrations we need to send an<br />// email to all the staff<br /> if ( ($Loginname) && ($Email) ) {<br /> $query = "<br /> SELECT U_Email<br /> FROM {$config['tbprefix']}Users<br /> WHERE U_Status = 'Administrator'<br /> ";<br /> $sth = $dbh -> do_query($query);<br /> while(list($adminemail) = $dbh -> fetch_array($sth)) {<br /> if (!$adminemail) {<br /> continue;<br /> }<br /> $newuser = rawurlencode($Loginname);<br /> $to = $adminemail;<br /> $subject = "{$ubbt_lang['NEWREG']} {$config['title']}";<br /> $msg = "{$ubbt_lang['NEWREG']} {$config['title']}\n\n Username: $Loginname\n\n Email: $Email\n\n IP: $ip\n\n{$config['phpurl']}/ubbthreads.php";<br /> $mailer -> send_mail("","","$to","$subject","$msg");<br /> }<br /> }<br /><br /> if ( ($Loginname) && ($Email) ) {<br /> $query = "<br /> SELECT U_Email<br /> FROM {$config['tbprefix']}Users<br /> WHERE U_Status = 'Moderator'<br /> ";<br /> $sth = $dbh -> do_query($query);<br /> while(list($modemail) = $dbh -> fetch_array($sth)) {<br /> if (!$modemail) {<br /> continue;<br /> }<br /> $newuser = rawurlencode($Loginname);<br /> $to = $modemail;<br /> $subject = "{$ubbt_lang['NEWREG']} {$config['title']}";<br /> $msg = "{$ubbt_lang['NEWREG']} {$config['title']}\n\n Username: $Loginname\n\n Email: $Email\n\n IP: $ip\n\n{$config['phpurl']}/ubbthreads.php";<br /> $mailer -> send_mail("","","$to","$subject","$msg");<br /> }<br /> }<br /> Now you can remove the part that mods get sent registration emails by not copying that part. Working Under: UBB.Threads 6.4 Mod Status: Beta Any pre-requisites: N/A Author(s): Omegatron Date: 12/21/03 Credits: Files Altered: adduser.php New Files: None Database Altered: No Info/Instructions: Disclaimer: Please backup every file that you intend to modify. If the modification modifies the database, it's a good idea to backup your database before doing so.
Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.
|
|
|
|
Joined: Mar 2001
Posts: 644
Member
|
Member
Joined: Mar 2001
Posts: 644 |
Handy, thanks. 
|
|
|
|
Joined: Sep 2003
Posts: 803
Coder
|
Coder
Joined: Sep 2003
Posts: 803 |
Promptly added. thanks. It was easy for even me 
|
|
|
|
Joined: Apr 2001
Posts: 3,266
Member
|
Member
Joined: Apr 2001
Posts: 3,266 |
Like I said very quick mod.
|
|
|
|
Joined: Dec 2003
Posts: 2
Lurker
|
Lurker
Joined: Dec 2003
Posts: 2 |
Omegatron, Thanks very much for the mod. I find it quite useful. A couple of questions though. I don't understand the last line in the instructions that reads: "Now you can remove the part that mods get sent registration emails by not copying that part." You lost me here. Are you saying to remove the following section of unmodified code? [ code snippet removed post-facto so as not to confuse people. ] Also, some admins including myself might find it useful to be notified only after new users verify their accounts. Do you think this mod could be made to work this way by putting it inside verifyemail.php? Aloha, -K
Last edited by Kahuna; 01/13/2004 11:01 PM.
|
|
|
|
Joined: Apr 2001
Posts: 3,266
Member
|
Member
Joined: Apr 2001
Posts: 3,266 |
What I mean is this
If you do not want moderators to get an email you omit this part the second half
if ( ($Loginname) && ($Email) ) { $query = " SELECT U_Email FROM {$config['tbprefix']}Users WHERE U_Status = 'Moderator' "; $sth = $dbh -> do_query($query); while(list($modemail) = $dbh -> fetch_array($sth)) { if (!$modemail) { continue; } $newuser = rawurlencode($Loginname); $to = $modemail; $subject = "{$ubbt_lang['NEWREG']} {$config['title']}"; $msg = "{$ubbt_lang['NEWREG']} {$config['title']}\n\n Username: $Loginname\n\n Email: $Email\n\n IP: $ip\n\n{$config['phpurl']}/ubbthreads.php"; $mailer -> send_mail("","","$to","$subject","$msg"); } }
Yes you should be able to play with this and try copying it under the mailer in verifyemail.php It would work there as well or should.
|
|
|
|
Joined: Dec 2003
Posts: 2
Lurker
|
Lurker
Joined: Dec 2003
Posts: 2 |
|
|
|
|
Joined: Jun 2004
Posts: 10
Newbie
|
Newbie
Joined: Jun 2004
Posts: 10 |
Sorry this post should be Re: Omegatron Thank you this is a nice quick hack. Quick question, I have two other administrators and one is complaining about receiving an email every time someone registers. Is there a way to exclude one admin from the mailing? Thank You.
Last edited by Menemeth; 07/25/2004 6:12 PM.
|
|
|
|
Joined: Sep 2003
Posts: 488
Code Monkey
|
Code Monkey
Joined: Sep 2003
Posts: 488 |
I think this should work.... CHANGE THIS PART: SELECT U_Email <br />FROM {$config['tbprefix']}Users <br />WHERE U_Status = 'Administrator' TO THIS: SELECT U_Email <br />FROM {$config['tbprefix']}Users <br />WHERE U_Status = 'Administrator' <br />AND U_Username <> 'usernameofadmin' "usernameofadmin" is the one who is excluded from the mailings 8)
|
|
|
|
Joined: Jul 2003
Posts: 46
Junior Member
|
Junior Member
Joined: Jul 2003
Posts: 46 |
Let's up the anty! I have 9 Administrators, but ONLY want 2 of them to receive the mail notification. Is this possible to do? 
|
|
|
|
Joined: Apr 2001
Posts: 3,266
Member
|
Member
Joined: Apr 2001
Posts: 3,266 |
Actually change the query to this
SELECT U_Email
FROM {$config['tbprefix']}Users
WHERE U_Status = 'Administrator'
AND U_Username = 'firstadminname'
OR U_Username = 'secondadminname'
|
|
|
|
Joined: Jul 2003
Posts: 46
Junior Member
|
Junior Member
Joined: Jul 2003
Posts: 46 |
|
|
|
|
Joined: Sep 2006
Posts: 75
Power User
|
Power User
Joined: Sep 2006
Posts: 75 |
Is there any chance of having this work in 6.5? There is no adduser.php. Any hints?
|
|
|
|
Joined: Nov 2004
Posts: 25
Newbie
|
Newbie
Joined: Nov 2004
Posts: 25 |
works fine with 6.5 and 6.5 does have adduser.php
|
|
|
|
Joined: Sep 2006
Posts: 75
Power User
|
Power User
Joined: Sep 2006
Posts: 75 |
The only adduser.php there is, is a language dictionary file. It doesn't have the relevant code in it.
|
|
|
|
Joined: Oct 2003
Posts: 2,305
Old Hand
|
Old Hand
Joined: Oct 2003
Posts: 2,305 |
must be an adduser.php in the main ubbthreads directory or ya won;t be getting new users 
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 1,157
Joined: July 2001
|
|
Forums63
Topics37,575
Posts293,931
Members13,823
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|