i go on many sites
and cant reset my pass
especially daffys ;)
so try this ;)
<td align="center"><a href=admincp.php?action=massemail><img src=images/admin/mail.gif border=0 width=32 height=32><br>Mass Email</a><BR></td>
at the bottom of your admincp before the last
?>
add
if($action == "massemail" && get_user_class() == 7) {
stdhead("Mass Email");
navmenu();
$class = 0 + $_POST["class"];
$or = $_POST["or"];
if ($_POST['do'] == "sendmsg")
{
begin_frame("Messages Sent");
$res = mysql_query("SELECT id, username, email FROM users WHERE class $or $class") or sqlerr(__FILE__, __LINE__);
$from_email = $site_config['SITEEMAIL']; //site email
$subject = substr(trim($_POST["subject"]), 0, 80);
if ($subject == "") $subject = "(no subject)";
$subject = "Fw: $subject";
$message1 = trim($_POST["message"]);
if ($message1 == "") stderr("Error", "Empty message!");
while($arr=mysql_fetch_array($res)){
$to = $arr["email"];
$message = "Message received from ".$site_config['SITENAME']." on " . gmdate("Y-m-d H:i:s") . " GMT.\n" .
"---------------------------------------------------------------------\n\n" .
$message1 . "\n\n" .
"---------------------------------------------------------------------\n".$site_config['SITENAME']."\n";
mail($to, $subject, $message, $from_email, "-f".$from_email) or die("error");
echo $arr['username'].", ";
}
end_frame();
}
begin_frame("Mass Email");
?>
<p><table border=0 class=main cellspacing=0 cellpadding=0><tr>
<td class=embedded><img src=/pic/email.gif></td>
<td class=embedded style='padding-left: 10px'><font size=3><b>Send mass e-mail to all members</b></font></td>
</tr></table></p>
<table border=1 cellspacing=0 cellpadding=5>
<form method=post action=admincp.php?action=massemail>
<input type='hidden' name='do' value='sendmsg' />
<!--<tr><td class=rowhead>Your name</td><td><input type=text name=from size=80></td></tr>-->
<?
print("<tr><td class=rowhead>Class</td><td colspan=2 align=left><select name=or><option value='<'><<option value='>'>><option value='='>=<option value='<='><=<option value='>='>>=</select><select name=class>\n");
$classes = mysql_query("SELECT group_id as id, level FROM groups ORDER BY group_id ASC");
while($carr = mysql_fetch_assoc($classes))
print("<option value=".$carr['id'].">" . htmlspecialchars($carr['level']) . "\n");
print("</select></td></tr>\n");
?>
<!--<tr><td class=rowhead>Your e-mail</td><td><input type=text name=from_email size=80></td></tr>-->
<tr><td class=rowhead>Subject</td><td><input type=text name=subject size=80></td></tr>
<tr><td class=rowhead>Body</td><td><textarea name=message cols=80 rows=20></textarea></td></tr>
<tr><td colspan=2 align=center><input type=submit value="Send" class=btn></td></tr>
</form>
</table>
<?php
end_frame();
stdfoot();
}
change this line to your required access level
if($action == "massemail" && get_user_class() == 7) {
tried and tested and working on version 2.05
all credits goto tbdev for this mod