Changeset 21739

Show
Ignore:
Timestamp:
10/13/07 07:56:16 (9 months ago)
Author:
GamerZ
Message:

date_i18n() and number_format_i18n()

Location:
wp-useronline/trunk
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • wp-useronline/trunk/readme.html

    r17547 r21739  
    33<head>       
    44      <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 
    5       <title>WP-UserOnline 2.20 Readme</title> 
     5      <title>WP-UserOnline 2.21 Readme</title> 
    66      <style type="text/css" media="screen"> 
    77            /* Default Style */ 
     
    205205<div id="Container"> 
    206206      <!-- Title --> 
    207       <div id="Title">WP-UserOnline 2.20&nbsp;&nbsp;&nbsp;<span style="color: #aaaaaa;">Readme</span></div> 
     207      <div id="Title">WP-UserOnline 2.21&nbsp;&nbsp;&nbsp;<span style="color: #aaaaaa;">Readme</span></div> 
    208208 
    209209      <!-- Tabs --> 
     
    227227                  </p> 
    228228                  <p> 
    229                         <strong>EMail:</strong><br /> 
    230                         <strong>&raquo;</strong> 
    231                         <script type="text/javascript"> 
    232                               /* <![CDATA[*/ 
    233                               document.write(' <a href="mailto:gamerz84@hotmail.com?Subject=WP-UserOnline%202.20%20Support" title="EMail To gamerz84@hotmail.com">gamerz84@hotmail.com</a>'); 
    234                               /* ]]> */ 
    235                         </script> 
    236                   </p> 
    237                   <p> 
    238229                        <strong>Website:</strong><br /> 
    239230                        <strong>&raquo;</strong> <a href="http://lesterchan.net/" title="http://lesterchan.net/">http://lesterchan.net/</a> 
     
    245236                  <p> 
    246237                        <strong>Download:</strong><br /> 
    247                         <strong>&raquo;</strong> <a href="http://lesterchan.net/others/downloads.php?id=14" title="http://lesterchan.net/others/downloads.php?id=14">WP-UserOnline 2.20 For WordPress 2.3.x</a><br /> 
     238                        <strong>&raquo;</strong> <a href="http://lesterchan.net/others/downloads.php?id=14" title="http://lesterchan.net/others/downloads.php?id=14">WP-UserOnline 2.21 For WordPress 2.3.x</a><br /> 
    248239                        <strong>&raquo;</strong> <a href="http://lesterchan.net/others/downloads/wp-useronline211.zip" title="http://lesterchan.net/others/downloads/wp-useronline211.zip">WP-UserOnline 2.11 For WordPress 2.1.x And 2.2.x</a><br /> 
    249240                        <strong>&raquo;</strong> <a href="http://lesterchan.net/others/downloads/wp-useronline206.zip" title="http://lesterchan.net/others/downloads/wp-useronline206.zip">WP-UserOnline 2.06 For WordPress 2.0.x</a><br /> 
     
    272263                  <p> 
    273264                        <strong>Updated:</strong><br /> 
    274                         <strong>&raquo;</strong> 1st October 2007 
     265                        <strong>&raquo;</strong> 1st January 2008 
    275266                  </p> 
    276267                  <p> 
     
    294285                  <ul> 
    295286                        <li> 
     287                              <strong>Version 2.21 (01-01-2008)</strong> 
     288                              <ul> 
     289                                    <li>NEW: Use date_i18n() For Localizing Date</li> 
     290                                    <li>NEW: Use number_format_i18n() Instead</li> 
     291                              </ul> 
     292                        </li> 
     293                        <li> 
    296294                              <strong>Version 2.20 (01-10-2007)</strong> 
    297295                              <ul> 
     
    411409            <div id="Upgrade" style="display: none;"> 
    412410                  <div class="SubTitle">&raquo; Upgrade Instructions</div> 
    413                   <div class="SubSubTitle">From v1.0x To v2.20</div> 
     411                  <div class="SubSubTitle">From v1.0x To v2.21</div> 
    414412                  <ol> 
    415413                        <li> 
     
    542540      </div> 
    543541</div> 
    544 <p id="Copyright">WP-UserOnline 2.20<br />Copyright &copy; 2007 Lester 'GaMerZ' Chan. All Rights Reserved.</p> 
     542<p id="Copyright">WP-UserOnline 2.21<br />Copyright &copy; 2007 Lester 'GaMerZ' Chan. All Rights Reserved.</p> 
    545543</body> 
    546544</html> 
  • wp-useronline/trunk/useronline/useronline-js.php

    r15777 r21739  
    33+----------------------------------------------------------------+ 
    44|                                                                                                                                         | 
    5 |     WordPress 2.1 Plugin: WP-UserOnline 2.20                                            | 
     5|     WordPress 2.3 Plugin: WP-UserOnline 2.21                                            | 
    66|     Copyright (c) 2007 Lester "GaMerZ" Chan                                                   | 
    77|                                                                                                                                         | 
  • wp-useronline/trunk/useronline/useronline-options.php

    r15777 r21739  
    33+----------------------------------------------------------------+ 
    44|                                                                                                                                         | 
    5 |     WordPress 2.1 Plugin: WP-UserOnline 2.20                                            | 
     5|     WordPress 2.3 Plugin: WP-UserOnline 2.21                                            | 
    66|     Copyright (c) 2007 Lester "GaMerZ" Chan                                                   | 
    77|                                                                                                                                         | 
  • wp-useronline/trunk/useronline/useronline-widget.php

    r17547 r21739  
    44Plugin URI: http://lesterchan.net/portfolio/programming.php 
    55Description: Adds a UserOnline Widget to display users online from WP-UserOnline Plugin. You need to activate WP-UserOnline first. 
    6 Version: 2.20 
     6Version: 2.21 
    77Author: Lester 'GaMerZ' Chan 
    88Author URI: http://lesterchan.net 
  • wp-useronline/trunk/useronline/useronline.php

    r19237 r21739  
    7575      // Useronline Settings 
    7676      $timeoutseconds = get_option('useronline_timeout'); 
    77       $timestamp = current_time('timestamp'); 
     77      $timestamp = current_time('timestamp', 1); 
    7878      $timeout = ($timestamp-$timeoutseconds); 
    7979      $ip = get_ipaddress(); 
     
    154154      if($useronline > $most_useronline) { 
    155155            update_option('useronline_most_users', $useronline); 
    156             update_option('useronline_most_timestamp', current_time('timestamp')); 
     156            update_option('useronline_most_timestamp', current_time('timestamp', 1)); 
    157157      } 
    158158} 
     
    167167            $template_useronline = stripslashes(get_option('useronline_template_useronline')); 
    168168            $template_useronline = str_replace('%USERONLINE_PAGE_URL%', get_option('useronline_url'), $template_useronline); 
    169             $template_useronline = str_replace('%USERONLINE_MOSTONLINE_COUNT%', number_format(get_most_useronline()), $template_useronline); 
     169            $template_useronline = str_replace('%USERONLINE_MOSTONLINE_COUNT%', number_format_i18n(get_most_useronline()), $template_useronline); 
    170170            $template_useronline = str_replace('%USERONLINE_MOSTONLINE_DATE%', get_most_useronline_date(), $template_useronline); 
    171171            if(get_useronline_count() == 1) { 
    172172                  $template_useronline = str_replace('%USERONLINE_USERS%', stripslashes($useronline_naming['user']), $template_useronline);                  
    173173            } else { 
    174                   $useronline_naming_users = str_replace('%USERONLINE_COUNT%', number_format(get_useronline_count()), stripslashes($useronline_naming['users'])); 
     174                  $useronline_naming_users = str_replace('%USERONLINE_COUNT%', number_format_i18n(get_useronline_count()), stripslashes($useronline_naming['users'])); 
    175175                  $template_useronline = str_replace('%USERONLINE_USERS%', $useronline_naming_users, $template_useronline); 
    176176            } 
     
    189189            global $useronline; 
    190190            if($display) { 
    191                   echo number_format($useronline); 
     191                  echo number_format_i18n($useronline); 
    192192            } else { 
    193193                  return $useronline; 
     
    202202            $most_useronline_users = intval(get_option('useronline_most_users')); 
    203203            if($display) { 
    204                   echo number_format($most_useronline_users); 
     204                  echo number_format_i18n($most_useronline_users); 
    205205            } else { 
    206206                  return $most_useronline_users; 
     
    214214      function get_most_useronline_date($display = false) { 
    215215            $most_useronline_timestamp = get_option('useronline_most_timestamp'); 
    216             $most_useronline_date = gmdate(sprintf(__('%s @ %s', 'wp-useronline'), get_option('date_format'), get_option('time_format')), $most_useronline_timestamp); 
     216            $most_useronline_date = date_i18n(sprintf(__('%s @ %s', 'wp-useronline'), get_option('date_format'), get_option('time_format')), $most_useronline_timestamp); 
    217217            if($display) { 
    218218                  echo $most_useronline_date; 
     
    238238      global $current_user, $user_ID; 
    239239      if(!empty($current_user) && intval($user_ID) > 0) { 
    240             update_user_option($user_ID, 'member_last_login', current_time('timestamp'));    
     240            update_user_option($user_ID, 'member_last_login', current_time('timestamp', 1));    
    241241      } 
    242242} 
     
    247247      $date_format = sprintf(__('%s @ %s', 'wp-useronline'), get_option('date_format'), get_option('time_format')); 
    248248      if($user_id == 0) { 
    249             return gmdate($date_format, get_user_option('member_last_login')); 
    250       } else { 
    251             return gmdate($date_format, get_user_option('member_last_login',$user_id)); 
     249            return date_i18n($date_format, get_user_option('member_last_login')); 
     250      } else { 
     251            return date_i18n($date_format, get_user_option('member_last_login',$user_id)); 
    252252      } 
    253253} 
     
    312312                  $template_browsingsite = str_replace('%USERONLINE_USERS%', stripslashes($useronline_naming['user']), $template_browsingsite);        
    313313            } else { 
    314                   $useronline_naming_users = str_replace('%USERONLINE_COUNT%', number_format(get_useronline_count()), stripslashes($useronline_naming['users'])); 
     314                  $useronline_naming_users = str_replace('%USERONLINE_COUNT%', number_format_i18n(get_useronline_count()), stripslashes($useronline_naming['users'])); 
    315315                  $template_browsingsite = str_replace('%USERONLINE_USERS%', $useronline_naming_users, $template_browsingsite); 
    316316            } 
     
    335335            // Nice Text For Members 
    336336            if($total_members > 1) {  
    337                   $useronline_naming_members = str_replace('%USERONLINE_COUNT%', number_format($total_members), stripslashes($useronline_naming['members'])); 
     337                  $useronline_naming_members = str_replace('%USERONLINE_COUNT%', number_format_i18n($total_members), stripslashes($useronline_naming['members'])); 
    338338                  $template_browsingsite = str_replace('%USERONLINE_MEMBERS%', $useronline_naming_members, $template_browsingsite); 
    339339            } elseif($total_members == 1) { 
     
    345345            // Nice Text For Guests 
    346346            if($total_guests > 1) { 
    347                   $useronline_naming_guests = str_replace('%USERONLINE_COUNT%', number_format($total_guests), stripslashes($useronline_naming['guests'])); 
     347                  $useronline_naming_guests = str_replace('%USERONLINE_COUNT%', number_format_i18n($total_guests), stripslashes($useronline_naming['guests'])); 
    348348                  $template_browsingsite = str_replace('%USERONLINE_GUESTS%', $useronline_naming_guests, $template_browsingsite); 
    349349            } elseif($total_guests == 1) {                   
     
    355355            // Nice Text For Bots 
    356356            if($total_bots > 1) { 
    357                   $useronline_naming_bots = str_replace('%USERONLINE_COUNT%', number_format($total_bots), stripslashes($useronline_naming['bots'])); 
     357                  $useronline_naming_bots = str_replace('%USERONLINE_COUNT%', number_format_i18n($total_bots), stripslashes($useronline_naming['bots'])); 
    358358                  $template_browsingsite = str_replace('%USERONLINE_BOTS%', $useronline_naming_bots, $template_browsingsite); 
    359359            } elseif($total_bots == 1) {               
     
    449449                  $template_browsingpage = str_replace('%USERONLINE_USERS%', stripslashes($useronline_naming['user']), $template_browsingpage);        
    450450            } else { 
    451                   $useronline_naming_users = str_replace('%USERONLINE_COUNT%', number_format($total_users), stripslashes($useronline_naming['users'])); 
     451                  $useronline_naming_users = str_replace('%USERONLINE_COUNT%', number_format_i18n($total_users), stripslashes($useronline_naming['users'])); 
    452452                  $template_browsingpage = str_replace('%USERONLINE_USERS%', $useronline_naming_users, $template_browsingpage); 
    453453            } 
     
    472472            // Nice Text For Members 
    473473            if($total_members > 1) {  
    474                   $useronline_naming_members = str_replace('%USERONLINE_COUNT%', number_format($total_members), stripslashes($useronline_naming['members'])); 
     474                  $useronline_naming_members = str_replace('%USERONLINE_COUNT%', number_format_i18n($total_members), stripslashes($useronline_naming['members'])); 
    475475                  $template_browsingpage = str_replace('%USERONLINE_MEMBERS%', $useronline_naming_members, $template_browsingpage); 
    476476            } elseif($total_members == 1) { 
     
    482482            // Nice Text For Guests 
    483483            if($total_guests > 1) { 
    484                   $useronline_naming_guests = str_replace('%USERONLINE_COUNT%', number_format($total_guests), stripslashes($useronline_naming['guests'])); 
     484                  $useronline_naming_guests = str_replace('%USERONLINE_COUNT%', number_format_i18n($total_guests), stripslashes($useronline_naming['guests'])); 
    485485                  $template_browsingpage = str_replace('%USERONLINE_GUESTS%', $useronline_naming_guests, $template_browsingpage); 
    486486            } elseif($total_guests == 1) {                   
     
    492492            // Nice Text For Bots 
    493493            if($total_bots > 1) { 
    494                   $useronline_naming_bots = str_replace('%USERONLINE_COUNT%', number_format($total_bots), stripslashes($useronline_naming['bots'])); 
     494                  $useronline_naming_bots = str_replace('%USERONLINE_COUNT%', number_format_i18n($total_bots), stripslashes($useronline_naming['bots'])); 
    495495                  $template_browsingpage = str_replace('%USERONLINE_BOTS%', $useronline_naming_bots, $template_browsingpage); 
    496496            } elseif($total_bots == 1) {               
     
    637637            $nicetext_users = $total_users.' '.__('User', 'wp-useronline'); 
    638638      } else { 
    639             $nicetext_users = number_format($total_users).' '.__('Users', 'wp-useronline'); 
     639            $nicetext_users = number_format_i18n($total_users).' '.__('Users', 'wp-useronline'); 
    640640      } 
    641641 
     
    644644            $nicetext_members = $total_members.' '.__('Member', 'wp-useronline'); 
    645645      } else { 
    646             $nicetext_members = number_format($total_members).' '.__('Members', 'wp-useronline'); 
     646            $nicetext_members = number_format_i18n($total_members).' '.__('Members', 'wp-useronline'); 
    647647      } 
    648648 
     
    652652            $nicetext_guests = $total_guests.' '.__('Guest', 'wp-useronline'); 
    653653      } else { 
    654             $nicetext_guests = number_format($total_guests).' '.__('Guests', 'wp-useronline');  
     654            $nicetext_guests = number_format_i18n($total_guests).' '.__('Guests', 'wp-useronline');  
    655655      } 
    656656 
     
    659659            $nicetext_bots = $total_bots.' '.__('Bot', 'wp-useronline');  
    660660      } else { 
    661             $nicetext_bots = number_format($total_bots).' '.__('Bots', 'wp-useronline');  
     661            $nicetext_bots = number_format_i18n($total_bots).' '.__('Bots', 'wp-useronline');  
    662662      } 
    663663 
     
    674674      } 
    675675      $useronline_output .= "<strong>$nicetext_users</strong> ".__('online now', 'wp-useronline').": <strong>$nicetext_members</strong>, <strong>$nicetext_guests</strong> ".__('and', 'wp-useronline')." <strong>$nicetext_bots</strong>.</p>\n"; 
    676       $useronline_output .= '<p>'.__('Most users ever online were', 'wp-useronline')." <strong>".number_format(get_most_useronline())."</strong>, ".__('on', 'wp-useronline')." <strong>".get_most_useronline_date()."</strong></p>\n"; 
     676      $useronline_output .= '<p>'.__('Most users ever online were', 'wp-useronline')." <strong>".number_format_i18n(get_most_useronline())."</strong>, ".__('on', 'wp-useronline')." <strong>".get_most_useronline_date()."</strong></p>\n"; 
    677677      // Print Out Members 
    678678      if($total_members > 0) { 
     
    687687                  } 
    688688                  if($wp_stats) { 
    689                         $useronline_output .= '<p><strong>#'.$no.' - <a href="'.useronline_stats_page_link($member['display_name']).'">'.$member['display_name'].'</a></strong> '.ip2nation_country($member['ip']).check_ip($member['ip']).' '.__('on', 'wp-useronline').' '.gmdate(sprintf(__('%s @ %s', 'wp-useronline'), get_option('date_format'), get_option('time_format')), $member['timestamp']).'<br />'.$member['location'].' [<a href="'.$member['url'].'">'.__('url', 'wp-useronline').'</a>]'.$referral_output.'</p>'."\n"; 
     689                        $useronline_output .= '<p><strong>#'.$no.' - <a href="'.useronline_stats_page_link($member['display_name']).'">'.$member['display_name'].'</a></strong> '.ip2nation_country($member['ip']).check_ip($member['ip']).' '.__('on', 'wp-useronline').' '.date_i18n(sprintf(__('%s @ %s', 'wp-useronline'), get_option('date_format'), get_option('time_format')), $member['timestamp']).'<br />'.$member['location'].' [<a href="'.$member['url'].'">'.__('url', 'wp-useronline').'</a>]'.$referral_output.'</p>'."\n"; 
    690690                  } else { 
    691                         $useronline_output .= '<p><strong>#'.$no.' - '.$member['user_name'].'</strong> '.ip2nation_country($member['ip']).check_ip($member['ip']).' '.__('on', 'wp-useronline').' '.gmdate(sprintf(__('%s @ %s', 'wp-useronline'), get_option('date_format'), get_option('time_format')), $member['timestamp']).'<br />'.$member['location'].' [<a href="'.$member['url'].'">'.__('url', 'wp-useronline').'</a>]'.$referral_output.'</p>'."\n"; 
     691                        $useronline_output .= '<p><strong>#'.$no.' - '.$member['user_name'].'</strong> '.ip2nation_country($member['ip']).check_ip($member['ip']).' '.__('on', 'wp-useronline').' '.date_i18n(sprintf(__('%s @ %s', 'wp-useronline'), get_option('date_format'), get_option('time_format')), $member['timestamp']).'<br />'.$member['location'].' [<a href="'.$member['url'].'">'.__('url', 'wp-useronline').'</a>]'.$referral_output.'</p>'."\n"; 
    692692                  } 
    693693                  $no++; 
     
    707707                  } 
    708708                  if($wp_stats) { 
    709                         $useronline_output .= '<p><strong>#'.$no.' - <a href="'.useronline_stats_page_link($guest['display_name']).'">'.$guest['display_name'].'</a></strong> '.ip2nation_country($guest['ip']).check_ip($guest['ip']).' '.__('on', 'wp-useronline').' '.gmdate(sprintf(__('%s @ %s', 'wp-useronline'), get_option('date_format'), get_option('time_format')), $guest['timestamp']).'<br />'.$guest['location'].' [<a href="'.$guest['url'].'">'.__('url', 'wp-useronline').'</a>]'.$referral_output.'</p>'."\n"; 
     709                        $useronline_output .= '<p><strong>#'.$no.' - <a href="'.useronline_stats_page_link($guest['display_name']).'">'.$guest['display_name'].'</a></strong> '.ip2nation_country($guest['ip']).check_ip($guest['ip']).' '.__('on', 'wp-useronline').' '.date_i18n(sprintf(__('%s @ %s', 'wp-useronline'), get_option('date_format'), get_option('time_format')), $guest['timestamp']).'<br />'.$guest['location'].' [<a href="'.$guest['url'].'">'.__('url', 'wp-useronline').'</a>]'.$referral_output.'</p>'."\n"; 
    710710                  } else { 
    711                         $useronline_output .= '<p><strong>#'.$no.' - '.$guest['user_name'].'</strong> '.ip2nation_country($guest['ip']).check_ip($guest['ip']).' '.__('on', 'wp-useronline').' '.gmdate(sprintf(__('%s @ %s', 'wp-useronline'), get_option('date_format'), get_option('time_format')), $guest['timestamp']).'<br />'.$guest['location'].' [<a href="'.$guest['url'].'">'.__('url', 'wp-useronline').'</a>]'.$referral_output.'</p>'."\n"; 
     711                        $useronline_output .= '<p><strong>#'.$no.' - '.$guest['user_name'].'</strong> '.ip2nation_country($guest['ip']).check_ip($guest['ip']).' '.__('on', 'wp-useronline').' '.date_i18n(sprintf(__('%s @ %s', 'wp-useronline'), get_option('date_format'), get_option('time_format')), $guest['timestamp']).'<br />'.$guest['location'].' [<a href="'.$guest['url'].'">'.__('url', 'wp-useronline').'</a>]'.$referral_output.'</p>'."\n"; 
    712712                  } 
    713713                  $no++; 
     
    722722      if($bots) { 
    723723            foreach($bots as $bot) { 
    724                   $useronline_output .= '<p><strong>#'.$no.' - '.$bot['display_name'].'</strong> '.check_ip($bot['ip']).' '.__('on', 'wp-useronline').' '.gmdate(sprintf(__('%s @ %s', 'wp-useronline'), get_option('date_format'), get_option('time_format')), $bot['timestamp']).'<br />'.$bot['location'].' [<a href="'.$bot['url'].'">'.__('url', 'wp-useronline').'</a>]</p>'."\n"; 
     724                  $useronline_output .= '<p><strong>#'.$no.' - '.$bot['display_name'].'</strong> '.check_ip($bot['ip']).' '.__('on', 'wp-useronline').' '.date_i18n(sprintf(__('%s @ %s', 'wp-useronline'), get_option('date_format'), get_option('time_format')), $bot['timestamp']).'<br />'.$bot['location'].' [<a href="'.$bot['url'].'">'.__('url', 'wp-useronline').'</a>]</p>'."\n"; 
    725725                  $no++; 
    726726            } 
     
    798798            $content .= '<p><strong>'.__('WP-UserOnline', 'wp-useronline').'</strong></p>'."\n"; 
    799799            $content .= '<ul>'."\n"; 
    800             $content .= '<li><strong>'.number_format(get_useronline_count()).'</strong> '.__('user(s) online now.', 'wp-useronline').'</li>'."\n"; 
    801             $content .= '<li>'.__('Most users ever online was', 'wp-useronline').' <strong>'.number_format(get_most_useronline()).'</strong>.</li>'."\n"; 
     800            $content .= '<li><strong>'.number_format_i18n(get_useronline_count()).'</strong> '.__('user(s) online now.', 'wp-useronline').'</li>'."\n"; 
     801            $content .= '<li>'.__('Most users ever online was', 'wp-useronline').' <strong>'.number_format_i18n(get_most_useronline()).'</strong>.</li>'."\n"; 
    802802            $content .= '<li>'.__('On', 'wp-useronline').' <strong>'.get_most_useronline_date().'</strong>.</li>'."\n"; 
    803803            $content .= '</ul>'."\n"; 
     
    837837      // Add In Options 
    838838      add_option('useronline_most_users', 1, 'Most Users Ever Online Count'); 
    839       add_option('useronline_most_timestamp', current_time('timestamp'), 'Most Users Ever Online Date'); 
     839      add_option('useronline_most_timestamp', current_time('timestamp', 1), 'Most Users Ever Online Date'); 
    840840      add_option('useronline_timeout', 300, 'Timeout In Seconds'); 
    841841      add_option('useronline_bots', $bots, 'Bots Name/Useragent'); 
  • wp-useronline/trunk/useronline/wp-useronline.pot

    r19237 r21739  
    11msgid "" 
    22msgstr "" 
    3 "Project-Id-Version: WP-UserOnline 2.20\n" 
     3"Project-Id-Version: WP-UserOnline 2.21\n" 
    44"POT-Creation-Date: \n" 
    5 "PO-Revision-Date: 2007-09-19 00:22+0800\n" 
     5"PO-Revision-Date: 2007-10-13 15:52+0800\n" 
    66"Last-Translator: Lester 'GaMerZ' Chan <gamerz84@hotmail.com>\n" 
    77"Language-Team: Lester Chan <gamerz84@hotmail.com>\n"