Changeset 6777
- Timestamp:
- 10/30/06 10:42:22 (2 years ago)
- Files:
-
- wp-stats/trunk/readme.html (modified) (6 diffs)
- wp-stats/trunk/stats/stats-options.php (modified) (3 diffs)
- wp-stats/trunk/stats/stats-widget.php (modified) (10 diffs)
- wp-stats/trunk/stats/stats.php (modified) (33 diffs)
- wp-stats/trunk/stats/wp-stats.pot (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
wp-stats/trunk/readme.html
r6424 r6777 3 3 <head> 4 4 <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 5 <title>WP-Stats 2.0 5Readme</title>5 <title>WP-Stats 2.06 Readme</title> 6 6 <style type="text/css" media="screen"> 7 7 /* Default Style */ … … 181 181 <div id="Container"> 182 182 <!-- Title --> 183 <div id="Title">WP-Stats 2.0 5 <span style="color: #aaaaaa;">Readme</span></div>183 <div id="Title">WP-Stats 2.06 <span style="color: #aaaaaa;">Readme</span></div> 184 184 185 185 <!-- Tabs --> … … 202 202 <script type="text/javascript"> 203 203 /* <![CDATA[*/ 204 document.write(' <a href="mailto:gamerz84@hotmail.com?Subject=WP-Stats%202.0 5%20Support" title="EMail To gamerz84@hotmail.com">gamerz84@hotmail.com</a>');204 document.write(' <a href="mailto:gamerz84@hotmail.com?Subject=WP-Stats%202.06%20Support" title="EMail To gamerz84@hotmail.com">gamerz84@hotmail.com</a>'); 205 205 /* ]]> */ 206 206 </script> … … 211 211 <p><b>Development:</b><br /><b>»</b> <a href="http://dev.wp-plugins.org/browser/wp-stats/" title="http://dev.wp-plugins.org/browser/wp-stats/">http://dev.wp-plugins.org/browser/wp-stats/</a></p> 212 212 <p><b>Support Forums:</b><br /><b>»</b> <a href="http://forums.lesterchan.net/viewforum.php?f=6" title="http://forums.lesterchan.net/viewforum.php?f=6">http://forums.lesterchan.net/viewforum.php?f=6</a></p> 213 <p><b>Updated:</b><br /><b>»</b> 1st October 2006</p> 213 <p><b>Updated:</b><br /><b>»</b> 1st October 2006</p> 214 <p><b>Note:</b><br /><b>»</b> I have localize WP-Stats, if there is any bug or some text is not translated properly, please contact me immediately.</p> 214 215 <div class="SubSubTitle">Changelog</div> 215 216 <ul> 217 <li> 218 <b>Version 2.06 (11-12-2006)</b> 219 <ul> 220 <li>NEW: Localize WP-Stats</li> 221 </ul> 222 <li> 216 223 <li> 217 224 <b>Version 2.05 (01-10-2006)</b> … … 293 300 <div id="Upgrade" style="display: none;"> 294 301 <div class="SubTitle">» Upgrade Instructions</div> 295 <div class="SubSubTitle">From v1.0x To v2.0 5</div>302 <div class="SubSubTitle">From v1.0x To v2.06</div> 296 303 <ol> 297 304 <li> … … 371 378 </div> 372 379 </div> 373 <p id="Copyright">WP-Stats 2.0 5<br />Copyright © 2006 Lester 'GaMerZ' Chan. All Rights Reserved.</p>380 <p id="Copyright">WP-Stats 2.06<br />Copyright © 2006 Lester 'GaMerZ' Chan. All Rights Reserved.</p> 374 381 </body> 375 382 </html> wp-stats/trunk/stats/stats-options.php
r6409 r6777 3 3 +----------------------------------------------------------------+ 4 4 | | 5 | WordPress 2.0 Plugin: WP-Stats 2.0 5|5 | WordPress 2.0 Plugin: WP-Stats 2.06 | 6 6 | Copyright (c) 2005 Lester "GaMerZ" Chan | 7 7 | | … … 41 41 $update_stats_queries[] = update_option('stats_mostlimit', $stats_mostlimit); 42 42 $update_stats_queries[] = update_option('stats_display', $stats_display); 43 $update_stats_text[] = __('Stats URL' );44 $update_stats_text[] = __('Stats Most Limit' );45 $update_stats_text[] = __('Stats Display Options' );43 $update_stats_text[] = __('Stats URL', 'wp-stats'); 44 $update_stats_text[] = __('Stats Most Limit', 'wp-stats'); 45 $update_stats_text[] = __('Stats Display Options', 'wp-stats'); 46 46 $i=0; 47 47 $text = ''; 48 48 foreach($update_stats_queries as $update_stats_query) { 49 49 if($update_stats_query) { 50 $text .= '<font color="green">'.$update_stats_text[$i].' '.__('Updated' ).'</font><br />';50 $text .= '<font color="green">'.$update_stats_text[$i].' '.__('Updated', 'wp-stats').'</font><br />'; 51 51 } 52 52 $i++; 53 53 } 54 54 if(empty($text)) { 55 $text = '<font color="red">'.__('No Stats Option Updated' ).'</font>';55 $text = '<font color="red">'.__('No Stats Option Updated', 'wp-stats').'</font>'; 56 56 } 57 57 } … … 59 59 <?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?> 60 60 <div class="wrap"> 61 <h2><?php _e('Stats Options' ); ?></h2>61 <h2><?php _e('Stats Options', 'wp-stats'); ?></h2> 62 62 <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>"> 63 63 <fieldset class="options"> 64 <legend><?php _e('Stats Options' ); ?></legend>64 <legend><?php _e('Stats Options', 'wp-stats'); ?></legend> 65 65 <table width="100%" border="0" cellspacing="3" cellpadding="3"> 66 66 <tr valign="top"> 67 <th align="left" width="30%"><?php _e('Stats URL' ); ?></th>67 <th align="left" width="30%"><?php _e('Stats URL', 'wp-stats'); ?></th> 68 68 <td align="left"> 69 <input type="text" name="stats_url" value="<?php echo get_settings('stats_url'); ?>" size="50" /><br /> URL To Stats Page.<br />Example: http://www.yoursite.com/blogs/stats/<br />Example: http://www.yoursite.com/blogs/?page_id=269 <input type="text" name="stats_url" value="<?php echo get_settings('stats_url'); ?>" size="50" /><br /><?php _e('URL To Stats Page.<br />Example: http://www.yoursite.com/blogs/stats/<br />Example: http://www.yoursite.com/blogs/?page_id=2', 'wp-stats'); ?> 70 70 </td> 71 71 </tr> 72 72 <tr valign="top"> 73 <th align="left" width="30%"><?php _e('Stats Most Limit' ); ?></th>73 <th align="left" width="30%"><?php _e('Stats Most Limit', 'wp-stats'); ?></th> 74 74 <td align="left"> 75 <input type="text" name="stats_mostlimit" value="<?php echo $stats_mostlimit ?>" size="2" /><br /> Top X Stats, where X is the most limit.75 <input type="text" name="stats_mostlimit" value="<?php echo $stats_mostlimit ?>" size="2" /><br /><?php _e('Top X Stats, where X is the most limit.', 'wp-stats'); ?> 76 76 </td> 77 77 </tr> 78 78 <tr valign="top"> 79 <th align="left" width="30%"><?php _e('Type Of Stats To Display' ); ?></th>79 <th align="left" width="30%"><?php _e('Type Of Stats To Display', 'wp-stats'); ?></th> 80 80 <td align="left"> 81 <p><strong> General Stats</strong></p>81 <p><strong><?php _e('General Stats', 'wp-stats'); ?></strong></p> 82 82 <input type="checkbox" name="stats_display[]" value="total_stats"<?php checked(1, $stats_display['total_stats']); ?> /> Total<br /> 83 <p><strong> Plugin Stats</strong></p>83 <p><strong><?php _e('Plugin Stats', 'wp-stats'); ?></strong></p> 84 84 <?php 85 85 if(function_exists('wp_email')) { 86 86 echo '<input type="checkbox" name="stats_display[]" value="email"'; 87 87 checked(1, $stats_display['email']); 88 echo ' /> WP-EMail<br />'."\n";88 echo ' /> '.__('WP-EMail', 'wp-stats').'<br />'."\n"; 89 89 } 90 90 if(function_exists('get_poll')) { 91 91 echo '<input type="checkbox" name="stats_display[]" value="polls"'; 92 92 checked(1, $stats_display['polls']); 93 echo ' /> WP-Polls<br />'."\n";93 echo ' /> '.__('WP-Polls', 'wp-stats').'<br />'."\n"; 94 94 } 95 95 if(function_exists('the_ratings')) { 96 96 echo '<input type="checkbox" name="stats_display[]" value="ratings"'; 97 97 checked(1, $stats_display['ratings']); 98 echo ' /> WP-PostRatings<br />'."\n";98 echo ' /> '.__('WP-PostRatings', 'wp-stats').'<br />'."\n"; 99 99 } 100 100 if(function_exists('the_views')) { 101 101 echo '<input type="checkbox" name="stats_display[]" value="views"'; 102 102 checked(1, $stats_display['views']); 103 echo ' /> WP-PostViews<br />'."\n";103 echo ' /> '.__('WP-PostViews', 'wp-stats').'<br />'."\n"; 104 104 } 105 105 if(function_exists('useronline')) { 106 106 echo '<input type="checkbox" name="stats_display[]" value="useronline"'; 107 107 checked(1, $stats_display['views']); 108 echo ' /> WP-UserOnline<br />'."\n";108 echo ' /> '.__('WP-UserOnline', 'wp-stats').'<br />'."\n"; 109 109 } 110 110 ?> 111 <p><strong> Top <?php echo get_settings('stats_mostlimit'); ?> Stats</strong></p>112 <input type="checkbox" name="stats_display[]" value="recent_posts"<?php checked(1, $stats_display['recent_posts']); ?> /> <?php echo $stats_mostlimit ?> Most Recent Posts<br />113 <input type="checkbox" name="stats_display[]" value="recent_commtents"<?php checked(1, $stats_display['recent_commtents']); ?> /> <?php echo $stats_mostlimit ?> Most Recent Comments<br />114 <input type="checkbox" name="stats_display[]" value="commented_post"<?php checked(1, $stats_display['commented_post']); ?> /> <?php echo $stats_mostlimit ?> Most Commented Posts<br />111 <p><strong><?php sprintf(_e('Top %s Stats', 'wp-stats'), get_settings('stats_mostlimit')); ?></strong></p> 112 <input type="checkbox" name="stats_display[]" value="recent_posts"<?php checked(1, $stats_display['recent_posts']); ?> /> <?php echo $stats_mostlimit ?> <?php _e('Most Recent Posts', 'wp-stats'); ?><br /> 113 <input type="checkbox" name="stats_display[]" value="recent_commtents"<?php checked(1, $stats_display['recent_commtents']); ?> /> <?php echo $stats_mostlimit ?> <?php _e('Most Recent Comments', 'wp-stats'); ?><br /> 114 <input type="checkbox" name="stats_display[]" value="commented_post"<?php checked(1, $stats_display['commented_post']); ?> /> <?php echo $stats_mostlimit ?> <?php _e('Most Commented Posts', 'wp-stats'); ?><br /> 115 115 <?php 116 116 if(function_exists('wp_email')) { 117 117 echo '<input type="checkbox" name="stats_display[]" value="emailed_most"'; 118 118 checked(1, $stats_display['emailed_most']); 119 echo ' /> '.$stats_mostlimit.' Most Emailed Posts<br />'."\n";119 echo ' /> '.$stats_mostlimit.' '.__('Most Emailed Posts', 'wp-stats').'<br />'."\n"; 120 120 } 121 121 if(function_exists('the_ratings')) { 122 122 echo '<input type="checkbox" name="stats_display[]" value="rated_highest"'; 123 123 checked(1, $stats_display['rated_highest']); 124 echo ' /> '.$stats_mostlimit.' Highest Rated Posts<br />'."\n";124 echo ' /> '.$stats_mostlimit.' '.__('Highest Rated Posts', 'wp-stats').'<br />'."\n"; 125 125 echo '<input type="checkbox" name="stats_display[]" value="rated_most"'; 126 126 checked(1, $stats_display['rated_most']); 127 echo ' /> '.$stats_mostlimit.' Most Rated Posts<br />'."\n";127 echo ' /> '.$stats_mostlimit.' '.__('Most Rated Posts', 'wp-stats').'<br />'."\n"; 128 128 } 129 129 if(function_exists('the_views')) { 130 130 echo '<input type="checkbox" name="stats_display[]" value="viewed_most"'; 131 131 checked(1, $stats_display['viewed_most']); 132 echo ' /> '.$stats_mostlimit.' Most Viewed Posts<br />'."\n";132 echo ' /> '.$stats_mostlimit.' '.__('Most Viewed Posts', 'wp-stats').'<br />'."\n"; 133 133 } 134 134 ?> 135 <p><strong> Authors Stats</strong></p>136 <input type="checkbox" name="stats_display[]" value="authors"<?php checked(1, $stats_display['authors']); ?> /> Authors<br />137 <p><strong> Comments' Members Stats</strong></p>138 <input type="checkbox" name="stats_display[]" value="comment_members"<?php checked(1, $stats_display['comment_members']); ?> /> Comment Members<br />139 <p><strong> Misc Stats</strong></p>140 <input type="checkbox" name="stats_display[]" value="post_cats"<?php checked(1, $stats_display['post_cats']); ?> /> Post Categories<br />141 <input type="checkbox" name="stats_display[]" value="link_cats"<?php checked(1, $stats_display['link_cats']); ?> /> Link Categories<br />135 <p><strong><?php _e('Authors Stats', 'wp-stats'); ?></strong></p> 136 <input type="checkbox" name="stats_display[]" value="authors"<?php checked(1, $stats_display['authors']); ?> /> <?php _e('Authors', 'wp-stats'); ?><br /> 137 <p><strong><?php _e('Comments\' Members Stats', 'wp-stats'); ?></strong></p> 138 <input type="checkbox" name="stats_display[]" value="comment_members"<?php checked(1, $stats_display['comment_members']); ?> /> <?php _e('Comment Members', 'wp-stats'); ?><br /> 139 <p><strong><?php _e('Misc Stats', 'wp-stats'); ?></strong></p> 140 <input type="checkbox" name="stats_display[]" value="post_cats"<?php checked(1, $stats_display['post_cats']); ?> /> <?php _e('Post Categories', 'wp-stats'); ?><br /> 141 <input type="checkbox" name="stats_display[]" value="link_cats"<?php checked(1, $stats_display['link_cats']); ?> /> <?php _e('Link Categories', 'wp-stats'); ?><br /> 142 142 </td> 143 143 </tr> wp-stats/trunk/stats/stats-widget.php
r6531 r6777 4 4 Plugin URI: http://www.lesterchan.net/portfolio/programming.php 5 5 Description: Adds a Sidebar Widget To Display Partial Stats From WP-Stats Plugin 6 Version: 2.0 56 Version: 2.06 7 7 Author: GaMerZ 8 8 Author URI: http://www.lesterchan.net … … 43 43 $chars = intval($options['snippet_chars']); 44 44 $title = htmlspecialchars($options['title']); 45 if (function_exists('display_stats') && basename($_SERVER['PHP_SELF']) != 'wp-stats.php') {45 if (function_exists('display_stats')) { 46 46 echo $before_widget.$before_title.$title.$after_title; 47 47 if(!empty($stats_total_options)) { 48 48 echo '<ul>'."\n"; 49 echo '<li><strong> Total Stats</strong></li>'."\n";49 echo '<li><strong>'.__('Total Stats', 'wp-stats').'</strong></li>'."\n"; 50 50 echo '<li>'."\n"; 51 51 echo '<ul>'."\n"; 52 52 // Total Authors 53 53 if($stats_total_options['authors'] == 1) { 54 echo '<li><strong>'.get_totalauthors(false).'</strong> Authors</li>'."\n";54 echo '<li><strong>'.get_totalauthors(false).'</strong> '.__('Authors', 'wp-stats').'</li>'."\n"; 55 55 } 56 56 // Total Posts 57 57 if($stats_total_options['posts'] == 1) { 58 echo '<li><strong>'.get_totalposts(false).'</strong> Posts</li>'."\n";58 echo '<li><strong>'.get_totalposts(false).'</strong> '.__('Posts', 'wp-stats').'</li>'."\n"; 59 59 } 60 60 // Total Pages 61 61 if($stats_total_options['pages'] == 1) { 62 echo '<li><strong>'.get_totalpages(false).'</strong> Pages</li>'."\n";62 echo '<li><strong>'.get_totalpages(false).'</strong> '.__('Pages', 'wp-stats').'</li>'."\n"; 63 63 } 64 64 // Total Comments 65 65 if($stats_total_options['comments'] == 1) { 66 echo '<li><strong>'.get_totalcomments(false).'</strong> Comments</li>'."\n";66 echo '<li><strong>'.get_totalcomments(false).'</strong> '.__('Comments', 'wp-stats').'</li>'."\n"; 67 67 } 68 68 // Total Comment Posters 69 69 if($stats_total_options['commenters'] == 1) { 70 echo '<li><strong>'.get_totalcommentposters(false).'</strong> Comment Posters</li>'."\n";70 echo '<li><strong>'.get_totalcommentposters(false).'</strong> '.__('Comment Posters', 'wp-stats').'</li>'."\n"; 71 71 } 72 72 // Total Links 73 73 if($stats_total_options['links'] == 1) { 74 echo '<li><strong>'.get_totallinks(false).'</strong> Links</li>'."\n";74 echo '<li><strong>'.get_totallinks(false).'</strong> '.__('Links', 'wp-stats').'</li>'."\n"; 75 75 } 76 76 echo '</ul>'."\n"; … … 81 81 if($stats_most_options['comments'] == 1) { 82 82 echo '<ul>'."\n"; 83 echo '<li><strong>'.$limit.' Most Commented</strong></li>'."\n";83 echo '<li><strong>'.$limit.' '.__('Most Commented', 'wp-stats').'</strong></li>'."\n"; 84 84 echo '<li>'."\n"; 85 85 echo '<ul>'."\n"; … … 92 92 if($stats_most_options['emails'] == 1) { 93 93 echo '<ul>'."\n"; 94 echo '<li><strong>'.$limit.' Most Emailed</strong></li>'."\n";94 echo '<li><strong>'.$limit.' '.__('Most Emailed', 'wp-stats').'</strong></li>'."\n"; 95 95 echo '<li>'."\n"; 96 96 echo '<ul>'."\n"; … … 103 103 if($stats_most_options['ratings_highest'] == 1) { 104 104 echo '<ul>'."\n"; 105 echo '<li><strong>'.$limit.' Highest Rated</strong></li>'."\n";105 echo '<li><strong>'.$limit.' '.__('Highest Rated', 'wp-stats').'</strong></li>'."\n"; 106 106 echo '<li>'."\n"; 107 107 echo '<ul>'."\n"; … … 114 114 if($stats_most_options['ratings_most'] == 1) { 115 115 echo '<ul>'."\n"; 116 echo '<li><strong>'.$limit.' Most Rated</strong></li>'."\n";116 echo '<li><strong>'.$limit.' '.__('Most Rated', 'wp-stats').'</strong></li>'."\n"; 117 117 echo '<li>'."\n"; 118 118 echo '<ul>'."\n"; … … 125 125 if($stats_most_options['views'] == 1) { 126 126 echo '<ul>'."\n"; 127 echo '<li><strong>'.$limit.' Most Viewed</strong></li>'."\n";127 echo '<li><strong>'.$limit.' '.__('Most Viewed', 'wp-stats').'</strong></li>'."\n"; 128 128 echo '<li>'."\n"; 129 129 echo '<ul>'."\n"; … … 135 135 if(intval($options['show_link']) == 1) { 136 136 echo '<ul>'."\n"; 137 echo '<li><a href="'.stripslashes(get_settings('stats_url')).'"> My Blog Statistics</a></li>'."\n";137 echo '<li><a href="'.stripslashes(get_settings('stats_url')).'">'.__('My Blog Statistics', 'wp-stats').'</a></li>'."\n"; 138 138 echo '</ul>'."\n"; 139 139 } … … 149 149 $stats_options_most_array = array(); 150 150 if (!is_array($options)) { 151 $options = array('title' => 'Statistics', 'stats_display_total' => array(), 'stats_display_most' => array(), 'most_limit' => '10', 'show_link' => '1', 'snippet_chars' => 12);151 $options = array('title' => __('Statistics', 'wp-stats'), 'stats_display_total' => array(), 'stats_display_most' => array(), 'most_limit' => '10', 'show_link' => '1', 'snippet_chars' => 12); 152 152 } 153 153 if ($_POST['stats-submit']) { … … 177 177 update_option('widget_stats', $options); 178 178 } 179 echo '<p style="text-align: left;"><label for="stats-title"> Widget Title:</label> <input type="text" id="stats-title" name="stats-title" value="'.htmlspecialchars($options['title']).'" />';180 echo '<p style="text-align: left;"><label for="stats_display"> Statistics To Display?</label> '."\n";179 echo '<p style="text-align: left;"><label for="stats-title">'.__('Widget Title', 'wp-stats').':</label> <input type="text" id="stats-title" name="stats-title" value="'.htmlspecialchars($options['title']).'" />'; 180 echo '<p style="text-align: left;"><label for="stats_display">'.__('Statistics To Display?', 'wp-stats').'</label> '."\n"; 181 181 echo '<p style="text-align: left;">'."\n"; 182 182 echo '<input type="checkbox" id="stats_display_total" name="stats_display_total[]" value="authors"'; 183 183 checked(1, $options['stats_display_total']['authors']); 184 echo ' /> Total Authors<br />'."\n";184 echo ' /> '.__('Total Authors', 'wp-stats').'<br />'."\n"; 185 185 echo '<input type="checkbox" id="stats_display_total" name="stats_display_total[]" value="posts"'; 186 186 checked(1, $options['stats_display_total']['posts']); 187 echo ' /> Total Posts<br />'."\n";187 echo ' /> '.__('Total Posts', 'wp-stats').'<br />'."\n"; 188 188 echo '<input type="checkbox" id="stats_display_total" name="stats_display_total[]" value="pages"'; 189 189 checked(1, $options['stats_display_total']['pages']); 190 echo ' /> Total Pages<br />'."\n";190 echo ' /> '.__('Total Pages', 'wp-stats').'<br />'."\n"; 191 191 echo '<input type="checkbox" id="stats_display_total" name="stats_display_total[]" value="comments"'; 192 192 checked(1, $options['stats_display_total']['comments']); 193 echo ' /> Total Comments<br />'."\n";193 echo ' /> '.__('Total Comments', 'wp-stats').'<br />'."\n"; 194 194 echo '<input type="checkbox" id="stats_display_total" name="stats_display_total[]" value="commenters"'; 195 195 checked(1, $options['stats_display_total']['commenters']); 196 echo ' /> Total Comment Posters<br />'."\n";196 echo ' /> '.__('Total Comment Posters', 'wp-stats').'<br />'."\n"; 197 197 echo '<input type="checkbox" id="stats_display_total" name="stats_display_total[]" value="links"'; 198 198 checked(1, $options['stats_display_total']['links']); 199 echo ' /> Total Links<br /><br />'."\n";199 echo ' /> '.__('Total Links', 'wp-stats').'<br /><br />'."\n"; 200 200 echo '<input type="checkbox" id="stats_display_most" name="stats_display_most[]" value="comments"'; 201 201 checked(1, $options['stats_display_most']['comments']); 202 echo ' /> '.$options['most_limit'].' Most Commented Posts<br />'."\n";202 echo ' /> '.$options['most_limit'].' '.__('Most Commented Posts', 'wp-stats').'<br />'."\n"; 203 203 if(function_exists('wp_email')) { 204 204 echo '<input type="checkbox" id="stats_display_most" name="stats_display_most[]" value="emails"'; 205 205 checked(1, $options['stats_display_most']['emails']); 206 echo ' /> '.$options['most_limit'].' Most Emailed Posts<br />'."\n";206 echo ' /> '.$options['most_limit'].' '.__('Most Emailed Posts', 'wp-stats').'<br />'."\n"; 207 207 } 208 208 if(function_exists('the_ratings')) { 209 209 echo '<input type="checkbox" id="stats_display_most" name="stats_display_most[]" value="ratings_highest"'; 210 210 checked(1, $options['stats_display_most']['ratings_highest']); 211 echo ' /> '.$options['most_limit'].' Highest Rated Posts<br />'."\n";211 echo ' /> '.$options['most_limit'].' '.__('Highest Rated Posts', 'wp-stats').'<br />'."\n"; 212 212 echo '<input type="checkbox" id="stats_display_most" name="stats_display_most[]" value="ratings_most"'; 213 213 checked(1, $options['stats_display_most']['ratings_most']); 214 echo ' /> '.$options['most_limit'].' Most Rated Posts<br />'."\n";214 echo ' /> '.$options['most_limit'].' '.__('Most Rated Posts', 'wp-stats').'<br />'."\n"; 215 215 } 216 216 if(function_exists('the_views')) { 217 217 echo '<input type="checkbox" id="stats_display_most" name="stats_display_most[]" value="views"'; 218 218 checked(1, $options['stats_display_most']['views']); 219 echo ' /> '.$options['most_limit'].' Most Viewed Posts<br />'."\n";219 echo ' /> '.$options['most_limit'].' '.__('Most Viewed Posts', 'wp-stats').'<br />'."\n"; 220 220 } 221 221 echo '</p>'."\n"; 222 echo '<p style="text-align: left;"><label for="most_limit"> Post Title Length (Characters):</label> '."\n";222 echo '<p style="text-align: left;"><label for="most_limit">'.__('Post Title Length (Characters)', 'wp-stats').':</label> '."\n"; 223 223 echo '<p style="text-align: left;"><input type="text" id="snippet_chars" name="snippet_chars" value="'.$options['snippet_chars'].'" size="3" maxlength="3" /></p>'."\n"; 224 echo '<p style="text-align: left;"><label for="most_limit"> Most Limit:</label> '."\n";224 echo '<p style="text-align: left;"><label for="most_limit">'.__('Most Limit', 'wp-stats').':</label> '."\n"; 225 225 echo '<p style="text-align: left;"><input type="text" id="most_limit" name="most_limit" value="'.$options['most_limit'].'" size="2" maxlength="2" /></p>'."\n"; 226 echo '<p style="text-align: left;"><label for="show_link"> Show Link To Full Stats?</label> '."\n";226 echo '<p style="text-align: left;"><label for="show_link">'.__('Show Link To Full Stats?', 'wp-stats').'</label> '."\n"; 227 227 echo '<p style="text-align: left;">'; 228 228 echo '<input type="radio" id="show_link" name="show_link" value="1"'; 229 229 checked(1, intval($options['show_link'])); 230 echo ' /> Yes <input type="radio" id="show_link" name="show_link" value="0"';230 echo ' /> '.__('Yes', 'wp-stats').' <input type="radio" id="show_link" name="show_link" value="0"'; 231 231 checked(0, intval($options['show_link'])); 232 echo ' /> No</p>'."\n";232 echo ' /> '.__('No', 'wp-stats').'</p>'."\n"; 233 233 echo '<input type="hidden" id="stats-submit" name="stats-submit" value="1" />'."\n"; 234 234 } wp-stats/trunk/stats/stats.php
r6409 r6777 4 4 Plugin URI: http://www.lesterchan.net/portfolio/programming.php 5 5 Description: Display Your WordPress Statistics. 6 Version: 2.0 56 Version: 2.06 7 7 Author: GaMerZ 8 8 Author URI: http://www.lesterchan.net … … 28 28 29 29 30 ### Create Text Domain For Translation 31 load_plugin_textdomain('wp-stats', 'wp-content/plugins/stats'); 32 33 30 34 ### Function: WP-Stats Menu 31 35 add_action('admin_menu', 'stats_menu'); 32 36 function stats_menu() { 33 37 if (function_exists('add_submenu_page')) { 34 add_submenu_page('index.php', __('WP-Stats' ), __('WP-Stats'), 1, 'stats/stats.php', 'display_stats');38 add_submenu_page('index.php', __('WP-Stats', 'wp-stats'), __('WP-Stats', 'wp-stats'), 1, 'stats/stats.php', 'display_stats'); 35 39 } 36 40 if (function_exists('add_options_page')) { 37 add_options_page(__('Stats' ), __('Stats'), 'manage_options', 'stats/stats-options.php');41 add_options_page(__('Stats', 'wp-stats'), __('Stats', 'wp-stats'), 'manage_options', 'stats/stats-options.php'); 38 42 } 39 43 } … … 140 144 } 141 145 } else { 142 $temp = '<li>'.__('N/A' ).'</li>';146 $temp = '<li>'.__('N/A', 'wp-stats').'</li>'; 143 147 } 144 148 if($display) { … … 171 175 } 172 176 } else { 173 $temp = '<li>'.__('N/A' ).'</li>';177 $temp = '<li>'.__('N/A', 'wp-stats').'</li>'; 174 178 } 175 179 if($display) { … … 199 203 $post_title = htmlspecialchars(stripslashes($post->post_title)); 200 204 $comment_total = intval($post->comment_total); 201 $temp .= "<li><a href=\"".get_permalink()."\">".snippet_chars($post_title, $chars)."</a> - $comment_total ".__('comments' )."</li>";205 $temp .= "<li><a href=\"".get_permalink()."\">".snippet_chars($post_title, $chars)."</a> - $comment_total ".__('comments', 'wp-stats')."</li>"; 202 206 } 203 207 } else { … … 205 209 $post_title = htmlspecialchars(stripslashes($post->post_title)); 206 210 $comment_total = intval($post->comment_total); 207 $temp .= "<li><a href=\"".get_permalink()."\">$post_title</a> - $comment_total ".__('comments' )."</li>";208 } 209 } 210 } else { 211 $temp = '<li>'.__('N/A' ).'</li>';211 $temp .= "<li><a href=\"".get_permalink()."\">$post_title</a> - $comment_total ".__('comments', 'wp-stats')."</li>"; 212 } 213 } 214 } else { 215 $temp = '<li>'.__('N/A', 'wp-stats').'</li>'; 212 216 } 213 217 if($display) { … … 246 250 } 247 251 } else { 248 $temp = '<li>'.__('N/A' ).'</li>';252 $temp = '<li>'.__('N/A', 'wp-stats').'</li>'; 249 253 } 250 254 if($display) { … … 275 279 } 276 280 } else { 277 $temp = '<li>'.__('N/A' ).'</li>';281 $temp = '<li>'.__('N/A', 'wp-stats').'</li>'; 278 282 } 279 283 if($display) { … … 297 301 } 298 302 } else { 299 $temp = '<li>'.__('N/A' ).'</li>';303 $temp = '<li>'.__('N/A', 'wp-stats').'</li>'; 300 304 } 301 305 if($display) { … … 308 312 309 313 ### Function: Snippet Characters 310 function snippet_chars($text, $length = 0) { 311 $text = htmlspecialchars_decode($text); 312 if (strlen($text) > $length){ 313 return htmlspecialchars(substr($text,0,$length)).'...'; 314 } else { 315 return htmlspecialchars($text); 316 } 314 if(!function_exists('snippet_chars')) { 315 function snippet_chars($text, $length = 0) { 316 $text = htmlspecialchars_decode($text); 317 if (strlen($text) > $length){ 318 return htmlspecialchars(substr($text,0,$length)).'...'; 319 } else { 320 return htmlspecialchars($text); 321 } 322 } 317 323 } 318 324 … … 366 372 // General Stats 367 373 if($stats_display['total_stats'] == 1) { 368 $temp_stats .= '<h2> General Stats</h2>'."\n";369 $temp_stats .= '<p><strong> Total Stats</strong></p>'."\n";370 $temp_stats .= '<ul>'."\n"; 371 $temp_stats .= '<li><strong>'.get_totalauthors(false).'</strong> Authors To This Blog.</li>'."\n";372 $temp_stats .= '<li><strong>'.get_totalposts(false).'</strong> Posts Were Posted.</li>'."\n";373 $temp_stats .= '<li><strong>'.get_totalpages(false).'</strong> Pages Were Created.</li>'."\n";374 $temp_stats .= '<li><strong>'.get_totalcomments(false).'</strong> Comments Were Posted.</li>'."\n";375 $temp_stats .= '<li><strong>'.get_totalcommentposters(false).'</strong> Different Nicks Were Represented In The Comments.</li>'."\n";376 $temp_stats .= '<li><strong>'.get_totallinks(false).'</strong> Links Were Added.</li>'."\n";374 $temp_stats .= '<h2>'.__('General Stats', 'wp-stats').'</h2>'."\n"; 375 $temp_stats .= '<p><strong>'.__('Total Stats', 'wp-stats').'</strong></p>'."\n"; 376 $temp_stats .= '<ul>'."\n"; 377 $temp_stats .= '<li><strong>'.get_totalauthors(false).'</strong> '.__('Authors To This Blog.', 'wp-stats').'</li>'."\n"; 378 $temp_stats .= '<li><strong>'.get_totalposts(false).'</strong> '.__('Posts Were Posted.', 'wp-stats').'</li>'."\n"; 379 $temp_stats .= '<li><strong>'.get_totalpages(false).'</strong> '.__('Pages Were Created.', 'wp-stats').'</li>'."\n"; 380 $temp_stats .= '<li><strong>'.get_totalcomments(false).'</strong> '.__('Comments Were Posted.', 'wp-stats').'</li>'."\n"; 381 $temp_stats .= '<li><strong>'.get_totalcommentposters(false).'</strong> '.__('Different Nicks Were Represented In The Comments.', 'wp-stats').'</li>'."\n"; 382 $temp_stats .= '<li><strong>'.get_totallinks(false).'</strong> '.__('Links Were Added', 'wp-stats').'</li>'."\n"; 377 383 $temp_stats .= '</ul>'."\n"; 378 384 } … … 380 386 // Plugin Stats 381 387 if($stats_display['email'] == 1 || $stats_display['polls'] == 1 || $stats_display['ratings'] == 1 || $stats_display['views'] || $stats_display['useronline'] == 1) { 382 $temp_stats .= '<h2> Plugins Stats</h2>'."\n";388 $temp_stats .= '<h2>'.__('Plugins Stats', 'wp-stats').'</h2>'."\n"; 383 389 } 384 390 385 391 // WP-EMail Stats 386 392 if(function_exists('wp_email') && $stats_display['email'] == 1) { 387 $temp_stats .= '<p><strong> WP-EMail</strong></p>'."\n";388 $temp_stats .= '<ul>'."\n"; 389 $temp_stats .= '<li><strong>'.get_emails(false).'</strong> Emails Were Sent.</li>'."\n";390 $temp_stats .= '<li><strong>'.get_emails_success(false).'</strong> Emails Were Sent Successfully.</li>'."\n";391 $temp_stats .= '<li><strong>'.get_emails_failed(false).'</strong> Emails Failed To Send.</li>'."\n";393 $temp_stats .= '<p><strong>'.__('WP-EMail', 'wp-stats').'</strong></p>'."\n"; 394 $temp_stats .= '<ul>'."\n"; 395 $temp_stats .= '<li><strong>'.get_emails(false).'</strong> '.__('Emails Were Sent.', 'wp-stats').'</li>'."\n"; 396 $temp_stats .= '<li><strong>'.get_emails_success(false).'</strong> '.__('Emails Were Sent Successfully.', 'wp-stats').'</li>'."\n"; 397 $temp_stats .= '<li><strong>'.get_emails_failed(false).'</strong> '.__('Emails Failed To Send.', 'wp-stats').'</li>'."\n"; 392 398 $temp_stats .= '</ul>'."\n"; 393 399 } … … 395 401 // WP-Polls Stats 396 402 if(function_exists('get_poll') && $stats_display['polls'] == 1) { 397 $temp_stats .= '<p><strong> WP-Polls</strong></p>'."\n";398 $temp_stats .= '<ul>'."\n"; 399 $temp_stats .= '<li><strong>'.get_pollquestions(false).'</strong> Polls Were Created.</li>'."\n";400 $temp_stats .= '<li><strong>'.get_pollanswers(false).'</strong> Polls\' Answers Were Given.</li>'."\n";401 $temp_stats .= '<li><strong>'.get_pollvotes(false).'</strong> Votes Were Casted.</li>'."\n";403 $temp_stats .= '<p><strong>'.__('WP-Polls', 'wp-stats').'</strong></p>'."\n"; 404 $temp_stats .= '<ul>'."\n"; 405 $temp_stats .= '<li><strong>'.get_pollquestions(false).'</strong> '.__('Polls Were Created.', 'wp-stats').'</li>'."\n"; 406 $temp_stats .= '<li><strong>'.get_pollanswers(false).'</strong> '.__('Polls\' Answers Were Given.', 'wp-stats').'</li>'."\n"; 407 $temp_stats .= '<li><strong>'.get_pollvotes(false).'</strong> '.__('Votes Were Casted.', 'wp-stats').'</li>'."\n"; 402 408 $temp_stats .= '</ul>'."\n"; 403 409 } … … 405 411 // WP-PostRatings Stats 406 412 if(function_exists('the_ratings') && $stats_display['ratings'] == 1) { 407 $temp_stats .= '<p><strong> WP-PostRatings</strong></p>'."\n";408 $temp_stats .= '<ul>'."\n"; 409 $temp_stats .= '<li><strong>'.get_ratings_votes(false).'</strong> Votes Were Casted.</li>'."\n";410 $temp_stats .= '<li><strong>'.get_ratings_users(false).'</strong> Users Casted Their Vote.</li>'."\n";413 $temp_stats .= '<p><strong>'.__('WP-PostRatings', 'wp-stats').'</strong></p>'."\n"; 414 $temp_stats .= '<ul>'."\n"; 415 $temp_stats .= '<li><strong>'.get_ratings_votes(false).'</strong> '.__('Votes Were Casted.', 'wp-stats').'</li>'."\n"; 416 $temp_stats .= '<li><strong>'.get_ratings_users(false).'</strong> '.__('Users Casted Their Vote.', 'wp-stats').'</li>'."\n"; 411 417 $temp_stats .= '</ul>'."\n"; 412 418 } … … 414 420 // WP-PostViews Stats 415 421 if(function_exists('the_views') && $stats_display['views'] == 1) { 416 $temp_stats .= '<p><strong> WP-PostViews</strong></p>'."\n";417 $temp_stats .= '<ul>'."\n"; 418 $temp_stats .= '<li><strong>'.get_totalviews(false).'</strong> Views Were Generated.</li>'."\n";422 $temp_stats .= '<p><strong>'.__('WP-PostViews', 'wp-stats').'</strong></p>'."\n"; 423 $temp_stats .= '<ul>'."\n"; 424 $temp_stats .= '<li><strong>'.get_totalviews(false).'</strong> '.__('Views Were Generated.', 'wp-stats').'</li>'."\n"; 419 425 $temp_stats .= '</ul>'."\n"; 420 426 } … … 422 428 // WP-UserOnline Stats 423 429 if(function_exists('useronline') && $stats_display['useronline'] == 1) { 424 $temp_stats .= '<p><strong> WP-UserOnline</strong></p>'."\n";425 $temp_stats .= '<ul>'."\n"; 426 $temp_stats .= '<li><strong>'.get_useronline('', '', false).'</strong> User(s) Online Now.</li>'."\n";427 $temp_stats .= '<li> Most users ever online was<strong>'.get_most_useronline(false).'</strong>.</li>'."\n";428 $temp_stats .= '<li> On<strong>'.get_most_useronline_date(false).'</strong>.</li>'."\n";430 $temp_stats .= '<p><strong>'.__('WP-UserOnline', 'wp-stats').'</strong></p>'."\n"; 431 $temp_stats .= '<ul>'."\n"; 432 $temp_stats .= '<li><strong>'.get_useronline('', '', false).'</strong> '.__('User(s) Online Now.', 'wp-stats').'</li>'."\n"; 433 $temp_stats .= '<li>'.__('Most users ever online was', 'wp-stats').' <strong>'.get_most_useronline(false).'</strong>.</li>'."\n"; 434 $temp_stats .= '<li>'.__('On', 'wp-stats').' <strong>'.get_most_useronline_date(false).'</strong>.</li>'."\n"; 429 435 $temp_stats .= '</ul>'."\n"; 430 436 } … … 432 438 // Top Stats 433 439 if($stats_display['recent_posts'] == 1 || $stats_display['recent_commtents'] == 1 || $stats_display['commented_post'] == 1 || $stats_display['emailed_most'] == 1 || $stats_display['rated_highest'] == 1
