|
@@ 405-413 (lines=9) @@
|
| 402 |
|
if ( !$_blog_id ) { |
| 403 |
|
$_blog_id = $blog_id; |
| 404 |
|
} |
| 405 |
|
if ( $service_name == false ) { |
| 406 |
|
if ( $post_id > 0 ) { |
| 407 |
|
// total number of shares for this post |
| 408 |
|
return (int) $wpdb->get_var( $wpdb->prepare( "SELECT SUM( count ) FROM sharing_stats WHERE blog_id = %d AND post_id = %d", $_blog_id, $post_id ) ); |
| 409 |
|
} else { |
| 410 |
|
// total number of shares for this blog |
| 411 |
|
return (int) $wpdb->get_var( $wpdb->prepare( "SELECT SUM( count ) FROM sharing_stats WHERE blog_id = %d", $_blog_id ) ); |
| 412 |
|
} |
| 413 |
|
} |
| 414 |
|
|
| 415 |
|
if ( $post_id > 0 ) |
| 416 |
|
return (int) $wpdb->get_var( $wpdb->prepare( "SELECT SUM( count ) FROM sharing_stats WHERE blog_id = %d AND post_id = %d AND share_service = %s", $_blog_id, $post_id, $service_name ) ); |
|
@@ 415-418 (lines=4) @@
|
| 412 |
|
} |
| 413 |
|
} |
| 414 |
|
|
| 415 |
|
if ( $post_id > 0 ) |
| 416 |
|
return (int) $wpdb->get_var( $wpdb->prepare( "SELECT SUM( count ) FROM sharing_stats WHERE blog_id = %d AND post_id = %d AND share_service = %s", $_blog_id, $post_id, $service_name ) ); |
| 417 |
|
else |
| 418 |
|
return (int) $wpdb->get_var( $wpdb->prepare( "SELECT SUM( count ) FROM sharing_stats WHERE blog_id = %d AND share_service = %s", $_blog_id, $service_name ) ); |
| 419 |
|
} |
| 420 |
|
|
| 421 |
|
public function get_services_total( $post_id = false ) { |