$action = $_GET['action']; if ($id == '') { echo 'Oi buster, watcha tryin\' to do? Post a comment into thin air? Give me a frekin\' article number!'; return 1; } if (get_pref('a_comment')) { if (!Auth::is_loggedin()) { echo 'This site requires that you login to post a comment'; return 1; } } if ($action == 'post') { $comment = $_POST['comment']; $date = time(); // Insert to database if (Auth::is_loggedin()) { $user = $_SESSION['user']; } else { $user = '******'; } $query = "INSERT INTO comments VALUES('','{$id}','{$user}','{$date}','{$comment}')"; if (mysql_query($query)) { echo '<b>Comment posted successfully!</b><br />'; echo 'Return to the <a href="index.php?module=news&article=' . $id . '">article</a>...'; } else { echo '<b>Error: Unable to post comment.</b>'; } } else { $theme = get_pref('theme'); require 'themes/' . $theme . '/postcomment.fbt'; }
<?php include 'api/classes/Auth.php'; include 'api/classes/Request.php'; include 'api/classes/Model/Quest.php'; session_start(); session_save_path('./session'); echo $_SESSION['username']; $db = new DBConnect(); $mysqli = $db->mysqli; $pdo = $db->getPDO(); $auth = new Auth(); if (!$auth->is_loggedin()) { $auth->redirect("/auth/index.php"); } $uid = $_SESSION['user_session']; $request = new Request($uid); ?> <!DOCTYPE html> <html> <head> <title>Questian :: Timeline</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0"> <meta name="theme-color" content="#00bcd9"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css"> <link rel="stylesheet" href="//rawgit.com/Soldier-B/jquery.toast/master/jquery.toast/jquery.toast.min.css" /> <link rel="stylesheet" href="css/noto.css">