|
@@ 281-293 (lines=13) @@
|
| 278 |
|
return $return; |
| 279 |
|
} |
| 280 |
|
|
| 281 |
|
public function get_total( $post = false ) { |
| 282 |
|
global $wpdb, $blog_id; |
| 283 |
|
|
| 284 |
|
$name = strtolower( $this->get_id() ); |
| 285 |
|
|
| 286 |
|
if ( $post == false ) { |
| 287 |
|
// get total number of shares for service |
| 288 |
|
return (int) $wpdb->get_var( $wpdb->prepare( 'SELECT SUM( count ) FROM sharing_stats WHERE blog_id = %d AND share_service = %s', $blog_id, $name ) ); |
| 289 |
|
} |
| 290 |
|
|
| 291 |
|
// get total shares for a post |
| 292 |
|
return (int) $wpdb->get_var( $wpdb->prepare( 'SELECT count FROM sharing_stats WHERE blog_id = %d AND post_id = %d AND share_service = %s', $blog_id, $post->ID, $name ) ); |
| 293 |
|
} |
| 294 |
|
|
| 295 |
|
public function get_posts_total() { |
| 296 |
|
global $wpdb, $blog_id; |
|
@@ 1191-1203 (lines=13) @@
|
| 1188 |
|
} |
| 1189 |
|
} |
| 1190 |
|
|
| 1191 |
|
public function get_total( $post = false ) { |
| 1192 |
|
global $wpdb, $blog_id; |
| 1193 |
|
|
| 1194 |
|
$name = strtolower( $this->get_id() ); |
| 1195 |
|
|
| 1196 |
|
if ( $post == false ) { |
| 1197 |
|
// get total number of shares for service |
| 1198 |
|
return $wpdb->get_var( $wpdb->prepare( 'SELECT SUM( count ) FROM sharing_stats WHERE blog_id = %d AND share_service = %s', $blog_id, $name ) ); |
| 1199 |
|
} |
| 1200 |
|
|
| 1201 |
|
// get total shares for a post |
| 1202 |
|
return $wpdb->get_var( $wpdb->prepare( 'SELECT count FROM sharing_stats WHERE blog_id = %d AND post_id = %d AND share_service = %s', $blog_id, $post->ID, $name ) ); |
| 1203 |
|
} |
| 1204 |
|
} |
| 1205 |
|
|
| 1206 |
|
class Share_Custom extends Sharing_Advanced_Source { |