Style sheet related modifications.

svn path=/trunk/boinc/; revision=2186
This commit is contained in:
David Anderson 2003-08-22 23:44:48 +00:00
parent f7154effa3
commit 081fca133c
1 changed files with 12 additions and 12 deletions

View File

@ -11,33 +11,33 @@ if (!empty($_GET['post'])) {
if ($choice == SOLUTION) { if ($choice == SOLUTION) {
$rating = 1; $rating = 1;
} else if ($choice == OFF_TOPIC) { } else if ($choice == OFF_TOPIC) {
$rating = -1; $rating = -1;
} }
// TODO: Define constants for these. // TODO: Define constants for these.
if ($choice == null && ($rating == null || $rating > 2 || $rating < -2)) { if ($choice == null && ($rating == null || $rating > 2 || $rating < -2)) {
show_result_page(false, NULL, $choice); show_result_page(false, NULL, $choice);
exit(); exit();
} }
$user = get_logged_in_user($true, '../'); $user = get_logged_in_user($true, '../');
$result = mysql_query("SELECT * FROM post WHERE id = $postId"); $result = mysql_query("SELECT * FROM post WHERE id = $postId");
if ($result) { if ($result) {
if (mysql_num_rows($result) > 0) { if (mysql_num_rows($result) > 0) {
$post = mysql_fetch_object($result); $post = mysql_fetch_object($result);
if ($choice == NULL || $choice == SOLUTION || $choice == OFF_TOPIC) { if ($choice == NULL || $choice == SOLUTION || $choice == OFF_TOPIC) {
$points = $post->votes * $post->score; $points = $post->votes * $post->score;
$votes = $post->votes + 1; $votes = $post->votes + 1;
$score = ($points + $rating) / $votes; $score = ($points + $rating) / $votes;
$result2 = mysql_query("UPDATE post SET votes = $votes, score = $score WHERE id = $postId"); $result2 = mysql_query("UPDATE post SET votes = $votes, score = $score WHERE id = $postId");
} else if ($choice == SUFFERER) { } else if ($choice == SUFFERER) {
$sql = "UPDATE thread SET sufferers = sufferers + 1 WHERE id = " . $post->thread; $sql = "UPDATE thread SET sufferers = sufferers + 1 WHERE id = " . $post->thread;
$result2 = mysql_query($sql); $result2 = mysql_query($sql);
} }
if ($result2) { if ($result2) {
show_result_page(true, $post, $choice); show_result_page(true, $post, $choice);
} else { } else {
@ -53,20 +53,20 @@ if (!empty($_GET['post'])) {
function show_result_page($success, $post, $choice) { function show_result_page($success, $post, $choice) {
$logged_in_user = get_logged_in_user(false, '../'); $logged_in_user = get_logged_in_user(false, '../');
if ($success) { if ($success) {
if ($choice) { if ($choice) {
page_head('Input Recorded', $logged_in_user, NULL, 'forum.css'); page_head('Input Recorded', $logged_in_user);
echo "<span class=\"title\">Helpdesk Input Recorded</span>"; echo "<span class=\"title\">Helpdesk Input Recorded</span>";
echo "<p>Your input has been successfully recorded. Thank you for your help.</p>"; echo "<p>Your input has been successfully recorded. Thank you for your help.</p>";
} else { } else {
page_head('Vote Registered', $logged_in_user, NULL, 'forum.css'); page_head('Vote Registered', $logged_in_user);
echo "<span class=\"title\">Vote Registered</span>"; echo "<span class=\"title\">Vote Registered</span>";
echo "<p>Your rating has been successfully recorded. Thank you for your input.</p>"; echo "<p>Your rating has been successfully recorded. Thank you for your input.</p>";
} }
echo "<a href=\"thread.php?id=", $post->thread, "#", $post->id, "\">Return to thread</a>"; echo "<a href=\"thread.php?id=", $post->thread, "#", $post->id, "\">Return to thread</a>";
} else { } else {
page_head('Vote Submission Problem', $logged_in_user, NULL, 'forum.css'); page_head('Vote Submission Problem', $logged_in_user);
echo "<span class=\"title\">Vote submission failed</span>"; echo "<span class=\"title\">Vote submission failed</span>";
if ($post) { if ($post) {
echo "<p>There was a problem recording your vote in our database. Please try again later.</p>"; echo "<p>There was a problem recording your vote in our database. Please try again later.</p>";