Forráskód Böngészése

! Convert the stats page (and a bit of the profile page) to use a sprite instead of regular images.

Signed-off-by: Peter Spicer <[email protected]>
Peter Spicer 11 éve
szülő
commit
86eb121409

+ 3 - 3
Themes/default/Profile.template.php

@@ -1141,7 +1141,7 @@ function template_statPanel()
 		<div id="activitytime" class="flow_hidden">
 			<div class="cat_bar">
 				<h3 class="catbg">
-				<img src="', $settings['images_url'], '/stats_history.png" alt="" class="icon" />', $txt['statPanel_activityTime'], '
+					<span class="stats_icon history"></span>', $txt['statPanel_activityTime'], '
 				</h3>
 			</div>
 			<div class="windowbg2">
@@ -1188,7 +1188,7 @@ function template_statPanel()
 			<div id="popularposts">
 				<div class="cat_bar">
 					<h3 class="catbg">
-						<img src="', $settings['images_url'], '/stats_replies.png" alt="" class="icon" />', $txt['statPanel_topBoards'], '
+						<span class="stats_icon replies"></span>', $txt['statPanel_topBoards'], '
 					</h3>
 				</div>
 				<div class="windowbg2">
@@ -1227,7 +1227,7 @@ function template_statPanel()
 			<div id="popularactivity">
 				<div class="cat_bar">
 					<h3 class="catbg">
-						<img src="', $settings['images_url'], '/stats_replies.png" alt="" class="icon" />', $txt['statPanel_topBoardsActivity'], '
+						<span class="stats_icon replies"></span>', $txt['statPanel_topBoardsActivity'], '
 					</h3>
 				</div>
 				<div class="windowbg2">

+ 8 - 8
Themes/default/Stats.template.php

@@ -22,7 +22,7 @@ function template_main()
 		<div class="flow_hidden">
 			<div class="title_bar">
 				<h4 class="titlebg statstitle">
-					<img src="', $settings['images_url'], '/stats_info.png" class="icon" alt="" /> ', $txt['general_stats'], '
+					<span class="stats_icon general"></span>', $txt['general_stats'], '
 				</h4>
 			</div>
 			<div id="stats_left">
@@ -91,7 +91,7 @@ function template_main()
 			<div id="top_posters">
 				<div class="title_bar">
 					<h4 class="titlebg statstitle">
-						<img src="', $settings['images_url'], '/stats_posters.png" class="icon" alt="" /> ', $txt['top_posters'], '
+						<span class="stats_icon posters"></span>', $txt['top_posters'], '
 					</h4>
 				</div>
 					<div class="windowbg2">
@@ -128,7 +128,7 @@ function template_main()
 			<div id="top_boards">
 				<div class="title_bar">
 					<h4 class="titlebg statstitle">
-						<img src="', $settings['images_url'], '/stats_board.png" class="icon" alt="" /> ', $txt['top_boards'], '
+						<span class="stats_icon boards"></span>', $txt['top_boards'], '
 					</h4>
 				</div>
 					<div class="windowbg2">
@@ -167,7 +167,7 @@ function template_main()
 			<div id="top_topics_replies">
 				<div class="title_bar">
 					<h4 class="titlebg statstitle">
-						<img src="', $settings['images_url'], '/stats_replies.png" class="icon" alt="" /> ', $txt['top_topics_replies'], '
+						<span class="stats_icon replies"></span>', $txt['top_topics_replies'], '
 					</h4>
 				</div>
 					<div class="windowbg2">
@@ -203,7 +203,7 @@ function template_main()
 			<div id="top_topics_views">
 				<div class="title_bar">
 					<h4 class="titlebg statstitle">
-						<img src="', $settings['images_url'], '/stats_views.png" class="icon" alt="" /> ', $txt['top_topics_views'], '
+						<span class="stats_icon views"></span>', $txt['top_topics_views'], '
 					</h4>
 				</div>
 				<div class="windowbg2">
@@ -240,7 +240,7 @@ function template_main()
 			<div id="top_topics_starter">
 				<div class="title_bar">
 					<h4 class="titlebg statstitle">
-						<img src="', $settings['images_url'], '/stats_replies.png" class="icon" alt="" /> ', $txt['top_starters'], '
+						<span class="stats_icon starters"></span>', $txt['top_starters'], '
 					</h4>
 				</div>
 				<div class="windowbg2">
@@ -274,7 +274,7 @@ function template_main()
 			<div id="most_online">
 				<div class="title_bar">
 					<h4 class="titlebg statstitle">
-						<img src="', $settings['images_url'], '/stats_views.png" class="icon" alt="" /> ', $txt['most_time_online'], '
+						<span class="stats_icon history"></span>', $txt['most_time_online'], '
 					</h4>
 				</div>
 				<div class="windowbg2">
@@ -312,7 +312,7 @@ function template_main()
 		<br class="clear" />
 		<div class="cat_bar">
 			<h3 class="catbg">
-				<img src="', $settings['images_url'], '/stats_history.png" class="icon" alt="" /> ', $txt['forum_history'], '
+				<span class="stats_icon history"></span>', $txt['forum_history'], '
 			</h3>
 		</div>
 		<div class="flow_hidden">';

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

@@ -3393,6 +3393,28 @@ img.centericon {
 	border-left: 1px solid #fff;
 	margin-top: 8px;
 }
+.stats_icon {
+	width: 16px;
+	height: 16px;
+	display: inline-block;
+	background: url(../images/stats_icons.png) no-repeat 0 0;
+	margin: 2px 6px -1px 3px;
+}
+.stats_icon.general, .stats_icon.boards {
+	background-position: 0 0;
+}
+.stats_icon.posters {
+	background-position: -16px 0;
+}
+.stats_icon.replies, .stats_icon.starters {
+	background-position: -32px 0;
+}
+.stats_icon.history {
+	background-position: -48px 0;
+}
+.stats_icon.views {
+	background-position: -64px 0;
+}
 dl.stats {
 	clear: both;
 	overflow: hidden;

BIN
Themes/default/images/stats_icons.png