Sent me a request for a friend ... when you accept you get automatically PM from me... Also, if you decline, you automatically get PM, not admitted to the friends.. Do you have the code, please ... 🙂
Pm For New Friends On The List
Started on the old forum in January 2009 · view the original in the archive · old links redirect here
TL;DR · summary of 12 replies
- -The fix was not resolved as the code provided did not work for sending a PM to the friend who accepted or declined.
- -Srecnica shared their corrected code, but the original thread concluded with "Thanks guys" indicating the issue might have been fixed by then.
- -looony suggested using a popup table structure instead of the ibwf private messages table, which Srecnica's final post mentioned they had changed to resolve the issue.
Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.
since i havent seen you on here asking for everyone to code everything for you ill code it in a min just give me a sec are u using the wapdesire script
if(isset($_SESSION['username'])) { print "everybody is a little loony inside"; } else { print"You should be shot"; }
read below
if(isset($_SESSION['username'])) { print "everybody is a little loony inside"; } else { print"You should be shot"; }
upload your genproc and sql here then ill do it
if(isset($_SESSION['username'])) { print "everybody is a little loony inside"; } else { print"You should be shot"; }
QUOTE (looony @ Jan 28 2009, 04:01 PM) <{POST_SNAPBACK}>
upload your genproc and sql here then ill do it
ok.. genproc....
CODEelse if($action=="bud") { $todo = $_GET["todo"]; $who = $_GET["who"]; addonline(getuid_sid($sid),"Dodaj/Obrisi Listu Prijatelja",""); echo "<card id="main" title="HAPPY Forum">"; echo " "; //$uid = getuid_sid($sid); $unick = getnick_uid($uid); $tnick = getnick_uid($who); if($todo=="add") { if(budres($uid,$who)!=3){ if(arebuds($uid,$who)) { echo "<img src="images/notok.gif" alt="x"/>$tnick is already your buddy "; }else if(budres($uid, $who)==0) { $res = mysql_query("INSERT INTO ibwf_buddies SET uid='".$uid."', tid='".$who."', reqdt='".time()."'"); if($res) { echo "<img src="images/ok.gif" alt="o"/>Molba ce biti poslata $tnick "; }else{ echo "<img src="images/notok.gif" alt="x"/>Nemozete uneti $tnick u vasu listu prijatejla! "; } } else if(budres($uid, $who)==1) { $res = mysql_query("UPDATE ibwf_buddies SET agreed='1' WHERE uid='".$who."' AND tid='".$uid."'"); if($res) { echo "<img src="images/ok.gif" alt="o"/>$tnick unet u vasu listu prijatelja! "; }else{ echo "<img src="images/notok.gif" alt="x"/>Nemozete uneti $tnick u vasu listu prijatejla! "; } } else{ echo "<img src="images/notok.gif" alt="x"/>Nemozete uneti $tnick u vasu listu prijatejla! "; } }else{ echo "<img src="images/notok.gif" alt="x"/>Nemozete uneti $tnick u vasu listu prijatejla! "; } }else if($todo="del") {
$res= mysql_query("DELETE FROM ibwf_buddies WHERE (uid='".$uid."' AND tid='".$who."') OR (uid='".$who."' AND tid='".$uid."')");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>$tnick obrisan iz vase liste prijatejla!
"; }else{ echo "<img src="images/notok.gif" alt="x"/>Nemozete obrisati $tnick iz vase liste prijatejla! "; }
} echo "<a href="index.php?action=main&sid=$sid"><img src="images/home.gif" alt="*"/>"; echo "HAPPY</a>"; echo " </card>";
end sl ...CODE-- --------------------------------------------------------
-- -- Table structure for table 'ibwf_buddies'
DROP TABLE IF EXISTS ibwf_buddies; CREATE TABLE ibwf_buddies ( id int(100) NOT NULL auto_increment, uid int(100) NOT NULL default '0', tid int(100) NOT NULL default '0', agreed char(1) NOT NULL default '0', reqdt int(100) NOT NULL default '0', PRIMARY KEY (id), KEY uid (uid) ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
else if($action=="bud")
{
$todo = $_GET["todo"];
$who = $_GET["who"];
addonline(getuid_sid($sid),"[b]Dodaj/Obrisi Listu Prijatelja[/b]","");
echo "<card id=\"main\" title=\"HAPPY Forum\">";
echo "<p align=\"center\">";
//$uid = getuid_sid($sid);
$unick = getnick_uid($uid);
$tnick = getnick_uid($who);
if($todo=="add")
{
if(budres($uid,$who)!=3){
if(arebuds($uid,$who))
{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>$tnick is already your buddy
";
}else if(budres($uid, $who)==0)
{
$res = mysql_query("INSERT INTO ibwf_buddies SET uid='".$uid."', tid='".$who."', reqdt='".time()."'");
if($res)
{
$sql = mysql_query("INSERT INTO ibwf_popups SET text='The User ".$who." has accepeted Your Buddy Request',byuid='$sitename',touid='$tnick',timesent='".time()."'");
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Molba ce biti poslata $tnick
";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Nemozete uneti $tnick u vasu listu prijatejla!
";
}
}
else if(budres($uid, $who)==1)
{
$res = mysql_query("UPDATE ibwf_buddies SET agreed='1' WHERE uid='".$who."' AND tid='".$uid."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>$tnick unet u vasu listu prijatelja!
";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Nemozete uneti $tnick u vasu listu prijatejla!
";
}
}
else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Nemozete uneti $tnick u vasu listu prijatejla!
";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Nemozete uneti $tnick u vasu listu prijatejla!
";
}
}else if($todo="del")
{
$res= mysql_query("DELETE FROM ibwf_buddies WHERE (uid='".$uid."' AND tid='".$who."') OR (uid='".$who."' AND tid='".$uid."')");
if($res)
{
$sql = mysql_query("INSERT INTO private SET text='The User ".$who." has Declined Your Buddy Request',byuid='$sitename',touid='$tnick',timesent='".time()."'");
echo "<img src=\"images/ok.gif\" alt=\"o\"/>$tnick obrisan iz vase liste prijatejla!
";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Nemozete obrisati $tnick iz vase liste prijatejla!
";
}
}
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "HAPPY</a>";
echo "</p></card>";
try that i havent tested it and u will have to translate into your langauge
if(isset($_SESSION['username'])) { print "everybody is a little loony inside"; } else { print"You should be shot"; }
QUOTE (looony @ Jan 29 2009, 08:33 AM) <{POST_SNAPBACK}>
else if($action=="bud") { $todo = $_GET["todo"]; $who = $_GET["who"]; addonline(getuid_sid($sid),"Dodaj/Obrisi Listu Prijatelja",""); echo "<card id=\"main\" title=\"HAPPY Forum\">"; echo "<p align=\"center\">"; //$uid = getuid_sid($sid); $unick = getnick_uid($uid); $tnick = getnick_uid($who); if($todo=="add") { if(budres($uid,$who)!=3){ if(arebuds($uid,$who)) { echo "<img src=\"images/notok.gif\" alt=\"x\"/>$tnick is already your buddy "; }else if(budres($uid, $who)==0) { $res = mysql_query("INSERT INTO ibwf_buddies SET uid='".$uid."', tid='".$who."', reqdt='".time()."'"); if($res) { $sql = mysql_query("INSERT INTO ibwf_popups SET text='The User ".$who." has accepeted Your Buddy Request',byuid='$sitename',touid='$tnick',timesent='".time()."'"); echo "<img src=\"images/ok.gif\" alt=\"o\"/>Molba ce biti poslata $tnick "; }else{ echo "<img src=\"images/notok.gif\" alt=\"x\"/>Nemozete uneti $tnick u vasu listu prijatejla! "; } } else if(budres($uid, $who)==1) { $res = mysql_query("UPDATE ibwf_buddies SET agreed='1' WHERE uid='".$who."' AND tid='".$uid."'"); if($res) { echo "<img src=\"images/ok.gif\" alt=\"o\"/>$tnick unet u vasu listu prijatelja! "; }else{ echo "<img src=\"images/notok.gif\" alt=\"x\"/>Nemozete uneti $tnick u vasu listu prijatejla! "; } } else{ echo "<img src=\"images/notok.gif\" alt=\"x\"/>Nemozete uneti $tnick u vasu listu prijatejla! "; } }else{ echo "<img src=\"images/notok.gif\" alt=\"x\"/>Nemozete uneti $tnick u vasu listu prijatejla! "; } }else if($todo="del") { $res= mysql_query("DELETE FROM ibwf_buddies WHERE (uid='".$uid."' AND tid='".$who."') OR (uid='".$who."' AND tid='".$uid."')"); if($res) { $sql = mysql_query("INSERT INTO private SET text='The User ".$who." has Declined Your Buddy Request',byuid='$sitename',touid='$tnick',timesent='".time()."'"); echo "<img src=\"images/ok.gif\" alt=\"o\"/>$tnick obrisan iz vase liste prijatejla! "; }else{ echo "<img src=\"images/notok.gif\" alt=\"x\"/>Nemozete obrisati $tnick iz vase liste prijatejla! "; } } echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>"; echo "HAPPY</a>"; echo "</p></card>";try that i havent tested it and u will have to translate into your langauge
not work 🙁 No PM for $who.....Added to the list of friends, but did not receive automatically PM
QUOTE (srecnica @ Jan 30 2009, 07:14 AM) <{POST_SNAPBACK}>
not work 🙁 No PM for $who.....Added to the list of friends, but did not receive automatically PM
ok can you put you popup sql up
if(isset($_SESSION['username'])) { print "everybody is a little loony inside"; } else { print"You should be shot"; }
QUOTE (looony @ Jan 29 2009, 11:27 PM) <{POST_SNAPBACK}>
ok can you put you popup sql up
Why popup? Why not private sql?CODE-- Struktura tabele popup
CREATE TABLE popup (
id int(100) NOT NULL auto_increment,
text text NOT NULL,
byuid int(100) NOT NULL default '0',
touid int(100) NOT NULL default '0',
unread char(1) NOT NULL default '1',
timesent int(100) NOT NULL default '0',
PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
My popup is no prefix ibwf perhaps is that a problem?
what table is used to store message data i dont use lava so dont have a clue
if(isset($_SESSION['username'])) { print "everybody is a little loony inside"; } else { print"You should be shot"; }
QUOTE (looony @ Feb 1 2009, 03:37 AM) <{POST_SNAPBACK}>
what table is used to store message data i dont use lava so dont have a clue
SQL-- --------------------------------------------------------
-- -- Table structure for table 'ibwf_private' --
DROP TABLE IF EXISTS ibwf_private;
CREATE TABLE ibwf_private (
id int(100) NOT NULL auto_increment,
text blob NOT NULL,
byuid int(100) NOT NULL default '0',
touid int(100) NOT NULL default '0',
unread char(1) NOT NULL default '1',
timesent int(100) NOT NULL default '0',
starred char(1) NOT NULL default '0',
reported char(1) NOT NULL default '0',
PRIMARY KEY (id)
) ENGINE=MyISAM ;
-- --------------------------------------------------------
It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt. ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ ! ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.
キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!
else if($action=="bud")
{
$todo = $_GET["todo"];
$who = $_GET["who"];
addonline(getuid_sid($sid),"[b]Dodaj/Obrisi Listu Prijatelja[/b]","");
echo "<card id=\"main\" title=\"HAPPY Forum\">";
echo "<p align=\"center\">";
//$uid = getuid_sid($sid);
$unick = getnick_uid($uid);
$tnick = getnick_uid($who);
if($todo=="add")
{
if(budres($uid,$who)!=3){
if(arebuds($uid,$who))
{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>$tnick is already your buddy
";
}else if(budres($uid, $who)==0)
{
$res = mysql_query("INSERT INTO ibwf_buddies SET uid='".$uid."', tid='".$who."', reqdt='".time()."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Molba ce biti poslata $tnick
";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Nemozete uneti $tnick u vasu listu prijatejla!
";
}
}
else if(budres($uid, $who)==1)
{
$res = mysql_query("UPDATE ibwf_buddies SET agreed='1' WHERE uid='".$who."' AND tid='".$uid."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>$tnick unet u vasu listu prijatelja!
";
$pmtext = "Ti porucuje da je tvoje prijateljstvo prihvaceno!!! [br/][br/][small] [b]Ovo je automatska poruka tvog novog prijatelja i ne moras odgovarati na nju[/b][/small]";
$tm = time();
$res = mysql_query("INSERT INTO ibwf_private SET text='".$pmtext."', byuid='".$uid."', touid='".$who."', timesent='".$tm."'");
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Nemozete uneti $tnick u vasu listu prijatejla!
";
}
}
else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Nemozete uneti $tnick u vasu listu prijatejla!
";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Nemozete uneti $tnick u vasu listu prijatejla!
";
}
}else if($todo="del")
{
$res= mysql_query("DELETE FROM ibwf_buddies WHERE (uid='".$uid."' AND tid='".$who."') OR (uid='".$who."' AND tid='".$uid."')");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>$tnick obrisan iz vase liste prijatejla!
";
$pmtext = "Ti porucuje da je tvoje prijateljstvo nije prihvaceno!!! [br/][br/][small] [b]Ovo je automatska poruka i ne moras odgovarati na nju[/b][/small]";
$tm = time();
$res = mysql_query("INSERT INTO ibwf_private SET text='".$pmtext."', byuid='".$uid."', touid='".$who."', timesent='".$tm."'");
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Nemozete obrisati $tnick iz vase liste prijatejla!
";
}
}
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "HAPPY</a>";
echo "</p></card>";
}
I made the code ... This code automtik PM friend is correct...working.:)... Thanks guys
here are one in english ive just done it fast so dnt know if everything are right
////////////////////////////
else if($action=="bud")
{
$todo = $_GET["todo"];
$who = $_GET["who"];
addonline(getuid_sid($sid),"Adding/Removing Buddy","");
echo "<card id=\"main\" title=\"Buddy\">";
echo "<p align=\"center\">";
//$uid = getuid_sid($sid);
$unick = getnick_uid($uid);
$tnick = getnick_uid($who);
if($todo=="add")
{
if(budres($uid,$who)!=3){
if(arebuds($uid,$who))
{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>$tnick is already your buddy";
}else if(budres($uid, $who)==0)
{
$res = mysql_query("INSERT INTO ibwf_buddies SET uid='".$uid."', tid='".$who."', reqdt='".time()."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>A request has been sent to $tnick";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>You can't add $tnick to your buddy list!";
}
}
else if(budres($uid, $who)==1)
{
$res = mysql_query("UPDATE ibwf_buddies SET agreed='1' WHERE uid='".$who."' AND tid='".$uid."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>$tnick Have accepted your request!";
$pmtext = "Your Buddy Request Have been Accepted** [br/][br/]";
$tm = time();
$res = mysql_query("INSERT INTO ibwf_private SET text='".$pmtext."', byuid='".$uid."', touid='".$who."', timesent='".$tm."'");
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Added to your buddy list successfully!";
}
}
else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>You can't add $tnick to your buddy list!";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>You can't add $tnick to your buddy list!";
}
}else if($todo="del")
{
$res= mysql_query("DELETE FROM ibwf_buddies WHERE (uid='".$uid."' AND tid='".$who."') OR (uid='".$who."' AND tid='".$uid."')");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>$tnick Is no longer your friend";
$pmtext = "Dont wona be friends!** [br/][br/]";
$tm = time();
$res = mysql_query("INSERT INTO ibwf_private SET text='".$pmtext."', byuid='".$uid."', touid='".$who."', timesent='".$tm."'");
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>can't remove $tnick from your buddy list!";
}
}
echo "</p></card>";
}
Jacques jacques@gw-designs.co.za http://coding.biz.tm Come join and lets make it a place to learn all the noobies how to code
NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH