Skip to:
Content

bbPress.org

Changes between Version 1 and Version 2 of Ticket #3083, comment 1


Ignore:
Timestamp:
03/09/2017 12:09:38 AM (7 years ago)
Author:
januzi_pl
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #3083, comment 1

    v1 v2  
    44
    55{{{
    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() ) );
     6$voices = $wpdb->get_col( $wpdb->prepare( "select count( distinct ( number )) from (
     7    ((SELECT (  post_author ) as number FROM {$wpdb->posts} as p2 WHERE post_parent = %d AND post_status = '%s' AND post_type = '%s' )  ) union ( SELECT (  post_author ) as number FROM {$wpdb->posts} as p1 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() ) );
    78}}}
    89