Pm to Owners, Mods, admin, head admin, online members, all staff

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

    Pm to Owners, Mods, admin, head admin, online members, all staff

    Code:
     <?php
    include("config.php");
    include("core.php");
    //include("xhtmlfunctions.php");
    //include("chkisdn.inc.php");
    echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
    echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
    
    ?>
    
    <body>
    <?php
    $bcon = connectdb();
    $uid = getuid_sid($sid);
    $lang = mysql_fetch_array(mysql_query("SELECT lang FROM ibwf_users WHERE id='".$uid."'"));
    include("language.php");
    if (!$bcon)
    {
            echo "<p align=\"center\">";
        echo "<img src=\"images/exit.gif\" alt=\"*\"/><br/>";
        echo "ERROR! cannot connect to database<br/><br/>";
        echo "This error happens usually when backing up the database, please be patient, The site will be up any minute<br/><br/>";
        echo "<b>THANK YOU VERY MUCH</b>";
        echo "</p>";
    echo "</font></body>";
    echo "</html>";
          exit();
    }
    $brws = explode("/",$_SERVER['HTTP_USER_AGENT']);
    $ubr = $brws[0];
    $uip = getip();
    $action = $_GET["action"];
    $sid = $_GET["sid"];
    $page = $_GET["page"];
    $who = $_GET["who"];
    cleardata();
    if(isipbanned($uip,$ubr))
        {
          if(!isshield(getuid_sid($sid)))
          {
          boxstart("Error!");
    
          echo "<p align=\"center\">";
          echo "<img src=\"images/notok.gif\" alt=\"x\"/><br/>";
          echo "This IP address is blocked<br/>";
          echo "<br/>";
          echo "How ever we grant a shield against IP-Ban for our great users, you can try to see if you are shielded by trying to log-in, if you kept coming to this page that means you are not shielded, so come back when the ip-ban period is over<br/><br/>";
          $banto = mysql_fetch_array(mysql_query("SELECT  timeto FROM ibwf_metpenaltiespl WHERE  penalty='2' AND ipadd='".$uip."' AND browserm='".$ubr."' LIMIT 1 "));
          //echo mysql_error();
          $remain =  $banto[0] - (time() - $timeadjust) ;
          $rmsg = gettimemsg($remain);
          echo "Time to unblock the IP: $rmsg<br/><br/>";
    
          echo "</p>";
          echo "<p>";
      echo "<form action=\"login.php\" method=\"get\">";
      echo "Username:<br/> <input name=\"loguid\" format=\"*x\" size=\"8\" maxlength=\"30\"/><br/>";
      echo "Password:<br/> <input type=\"password\" name=\"logpwd\" size=\"8\" maxlength=\"30\"/><br/>";
    echo "<input type=\"submit\" value=\"Login\"/>";
    echo "</form>";
      echo "</p>";
            boxend();
          exit();
          }
        }
    if(($action != "") && ($action!="terms"))
    {
        $uid = getuid_sid($sid);
        if((islogged($sid)==false)||($uid==0))
        {
        boxstart("Error!");
    
          echo "<p align=\"center\">";
          echo "You are not logged in<br/>";
          echo "Or Your session has been expired<br/><br/>";
          echo "<a href=\"index.php\">Login</a>";
          echo "</p>";
    boxend();
    echo "</font></body></html>";
          exit();
        }
    
    
    
    }
    //echo isbanned($uid);
    if(isbanned($uid))
        {
          $pstyle = gettheme($sid);
    
          echo "<p align=\"center\">";
          echo "<img src=\"images/notok.gif\" alt=\"x\"/><br/>";
          echo "You are <b>Banned</b><br/>";
          $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_metpenaltiespl WHERE uid='".$uid."' AND penalty='1'"));
              $banres = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id='".$uid."'"));
    
          $remain = $banto[0]- (time() - $timeadjust) ;
          $rmsg = gettimemsg($remain);
          echo "Time to finish your penalty: $rmsg<br/><br/>";
              echo "Ban Reason: $banres[0]";
          //echo "<a href=\"index.php\">Login</a>";
          echo "</p>";
      echo xhtmlfoot();
          exit();
        }
    $res = mysql_query("UPDATE ibwf_users SET browserm='".$ubr."', ipadd='".$uip."' WHERE id='".getuid_sid($sid)."'");
    if(!isowner(getuid_sid($sid)))
      {
    
          echo "<p align=\"center\">";
          echo "You are not an owner<br/>";
          echo "<br/>";
          echo "<a href=\"index.php\">Home</a>";
          echo "</p>";
          exit();
        }
    ////////////////////////////////////////////////////
       if($action=="main")
    {
        addonline(getuid_sid($sid),"pm2all - xHTML","");
    
     echo "<p align=\"center\">";
    
        echo "<form action=\"pm2all.php?action=global&amp;sid=$sid\" method=\"post\">";
      echo "PM:<input name=\"pmtou\" maxlength=\"250\"/><br/>";
      echo "TO:<select name=\"who\">";
      echo "<option value=\"online\">Online users</option>";
      echo "<option value=\"staff\">staff</option>";
     echo "<option value=\"owners\">owners</option>";
     echo "<option value=\"admin\">admin</option>";
     echo "<option value=\"mods\">mods</option>";
     echo "<option value=\"headadmin\">headadmin</option>";
      echo "<option value=\"all\">all members</option>";
      echo "</select><br/>";
      echo "<input type=\"submit\" value=\"Update\"/>";
      echo "</form>";
    
    
            /////////main menu footer
    echo "<div class=\"footer\"><center><small>";
    	    echo "5.<a href=\"index.php?action=online&amp;sid=$sid\" accesskey=\"5\">Online Users(".getnumonline().")</a> |";
    	     echo "<a href=\"index.php?action=main&amp;sid=$sid\">Main Menu</a> <br/>";
    	     echo "<a href=\"index.php?action=chbmsg&amp;sid=$sid\">Set Mood</a> |";
                 echo "<a href=\"index.php?action=stats&amp;sid=$sid\">Site Stats</a><br/>";
                   echo "<a href=\"index.php?action=logout&amp;sid=$sid\">Log out</a><br/>";
    
    echo "<b>&#169; copyright 2009 &#169;</b><br/>www.WapLive.co.za<br/>";
               echo "</small></center></div>";
    
    
     }
    /////////////////////////////////////////////
      else if($action=="global")
    {
     addonline(getuid_sid($sid),"pm2all - xHTML","");
    
     echo "<p align=\"center\">";
    $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='Staff Anouncment:[br/]".$pmtou."[br/]This message was sent to all staff', byuid='".$byuid."', touid='".$pm[0]."', timesent='".$tm."'");
    }
    }
    else if($who=="mods"){
    $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>1");
    $tm = time();
    while($pm=mysql_fetch_array($pms))
    {
    mysql_query("INSERT INTO ibwf_private SET text='Staff Anouncment:[br/]".$pmtou."[br/]This message was sent to all Mods', byuid='".$byuid."', touid='".$pm[0]."', timesent='".$tm."'");
    }
    }
    else if($who=="owners"){
    $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>4");
    $tm = time();
    while($pm=mysql_fetch_array($pms))
    {
    mysql_query("INSERT INTO ibwf_private SET text='Staff Anouncment:[br/]".$pmtou."[br/]This message was sent to all owners', byuid='".$byuid."', touid='".$pm[0]."', timesent='".$tm."'");
    }
    }
    else if($who=="admin"){
    $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>2");
    $tm = time();
    while($pm=mysql_fetch_array($pms))
    {
    mysql_query("INSERT INTO ibwf_private SET text='Staff Anouncment:[br/]".$pmtou."[br/]This message was sent to all admin', byuid='".$byuid."', touid='".$pm[0]."', timesent='".$tm."'");
    }
    }
    else if($who=="headadmin"){
    $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>3");
    $tm = time();
    while($pm=mysql_fetch_array($pms))
    {
    mysql_query("INSERT INTO ibwf_private SET text='Staff Anouncment:[br/]".$pmtou."[br/]This message was sent to all head admin', byuid='".$byuid."', touid='".$pm[0]."', timesent='".$tm."'");
    }
    }
    else if($who=="online"){
      $lastpm = mysql_fetch_array(mysql_query("SELECT MAX(timesent) FROM ibwf_private WHERE byuid='".$byuid."'"));
    echo "<p align=\"center\">";
      echo "All online users where sent this pm<br/>";
      $pms = mysql_query("SELECT userid FROM ibwf_online");
      $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 online users at this moment in time[/i]', byuid='".$byuid."', touid='".$pm[0]."', timesent='".$tm."'");
      }
    }
             /////////main menu footer
    echo "<div class=\"footer\"><center><small>";
    	    echo "5.<a href=\"index.php?action=online&amp;sid=$sid\" accesskey=\"5\">Online Users(".getnumonline().")</a> |";
         echo "<a href=\"index.php?action=main&amp;sid=$sid\">Main Menu</a> <br/>";
    	     echo "<a href=\"index.php?action=chbmsg&amp;sid=$sid\">Set Mood</a> |";
                 echo "<a href=\"index.php?action=stats&amp;sid=$sid\">Site Stats</a><br/>";
                   echo "<a href=\"index.php?action=logout&amp;sid=$sid\">Log out</a><br/>";
    
    echo "<b>&#169; copyright 2009 &#169;</b><br/>www.WapLive.co.za<br/>";
               echo "</small></center></div>";
    
    
    
    
    }
    ?>
    Here are a pm to all create a file called pm2all.php and add above code in it u can send pm to Owners, Mods, Admins, Head Admins, All staff, All members Online
    ________________
    Jacques
    jacques@gw-designs.co.za
    http://coding.biz.tm
    Come join and lets make it a place to learn all the noobies how to code
    __________________

    NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

    #2
    thankz tolL

    Comment


      #3
      what ab0ut the sql

      Comment


        #4
        No sql needed u just add that page to ur site and link it up
        Code:
           echo "<a href=\"pm2all.php?action=main&amp;sid=$sid\">&#187;Pm 2 All</a><br/>";
        ________________
        Jacques
        jacques@gw-designs.co.za
        http://coding.biz.tm
        Come join and lets make it a place to learn all the noobies how to code
        __________________

        NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

        Comment


          #5
          I had added a contact site admin emailing system and the highest amount of similar messages i got were
          "please help me find a suitable girl to chat with me"
          tinyurl.com/earnbymobile
          Easy earning for Indians
          ---------------------
          Alternative mobile advertising network .. Minimum 100 USD pay / NET15 pay cycle, Good Brand, Best targeting for Android
          goo.gl/6vub3

          Comment


            #6
            Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/kozmoz/public_html/pm2all.php on line 15

            Warning: include(language.php) [function.include]: failed to open stream: No such file or directory in /home/kozmoz/public_html/pm2all.php on line 16

            Warning: include(language.php) [function.include]: failed to open stream: No such file or directory in /home/kozmoz/public_html/pm2all.php on line 16

            Warning: include() [function.include]: Failed opening 'language.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/kozmoz/public_html/pm2all.php on line 16

            Fatal error: Call to undefined function isowner() in /home/kozmoz/public_html/pm2all.php on line 107

            ----i got this error! hehe but i can fix this.. thanks mate,,
            LESS TALK. LESS MISTAKE.

            HTTP://APPSROB.COM - LIST OF MY FACEBOOK APPS!

            Comment


              #7
              u dnt have owner tools so change is owner to is admin and remove the line ontop the page include(language.php) then it will work
              ________________
              Jacques
              jacques@gw-designs.co.za
              http://coding.biz.tm
              Come join and lets make it a place to learn all the noobies how to code
              __________________

              NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

              Comment


                #8
                Pm to all team:
                PHP Code:
                $pms mysql_query("SELECT id, name FROM ibwf_users WHERE perm>'0'"); 
                Pm to any level of your team:
                PHP Code:
                $pms mysql_query("SELECT id, name FROM ibwf_users WHERE perm='1'");
                $pms mysql_query("SELECT id, name FROM ibwf_users WHERE perm='2'");
                $pms mysql_query("SELECT id, name FROM ibwf_users WHERE perm='3'");
                $pms mysql_query("SELECT id, name FROM ibwf_users WHERE perm='4'"); 
                Replace this with old source of riderz:
                www.inbuzunar.mobi - Your mobile portal pocket

                Comment

                Working...
                X