Jump to content
MakeWebGames

New Mail Problem.


chaoswar4u

Recommended Posts

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.

Link to comment
Share on other sites

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>";
}
}
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...