View file admin/pmall.php

File size: 4.51Kb
<?php
define('WCS',true);
include('../core/main.inc');
header_type();
cleardata();
if(ipbanned(ip(),browser())){
if(!shield(getuid_sid($sid))){
echo head_tag("Ip Blocked!!!",0,0);
echo ipbanned_msg();
echo foot_tag();
exit();
}
}
if(!islogged($sid)){
echo head_tag("Error!!!",0,0);
echo session_expired();
echo foot_tag();
exit();
}
if(banned(getuid_sid($sid))){
echo head_tag("Error!!!",1,getnick_sid($sid));
echo banned_msg($sid);
echo foot_tag();
exit();
}
mysql_query("UPDATE users SET browser='".browser()."', ipaddress='".ip()."', host='".subno()."' WHERE id='".getuid_sid($sid)."'");

/////////////////////////PM ALL Users/////////////////////////



if($sent==true)
{

addonline(getuid_sid($sid),"Admin Tools","");
echo head_tag(getnick_sid($sid)."@Admin Tools",1,getnick_sid($sid));
$title="<b>Admin Tools</b>";
$level=mysql_fetch_array(mysql_query("SELECT level FROM users WHERE id='".getuid_sid($sid)."'"));
if($level[0]>0){

  $byid = getuid_sid($sid);



  $tm24 = time();
  $tm = time();
  if($who=="all"){
  $lastpm = mysql_fetch_array(mysql_query("SELECT MAX(timesent) FROM inbox WHERE byid='".$byid."'"));
  $main.="<p align=\"center\">";
  $main.="<img src=\"../phpThumb/phpThumb.php?src=../images/ok.gif\" alt=\"x\"/>";
  $main.="All The Members have been sent The Message<br/>";
  $main.="</p>";
  $pms = mysql_query("SELECT id, username FROM users WHERE level >=0");
  $tm = time();
  while($pm=mysql_fetch_array($pms)){
  mysql_query("INSERT INTO inbox SET text='[b]Public Anouncment:[/b][br/]".$pmtou."[br/][i]This message was sent to all the members[/i]', byid='".$byid."', toid='".$pm[0]."', timesent='".$tm."'");
  }}



  else if($who=="staff"){ 
  $lastpm = mysql_fetch_array(mysql_query("SELECT MAX(timesent) FROM inbox WHERE byid='".$byid."'"));
  $main.="<p align=\"center\">";
  $main.="<img src=\"../phpThumb/phpThumb.php?src=../images/ok.gif\" alt=\"x\"/>";
  $main.="The Staff have been sent The Message<br/>";
  $main.="</p>";
  $pms = mysql_query("SELECT id, username FROM users WHERE level>0");
  $tm = microtime(get_as_float);
  while($pm=mysql_fetch_array($pms)){
  mysql_query("INSERT INTO inbox SET text='[b]Public Anouncment:[/b][br/]".$pmtou."[br/][i]This message was sent to all staff[/i]', byid='".$byid."', toid='".$pm[0]."', timesent='".$tm."'");
  }}

  else if($who=="online"){ 

$timeout=time()-1200;


  $lastpm = mysql_fetch_array(mysql_query("SELECT MAX(timesent) FROM inbox WHERE byid='".$byid."'"));
  $main.="<p align=\"center\">";
  $main.="<img src=\"../phpThumb/phpThumb.php?src=../images/ok.gif\" alt=\"x\"/>";
  $main.="all online members have been sent The Message<br/>";
  $main.="</p>";

////////
  $pms = mysql_query("SELECT id, username FROM users WHERE lastact>'".$timeout."'");

  $tm = microtime(get_as_float);
  while($pm=mysql_fetch_array($pms)){
  mysql_query("INSERT INTO inbox SET text='[b]Public Anouncment:[/b][br/]".$pmtou."[br/][i]This message was sent to all online members[/i]', byid='".$byid."', toid='".$pm[0]."', timesent='".$tm."'");
  }}



}}else{

	
	addonline(getuid_sid($sid),"Admin Tools","");
	echo head_tag(getnick_sid($sid)."@Admin Tools",1,getnick_sid($sid));
	$title="<b>Admin Tools</b>";
	$level=mysql_fetch_array(mysql_query("SELECT level FROM users WHERE id='".getuid_sid($sid)."'"));
	if($level[0]>0){

    
  $main="<p align=".align().">\n";
  $main.="This Will Send Pm To Numerous Members In One Go";
      
  $main.="<form action=\"./pmall.php?sent=true&amp;sid=$sid\" method=\"post\"><p align=\"center\">";
  $main.="Message:<input name=\"pmtou\" maxlength=\"400\"/><br/>";
  $main.="Recipient:<select name=\"who\">";
  $main.="<option value=\"staff\">Staff Members</option>";
  $main.="<option value=\"all\">All members</option>";
  $main.="<option value=\"online\">Online members</option>";
  
  $main.="</select><br/>";
  $main.="<input type=\"submit\" value=\"Update\"/>";
  $main.="</p></form>";

}}

if($level[0]<1){
addonline(getuid_sid($sid),"In The Forbidden Zone!","");
$main.="<img src=\"../images/error.gif\" alt=\"x\"/><br/>Permission Denied!<br/>
<br/>
$fivekey<a $key5 href=\"./tools.php?type=tools&amp;sid=$sid\">Back</a>
</p>\n";
}


$L1="$sixkey<a $key6 href=\"../inbox/inbox.php?sid=$sid\">Inbox</a>";
$L2="$sevenkey<a $key7 href=\"../buds/buds.php?sid=$sid\">BuddyList</a>";
$L3="$eightkey<a $key8 href=\"../chat/public.php?sid=$sid\">Chat</a>";
$L4="$ninekey<a $key9 href=\"../forums/forums.php?sid=$sid\">Forums</a>";
$L5="$zerokey<a $key0 href=\"../main.php?sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Main Menu</a>";
echo xhtml($sid,$title,1,$L1,$L2,$L3,$L4,$L5,0,0,0,$main);
?>