Sending All Users One Message

Started on the old forum in February 2008 · view the original in the archive · old links redirect here

6 replies · 991 views · started 18 years ago · 1 min read

5 participants
nclemale36 Lead · 537 posts #1

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

mcKeny Developer · 130 posts #2

hmmm you could put the autopm function on the login page.... on my site i do something like this

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='1' , towho='".$i."' text='".$text."' new='1'"); 
}}

just edit it to work with the lava script

R.M.C

PHP Adovocate B)

Guest #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

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.

SpiderWap Lead · 622 posts #4
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='1' , towho='".$i."' text='".$text."' new='1'"); 
}}

What should i do next after inseting this into login.php

subzero Super moderator Fellow · 3,954 posts #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... _______…

Guest #7
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='".$byuid."'"));
    $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>'".$tm24."'");
    $tm = time();
    
    while($pm=mysql_fetch_array($pms))
        {
    
        
      mysql_query("INSERT INTO ibwf_private SET text='".$pmtext."', byuid='".$byuid."', touid='".$pm[0]."', timesent='".$tm."'");
      }

  
  echo "

<a href=\"inbox.php?action=main&sid=$sid\">Back to inbox</a>
";
  echo "<a href=\"index.php?action=main&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

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close