Send pm to all buddies

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

    Send pm to all buddies

    Hi, coder have you this code for lava then plz post here. Thanx in advance.
    LoveForum.BiZ

    #2
    PHP Code:
    $text mysql_real_escape_string($_POST['text']);
    $tot time() - (30*60); // 30 mins * 60 secs
     
    $sql mysql_query("SELECT a.id, a.name FROM ibwf_users a INNER JOIN ibwf_buddies b  ON (a.id = b.uid) OR (a.id=b.tid) WHERE (b.uid='".$uid."' OR b.tid='".$uid."') AND b.agreed='1' AND a.lastact>'".$tot."' AND a.id!='".$uid."'");
    while (
    $id mysql_fetch_assoc($sql)){

    //insert where
    // $id['id'] = user id
    // $id['name'] = user name
    // $text = ur text sended from wml / html forms


    <?php unlink('World/Europe/Romania.country'); ?>

    Comment


      #3
      Originally posted by i0nutzxp View Post
      PHP Code:
      $text mysql_real_escape_string($_POST['text']);
      $tot time() - (30*60); // 30 mins * 60 secs
       
      $sql mysql_query("SELECT a.id, a.name FROM ibwf_users a INNER JOIN ibwf_buddies b  ON (a.id = b.uid) OR (a.id=b.tid) WHERE (b.uid='".$uid."' OR b.tid='".$uid."') AND b.agreed='1' AND a.lastact>'".$tot."' AND a.id!='".$uid."'");
      while (
      $id mysql_fetch_assoc($sql)){

      //insert where
      // $id['id'] = user id
      // $id['name'] = user name
      // $text = ur text sended from wml / html forms


      Sorry bro. i didnt get it plz can u make a perfect code for me like this bcz i m not a coder i cant make ..i have code of club owner send pm to all club members.


      else if($action=="pmallmem")
      {
      $clid=$_GET["clid"];
      $clinfo = mysql_fetch_array(mysql_query("SELECT name, owner, description, rules, logo, plusses, created FROM ibwf_clubs WHERE id='".$clid."'"));
      addonline(getuid_sid($sid),"Xhtml - PMing Club Members","");

      echo "<p align=\"center\">";
      boxstart ("Send Pm");
      echo "<b>PM All Members Of The $clinfo[0] Club</b><br/><br/>";
      echo "Please enter the message You Wish To Send To ALL Members Below<br/>";
      echo "<form action=\"index.php?action=sendclpm&amp;sid=$sid\" method=\"post\">";
      echo "<br/><input id=\"inputText\" name=\"pmtext\" maxlength=\"1000\"/><br/>";

      echo "<input type=\"hidden\" name=\"clid\" value=\"$clid\"/>";
      echo "<input type=\"hidden\" name=\"cname\" value=\"$clinfo[0] \"/>";
      echo "<br/><input id=\"inputButton\" type=\"submit\" value=\"SEND\"/></form>";

      echo "<p align=\"center\">";
      echo "(Service costs 100 Plusses)<br/>";
      echo "<a href=\"index.php?action=clubs&amp;sid=$sid\">";
      echo "Clubs list</a><br/>";
      $thid = mysql_fetch_array(mysql_query("SELECT themeid FROM ibwf_users WHERE id='".$uid."'"));
      $themeimageset = mysql_fetch_array(mysql_query("SELECT themedir FROM ibwf_iconset WHERE id='".$thid[0]."'"));
      echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
      echo "Home</a>";
      echo "</p>";
      boxend();
      exit();
      }
      /////////////////////////////////////////////////////////
      else if($action=="sendclpm")
      {
      $cname=$_POST["cname"];
      $clid=$_POST["clid"];
      $pmtext=$_POST["pmtext"];
      $clinfo = mysql_fetch_array(mysql_query("SELECT name, owner, description, rules, logo, plusses, created FROM ibwf_clubs WHERE id='".$clid."'"));
      $owner = $clinfo[1];
      addonline(getuid_sid($sid),"PMing Club Members","");

      echo "<p align=\"center\">";
      boxstart ("Send Pm");
      echo "<b>PM All Members Of The $clinfo[0] Club</b><br/><br/>";
      $mems = mysql_query("SELECT uid FROM ibwf_clubmembers WHERE clid='".$clid."' AND accepted='1'");
      while($row=mysql_fetch_array($mems))
      {
      $tm = time();
      $pmtextn = "$pmtext [br/][br/]* Automatic PM From [club=$clid] $cname [/club]Club!*";
      $res = mysql_query("INSERT INTO ibwf_private SET text='".$pmtextn."', byuid='".$owner."', touid='".$row[0]."', timesent='".$tm."'");
      }
      if($res)
      {

      echo "<img src=\"../images/ok.gif\" alt=\"O\"/>";
      echo "PMs sent successfully<br/><br/>";
      echo parsepm($pmtextn, $sid);
      mysql_query("UPDATE ibwf_users SET plusses=plusses-100 WHERE id='".$uid."'");
      echo "<br/><br/>-------<br/>100 plusses were subtracted from you<br/>";
      $nopl = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$uid."'"));
      echo "You now have: $nopl[0] plusses";
      }else{
      echo "<img src=\"../images/notok.gif\" alt=\"X\"/>";
      echo "Can't Send PM<br/><br/>";
      }
      echo "</p>";
      echo "<p align=\"center\">";
      echo "<a href=\"index.php?action=clubs&amp;sid=$sid\">";
      echo "Clubs list</a><br/>";
      $thid = mysql_fetch_array(mysql_query("SELECT themeid FROM ibwf_users WHERE id='".$uid."'"));
      $themeimageset = mysql_fetch_array(mysql_query("SELECT themedir FROM ibwf_iconset WHERE id='".$thid[0]."'"));
      echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
      echo "Home</a>";
      echo "</p>";
      boxend();
      exit();
      }
      LoveForum.BiZ

      Comment


        #4
        good time to start coding then if you own a site lol

        Comment


          #5
          Dear i can edit code if facing any error but i cant make code so plz help me.
          LoveForum.BiZ

          Comment


            #6
            this will work for mobile zonze .....

            in lists.php under action buds

            PHP Code:
            echo '<a href="inbox.php?action=pmallbuddy&amp;sid='.$sid.'&amp;uid='.$uid.'">Pm to all members</a><br/>'
            in inbox.php add a new action ...just past

            PHP Code:
            else if($action=="pmallbuddy")
            {
            $uid $_GET["uid"];
            addonline(getuid_sid($sid),"PMing to all in buddy ","");


            boxstart ("Send Pm");
            echo 
            "<b>PM All Members Of The $uid Club</b><br/><br/>";
            echo 
            "Please enter the message You Wish To Send To ALL Members Below<br/>";
            echo 
            "<form action=\"inbxproc.php?action=sendbdpm&amp;sid=$sid\" method=\"post\">";
            echo 
            "<br/><input id=\"inputText\" name=\"pmtext\" maxlength=\"1000\"/><br/>";

            echo 
            "<input type=\"hidden\" name=\"uid\" value=\"$uid\"/>";
            echo 
            "<br/><input id=\"inputButton\" type=\"submit\" value=\"SEND\"/></form>";
            echo 
            "(Service costs 10 Plusses)<br/>";
            echo 
            "<a href=\"lists.php?action=buds&amp;sid=$sid\">back to Buddy list</a><br/><br/>";
                

            boxend();
            getfooter($sid);
            exit();


            the pluses charged for this can b chaged as you wish .......

            thn in inboxproc.php

            PHP Code:
            else if($action=="sendbdpm")
            {
            $cname=$_POST["cname"];
            //$uid=$_POST["uid"];
            $pmtext=$_POST["pmtext"];
            $uid getuid_sid($sid); 

            addonline(getuid_sid($sid),"PMing all in buddy list","");

            echo 
            "<p align=\"center\">";
            boxstart ("Send Pm");
            echo 
            "<b>PM All Members in buddy list</b><br/><br/>";

            $mems mysql_query("SELECT uid, tid FROM ibwf_buddies WHERE (uid='".$uid."' OR tid='".$uid."') AND agreed='1'");

            while(
            $row=mysql_fetch_array($mems))
            {
            //$tm = time();

            $pmtextn "$pmtext [br/][br/]* pm send to all friends by ".getnick_uid($uid)." *";
            if(
            $row[0]!=$uid)
                
            $res mysql_query("INSERT INTO ibwf_private SET text='".$pmtextn."', byuid='".$uid."', touid='".$row[0]."', timesent='".time()."'");
            if(
            $row[1]!=$uid)
                
            $res mysql_query("INSERT INTO ibwf_private SET text='".$pmtextn."', byuid='".$uid."', touid='".$row[1]."', timesent='".time()."'");


            }
            if(
            $res)
            {

            echo 
            "<img src=\"../images/ok.gif\" alt=\"O\"/>";
            echo 
            "PMs sent successfully<br/><br/>";
            echo 
            parsepm($pmtextn$sid);
            mysql_query("UPDATE ibwf_users SET plusses=plusses-10 WHERE id='".$uid."'");
            echo 
            "<br/><br/>*__*__*__*__*<br/>50 plusses were subtracted from you<br/>";
            $nopl mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$uid."'"));
            echo 
            "You now have: $nopl[0] plusses";
            }else{
            echo 
            "<img src=\"../images/notok.gif\" alt=\"X\"/>";
            echo 
            "Can't Send PM<br/><br/>";
            }


            echo 
            "<br/><a href=\"lists.php?action=buds&amp;sid=$sid\">back to Buddy list</a><br/><br/>";
               


            boxend();
            getfooter($sid);
            exit();

            hope it will work good

            Comment


              #7
              its working thnx bro.
              Last edited by bigboss; 17.03.11, 05:31.
              LoveForum.BiZ

              Comment

              Working...
              X