📄 mailing_ing.php
字号:
<?
//////////////////////////////////ready
include "connect.php";
include "lib.php";
include "header.inc";
//////////////////////////////////Whole membership that admit mailling
if($level){$where="and level='$level'";}
$query="select distinct mail from $member_table where mailing='1' $where";
$total=mysql_query($query);
$total=mysql_num_rows($total);
//////////////////////////////////To take out member information
$admin=member_info($HTTP_COOKIE_VARS[$member_cookie]);
//////////////////////////////////mail address check of send person
chk_mail($from,"${error}错误的电子邮件地址");
//////////////////////////////////When is whole, check
if($to=="everyone"){
chk_level(1,0,"login.php?go=root.php");
$ready="\n\n本次处理,共给 ${total} 位会员发送了邮件。\n----论坛邮件系统";
$mail_title=" 管理面板>邮件列表>发送系统";
}
//////////////////////////////////When is one person, check
else{
chk_mail($to,"${error}错误的电子邮件地址");
$ready="\n\n发送给 ${to} 的电子邮件,已处理完毕。\n----论坛邮件系统";
$main_title=" 电邮系统>发送邮件";
}
?>
<script language=javascript>
function input_result(address,ok){
if(ok){result.memo.value="发给 "+address+" 完成!\n"+result.memo.value;}
else{result.memo.value="发给 "+address+" 失败!\n"+result.memo.value;}
}
function send_result(to){
if(to){result.memo.value="电子邮件将发向 <?=$total?> 位会员。 \n\n"+result.memo.value;}
else{result.memo.value="电子邮件将发向 <?=$to?> .\n\n"+result.memo.value;}
}
function view_process(str){
result.process.value=str;
}
function graph(per){
document.block.width=per;
}
</script>
<link rel=StyleSheet HREF=style.css type=text/css title=style>
<table width=100% height=100%>
<tr><td height=5></td></tr>
<tr><td valign=top>
<table align=center width=95% cellpadding=2 cellspacing=0 border=0 bgcolor=#F1F9FD>
<tr><td colspan=2 bgcolor=white><img src=image/logo.gif><br><br></td></tr>
<tr><td colspan=2 bgcolor=white>
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<td><?=$main_title?></td>
<td align=right><?=$help?></td>
</tr></table>
</td></tr>
<tr><td colspan=2 height=3 bgcolor=#2CBBFF></td></tr>
<tr><td colspan=2 bgcolor=#F1F9FD>
<table width=100% cellpadding=2 cellspacing=2>
<form name=result>
<tr>
<td bgcolor=#C9F0FF width=1% nowrap> 处理 </td>
<td width=99%> <input type=text name=process size=50 class=input readonly value='正在准备发送'><br>
<img src=image/block.gif height=10 width=1 name=block></td>
</tr>
<tr>
<td bgcolor=#C9F0FF width=1% nowrap> 结果 </td>
<td width=99%> <textarea name=memo readonly class=input style="overflow:auto;word-break:break-all" cols=50 rows=11><?=$ready?></textarea></td>
</tr>
</form>
</table>
</td></tr>
<tr><td colspan=2 height=3 bgcolor=#2CBBFF></td></tr>
<tr><td bgcolor=white><a href=# onclick=window.close()>关闭</a></td><td bgcolor=white><?=$copyright?></td></tr>
</table>
</td></tr></table>
<?
//////////////////////////////////default
$copyright="<br><br>$version navyism\n脚本:<a href=http://navyism.com/english target=_blank>http://navyism.com/english</a>\n汉化:<a href=http://www.hoopig.com target=_blank>http://www.hoopig.com/english</a> ";
echo"<script language=javascript>view_process(\"正在发送电子邮件\");</script>";
flush(stdout);
usleep(5000);
$i=0;
if(html=="text"){
$copyright="\n\nn@board $version navyism\nhttp://navyism.com/english";
$memo=strip_tags($memo);
}
//////////////////////////////////To send to whole
if($to=="everyone"){
$memo = stripslashes($memo);
if($html=="htmlbr") $memo=nl2br($memo);
$num=0;$i=0;
$query_temp="select distinct mail from $member_table where mailing='1' $where";
$result_temp=mysql_query($query_temp,$connect);
while($data_temp=mysql_fetch_array($result_temp))
{
$query="select * from $member_table where mail='$data_temp[mail]'";
$data=mysql_fetch_array(mysql_query($query));
$header = "Return-Path: $from\n";
$header .= "From: $admin[name] <$from>\n";
$header .= "Reply-to: $from\n";
if($html=="html" || $html=="htmlbr"){$header .= "Content-Type: text/html;";}
else{$header .= "Content-Type: text/plain;";}
$header .= "charset=euc-kr\n";
flush(stdout);
usleep(5000);
$send_result=@mail($data[mail],$title,$memo.$copyright,$header);
flush(stdout);
usleep(5000);
$num++;$i++;
$per=round(($i/$total)*270,0);
$perc=round(($i/$total)*100,0);
if($send_result){$ok=1;}else{$ok=0;}
echo"<script language=javascript>input_result(\"$data[mail]\",$ok);graph($per);</script>";
echo"<script language=javascript>view_process(\"正在发送邮件($num/$total) ${perc}%\");</script>";
flush(stdout);
usleep(5000);
}
echo"<script language=javascript>send_result(1);</script>";
flush(stdout);
usleep(5000);
echo"<script language=javascript>view_process(\"发送完成.\");graph(270);</script>";
flush(stdout);
usleep(5000);
}
//////////////////////////////////Send to only one person
else{
$header = "Return-Path: $from\n";
$header .= "From: $admin[name] <$from>\n";
$header .= "Reply-to: $from\n";
if($html=="html" || $html=="htmlbr"){$header .= "Content-Type: text/html;";}
else{$header .= "Content-Type: text/plain;";}
$header .= "charset=euc-kr\n";
$memo = stripslashes($memo);
if($html=="htmlbr") $memo=nl2br($memo);
$send_result=@mail($to,$title,$memo.$copyright,$header);
if($send_result){$ok=1;}else{$ok=0;}
echo"<script language=javascript>input_result(\"$to\",$ok);</script>";
flush(stdout);
usleep(5000);
echo"<script language=javascript>send_result(0);</script>";
flush(stdout);
usleep(5000);
echo"<script language=javascript>view_process(\"发送完成\");graph(270);</script>";
flush(stdout);
usleep(5000);
}
mysql_close($connect);
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -