$nick: $msg"; $line_end = "\"; ?>\n"; $old_content = file_get_contents("ssb_db/friends/" . ${"friend_chat_db" . $x} . ".php"); $notifications = file_get_contents("ssb_db/friends/" . ${"friend" . $x} . ".notifications"); // update conversation message count file_put_contents("ssb_db/friends/" . ${"friend_chat_db" . $x} . ".count", $msgCount); // conents into database file_put_contents("ssb_db/friends/" . ${"friend_chat_db" . $x} . ".php", $old_content . $line_start . $line_end); // notifications! file_put_contents("ssb_db/friends/" . ${"friend" . $x} . ".notifications", "" . $nick . " sent you a message\n" . $notifications); } } } else if (isset($_GET['get'])){ $friendNick = $_GET['get']; $nick = $_SESSION['ssb-user']; $friendcount = file_get_contents("ssb_db/friends/" . $nick . ".count"); include "ssb_db/friends/" . $nick . ".php"; for($x = 1; $x <= $friendcount; $x++) { if($friendNick == ${"friend" . $x}) { $msgCount = file_get_contents("ssb_db/friends/" . ${"friend_chat_db" . $x} . ".count"); include "ssb_db/friends/" . ${"friend_chat_db" . $x} . ".php"; for($y = 1; $y <= $msgCount; $y++) { echo ${"msg" . $y}; } } //else { echo "Not friend!"; } //echo "Finding friend in slot " . $x; } } ?>