I wont add this :
if any1 have the code to add this pls write at this topic
tnks
if any1 have the code to add this pls write at this topic

tnks
$pmtou = $_POST["pmtou"];
$byuid = getuid_sid($sid);
$tm = time();
$lastpm = mysql_fetch_array(mysql_query("SELECT MAX(timesent) FROM ibwf_private WHERE byuid='".$byuid."'"));
echo "All users has been send a pm
";
$pms = mysql_query("SELECT id, name FROM ibwf_users WHERE lastact>'".$tm24."'");
$tm = time();
while($pm=mysql_fetch_array($pms))
{
mysql_query("INSERT INTO ibwf_private SET text='[b]Public Anouncment:[/b][br/]".$pmtou."[br/][i]This message was sent to all the members[/i]', byuid='".$byuid."', touid='".$pm[0]."', timesent='".$tm."'");
}
echo "<form action=\"admproc.php?action=global&sid=$sid\" method=\"post\">"; echo "PM:<input name=\"pmtou\" maxlength=\"250\"/> "; echo "TO:<select name=\"who\">"; echo "<option value=\"staff\">staff</option>"; echo "<option value=\"all\">all members</option>"; echo "</select> "; echo "<input type=\"submit\" value=\"Update\"/>"; echo "</form>";
$who = $_POST["who"];
$pmtou = $_POST["pmtou"];
$byuid = getuid_sid($sid);
$tm = time();
if($who=="all"){
$lastpm = mysql_fetch_array(mysql_query("SELECT MAX(timesent) FROM ibwf_private WHERE byuid='".$byuid."'"));
echo "All users has been send a pm
";
$pms = mysql_query("SELECT id, name FROM ibwf_users WHERE lastact>'".$tm24."'");
$tm = time();
while($pm=mysql_fetch_array($pms))
{
mysql_query("INSERT INTO ibwf_private SET text='[b]Public Anouncment:[/b][br/]".$pmtou."[br/][i]This message was sent to all the members[/i]', byuid='".$byuid."', touid='".$pm[0]."', timesent='".$tm."'");
}
}else if($who=="staff"){
$lastpm = mysql_fetch_array(mysql_query("SELECT MAX(timesent) FROM ibwf_private WHERE byuid='".$byuid."'"));
echo "All users has been send a pm
";
$pms = mysql_query("SELECT id, name FROM ibwf_users WHERE perm>0");
$tm = time();
while($pm=mysql_fetch_array($pms))
{
mysql_query("INSERT INTO ibwf_private SET text='[b]Public Anouncment:[/b][br/]".$pmtou."[br/][i]This message was sent to all staff[/i]', byuid='".$byuid."', touid='".$pm[0]."', timesent='".$tm."'");
}
}
Comment