pm all online members ONLY! for owners

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    yeah has ANYBODY got anything at all to do with wapdesire v_2 script coz lavalair script really dnt help me pmpl x

    Comment


      #17
      Originally posted by cheeky-girl View Post
      yeah has ANYBODY got anything at all to do with wapdesire v_2 script coz lavalair script really dnt help me pmpl x
      wapdesire is lavalair script, be it a modded version

      Comment


        #18
        Originally posted by arg0s12 View Post
        PHP Code:
        $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<br/>";
          $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='Public Anouncment:[br/]".$pmtou."[br/]This message was sent to all the members', 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<br/>";
          $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='Public Anouncment:[br/]".$pmtou."[br/]This message was sent to all staff', byuid='".$byuid."', touid='".$pm[0]."', timesent='".$tm."'");
          }
        }else if($who=="males"){ 
          $lastpm = mysql_fetch_array(mysql_query("SELECT MAX(timesent) FROM ibwf_private WHERE byuid='".$byuid."'"));
          echo "All users has been send a pm<br/>";
          $pms = mysql_query("SELECT id, name FROM ibwf_users WHERE sex='M'");
          $tm = time();
          while($pm=mysql_fetch_array($pms))
          {
          mysql_query("INSERT INTO ibwf_private SET text='Public Anouncment:[br/]".$pmtou."[br/]This message was sent to all male members', byuid='".$byuid."', touid='".$pm[0]."', timesent='".$tm."'");
          }
        }else if($who=="females"){ 
          $lastpm = mysql_fetch_array(mysql_query("SELECT MAX(timesent) FROM ibwf_private WHERE byuid='".$byuid."'"));
          echo "All users has been send a pm<br/>";
          $pms = mysql_query("SELECT id, name FROM ibwf_users WHERE sex='F'");
          $tm = time();
          while($pm=mysql_fetch_array($pms))
          {
          mysql_query("INSERT INTO ibwf_private SET text='Public Anouncment:[br/]".$pmtou."[br/]This message was sent to all female members', byuid='".$byuid."', touid='".$pm[0]."', timesent='".$tm."'");
          }
        } 
        
        all that mess could be replaced by a neater looking...

        PHP Code:
        $who = $_POST["who"];
        $pmtou = $_POST["pmtou"];
        $byuid = getuid_sid($sid);
        if(in_array($who, array("all", "staff", "males", "females")))
         {
         $sendres = mysql_query("SELECT id, name FROM ibwf_users".($who != "all" ? " WHERE ".($who == "males" ? "sex='M'" : ($who == "females" : "sex='F'" : "perm > 0")):""));
         if(mysql_num_rows($sendres) > 0)
          {
          $ins = array();
          switch($who) {
           case "all": $whotxt = "members"; break;
           case "males": $whotxt = "male members"; break;
           case "females": $whotxt = "female members"; break;
           default: $whotxt = "staff";
           }
          $txt = "'".mysql_real_escape_string("Public Anouncment:[br/]$pmtou[br/]This message was sent to all $whotxt")."'";
          while($sendarr = mysql_fetch_assoc($sendres)) {
           $ins[] = "($txt,$byuid,".$sendarr['id'].", ".time().")";
           }
          mysql_query("INSERT INTO ibwf_private (text, byuid, touid, timesent) VALUES ".implode(",",$ins));
          echo "Message was sent to ".count($ins)." $whotxt. <br />";
          }
         else
          echo "No one matching your criteria was found, no PMs were sent.";
         }
        else
         echo "Unknown send to param."; 
        

        Comment


          #19
          I recoded this in WML but ut dosnt want to work..... If any 1 has it in WML it would be much appreciated
          BakGat
          Code:
          class Counter {
          public:
            void Count();
            int  ReadDisplay();
          private:
            int  CurrentCount;
          };








          Back up my hard drive? How do I put it in reverse?
          My Community
          BakGat
          sigpic

          Comment


            #20
            can ne 1 code this 4 a wap v2 script please

            Comment

            Working...
            X