Changeset 14640

Show
Ignore:
Timestamp:
06/28/07 08:03:27 (1 year ago)
Author:
GamerZ
Message:

NEW: Uses WP-Stats Filter To Add Stats Into WP-Stats Page

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wp-email/trunk/email/email.php

    r14476 r14640  
    556556      function get_emails_failed($echo = true) { 
    557557            global $wpdb;  
    558             $totalemails_failed = $wpdb->get_var("SELECT COUNT(email_id) FROM $wpdb->email WHERE email_status = '". __('Failed', 'wp-email')."'"); 
     558            $totalemails_failed = $wpdb->get_var("SELECT COUNT(email_id) FROM $wpdb->email WHERE email_status = '".__('Failed', 'wp-email')."'"); 
    559559            if($echo) { 
    560560                  echo number_format($totalemails_failed); 
     
    971971} 
    972972*/ 
     973 
     974 
     975### Function: Plug Into WP-Stats 
     976if(strpos(get_option('stats_url'), $_SERVER['REQUEST_URI']) || strpos($_SERVER['REQUEST_URI'], 'stats-options.php')) { 
     977      add_filter('wp_stats_page_admin_plugins', 'email_page_admin_general_stats'); 
     978      add_filter('wp_stats_page_admin_most', 'email_page_admin_most_stats'); 
     979      add_filter('wp_stats_page_plugins', 'email_page_general_stats'); 
     980      add_filter('wp_stats_page_most', 'email_page_most_stats'); 
     981} 
     982 
     983 
     984### Function: Add WP-EMail General Stats To WP-Stats Page Options 
     985function email_page_admin_general_stats($content) { 
     986      $stats_display = get_option('stats_display'); 
     987      if($stats_display['email'] == 1) { 
     988            $content .= '<input type="checkbox" name="stats_display[]" value="email" checked="checked" />&nbsp;&nbsp;'.__('WP-EMail', 'wp-email').'<br />'."\n"; 
     989      } else { 
     990            $content .= '<input type="checkbox" name="stats_display[]" value="email" />&nbsp;&nbsp;'.__('WP-EMail', 'wp-email').'<br />'."\n"; 
     991      } 
     992      return $content; 
     993} 
     994 
     995 
     996### Function: Add WP-EMail Top Most/Highest Stats To WP-Stats Page Options 
     997function email_page_admin_most_stats($content) { 
     998      $stats_display = get_option('stats_display'); 
     999      $stats_mostlimit = intval(get_option('stats_mostlimit')); 
     1000      if($stats_display['emailed_most'] == 1) { 
     1001            $content .= '<input type="checkbox" name="stats_display[]" value="emailed_most" checked="checked" />&nbsp;&nbsp;'.$stats_mostlimit.' '.__('Most Emailed Posts', 'wp-email').'<br />'."\n"; 
     1002      } else { 
     1003            $content .= '<input type="checkbox" name="stats_display[]" value="emailed_most" />&nbsp;&nbsp;'.$stats_mostlimit.' '.__('Most Emailed Posts', 'wp-email').'<br />'."\n"; 
     1004      } 
     1005      return $content; 
     1006} 
     1007 
     1008 
     1009### Function: Add WP-EMail General Stats To WP-Stats Page 
     1010function email_page_general_stats($content) { 
     1011      global $wpdb; 
     1012      $stats_display = get_option('stats_display'); 
     1013      if($stats_display['email'] == 1) { 
     1014            $email_stats = $wpdb->get_results("SELECT email_status, COUNT(email_id) AS email_total FROM $wpdb->email GROUP BY email_status"); 
     1015            if($email_stats) { 
     1016                  $email_stats_array = array(); 
     1017                  $email_stats_array['total'] = 0; 
     1018                  foreach($email_stats as $email_stat) { 
     1019                        $email_stats_array[$email_stat->email_status] = intval($email_stat->email_total); 
     1020                        $email_stats_array['total'] += intval($email_stat->email_total); 
     1021                  } 
     1022            } 
     1023            $content .= '<p><strong>'.__('WP-EMail', 'wp-email').'</strong></p>'."\n"; 
     1024            $content .= '<ul>'."\n"; 
     1025            $content .= '<li><strong>'.number_format($email_stats_array['total']).'</strong> '.__('Emails Were Sent.', 'wp-email').'</li>'."\n"; 
     1026            $content .= '<li><strong>'.number_format($email_stats_array[__('Success', 'wp-email')]).'</strong> '.__('Emails Were Sent Successfully.', 'wp-email').'</li>'."\n"; 
     1027            $content .= '<li><strong>'.number_format($email_stats_array[__('Failed', 'wp-email')]).'</strong> '.__('Emails Failed To Send.', 'wp-email').'</li>'."\n"; 
     1028            $content .= '</ul>'."\n"; 
     1029      } 
     1030      return $content; 
     1031} 
     1032 
     1033 
     1034### Function: Add WP-EMail Top Most/Highest Stats To WP-Stats Page 
     1035function email_page_most_stats($content) { 
     1036      $stats_display = get_option('stats_display'); 
     1037      $stats_mostlimit = intval(get_option('stats_mostlimit')); 
     1038      if($stats_display['emailed_most'] == 1) { 
     1039            $content .= '<p><strong>'.$stats_mostlimit.' '.__('Most Emailed Post', 'wp-email').'</strong></p>'."\n"; 
     1040            $content .= '<ul>'."\n"; 
     1041            $content .= get_mostemailed('post', $stats_mostlimit, 0, false); 
     1042            $content .= '</ul>'."\n"; 
     1043      } 
     1044      return $content; 
     1045} 
    9731046 
    9741047 
  • wp-email/trunk/email/wp-email.pot

    r14476 r14640  
    33"Project-Id-Version: WP-EMail 2.20\n" 
    44"POT-Creation-Date: \n" 
    5 "PO-Revision-Date: 2007-06-25 00:08+0800\n" 
     5"PO-Revision-Date: 2007-06-28 16:03+0800\n" 
    66"Last-Translator: Lester 'GaMerZ' Chan <gamerz84@hotmail.com>\n" 
    77"Language-Team: Lester Chan <gamerz84@hotmail.com>\n" 
     
    9696#: email.php:819 
    9797#: email.php:867 
     98#: email.php:1026 
    9899msgid "Success" 
    99100msgstr "" 
     
    102103#: email.php:558 
    103104#: email.php:831 
     105#: email.php:1027 
    104106msgid "Failed" 
    105107msgstr "" 
     
    299301 
    300302#: email-options.php:121 
    301 #: email.php:1025 
     303#: email.php:1098 
    302304msgid "E-Mail '%EMAIL_POST_TITLE%' To A Friend" 
    303305msgstr "" 
    304306 
    305307#: email-options.php:124 
    306 #: email.php:1026 
     308#: email.php:1099 
    307309msgid "Email a copy of <strong>'%EMAIL_POST_TITLE%'</strong> to a friend" 
    308310msgstr "" 
    309311 
    310312#: email-options.php:127 
    311 #: email.php:1000 
     313#: email.php:1073 
    312314msgid "Recommended Article By %EMAIL_YOUR_NAME%: %EMAIL_POST_TITLE%" 
    313315msgstr "" 
     
    337339 
    338340#: email-options.php:139 
    339 #: email.php:1012 
     341#: email.php:1085 
    340342msgid "An Error Has Occured When Trying To Send The E-Mail" 
    341343msgstr "" 
    342344 
    343345#: email-options.php:142 
    344 #: email.php:1013 
     346#: email.php:1086 
    345347msgid "An Error Has Occured" 
    346348msgstr "" 
     
    903905msgstr "" 
    904906 
     907#: email.php:988 
     908#: email.php:990 
     909#: email.php:1023 
     910msgid "WP-EMail" 
     911msgstr "" 
     912 
    905913#: email.php:1001 
     914#: email.php:1003 
     915msgid "Most Emailed Posts" 
     916msgstr "" 
     917 
     918#: email.php:1025 
     919msgid "Emails Were Sent." 
     920msgstr "" 
     921 
     922#: email.php:1026 
     923msgid "Emails Were Sent Successfully." 
     924msgstr "" 
     925 
     926#: email.php:1027 
     927msgid "Emails Failed To Send." 
     928msgstr "" 
     929 
     930#: email.php:1039 
     931msgid "Most Emailed Post" 
     932msgstr "" 
     933 
     934#: email.php:1074 
    906935msgid "<p>Hi <strong>%EMAIL_FRIEND_NAME%</strong>,<br />Your friend, <strong>%EMAIL_YOUR_NAME%</strong>, has recommended this article entitled '<strong>%EMAIL_POST_TITLE%</strong>' to you.</p><p><strong>Here is his/her remark:</strong><br />%EMAIL_YOUR_REMARKS%</p><p><strong>%EMAIL_POST_TITLE%</strong><br />Posted By %EMAIL_POST_AUTHOR% On %EMAIL_POST_DATE% In %EMAIL_POST_CATEGORY%</p>%EMAIL_POST_CONTENT%<p>Article taken from %EMAIL_BLOG_NAME% - <a href=\"%EMAIL_BLOG_URL%\">%EMAIL_BLOG_URL%</a><br />URL to article: <a href=\"%EMAIL_PERMALINK%\">%EMAIL_PERMALINK%</a></p>" 
    907936msgstr "" 
    908937 
    909 #: email.php:1002 
     938#: email.php:1075 
    910939msgid "Hi %EMAIL_FRIEND_NAME%," 
    911940msgstr "" 
    912941 
    913 #: email.php:1002 
    914 #: email.php:1004 
    915 #: email.php:1006 
    916 #: email.php:1007 
    917 #: email.php:1008 
    918 #: email.php:1009 
     942#: email.php:1075 
     943#: email.php:1077 
     944#: email.php:1079 
     945#: email.php:1080 
     946#: email.php:1081 
     947#: email.php:1082 
    919948msgid "\n" 
    920949msgstr "" 
    921950 
    922 #: email.php:1003 
     951#: email.php:1076 
    923952msgid "Your friend, %EMAIL_YOUR_NAME%, has recommended this article entitled '%EMAIL_POST_TITLE%' to you." 
    924953msgstr "" 
    925954 
    926 #: email.php:1003 
    927 #: email.php:1005 
     955#: email.php:1076 
     956#: email.php:1078 
    928957msgid "" 
    929958"\n" 
     
    931960msgstr "" 
    932961 
    933 #: email.php:1004 
     962#: email.php:1077 
    934963msgid "Here is his/her remarks:" 
    935964msgstr "" 
    936965 
    937 #: email.php:1005 
     966#: email.php:1078 
    938967msgid "%EMAIL_YOUR_REMARKS%" 
    939968msgstr "" 
    940969 
    941 #: email.php:1006 
     970#: email.php:1079 
    942971msgid "%EMAIL_POST_TITLE%" 
    943972msgstr "" 
    944973 
    945 #: email.php:1007 
     974#: email.php:1080 
    946975msgid "Posted By %EMAIL_POST_AUTHOR% On %EMAIL_POST_DATE% In %EMAIL_POST_CATEGORY%" 
    947976msgstr "" 
    948977 
    949 #: email.php:1008 
     978#: email.php:1081 
    950979msgid "%EMAIL_POST_CONTENT%" 
    951980msgstr "" 
    952981 
    953 #: email.php:1009 
     982#: email.php:1082 
    954983msgid "Article taken from %EMAIL_BLOG_NAME% - %EMAIL_BLOG_URL%" 
    955984msgstr "" 
    956985 
    957 #: email.php:1010 
     986#: email.php:1083 
    958987msgid "URL to article: %EMAIL_PERMALINK%" 
    959988msgstr "" 
    960989 
    961 #: email.php:1011 
     990#: email.php:1084 
    962991msgid "Article: <strong>%EMAIL_POST_TITLE%</strong> Has Been Sent To <strong>%EMAIL_FRIEND_NAME% (%EMAIL_FRIEND_EMAIL%)</strong></p>" 
    963992msgstr "" 
    964993 
    965 #: email.php:1020 
     994#: email.php:1093 
    966995msgid "Email This Post" 
    967996msgstr "" 
    968997 
    969 #: email.php:1020 
     998#: email.php:1093 
    970999msgid "Email This Page" 
    9711000msgstr "" 
  • wp-email/trunk/readme.html

    r14476 r14640  
    293293                                    <li>NEW: Most Emailed Widget Added</li> 
    294294                                    <li>NEW: Ability To Uninstall WP-EMail</li> 
     295                                    <li>NEW: Uses WP-Stats Filter To Add Stats Into WP-Stats Page</li> 
    295296                              </ul> 
    296297                        </li>