| | 673 | } |
|---|
| | 674 | |
|---|
| | 675 | |
|---|
| | 676 | ### Function: Plug Into WP-Stats |
|---|
| | 677 | if(strpos(get_option('stats_url'), $_SERVER['REQUEST_URI']) || strpos($_SERVER['REQUEST_URI'], 'stats-options.php')) { |
|---|
| | 678 | add_filter('wp_stats_page_admin_plugins', 'useronline_page_admin_general_stats'); |
|---|
| | 679 | add_filter('wp_stats_page_plugins', 'useronline_page_general_stats'); |
|---|
| | 680 | } |
|---|
| | 681 | |
|---|
| | 682 | |
|---|
| | 683 | ### Function: Add WP-UserOnline General Stats To WP-Stats Page Options |
|---|
| | 684 | function useronline_page_admin_general_stats($content) { |
|---|
| | 685 | $stats_display = get_option('stats_display'); |
|---|
| | 686 | if($stats_display['useronline'] == 1) { |
|---|
| | 687 | $content .= '<input type="checkbox" name="stats_display[]" value="useronline" checked="checked" /> '.__('WP-UserOnline', 'wp-useronline').'<br />'."\n"; |
|---|
| | 688 | } else { |
|---|
| | 689 | $content .= '<input type="checkbox" name="stats_display[]" value="useronline" /> '.__('WP-UserOnline', 'wp-useronline').'<br />'."\n"; |
|---|
| | 690 | } |
|---|
| | 691 | return $content; |
|---|
| | 692 | } |
|---|
| | 693 | |
|---|
| | 694 | |
|---|
| | 695 | ### Function: Add WP-UserOnline General Stats To WP-Stats Page |
|---|
| | 696 | function useronline_page_general_stats($content) { |
|---|
| | 697 | $stats_display = get_option('stats_display'); |
|---|
| | 698 | if($stats_display['useronline'] == 1) { |
|---|
| | 699 | $content .= '<p><strong>'.__('WP-UserOnline', 'wp-useronline').'</strong></p>'."\n"; |
|---|
| | 700 | $content .= '<ul>'."\n"; |
|---|
| | 701 | $content .= '<li><strong>'.get_useronline('', '', false).'</strong> '.__('User(s) Online Now.', 'wp-useronline').'</li>'."\n"; |
|---|
| | 702 | $content .= '<li>'.__('Most users ever online was', 'wp-useronline').' <strong>'.get_most_useronline(false).'</strong>.</li>'."\n"; |
|---|
| | 703 | $content .= '<li>'.__('On', 'wp-useronline').' <strong>'.get_most_useronline_date(false).'</strong>.</li>'."\n"; |
|---|
| | 704 | $content .= '</ul>'."\n"; |
|---|
| | 705 | } |
|---|
| | 706 | return $content; |
|---|