2 include
'../../system/classes/db.php';
3 include
'../../system/classes/sys.php';
4 include
'../../system/classes/user.php';
5 include
'../../system/classes/alert.php';
6 include
'../../system/classes/settings.php';
20 if (
$sql =
$db->query(
"SELECT id FROM {friends}
21 WHERE friendA = '".$uid.
"' AND friendB = '".
$hunted.
"'
24 AND aborted NOT LIKE '1'"))
27 if (
$res[0] ===
true )
29 if (
$sql =
$db->query(
"DELETE FROM {friends}
30 WHERE confirmed = '1' AND friendA = '".$uid.
"' AND friendB = '".
$hunted.
"'
31 OR confirmed = '1' AND friendA = '".
$hunted.
"' AND friendB = '".
$uid.
"'"))
33 \YAWK\sys::setSyslog(
$db, 17, 0,
"$userA un-friended $userB.",
$uid,
$hunted, 0, 0);
35 \YAWK\sys::setNotification(
$db, 3, 0,
"$userA un-friended you.",
$uid,
$hunted, 0, 0);
36 \YAWK\alert::draw(
"danger",
"Disconnected with $userB",
"You are not friend with $userB anymore.",
"",4200);
41 if (
$sql =
$db->query(
"INSERT INTO {friends} (friendA, friendB) VALUES ('$uid', '$hunted')"))
43 \YAWK\sys::setSyslog(
$db, 17, 0,
"$userA asked $userB for friendship",
$uid,
$hunted, 0, 0);
52 echo \YAWK\alert::draw(
"success",
"You sent a friend request to $userB.",
"Now you can take a cup of tea and... wait until $userB responds.",
"",4200);
56 echo \YAWK\alert::draw(
"warning",
"Error!",
"A database error occured, your request could not be sent. Please try again.",
"",4200);
62 echo \YAWK\alert::draw(
"danger",
"Error!",
"Some kind of error happened to the database. Please try again.",
"",4200);
static draw($type, $title, $text, $redirect, $delay)