Hi, coder have you this code for lava then plz post here. Thanx in advance.
Send pm to all buddies
Collapse
X
-
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'); ?>
-
Originally posted by i0nutzxp View PostPHP 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
}
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&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&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&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&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&sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
boxend();
exit();
}
Comment
-
this will work for mobile zonze .....
in lists.php under action buds
PHP Code:echo '<a href="inbox.php?action=pmallbuddy&sid='.$sid.'&uid='.$uid.'">Pm to all members</a><br/>';
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&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
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&sid=$sid\">back to Buddy list</a><br/><br/>";
boxend();
getfooter($sid);
exit();
}
Comment
Comment