here is small php code for pm..
inbox.php
inbxproc.php
inbox.php
PHP Code:
if($action=="prijatelji")
{
addonline(getuid_sid($sid),"Salje PP za sve svoje prijatelje","");
echo "<card id=\"main\" title=\"Serbian world - Salji PP\">";
echo "<p align=\"center\">";
$whonick = getnick_uid($who);
echo "Posalji PP za sve svoje prijatelje<br/><br/>";
echo "<input name=\"pmtext\" maxlength=\"500\"/><br/>";
echo "<anchor>Posalji<go href=\"inbxproc.php?action=prijatelji&who=$who&sid=$sid\" method=\"post\">";
echo "<postfield name=\"pmtext\" value=\"$(pmtext)\"/>";
echo "</go></anchor><br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"http://coding-talk.com/images/home.gif\" alt=\"*\"/>";
echo "Pocetna</a><br/>Created by HartMann";
echo "</p>";
echo "</card>";
inbxproc.php
PHP Code:
if($action=="prijatelji")
{
echo "<card id=\"main\" title=\"Serbian World - Poruka poslata\">";
echo "<p align=\"center\">";
$byuid = getuid_sid($sid);
$whonick = getnick_uid($who);
$lastpm = mysql_fetch_array(mysql_query("SELECT MAX(timesent) FROM ibwf_private WHERE byuid='".$byuid."'"));
$pms = mysql_query("SELECT uid FROM ibwf_buddies WHERE tid='$byuid'");
$tm = time();
while($pm=mysql_fetch_array($pms))
{
mysql_query("INSERT INTO ibwf_private SET text='".$pmtext."[br/]ovu poruku sam poslao/la svim svojim prijateljima.', byuid='".$byuid."', touid='".$pm[0]."', timesent='".$tm."'");
}
$pmk = mysql_query("SELECT tid FROM ibwf_buddies WHERE uid='$byuid'");
while($pm1=mysql_fetch_array($pmk))
{
mysql_query("INSERT INTO ibwf_private SET text='".$pmtext."[br/]Ovu poruku sam poslao/la svim prijateljima..', byuid='".$byuid."', touid='".$pm1[0]."', timesent='".$tm."'");
}
echo "Poruka uspesno poslata!<br/> ";
echo "<br/><br/><a href=\"inbox.php?action=main&sid=$sid\">Back to inbox</a><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"http://coding-talk.com/images/home.gif\" alt=\"*\"/>";
echo "Pocetna</a>";
echo "</p>";
echo "</card>";
}
Comment