Changeset 6290
- Timestamp:
- 08/14/06 09:13:57 (2 years ago)
- Files:
-
- wp-email/trunk/email/email.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
wp-email/trunk/email/email.php
r6284 r6290 410 410 ### Function: Get EMail Total Sent 411 411 if(!function_exists('get_emails')) { 412 function get_emails( ) {412 function get_emails($display = true) { 413 413 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) { 416 416 echo number_format($totalemails); 417 } else { 418 return number_format($totalemails); 417 419 } 418 420 } … … 422 424 ### Function: Get EMail Total Sent Success 423 425 if(!function_exists('get_emails_success')) { 424 function get_emails_success( ) {426 function get_emails_success($display = true) { 425 427 global $wpdb; 426 428 $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 } 428 434 } 429 435 } … … 432 438 ### Function: Get EMail Total Sent Failed 433 439 if(!function_exists('get_emails_failed')) { 434 function get_emails_failed( ) {440 function get_emails_failed($display = true) { 435 441 global $wpdb; 436 442 $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 } 438 448 } 439 449 } … … 442 452 ### Function: Get Most E-Mailed 443 453 if(!function_exists('get_mostemailed')) { 444 function get_mostemailed($mode = '', $limit = 10, $chars = 0 ) {454 function get_mostemailed($mode = '', $limit = 10, $chars = 0, $display = true) { 445 455 global $wpdb, $post; 446 456 $where = ''; 457 $temp = ''; 447 458 if($mode == 'post') { 448 459 $where = 'post_status = \'publish\''; … … 458 469 $post_title = htmlspecialchars(stripslashes($post->post_title)); 459 470 $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"; 461 472 } 462 473 } else { … … 464 475 $post_title = htmlspecialchars(stripslashes($post->post_title)); 465 476 $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"; 467 478 } 468 479 } 469 480 } 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; 471 487 } 472 488 }
