From 02a692833568ccba6fd2f559983c20e291bf1b45 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 1 Nov 2007 20:41:24 +0000 Subject: [PATCH] - see last commit svn path=/trunk/boinc/; revision=14018 --- html/inc/forum.inc | 23 +++++++++--- html/inc/forum_show.inc | 21 ++++++----- html/inc/util.inc | 17 ++++++--- html/user/forum_forum.php | 73 ++++++++++++++++++++------------------- 4 files changed, 78 insertions(+), 56 deletions(-) diff --git a/html/inc/forum.inc b/html/inc/forum.inc index bc53ab9978..6a8f215da5 100644 --- a/html/inc/forum.inc +++ b/html/inc/forum.inc @@ -312,10 +312,10 @@ function show_post($post, $thread, $logged_in_user, $n, $controls=FORUM_CONTROLS } if ($logged_in_user && $post->getTimestamp()>$thread->getLastReadTimestamp($logged_in_user)){ - echo "\"Unread"; + show_image(NEW_IMAGE, "You haven't read this message yet", NEW_IMAGE_HEIGHT); } if ($rated_above_threshold){ - echo "\"!\""; + show_image(EMPHASIZE_IMAGE, "This message has a high average rating", EMPHASIZE_IMAGE_HEIGHT); } echo " getID()."&nowrap=true#$post->id\">Message ".$post->getID()." - "; @@ -357,13 +357,26 @@ function show_post($post, $thread, $logged_in_user, $n, $controls=FORUM_CONTROLS echo "

", $posttext, "

"; echo "ID: ", $post->id; if ($no_forum_rating != NULL) { - echo " | getID()."\">\"Report"; + echo " | getID()."\">"; + show_image(REPORT_POST_IMAGE, "Report this post as offensive", REPORT_POST_IMAGE_HEIGHT); + echo ""; } else { $rating = $post->getRating(); - echo " | Rating: ", $rating, " | rate: getID()."&choice=p$tokens\">\"+\" / getID()."&choice=n$tokens\">\"-\" - getID()."\">\"Report"; + echo " | Rating: ", $rating, " | rate: + getID()."&choice=p$tokens\"> + "; + show_image(RATE_POSITIVE_IMAGE, "Click if you like this message", RATE_POSITIVE_IMAGE_HEIGHT); + echo " / getID()."&choice=n$tokens\">"; + show_image(RATE_NEGATIVE_IMAGE, "Click if you don't like this message", RATE_NEGATIVE_IMAGE_HEIGHT); + echo " getID()."\">"; + show_image(REPORT_POST_IMAGE, "Report this post as offensive", REPORT_POST_IMAGE_HEIGHT); + echo " "; } if (($controls == FORUM_CONTROLS) && (can_reply($thread, $logged_in_user))) { - echo "[getID() . "&post=" . $post->getID() . "#input\">Reply to this post]"; + echo ""; + $url = "forum_reply.php?thread=" . $thread->getID() . "&post=" . $post->getID() . "#input"; + show_button($url, "Reply", "Post a reply to this message"); + echo ""; } else { echo ""; } diff --git a/html/inc/forum_show.inc b/html/inc/forum_show.inc index 3b057e5226..4b1b855666 100644 --- a/html/inc/forum_show.inc +++ b/html/inc/forum_show.inc @@ -100,23 +100,22 @@ function show_forum($category, $forum, $start, $sort_style, $logged_in_user) { echo " "; - if (!$category->is_helpdesk) { //Show thread icons if in forum: + //Show thread icons if in forum: + if (!$category->is_helpdesk) { echo ""; $first_post = getFirstPost($thread->id); if ($first_post->score*$first_post->votes>$logged_in_user->high_rating_threshold) { - echo "\"Emphasized"; + show_image(EMPHASIZE_IMAGE, "This thread has a high average rating"); } if ($first_post->score*$first_post->votes<$logged_in_user->low_rating_threshold) { - echo "\"Filtered"; + show_image(FILTER_IMAGE, "This thread has a low average rating"); } if ($unread && !$thread->sticky) { - echo "\"Unread"; - } - elseif($unread) { - echo "\"Unread"; - } - elseif($thread->sticky) { - echo "\"Sticky\""; + show_image(NEW_IMAGE, "You haven't read this thread yet"); + } else if($unread) { + show_image(NEW_IMAGE_STICKY, "This thread is sticky and you haven't read it yet"); + } else if($thread->sticky) { + show_image(STICKY_IMAGE, "This thread is sticky"); } echo ""; } @@ -124,7 +123,7 @@ function show_forum($category, $forum, $start, $sort_style, $logged_in_user) { $titlelength = 48; $title = cleanup_title($thread->title); if (strlen($title) > $titlelength) { - $title = substr($title,0,$titlelength)."..."; + $title = substr($title,0,$titlelength)."..."; } echo "id, "\">", $title, "
"; $n = ($n+1)%2; diff --git a/html/inc/util.inc b/html/inc/util.inc index b8b72f090b..b16441150d 100644 --- a/html/inc/util.inc +++ b/html/inc/util.inc @@ -555,10 +555,11 @@ function sched_stopped() { function user_links($user) { $x = "id."\">".$user->name.""; if ($user->has_profile) { - $x .= ' User profile image'; + $x .= ' User profile image'; } - # Does this project accept donations? - # If so, do you want to have a link next to user name as it appears on the web site? + // Does this project accept donations? + // If so, do you want to have a link next to user name as it appears on the web site? + // if ($user->donated == 1) { require_once("../project/donations.inc"); $x .= DONATION_LINK; @@ -767,7 +768,15 @@ function current_url() { } function show_button($url, $text, $desc) { - echo "\n"; + echo "\n"; +} + +function show_image($src, $title, $height=null) { + $h = ""; + if ($height) { + $h = "height=\"$height\""; + } + echo "\"$title\""; } ?> diff --git a/html/user/forum_forum.php b/html/user/forum_forum.php index 183b1c65ad..6a14ede8c8 100644 --- a/html/user/forum_forum.php +++ b/html/user/forum_forum.php @@ -102,46 +102,46 @@ function show_forum($forum, $start, $sort_style, $user) { echo ''; } else { // Just a standard thread. - echo ''; + echo ''; } echo ""; if ($user && ($thread->getRating()>$user->getHighRatingThreshold())) { - echo "\"Emphasized"; + show_image(EMPHASIZE_IMAGE, "This message has a high average rating"); } if ($user && ($thread->getRating()<$user->getLowRatingThreshold())) { - echo "\"Filtered"; + show_image(FILTER_IMAGE, "This message has a low average rating"); } if ($thread->isHidden()) { echo "X"; } - if ($unread) { - if ($thread->isSticky()) { - if ($thread->isLocked()) { - echo "\"Unread"; - } else { - echo "\"Unread"; - } - } else { - if ($thread->isLocked()) { - echo "\"Unread"; - } else { - echo "\"Unread"; - } - } - } else { - if ($thread->isSticky()) { - if ($thread->isLocked()) { - echo "\"Sticky,"; - } else { - echo "\"Sticky\""; - } - } else { - if ($thread->isLocked()) { - echo "\"Thread"; - } - } - } + if ($unread) { + if ($thread->isSticky()) { + if ($thread->isLocked()) { + show_image(NEW_IMAGE_STICKY_LOCKED, "This thread is sticky and locked, and you haven't read it yet"); + } else { + show_image(NEW_IMAGE_STICKY, "This thread is sticky and you haven't read it yet"); + } + } else { + if ($thread->isLocked()) { + show_image(NEW_IMAGE_LOCKED, "You haven't read this thread yet, and it's locked"); + } else { + show_image(NEW_IMAGE, "You haven't read this thread yet"); + } + } + } else { + if ($thread->isSticky()) { + if ($thread->isLocked()) { + show_image(IMAGE_STICKY_LOCKED, "This thread is sticky and locked"); + } else { + show_image(IMAGE_STICKY, "This thread is sticky"); + } + } else { + if ($thread->isLocked()) { + show_image(IMAGE_LOCKED, "This thread is locked"); + } + } + } echo ""; $titlelength = 48; @@ -154,12 +154,13 @@ function show_forum($forum, $start, $sort_style, $user) { $n = ($n+1)%2; echo ' - '.($thread->getPostCount()+1).' -
'.re_user_links($owner).'
- '.$thread->getViewCount().' - '.time_diff_str($thread->getLastTimestamp(), time()).' - '; - flush(); + '.($thread->getPostCount()+1).' +
'.re_user_links($owner).'
+ '.$thread->getViewCount().' + '.time_diff_str($thread->getLastTimestamp(), time()).' + + '; + flush(); } end_forum_table(); echo $gotoStr; // Display the navigation bar at the bottom as well.