@@ 466-474 (lines=9) @@ | ||
463 | if ( ! $_blog_id ) { |
|
464 | $_blog_id = $blog_id; |
|
465 | } |
|
466 | if ( $service_name == false ) { |
|
467 | if ( $post_id > 0 ) { |
|
468 | // total number of shares for this post |
|
469 | 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 ) ); |
|
470 | } else { |
|
471 | // total number of shares for this blog |
|
472 | return (int) $wpdb->get_var( $wpdb->prepare( 'SELECT SUM( count ) FROM sharing_stats WHERE blog_id = %d', $_blog_id ) ); |
|
473 | } |
|
474 | } |
|
475 | ||
476 | if ( $post_id > 0 ) { |
|
477 | 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 ) ); |
|
@@ 476-479 (lines=4) @@ | ||
473 | } |
|
474 | } |
|
475 | ||
476 | if ( $post_id > 0 ) { |
|
477 | 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 ) ); |
|
478 | } else { |
|
479 | 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 ) ); |
|
480 | } |
|
481 | } |
|
482 |