Help Me.
Started on the old forum in July 2008 · view the original in the archive · old links redirect here
How can i send a pm to users online or all users or staff users 😕 Help me pls 😢
Use the search tool, its already been posted about 10 times 🙂
try this CODEfunction PMtoALL($text){ $sql = @mysql_query("SELECT id FROM ibwf_users"); while ($id = @mysql_fetch_array($sql)){ @mysql_query("INSERT INTO ibwf_private SET byuid = '1', touid = '".$id[0]."', text = '".$text."', timesent = '".time()."'"); } } //// this is the id of the owner, if u are the owner put your id here byuid = '1'
try this CODE function PMtoALL($text){ $sql = @mysql_query("SELECT id FROM ibwf_users"); while ($id = @mysql_fetch_array($sql)){ @mysql_query("INSERT INTO ibwf_private SET byuid = '1', touid = '".$id[0]."', text = '".$text."', timesent = '".time()."'"); } } //// this is the id of the owner, if u are the owner put your id here byuid = '1' Does not work:( where have to put this? in core i think but give me one erros:( help me 🙁 uffff
I search but i don'd found nothing:( u can help me? u can give me a link to a topic or something pls :(
type in search
PM to all members
or
just code it.. it would work like...
create the inbox thinggy where you enter the text, in the other part select all the members ids then insert it into the inbox as a unred message... look how the inbox works, study the coding, think how it would work then try and do it..
nothing can go wrong if you just try.. download soething called xampp and test everything offline
JUST FOLLOW THESE STEPS:
- put this in core.php
function PMtoALL($text){
$sql = @mysql_query("SELECT id FROM ibwf_users");
while ($id = @mysql_fetch_array($sql)){
@mysql_query("INSERT INTO ibwf_private SET byuid = '1', touid = '".$id[0]."', text = '".$text."', timesent = '".time()."'");
}
}
//// this is the id of the owner, if u are the owner put your id here
byuid = '1'
- in admincp.php put this:
else if ($action=="pmtoall"){
echo '<card id="main" title="Send pm to all">
';
echo 'Send pm to all:
';
echo '<input type="text" name="msg"/>
';
echo '<anchor>send';
echo "<go href=\"adminproc.php?action=pmtoall&sid=$sid\" method=\"post\">";
echo "<postfield name=\"msg\" value=\"$(msg)\"/>";
echo '</go></anchor>';
echo '</p></card>';
}
- and in adminproc.php put this:
else if ($action=="pmtoall"){
echo '<card id="main" title="Send pm to all">
';
$msg = $_POST['msg'];
PMtoALL($msg);
echo 'Pm sent to all users!
';
echo "<a href=\"index.php?action=main&sid=$sid\">index</a>";
echo '</p></card>';
}
JUST FOLLOW THESE STEPS:
- put this in core.php
function PMtoALL($text){ $sql = @mysql_query("SELECT id FROM ibwf_users"); while ($id = @mysql_fetch_array($sql)){ @mysql_query("INSERT INTO ibwf_private SET byuid = '1', touid = '".$id[0]."', text = '".$text."', timesent = '".time()."'"); } } //// this is the id of the owner, if u are the owner put your id here byuid = '1'
- in admincp.php put this:
else if ($action=="pmtoall"){ echo '<card id="main" title="Send pm to all"> '; echo 'Send pm to all: '; echo '<input type="text" name="msg"/> '; echo '<anchor>send'; echo "<go href=\"adminproc.php?action=pmtoall&sid=$sid\" method=\"post\">"; echo "<postfield name=\"msg\" value=\"$(msg)\"/>"; echo '</go></anchor>'; echo '</p></card>'; }
- and in adminproc.php put this:
else if ($action=="pmtoall"){ echo '<card id="main" title="Send pm to all"> '; $msg = $_POST['msg']; PMtoALL($msg); echo 'Pm sent to all users! '; echo "<a href=\"index.php?action=main&sid=$sid\">index</a>"; echo '</p></card>'; }
thenks kosty a lot 😀 u are my man..it work 😀 😮
Can v use the same code for Pm to Online user. . i tried but failed.. .I replace core function ibwf_users to ibwf_online. but pm didnt send to online members. . Plz post the actual code
Its maybe like this
function PMtoALL($text){
$offline = 300;
$sql = @mysql_query("select * from `ibwf_users` WHERE lastvst>'".intval(time()-$offline)."'");
while ($id = @mysql_fetch_array($sql)){
@mysql_query("INSERT INTO ibwf_private SET byuid = '1', touid = '".$id[0]."', text = '".$text."', timesent = '".time()."'");
}
}
Its maybe like this
function PMtoALL($text){ $offline = 300; $sql = @mysql_query("select * from `ibwf_users` WHERE lastvst>'".intval(time()-$offline)."'"); while ($id = @mysql_fetch_array($sql)){ @mysql_query("INSERT INTO ibwf_private SET byuid = '1', touid = '".$id[0]."', text = '".$text."', timesent = '".time()."'"); } }
Bro it will
Btw thanks for reply ..tc
function PMtoALL($text){
$offline = 300;
$sql = @mysql_query("SELECT * from ibwf_users WHERE lastact>'".intval(time()-$offline)."'");
while ($id = @mysql_fetch_array($sql)){
@mysql_query("INSERT INTO ibwf_private SET byuid = '1', touid = '".$id[0]."', text = '".$text."', timesent = '".time()."'");
}
}