6 | | $voices = $wpdb->get_col( $wpdb->prepare( "select sum( number ) from ( SELECT ( DISTINCT post_author ) FROM {$wpdb->posts} WHERE ( post_parent = %d AND post_status = '%s' AND post_type = '%s' ) as s1 ) union ( SELECT ( DISTINCT post_author ) FROM {$wpdb->posts} WHERE ( ID = %d AND post_type = '%s' ) as s2 );", $topic_id, bbp_get_public_status_id(), bbp_get_reply_post_type(), $topic_id, bbp_get_topic_post_type() ) ); |
| 6 | $voices = $wpdb->get_col( $wpdb->prepare( "select sum( number ) from ( SELECT ( DISTINCT post_author ) as number FROM {$wpdb->posts} WHERE ( post_parent = %d AND post_status = '%s' AND post_type = '%s' ) as s1 ) union ( SELECT ( DISTINCT post_author ) as number FROM {$wpdb->posts} WHERE ( ID = %d AND post_type = '%s' ) as s2 );", $topic_id, bbp_get_public_status_id(), bbp_get_reply_post_type(), $topic_id, bbp_get_topic_post_type() ) ); |