Browse Source

Merge pull request #696 from Arantor/release-2.1

! Stats bars with 0-item entries (e.g. topics with 0 views, users online...
Arantor 10 years ago
parent
commit
ce30aeee95
2 changed files with 20 additions and 0 deletions
  1. 16 0
      Themes/default/Stats.template.php
  2. 4 0
      Themes/default/css/index.css

+ 16 - 0
Themes/default/Stats.template.php

@@ -111,6 +111,9 @@ function template_main()
 									<div class="bar" style="width: ', $poster['post_percent'] + 4, 'px;">
 										<div style="width: ', $poster['post_percent'], 'px;"></div>
 									</div>';
+		else
+			echo '
+									<div class="bar empty"></div>';
 
 		echo '
 									<span class="righttext">', $poster['num_posts'], '</span>
@@ -145,6 +148,10 @@ function template_main()
 									<div class="bar" style="width: ', $board['post_percent'] + 4, 'px;">
 										<div style="width: ', $board['post_percent'], 'px;"></div>
 									</div>';
+		else
+			echo '
+									<div class="bar empty"></div>';
+
 		echo '
 									<span class="righttext">', $board['num_posts'], '</span>
 								</dd>';
@@ -179,6 +186,9 @@ function template_main()
 									<div class="bar" style="width: ', $topic['post_percent'] + 4, 'px;">
 										<div style="width: ', $topic['post_percent'], 'px;"></div>
 									</div>';
+		else
+			echo '
+									<div class="bar empty"></div>';
 
 		echo '
 									<span class="righttext">' . $topic['num_replies'] . '</span>
@@ -211,6 +221,9 @@ function template_main()
 								<div class="bar" style="width: ', $topic['post_percent'] + 4, 'px;">
 									<div style="width: ', $topic['post_percent'], 'px;"></div>
 								</div>';
+		else
+			echo '
+									<div class="bar empty"></div>';
 
 		echo '
 								<span class="righttext">' . $topic['num_views'] . '</span>
@@ -281,6 +294,9 @@ function template_main()
 								<div class="bar" style="width: ', $poster['time_percent'] + 4, 'px;">
 									<div style="width: ', $poster['time_percent'], 'px;"></div>
 								</div>';
+		else
+			echo '
+									<div class="bar empty"></div>';
 
 		echo '
 								<span>', $poster['time_online'], '</span>

+ 4 - 0
Themes/default/css/index.css

@@ -3453,6 +3453,10 @@ dl.stats dd {
 	margin: 0 4px 0 0;
 	height: 1.4em;
 }
+.statsbar div.bar.empty {
+	width: 0;
+	border-right: none;
+}
 /* Absolute positioning stops these breaking the bars on narrow screens. */
 dl.stats dd span {
 	padding: 0 2px;