mirror of https://github.com/BOINC/boinc.git
parent
d6a39cfac0
commit
02a6928335
|
@ -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 "<img src=\"".NEW_IMAGE."\" alt=\"Unread post\" height=\"".NEW_IMAGE_HEIGHT."\">";
|
||||
show_image(NEW_IMAGE, "You haven't read this message yet", NEW_IMAGE_HEIGHT);
|
||||
}
|
||||
if ($rated_above_threshold){
|
||||
echo "<img src=\"".EMPHASIZE_IMAGE."\" alt=\"!\" height=\"".EMPHASIZE_IMAGE_HEIGHT."\">";
|
||||
show_image(EMPHASIZE_IMAGE, "This message has a high average rating", EMPHASIZE_IMAGE_HEIGHT);
|
||||
}
|
||||
|
||||
echo " <a href=\"forum_thread.php?id=".$thread->getID()."&nowrap=true#$post->id\">Message ".$post->getID()."</a> - ";
|
||||
|
@ -357,13 +357,26 @@ function show_post($post, $thread, $logged_in_user, $n, $controls=FORUM_CONTROLS
|
|||
echo "<p>", $posttext, "</p>";
|
||||
echo "</td></tr><tr><td class=\"postfooter\">ID: <i>", $post->id;
|
||||
if ($no_forum_rating != NULL) {
|
||||
echo " | <a href=\"forum_report_post.php?post=".$post->getID()."\"><img src=\"".REPORT_POST_IMAGE."\" alt=\"Report this post as offensive\" height=\"".REPORT_POST_IMAGE_HEIGHT."\" border=0></a></td>";
|
||||
echo " | <a href=\"forum_report_post.php?post=".$post->getID()."\">";
|
||||
show_image(REPORT_POST_IMAGE, "Report this post as offensive", REPORT_POST_IMAGE_HEIGHT);
|
||||
echo "</td>";
|
||||
} else {
|
||||
$rating = $post->getRating();
|
||||
echo " | Rating: ", $rating, "</i> | rate: <a href=\"forum_rate.php?post=".$post->getID()."&choice=p$tokens\"><img src=\"".RATE_POSITIVE_IMAGE."\" alt=\"+\" height=\"".RATE_POSITIVE_IMAGE_HEIGHT."\" border=0></a> / <a href=\"forum_rate.php?post=".$post->getID()."&choice=n$tokens\"><img src=\"".RATE_NEGATIVE_IMAGE."\" alt=\"-\" height=\"".RATE_NEGATIVE_IMAGE_HEIGHT."\" border=0></a> - <a href=\"forum_report_post.php?post=".$post->getID()."\"><img src=\"".REPORT_POST_IMAGE."\" alt=\"Report this post as offensive\" height=\"".REPORT_POST_IMAGE_HEIGHT."\" border=0></a></td>";
|
||||
echo " | Rating: ", $rating, "</i> | rate:
|
||||
<a href=\"forum_rate.php?post=".$post->getID()."&choice=p$tokens\">
|
||||
";
|
||||
show_image(RATE_POSITIVE_IMAGE, "Click if you like this message", RATE_POSITIVE_IMAGE_HEIGHT);
|
||||
echo "</a> / <a href=\"forum_rate.php?post=".$post->getID()."&choice=n$tokens\">";
|
||||
show_image(RATE_NEGATIVE_IMAGE, "Click if you don't like this message", RATE_NEGATIVE_IMAGE_HEIGHT);
|
||||
echo "</a> <a href=\"forum_report_post.php?post=".$post->getID()."\">";
|
||||
show_image(REPORT_POST_IMAGE, "Report this post as offensive", REPORT_POST_IMAGE_HEIGHT);
|
||||
echo "</a></td> ";
|
||||
}
|
||||
if (($controls == FORUM_CONTROLS) && (can_reply($thread, $logged_in_user))) {
|
||||
echo "<td align=right class=\"postfooter\">[<a href=\"forum_reply.php?thread=" . $thread->getID() . "&post=" . $post->getID() . "#input\">Reply to this post</a>]</td>";
|
||||
echo "<td align=right class=\"postfooter\">";
|
||||
$url = "forum_reply.php?thread=" . $thread->getID() . "&post=" . $post->getID() . "#input";
|
||||
show_button($url, "Reply", "Post a reply to this message");
|
||||
echo "</td>";
|
||||
} else {
|
||||
echo "<td class=\"postfooter\"></td>";
|
||||
}
|
||||
|
|
|
@ -100,23 +100,22 @@ function show_forum($category, $forum, $start, $sort_style, $logged_in_user) {
|
|||
echo "
|
||||
<tr class=row$n style=\"text-align:center\">";
|
||||
|
||||
if (!$category->is_helpdesk) { //Show thread icons if in forum:
|
||||
//Show thread icons if in forum:
|
||||
if (!$category->is_helpdesk) {
|
||||
echo "<td width=\"1%\" align=\"right\"><nobr>";
|
||||
$first_post = getFirstPost($thread->id);
|
||||
if ($first_post->score*$first_post->votes>$logged_in_user->high_rating_threshold) {
|
||||
echo "<img src=\"".EMPHASIZE_IMAGE."\" alt=\"Emphasized thread\">";
|
||||
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 "<img src=\"".FILTER_IMAGE."\" alt=\"Filtered thread\">";
|
||||
show_image(FILTER_IMAGE, "This thread has a low average rating");
|
||||
}
|
||||
if ($unread && !$thread->sticky) {
|
||||
echo "<img src=\"".NEW_IMAGE."\" alt=\"Unread post(s)\">";
|
||||
}
|
||||
elseif($unread) {
|
||||
echo "<img src=\"".NEW_IMAGE_STICKY."\" alt=\"Unread post(s)\">";
|
||||
}
|
||||
elseif($thread->sticky) {
|
||||
echo "<img src=\"".STICKY_IMAGE."\" alt=\"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 "</nobr></td>";
|
||||
}
|
||||
|
@ -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 "<td style=\"font-size:10pt; text-align:left\"><a href=\"forum_thread.php?id=", $thread->id, "\"><b>", $title, "</b></a><br>";
|
||||
$n = ($n+1)%2;
|
||||
|
|
|
@ -555,10 +555,11 @@ function sched_stopped() {
|
|||
function user_links($user) {
|
||||
$x = "<a href=\"".URL_BASE."/show_user.php?userid=".$user->id."\">".$user->name."</a>";
|
||||
if ($user->has_profile) {
|
||||
$x .= ' <a href="'.URL_BASE.'/view_profile.php?userid='.$user->id.'"><img border="0" src="'.URL_BASE.'/img/head_20.png" alt="User profile image"></a>';
|
||||
$x .= ' <a href="'.URL_BASE.'/view_profile.php?userid='.$user->id.'"><img title="View the profile of '.$user->name.'" vspace=2 border="0" src="'.URL_BASE.'/img/head_20.png" alt="User profile image"></a>';
|
||||
}
|
||||
# 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 "<a href=$url><input class=btn type=button value=\"$text\" title=\"$desc\"></a>\n";
|
||||
echo "<a href=$url><input onClick=\"document.location.href='$url'\" class=btn type=button value=\"$text\" title=\"$desc\"></a>\n";
|
||||
}
|
||||
|
||||
function show_image($src, $title, $height=null) {
|
||||
$h = "";
|
||||
if ($height) {
|
||||
$h = "height=\"$height\"";
|
||||
}
|
||||
echo "<img border=0 title=\"$title\" alt=\"$title\" src=\"$src\" $h>";
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -102,46 +102,46 @@ function show_forum($forum, $start, $sort_style, $user) {
|
|||
echo '<tr class="row_hd'.$n.'">';
|
||||
} else {
|
||||
// Just a standard thread.
|
||||
echo '<tr class="row'.$n.'">';
|
||||
echo '<tr class="row'.$n.'">';
|
||||
}
|
||||
|
||||
echo "<td width=\"1%\" align=\"right\"><nobr>";
|
||||
if ($user && ($thread->getRating()>$user->getHighRatingThreshold())) {
|
||||
echo "<img src=\"".EMPHASIZE_IMAGE."\" alt=\"Emphasized thread\">";
|
||||
show_image(EMPHASIZE_IMAGE, "This message has a high average rating");
|
||||
}
|
||||
if ($user && ($thread->getRating()<$user->getLowRatingThreshold())) {
|
||||
echo "<img src=\"".FILTER_IMAGE."\" alt=\"Filtered thread\">";
|
||||
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 "<img src=\"".NEW_IMAGE_STICKY_LOCKED."\" alt=\"Unread post(s), sticky, thread locked\">";
|
||||
} else {
|
||||
echo "<img src=\"".NEW_IMAGE_STICKY."\" alt=\"Unread post(s), sticky\">";
|
||||
}
|
||||
} else {
|
||||
if ($thread->isLocked()) {
|
||||
echo "<img src=\"".NEW_IMAGE_LOCKED."\" alt=\"Unread post(s), thread locked\">";
|
||||
} else {
|
||||
echo "<img src=\"".NEW_IMAGE."\" alt=\"Unread post(s)\">";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($thread->isSticky()) {
|
||||
if ($thread->isLocked()) {
|
||||
echo "<img src=\"".IMAGE_STICKY_LOCKED."\" alt=\"Sticky, thread locked\">";
|
||||
} else {
|
||||
echo "<img src=\"".IMAGE_STICKY."\" alt=\"Sticky\">";
|
||||
}
|
||||
} else {
|
||||
if ($thread->isLocked()) {
|
||||
echo "<img src=\"".IMAGE_LOCKED."\" alt=\"Thread locked\">";
|
||||
}
|
||||
}
|
||||
}
|
||||
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 "</nobr></td>";
|
||||
|
||||
$titlelength = 48;
|
||||
|
@ -154,12 +154,13 @@ function show_forum($forum, $start, $sort_style, $user) {
|
|||
$n = ($n+1)%2;
|
||||
|
||||
echo '
|
||||
<td>'.($thread->getPostCount()+1).'</td>
|
||||
<td align="left"><div class="authorcol">'.re_user_links($owner).'</div></td>
|
||||
<td>'.$thread->getViewCount().'</td>
|
||||
<td style="text-align:right">'.time_diff_str($thread->getLastTimestamp(), time()).'</td>
|
||||
</tr>';
|
||||
flush();
|
||||
<td>'.($thread->getPostCount()+1).'</td>
|
||||
<td align="left"><div class="authorcol">'.re_user_links($owner).'</div></td>
|
||||
<td>'.$thread->getViewCount().'</td>
|
||||
<td style="text-align:right">'.time_diff_str($thread->getLastTimestamp(), time()).'</td>
|
||||
</tr>
|
||||
';
|
||||
flush();
|
||||
}
|
||||
end_forum_table();
|
||||
echo $gotoStr; // Display the navigation bar at the bottom as well.
|
||||
|
|
Loading…
Reference in New Issue