Ticket #2509: akismet.diff
File akismet.diff, 9.0 KB (added by , 19 years ago) |
---|
-
E:/PHP/WordPress/SVN/wp-content/plugins/akismet/akismet.php
8 8 Author URI: http://photomatt.net/ 9 9 */ 10 10 11 load_plugin_textdomain('akismet', 'wp-content/plugins/akismet'); 12 11 13 add_action('admin_menu', 'ksd_config_page'); 12 14 13 15 function ksd_config_page() { 14 16 global $wpdb; 15 17 if ( function_exists('add_submenu_page') ) 16 add_submenu_page('plugins.php', __('Akismet Configuration' ), __('Akismet Configuration'), 1, __FILE__, 'akismet_conf');18 add_submenu_page('plugins.php', __('Akismet Configuration', 'akismet'), __('Akismet Configuration', 'akismet'), 1, __FILE__, 'akismet_conf'); 17 19 } 18 20 19 21 function akismet_conf() { … … 30 32 ?> 31 33 32 34 <div class="wrap"> 33 <h2><?php _e('Akismet Configuration' ); ?></h2>34 <p><?php printf(__('For many people, <a href="%1$s">Akismet</a> will greatly reduce or even completely eliminate the comment and trackback spam you get on your site. If one does happen to get through, simply mark it as "spam" on the moderation screen and Akismet will learn from the mistakes. If you don\'t have a WordPress.com account yet, you can get one at <a href="%2$s">WordPress.com</a>.' ), 'http://akismet.com/', 'http://wordpress.com/api-keys/'); ?></p>35 <h2><?php _e('Akismet Configuration', 'akismet'); ?></h2> 36 <p><?php printf(__('For many people, <a href="%1$s">Akismet</a> will greatly reduce or even completely eliminate the comment and trackback spam you get on your site. If one does happen to get through, simply mark it as "spam" on the moderation screen and Akismet will learn from the mistakes. If you don\'t have a WordPress.com account yet, you can get one at <a href="%2$s">WordPress.com</a>.', 'akismet'), 'http://akismet.com/', 'http://wordpress.com/api-keys/'); ?></p> 35 37 36 38 <form action="" method="post" id="akismet-conf" style="margin: auto; width: 25em; "> 37 <h3><label for="key"><?php _e('WordPress.com API Key' ); ?></label></h3>39 <h3><label for="key"><?php _e('WordPress.com API Key', 'akismet'); ?></label></h3> 38 40 <?php if ( $invalid_key ) { ?> 39 <p style="padding: .5em; background-color: #f33; color: #fff; font-weight: bold;"><?php _e('Your key appears invalid. Double-check it.' ); ?></p>41 <p style="padding: .5em; background-color: #f33; color: #fff; font-weight: bold;"><?php _e('Your key appears invalid. Double-check it.', 'akismet'); ?></p> 40 42 <?php } ?> 41 <p><input id="key" name="key" type="text" size="15" maxlength="12" value="<?php echo get_option('wordpress_api_key'); ?>" style="font-family: 'Courier New', Courier, mono; font-size: 1.5em;" /> (<?php _e('<a href="http://faq.wordpress.com/2005/10/19/api-key/">What is this?</a>' ); ?>)</p>42 <p class="submit"><input type="submit" name="submit" value="<?php _e('Update API Key »' ); ?>" /></p>43 <p><input id="key" name="key" type="text" size="15" maxlength="12" value="<?php echo get_option('wordpress_api_key'); ?>" style="font-family: 'Courier New', Courier, mono; font-size: 1.5em;" /> (<?php _e('<a href="http://faq.wordpress.com/2005/10/19/api-key/">What is this?</a>', 'akismet'); ?>)</p> 44 <p class="submit"><input type="submit" name="submit" value="<?php _e('Update API Key »', 'akismet'); ?>" /></p> 43 45 </form> 44 46 </div> 45 47 <?php … … 59 61 function akismet_warning() { 60 62 $path = plugin_basename(__FILE__); 61 63 echo " 62 <div id='akismet-warning' class='updated fade-ff0000'><p><strong>".__('Akismet is not active.' )."</strong> ".sprintf(__('You must <a href="%1$s">enter your WordPress.com API key</a> for it to work.'), "plugins.php?page=$path")."</p></div>64 <div id='akismet-warning' class='updated fade-ff0000'><p><strong>".__('Akismet is not active.', 'akismet')."</strong> ".sprintf(__('You must <a href="%1$s">enter your WordPress.com API key</a> for it to work.', 'akismet'), "plugins.php?page=$path")."</p></div> 63 65 <style type='text/css'> 64 66 #adminmenu { margin-bottom: 5em; } 65 67 #akismet-warning { position: absolute; top: 7em; } … … 183 185 184 186 function ksd_manage_page() { 185 187 global $wpdb; 186 $count = sprintf(__('Akismet Spam (%s)' ), ksd_spam_count());188 $count = sprintf(__('Akismet Spam (%s)', 'akismet'), ksd_spam_count()); 187 189 if ( function_exists('add_management_page') ) 188 add_management_page(__('Akismet Spam' ), $count, 1, __FILE__, 'ksd_caught');190 add_management_page(__('Akismet Spam', 'akismet'), $count, 1, __FILE__, 'ksd_caught'); 189 191 } 190 192 191 193 function ksd_caught() { … … 201 203 ksd_submit_nonspam_comment($comment); 202 204 ++$i; 203 205 endforeach; 204 echo '<div class="updated"><p>' . sprintf(__('%1$s comments recovered.' ), $i) . "</p></div>";206 echo '<div class="updated"><p>' . sprintf(__('%1$s comments recovered.', 'akismet'), $i) . "</p></div>"; 205 207 } 206 208 if ('delete' == $_POST['action']) { 207 209 $delete_time = addslashes( $_POST['display_time'] ); … … 209 211 if (isset($nuked)) { 210 212 echo '<div class="updated"><p>'; 211 213 if ($nuked) { 212 _e('All spam deleted.' );214 _e('All spam deleted.', 'akismet'); 213 215 } 214 216 echo "</p></div>"; 215 217 } 216 218 } 217 219 ?> 218 220 <div class="wrap"> 219 <h2><?php _e('Caught Spam' ) ?></h2>221 <h2><?php _e('Caught Spam', 'akismet') ?></h2> 220 222 <?php 221 223 $count = get_option('akismet_spam_count'); 222 224 if ( $count ) { 223 225 ?> 224 <p><?php printf(__('Akismet has caught <strong>%1$s</strong> spam for you since you installed it.' ), number_format($count) ); ?></p>226 <p><?php printf(__('Akismet has caught <strong>%1$s</strong> spam for you since you installed it.', 'akismet'), number_format($count) ); ?></p> 225 227 <?php 226 228 } 227 229 $spam_count = ksd_spam_count(); 228 230 if (0 == $spam_count) { 229 echo '<p>'.__('You have no spam currently in the queue. Must be your lucky day. :)' ).'</p>';231 echo '<p>'.__('You have no spam currently in the queue. Must be your lucky day. :)', 'akismet').'</p>'; 230 232 echo '</div>'; 231 233 } else { 232 echo '<p>'.__('You can delete all of the spam from your database with a single click. This operation cannot be undone, so you may wish to check to ensure that no legitimate comments got through first. Spam is automatically deleted after 15 days, so don’t sweat it.' ).'</p>';234 echo '<p>'.__('You can delete all of the spam from your database with a single click. This operation cannot be undone, so you may wish to check to ensure that no legitimate comments got through first. Spam is automatically deleted after 15 days, so don’t sweat it.', 'akismet').'</p>'; 233 235 ?> 234 236 <form method="post" action=""> 235 237 <input type="hidden" name="action" value="delete" /> 236 <?php printf(__('There are currently %1$s comments identified as spam.' ), $spam_count); ?> <input type="submit" name="Submit" value="<?php _e('Delete all'); ?>" />238 <?php printf(__('There are currently %1$s comments identified as spam.', 'akismet'), $spam_count); ?> <input type="submit" name="Submit" value="<?php _e('Delete all', 'akismet'); ?>" /> 237 239 <input type="hidden" name="display_time" value="<?php echo current_time('mysql', 1); ?>" /> 238 240 </form> 239 241 </div> 240 242 <div class="wrap"> 241 <h2><?php _e('Last 15 days' ); ?></h2>242 <?php echo '<p>'.__('These are the latest comments identified as spam by Akismet. If you see any mistakes, simply mark the comment as "not spam" and Akismet will learn from the submission. If you wish to recover a comment from spam, simply select the comment, and click Not Spam. After 15 days we clean out the junk for you.' ).'</p>'; ?>243 <h2><?php _e('Last 15 days', 'akismet'); ?></h2> 244 <?php echo '<p>'.__('These are the latest comments identified as spam by Akismet. If you see any mistakes, simply mark the comment as "not spam" and Akismet will learn from the submission. If you wish to recover a comment from spam, simply select the comment, and click Not Spam. After 15 days we clean out the junk for you.', 'akismet').'</p>'; ?> 243 245 <?php 244 246 $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_approved = 'spam' ORDER BY comment_date DESC LIMIT 150"); 245 247 … … 263 265 <?php comment_text() ?> 264 266 <label for="spam-<?php echo $comment->comment_ID; ?>"> 265 267 <input type="checkbox" id="spam-<?php echo $comment->comment_ID; ?>" name="not_spam[]" value="<?php echo $comment->comment_ID; ?>" /> 266 <?php _e('Not Spam' ) ?></label>268 <?php _e('Not Spam', 'akismet') ?></label> 267 269 <?php 268 270 } 269 271 } 270 272 ?> 271 273 </ol> 272 274 <p class="submit"> 273 <input type="submit" name="submit" value="<?php _e('Not Spam »' ); ?>" />275 <input type="submit" name="submit" value="<?php _e('Not Spam »', 'akismet'); ?>" /> 274 276 </p> 275 277 </form> 276 278 </div> … … 285 287 if ( !$count ) 286 288 return; 287 289 $path = plugin_basename(__FILE__); 288 echo '<h3>'.__('Spam' ).'</h3>';289 echo '<p>'.sprintf(__('<a href="%1$s">Akismet</a> has protected your site from <a href="%2$s">%3$s spam comments</a>.' ), 'http://akismet.com/', "edit.php?page=$path", number_format($count) ).'</p>';290 echo '<h3>'.__('Spam', 'akismet').'</h3>'; 291 echo '<p>'.sprintf(__('<a href="%1$s">Akismet</a> has protected your site from <a href="%2$s">%3$s spam comments</a>.', 'akismet'), 'http://akismet.com/', "edit.php?page=$path", number_format($count) ).'</p>'; 290 292 } 291 293 292 294 add_action('activity_box_end', 'akismet_stats');