Changeset 6525 for trunk/src/includes/users/engagements.php
- Timestamp:
- 06/12/2017 02:10:58 PM (9 years ago)
- File:
-
- 1 edited
-
trunk/src/includes/users/engagements.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/users/engagements.php
r6522 r6525 196 196 $topic_id = bbp_get_topic_id( $topic_id ); 197 197 $bbp_db = bbp_db(); 198 $statii = "'" . implode( "', '", bbp_get_public_topic_statuses() ) . "'";199 198 200 199 // A cool UNION query! … … 202 201 SELECT DISTINCT( post_author ) FROM ( 203 202 SELECT post_author FROM {$bbp_db->posts} 204 WHERE ( ID = %d AND post_ status IN ({$statii}) AND post_type = %s )203 WHERE ( ID = %d AND post_type = %s ) 205 204 UNION 206 205 SELECT post_author FROM {$bbp_db->posts} 207 WHERE ( post_parent = %d AND post_ status = %s AND post_type = %s )206 WHERE ( post_parent = %d AND post_type = %s ) 208 207 ) as u1"; 209 208 210 209 // Prepare & get results 211 $query = $bbp_db->prepare( $sql, $topic_id, bbp_get_topic_post_type(), $topic_id, bbp_get_ public_status_id(), bbp_get_reply_post_type() );210 $query = $bbp_db->prepare( $sql, $topic_id, bbp_get_topic_post_type(), $topic_id, bbp_get_reply_post_type() ); 212 211 $results = $bbp_db->get_col( $query ); 213 212
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)