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.
"'
22 OR friendA = '".
$hunted.
"' AND friendB = '".
$uid.
"'"))
25 if (
$res[0] ===
true )
27 if (
$sql =
$db->query(
"DELETE FROM {friends}
28 WHERE confirmed = '1' AND friendA = '".$uid.
"' AND friendB = '".
$hunted.
"'
29 OR confirmed = '1' AND friendA = '".
$hunted.
"' AND friendB = '".
$uid.
"'"))
31 \YAWK\sys::setSyslog(
$db, 17, 0,
"$userA un-friended $userB.",
$uid,
$hunted, 0, 0);
32 \YAWK\sys::setNotification(
$db, 3, 0,
"$userA un-friended you.",
$uid,
$hunted, 0, 0);
33 \YAWK\alert::draw(
"danger",
"Disconnected with $userB",
"You are not friend with $userB anymore.",
"",4200);
38 if (
$sql =
$db->query(
"INSERT INTO {friends} (friendA, friendB) VALUES ('$uid', '$hunted')"))
40 \YAWK\sys::setSyslog(
$db, 17, 0,
"$userA asked $userB for friendship",
$uid,
$hunted, 0, 0);
41 \YAWK\sys::setNotification(
$db, 3, 0,
"$userA want to be your friend<br>
42 <b><i class=\"fa fa-check-circle-o text-green\"> </i>
43 <i class=\"fa fa-times-circle-o text-red\"> </i></b>",
$uid,
$hunted, 0, 0);
45 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);
49 echo \YAWK\alert::draw(
"warning",
"Error!",
"A database error occured, your request could not be sent. Please try again.",
"",4200);
55 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)