Sending All Users One Message

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

    Sending All Users One Message

    for example if you need to tell them some important info about site and it must be read by everyone.
    is it possible to send a inbox to everyone on the site in one go .

    using lava script.

    cheers
    Wapchat4u


    Topsites4u

    #2
    hmmm
    you could put the autopm function on the login page....
    on my site i do something like this
    Code:
    function textall($text)
    { 
    $sql= mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM mc_users "));
    for($i=0;$i<$sql[0];$i++)
    {
    mysql_query("INSERT INTO mc_text SET bywho=&#39;1&#39; , towho=&#39;".$i."&#39; text=&#39;".$text."&#39; new=&#39;1&#39;"); 
    }}
    just edit it to work with the lava script

    R.M.C
    ----------
    PHP Adovocate B)

    Comment


      #3
      for example if you need to tell them some important info about site and it must be read by everyone.
      is it possible to send a inbox to everyone on the site in one go .

      using lava script.

      cheers[/b]
      Its easy but becarefull not to overload the database with a function like that.
      You can rather change it to send the message to everybody that was online say in the past week. That way, you wont inbox people who is not active.

      Comment


        #4
        Code:
        function textall($text)
        { 
        $sql= mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users "));
        for($i=0;$i<$sql[0];$i++)
        {
        mysql_query("INSERT INTO ibwf_private SET bywho=&#39;1&#39; , towho=&#39;".$i."&#39; text=&#39;".$text."&#39; new=&#39;1&#39;"); 
        }}
        What should i do next after inseting this into login.php

        Click here!!!

        Comment


          #5
          shouldnt that go in core? its a function




          Comment


            #6
            sending to all users is a bad idea as oondocksaint said it also use cpu power.


            if you own your server meaning buy for
            Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
            Visit: WapMasterz Coming Back Soon!
            _______
            SCRIPTS FOR SALE BY SUBZERO
            Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
            FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
            _______
            Info & Tips
            php.net
            w3schools.com

            Comment


              #7
              Code:
              echo "<card id=\"main\" title=\"Inbox\">";
                echo "<p align=\"center\">";
                $pmtou = $_POST["pmtou"];
                 $byuid = getuid_sid($sid);
                $tm = time();
                $lastpm = mysql_fetch_array(mysql_query("SELECT MAX(timesent) FROM ibwf_private WHERE byuid=&#39;".$byuid."&#39;"));
                  $tm24 = time() - (24*60*60);
                  echo "All users that has been Active the in the next 24 hours has been send a pm
              ";
                  $pms = mysql_query("SELECT id, name FROM ibwf_users WHERE lastact>&#39;".$tm24."&#39;");
                  $tm = time();
                  
                  while($pm=mysql_fetch_array($pms))
                      {
                  
                      
                    mysql_query("INSERT INTO ibwf_private SET text=&#39;".$pmtext."&#39;, byuid=&#39;".$byuid."&#39;, touid=&#39;".$pm[0]."&#39;, timesent=&#39;".$tm."&#39;");
                    }
              
                
                echo "
              
              <a href=\"inbox.php?action=main&amp;sid=$sid\">Back to inbox</a>
              ";
                echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p>";
                  echo "</card>";
              try this one u can send a pm to all the users that has been active the next 24 hours

              Comment

              Working...
              X