diff --git a/css/profile.css b/css/profile.css index 0ba867c..8bfe327 100644 --- a/css/profile.css +++ b/css/profile.css @@ -72,3 +72,12 @@ div.page-with-form-body > form > p.form-inputs { background-color: #eeeeee; } +#question-page-table td.comments { + border-style: solid none solid none; + border-width: 1px; + padding: 2em 0; +} + +#question-page-table div.new-comment { + text-align:left; +} diff --git a/css/style.css b/css/style.css index 7c0ced2..2b1bc25 100644 --- a/css/style.css +++ b/css/style.css @@ -1,5 +1,5 @@ .sidebar-outer { - position: relative; + position: relative; } .none { @@ -60,7 +60,7 @@ } .sidebar-outer + div.col-sm-8 { - + } .fixed-sidebar a { @@ -121,7 +121,7 @@ width: 35px; height: 5px; background-color: black; - margin: 6px 0; + margin: 6px 0; } .t--dark div.navicon div { @@ -160,6 +160,7 @@ a.question-tags { .question-poster { padding: 5px 6px 7px 7px; + float: right; } .question-poster, .question-tags { @@ -216,4 +217,3 @@ form input, form textarea { form input:focus { outline-color: blue; } - diff --git a/css/toggles.css b/css/toggles.css index cb43abf..99b9d8a 100644 --- a/css/toggles.css +++ b/css/toggles.css @@ -1,7 +1,7 @@ table#question-page-table { padding: 0px; - width: 790px; border-collapse: separate; + width: 100%; border-spacing: 10px 50px; } @@ -23,6 +23,10 @@ table#question-page-table tr td div { text-align: center; } +#your-answer-ta { + width: 100%; +} + #bio { margin-bottom: 1em; width: 80%; @@ -137,4 +141,3 @@ td.output { margin-bottom: 40%; } } - diff --git a/images/unavailable.png b/images/unavailable.png index e47b95b..9931ce3 100644 Binary files a/images/unavailable.png and b/images/unavailable.png differ diff --git a/pages/ajax/answer.php b/pages/ajax/answer.php index 67edeb5..09c668a 100644 --- a/pages/ajax/answer.php +++ b/pages/ajax/answer.php @@ -1,12 +1,13 @@ -$way\n"; +} + +function votedOnQuestion($msg_id, $vote) { + global $dbc; + if (isset($_SESSION['id'])) { + $query = "SELECT vote FROM `user-message-votes` WHERE user_id = {$_SESSION['id']} AND message_id = $msg_id ORDER BY id DESC LIMIT 1"; // Select latest vote for the user for the question + $result = mysqli_query($dbc, $query); + return @mysqli_fetch_array($result, MYSQLI_NUM)[0] == $vote; + } + +} + // Return the answer to the question that has just been posted function getUpArrow() { global $fillColor; @@ -30,9 +46,11 @@ function getDownArrow() { $ansquery = ' SELECT messages.id AS msg_id, users.id AS usr_id, messages.body AS msg_body, users.profile_picture AS profile, users.first_name AS fn -FROM messages -JOIN users -ON users.id = messages.user_id'; +FROM messages +JOIN users +ON users.id = messages.user_id +ORDER BY date_entered DESC +LIMIT 1'; $ansresult = mysqli_query($dbc, $ansquery); $ansrow = mysqli_fetch_array($ansresult, MYSQLI_ASSOC); $ans_id = $ansrow['msg_id']; @@ -45,15 +63,13 @@ function getDownArrow() { $noAccountVoteDownBtn = getNoAccountButton($downarrow); $voteupbtn = isset($_SESSION['id']) ? "\t\n" : $noAccountVoteUpBtn; -$votedownbtn = isset($_SESSION['id']) ? "\t\t\n" : $noAccountVoteDownBtn; +$votedownbtn = isset($_SESSION['id']) ? "\t\t\n" : $noAccountVoteDownBtn; echo ""; echo ""; echo $voteupbtn; -$voteCount = $ansrow['votes'] == null ? 0 : $ansrow['votes']; - -echo "\t\t
$voteCount
"; +echo "\t\t
0
"; echo $votedownbtn; echo ""; // Generate query for answers' information @@ -81,11 +97,10 @@ function getDownArrow() { - + "; /* */ ?> - diff --git a/pages/includes/footer.html b/pages/includes/footer.html index 597748f..1ad22b4 100644 --- a/pages/includes/footer.html +++ b/pages/includes/footer.html @@ -11,9 +11,9 @@