Send pm to all buddies

Started on the old forum in January 2011 · view the original in the archive · old links redirect here

6 replies · 650 views · started 15 years ago · 1 min read

4 participants
bigboss Developer · 110 posts #1

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

i0nutzxp Developer · 150 posts #2
$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'); ?>
bigboss Developer · 110 posts #3

i0nutzxp wrote:

$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 "

"; boxstart ("Send Pm"); echo "PM All Members Of The $clinfo[0] Club

"; echo "Please enter the message You Wish To Send To ALL Members Below "; echo "<form action="index.php?action=sendclpm&sid=$sid" method="post">"; echo " <input id="inputText" name="pmtext" maxlength="1000"/> ";

echo "<input type=\"hidden\" name=\"clid\" value=\"$clid\"/>";
 echo "<input type=\"hidden\" name=\"cname\" value=\"$clinfo[0] \"/>";

echo " <input id="inputButton" type="submit" value="SEND"/></form>";

echo "

"; echo "(Service costs 100 Plusses) "; echo "<a href="index.php?action=clubs&sid=$sid">"; echo "Clubs list</a> "; $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&sid=$sid"><img src="../images/home.gif" alt="*"/>"; echo "Home</a>"; echo " "; 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 "

"; boxstart ("Send Pm"); echo "PM All Members Of The $clinfo[0] Club

"; $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

"; echo parsepm($pmtextn, $sid); mysql_query("UPDATE ibwf_users SET plusses=plusses-100 WHERE id='".$uid."'"); echo "


100 plusses were subtracted from you "; $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

"; } echo " "; echo " "; echo "<a href="index.php?action=clubs&sid=$sid">"; echo "Clubs list</a> "; $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&sid=$sid"><img src="../images/home.gif" alt="*"/>"; echo "Home</a>"; echo " "; boxend(); exit(); }

something else Fellow · 2,296 posts #4

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

bigboss Developer · 110 posts #5

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

love_444 Junior · 38 posts #6

this will work for mobile zonze .....

in lists.php under action buds

echo '<a href="inbox.php?action=pmallbuddy&sid='.$sid.'&uid='.$uid.'">Pm to all members</a><br/>'; 

in inbox.php add a new action ...just past

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&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&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

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&sid=$sid\">back to Buddy list</a><br/><br/>";
   

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

hope it will work good

skils are gained by practis http://myguruworld.com/

Write your reply now; next you create a free account (or sign in) and it is posted right away. 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