chaoswar4u Posted June 3, 2007 Posted June 3, 2007 All the mail function works in v2 except when you recieve mail from a mass of from the system (admin) or when you send a mass mail from Your gang. The code for the Admin mass mail is staff special.php while($r=$db->fetch_row($q)) { $db->query("INSERT INTO mail VALUES('', 0, 0, {$r['userid']}, unix_timestamp(),'$subj','{$_POST['text']}')"); print "Mass mail sent to {$r['username']}. "; } I tried adding before the Mass mail sent $db->query("UPDATE users SET new_mail=new_mail+1 "); However this causes it to add 1 new mail per member. Example if you mass mailed 4 members then 1 member would get the Mail (4) but infact only have 1 mail to read. Code section for yourgang.php function gang_staff_massmailer() { global $db,$ir,$c,$userid,$gangdata; if($_POST['text']) { $subj="This is a mass mail from your gang"; $q=$db->query("SELECT * FROM users WHERE gang={$ir['gang']}"); while($r=$db->fetch_row($q)) { $db->query("INSERT INTO mail VALUES('', 0, {$ir['userid']}, {$r['userid']}, unix_timestamp(),'$subj','{$_POST['text']}')"); print "Mass mail sent to {$r['username']}. "; } print "Mass mail sending complete! > Back"; } else { print "Mass Mailer Text: "; } } Any help would be great. Many thx in advance for any replies. Quote
hamster01 Posted June 3, 2007 Posted June 3, 2007 Re: New Mail Problem. The function from yourgang.php: function gang_staff_massmailer() { global $db,$ir,$c,$userid,$gangdata; if($_POST['text']) { $subj="This is a mass mail from your gang"; $q=$db->query("SELECT * FROM users WHERE gang='{$ir['gang']}'"); while($r=$db->fetch_row($q)) { $db->query("INSERT INTO mail VALUES('', 0, '{$ir['userid']}', '{$r['userid']}', unix_timestamp(),'$subj','{$_POST['text']}')"); print "Mass mail sent to {$r['username']}. "; } print "Mass mail sending complete! [url='yourgang.php?action=staff']> Back[/url]"; } else { print "[b]Mass Mailer[/b] <form action='yourgang.php?action=staff&act2=massmailer' method='post'> Text: <textarea name='text' rows='7' cols='40'></textarea> <input type='submit' value='Send' /></form>"; } } Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.