summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--discussion.php14
-rw-r--r--includes/function.inc2
-rw-r--r--includes/template.inc4
3 files changed, 10 insertions, 10 deletions
diff --git a/discussion.php b/discussion.php
index 3014e9954..79e48d0dc 100644
--- a/discussion.php
+++ b/discussion.php
@@ -11,7 +11,7 @@ function discussion_moderate($moderate) {
$na = $comment_votes[key($comment_votes)];
foreach ($moderate as $id=>$vote) {
- if ($user && $vote != $comment_votes[$na] && !user_getHistory($user->history, "c$id")) {
+ if ($user->id && $vote != $comment_votes[$na] && !user_getHistory($user->history, "c$id")) {
### Update the comment's score:
$result = db_query("UPDATE comments SET score = score $vote, votes = votes + 1 WHERE cid = $id");
@@ -92,7 +92,7 @@ function discussion_childs($cid, $level = 0, $thread) {
function discussion_settings($mode, $order, $thold) {
global $user;
- if ($user) {
+ if ($user->id) {
db_query("UPDATE users SET umode = '$mode', uorder = '$order', thold = '$thold' WHERE id = '$user->id'");
user_rehash();
}
@@ -121,7 +121,7 @@ function discussion_display($sid, $pid, $cid, $level = 0) {
}
### Display `comment control'-box:
- if ($user) {
+ if ($user->id) {
$theme->commentControl($sid, $title, $thold, $mode, $order);
}
@@ -181,7 +181,7 @@ function discussion_reply($pid, $sid) {
$output .= "<FORM ACTION=\"discussion.php\" METHOD=\"post\">\n";
### Name field:
- if ($user) {
+ if ($user->id) {
$output .= "<P>\n";
$output .= " <B>Your name:</B><BR>\n";
$output .= " <A HREF=\"account.php\">$user->userid</A> &nbsp; &nbsp; <FONT SIZE=\"2\">[ <A HREF=\"account.php?op=logout\">logout</A> ]</FONT>\n";
@@ -221,14 +221,14 @@ function comment_preview($pid, $sid, $subject, $comment) {
global $anonymous, $user, $theme;
### Preview comment:
- if ($user) $theme->comment("", check_output(stripslashes($subject)), check_output(stripslashes($comment)), time(), "", "", "na", "", "", "reply to this comment");
- else $theme->comment($user->userid, check_output(stripslashes($subject)), check_output(stripslashes($comment)), time(), stripslashes($user->url), stripslashes($user->femail), "na", "", "", "reply to this comment");
+ if ($user->id) $theme->comment("", check_output(stripslashes($subject)), check_output(stripslashes($comment)), time(), "", "", "", "", "", "reply to this comment");
+ else $theme->comment($user->userid, check_output(stripslashes($subject)), check_output(stripslashes($comment)), time(), stripslashes($user->url), stripslashes($user->femail), "", "", "", "reply to this comment");
### Build reply form:
$output .= "<FORM ACTION=\"discussion.php\" METHOD=\"post\">\n";
### Name field:
- if ($user) {
+ if ($user->id) {
$output .= "<P>\n";
$output .= " <B>Your name:</B><BR>\n";
$output .= " <A HREF=\"account.php\">$user->userid</A> &nbsp; &nbsp; <FONT SIZE=\"2\">[ <A HREF=\"account.php?op=logout\">logout</A> ]</FONT>\n";
diff --git a/includes/function.inc b/includes/function.inc
index de2dbaac0..281eb0358 100644
--- a/includes/function.inc
+++ b/includes/function.inc
@@ -71,7 +71,7 @@ function format_date($timestamp, $type = "medium") {
return $date;
}
-function format_data($field, $replacement = "<I>n/a</I>") {
+function format_data($field, $replacement = "<I>na</I>") {
return ($field) ? $field : $replacement;
}
diff --git a/includes/template.inc b/includes/template.inc
index 08d469d94..8e86620a0 100644
--- a/includes/template.inc
+++ b/includes/template.inc
@@ -61,13 +61,13 @@ function display_old_headlines($theme, $num = 10) {
function display_comment_moderation($id, $author, $score, $votes) {
global $user, $comment_votes;
- if ($user && $user->userid != $author && !user_getHistory($user->history, "c$id")) {
+ if ($user->userid && $user->userid != $author && !user_getHistory($user->history, "c$id")) {
$output .= "<SELECT NAME=\"moderate[$id]\">\n";
foreach ($comment_votes as $key=>$value) $output .= " <OPTION VALUE=\"$value\">$key</OPTION>\n";
$output .= "</SELECT>\n";
}
else {
- $output .= "<TABLE BORDER=\"0\" CELLSPACING=\"1\" CELLPADDING=\"0\"><TR><TD>score:</TD><TD>$score</TD></TR><TR><TD>votes:</TD><TD>$votes</TR></TABLE>";
+ $output .= "<TABLE BORDER=\"0\" CELLSPACING=\"1\" CELLPADDING=\"0\"><TR><TD>score:</TD><TD>". format_data($score) ."</TD></TR><TR><TD>votes:</TD><TD>". format_data($votes) ."</TR></TABLE>";
}
print $output;