2 include
'../../../classes/db.php';
3 if (!isset(
$db)) {
$db = new \YAWK\db(); }
4 include
'../../../classes/sys.php';
9 $ip = $_SERVER[
'REMOTE_ADDR'];
17 if (isset($_POST[
'email'])){
24 $sql =
$db->query(
"SELECT email FROM {users} WHERE id ='" .
$uid .
"' AND privacy = 0");
47 if (
$db->query(
"INSERT INTO {blog_comments} (blogid, itemid, uid, gid, ip, date_created, name, email, comment)
48 VALUES('$blogid', '$itemid', '$uid', '$gid', '$ip', '$now', '$name', '$email', '$comment')"))
53 $year =
$date[
'year'];
54 $month =
$date[
'month'];
56 $time =
$date[
'time'];
57 $prettydate =
"$day. $month $year $time";
62 $html .=
"<p id=\"comment_thread\"><i><h5><strong>" .
$name .
"</strong> <small>on " . $prettydate .
"</small></h5></i> <div style=\"padding-left: 0.3em;\">" .
$comment .
"</div></p><hr>";
65 $sql2 =
$db->query(
"SELECT username FROM {users} WHERE id = '" .
$uid .
"'");
66 while ($row2 = mysqli_fetch_row($sql2)) {
69 $html .=
"<p id=\"comment_thread\"><i><h5><strong><a href=\"mailto:$email\">$row2[0]</a></strong> <small>am " . $prettydate .
"</small></h5></i> <div style=\"padding-left: 0.3em;\">" .
$comment .
"</div></p><hr>";
73 $html .=
"<p id=\"comment_thread\"><i><h5><strong>$row2[0]</strong> <small>am " . $prettydate .
"</small></h5></i> <div style=\"padding-left: 0.3em;\">" .
$comment .
"</div></p><hr>";
81 echo
"<p>There was an error saving your comment, we're sorry.</p>";
static splitDate($date)
split a date to month, day, year and time
static encodeChars($string)
convert german special chars and vowels into legal html