Changeset 6290

Show
Ignore:
Timestamp:
08/14/06 09:13:57 (2 years ago)
Author:
GamerZ
Message:

Update To Accommodate Latest Version Of WP-Stats

Files:

Legend:

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

    r6284 r6290  
    410410### Function: Get EMail Total Sent 
    411411if(!function_exists('get_emails')) { 
    412       function get_emails() { 
     412      function get_emails($display = true) { 
    413413            global $wpdb; 
    414             if(function_exists('wp_email')) { 
    415                  $totalemails = $wpdb->get_var("SELECT COUNT(email_id) FROM $wpdb->email"); 
     414            $totalemails = $wpdb->get_var("SELECT COUNT(email_id) FROM $wpdb->email"); 
     415            if($display) { 
    416416                  echo number_format($totalemails); 
     417            } else { 
     418                  return number_format($totalemails); 
    417419            } 
    418420      } 
     
    422424### Function: Get EMail Total Sent Success 
    423425if(!function_exists('get_emails_success')) { 
    424       function get_emails_success() { 
     426      function get_emails_success($display = true) { 
    425427            global $wpdb;  
    426428            $totalemails_success = $wpdb->get_var("SELECT COUNT(email_id) FROM $wpdb->email WHERE email_status = '".__('Success')."'"); 
    427             echo number_format($totalemails_success); 
     429            if($display) { 
     430                  echo number_format($totalemails_success); 
     431            } else { 
     432                  return number_format($totalemails_success); 
     433            } 
    428434      } 
    429435} 
     
    432438### Function: Get EMail Total Sent Failed 
    433439if(!function_exists('get_emails_failed')) { 
    434       function get_emails_failed() { 
     440      function get_emails_failed($display = true) { 
    435441            global $wpdb;  
    436442            $totalemails_failed = $wpdb->get_var("SELECT COUNT(email_id) FROM $wpdb->email WHERE email_status = '". __('Failed')."'"); 
    437             echo number_format($totalemails_failed); 
     443            if($display) { 
     444                  echo number_format($totalemails_failed); 
     445            } else { 
     446                  return number_format($totalemails_failed); 
     447            } 
    438448      } 
    439449} 
     
    442452### Function: Get Most E-Mailed 
    443453if(!function_exists('get_mostemailed')) { 
    444       function get_mostemailed($mode = '', $limit = 10, $chars = 0) { 
     454      function get_mostemailed($mode = '', $limit = 10, $chars = 0, $display = true) { 
    445455            global $wpdb, $post; 
    446456            $where = ''; 
     457            $temp = ''; 
    447458            if($mode == 'post') { 
    448459                        $where = 'post_status = \'publish\''; 
     
    458469                                    $post_title = htmlspecialchars(stripslashes($post->post_title)); 
    459470                                    $email_total = intval($post->email_total); 
    460                                     echo "<li><a href=\"".get_permalink()."\">".snippet_chars($post_title, $chars)."</a> - $email_total ".__('Emails')."</li>"; 
     471                                    $temp .= "<li><a href=\"".get_permalink()."\">".snippet_chars($post_title, $chars)."</a> - $email_total ".__('Emails')."</li>\n"; 
    461472                        } 
    462473                  } else { 
     
    464475                                    $post_title = htmlspecialchars(stripslashes($post->post_title)); 
    465476                                    $email_total = intval($post->email_total); 
    466                                     echo "<li><a href=\"".get_permalink()."\">$post_title</a> - $email_total ".__('Emails')."</li>"; 
     477                                    $temp .= "<li><a href=\"".get_permalink()."\">$post_title</a> - $email_total ".__('Emails')."</li>\n"; 
    467478                        } 
    468479                  } 
    469480            } else { 
    470                   echo '<li>'.__('N/A').'</li>'; 
     481                  $temp = '<li>'.__('N/A').'</li>'."\n"; 
     482            } 
     483            if($display) { 
     484                  echo $temp; 
     485            } else { 
     486                  return $temp; 
    471487            } 
    472488      }