Changeset 5286 for sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-support-compat.php
- Timestamp:
- 04/07/2017 09:16:09 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-support-compat.php
r5097 r5286 133 133 'taxonomy' => 'topic-plugin', 134 134 'field' => 'slug', 135 'terms' => self::get_plugin_slugs_by_committer( $this->user->user_ login),135 'terms' => self::get_plugin_slugs_by_committer( $this->user->user_nicename ), 136 136 ) ), 137 137 'show_stickies' => false, … … 145 145 'taxonomy' => 'topic-plugin', 146 146 'field' => 'slug', 147 'terms' => $this->get_plugin_slugs_by_contributor( $this->user ),147 'terms' => $this->get_plugin_slugs_by_contributor( $this->user->user_nicename ), 148 148 ) ), 149 149 'show_stickies' => false, … … 168 168 if ( $view == 'plugin-committer' ) { 169 169 170 $slugs = self::get_plugin_slugs_by_committer( $this->user->user_ login);170 $slugs = self::get_plugin_slugs_by_committer( $this->user->user_nicename ); 171 171 172 172 // Add plugin-committer view. … … 191 191 } elseif ( $view == 'plugin-contributor' ) { 192 192 193 $slugs = self::get_plugin_slugs_by_contributor( $this->user );193 $slugs = self::get_plugin_slugs_by_contributor( $this->user->user_nicename ); 194 194 195 195 // Add plugin-contributor view. … … 453 453 } 454 454 455 public static function get_plugin_slugs_by_committer( $user_ login) {455 public static function get_plugin_slugs_by_committer( $user_nicename ) { 456 456 global $wpdb; 457 $slugs = (array) $wpdb->get_col( $wpdb->prepare( "SELECT `path` FROM `" . PLUGINS_TABLE_PREFIX . "svn_access` WHERE `user` = %s AND `access` = 'rw'", $user_login ) ); 458 return self::clean_slugs( $slugs ); 459 } 460 461 public static function get_plugin_slugs_by_contributor( $user ) { 457 458 $prefix = $wpdb->base_prefix . WPORG_PLUGIN_DIRECTORY_BLOGID . '_'; 459 $slugs = $wpdb->get_col( $wpdb->prepare( 460 "SELECT post_name 461 FROM {$prefix}posts AS p 462 LEFT JOIN {$prefix}term_relationships AS tr ON p.ID = tr.object_id 463 LEFT JOIN {$prefix}term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id 464 LEFT JOIN {$prefix}terms AS t ON tt.term_id = t.term_id 465 WHERE tt.taxonomy = 'plugin_committers' AND p.post_status = 'publish' AND p.post_type = 'plugin' AND t.slug = %s 466 ORDER BY p.post_title ASC", 467 $user_nicename 468 ) ); 469 470 return $slugs; 471 } 472 473 public static function get_plugin_slugs_by_contributor( $user_nicename ) { 462 474 global $wpdb; 463 $slugs = (array) $wpdb->get_col( $wpdb->prepare( "SELECT `topic_slug` FROM `" . PLUGINS_TABLE_PREFIX . "topics` WHERE `topic_poster` = %d AND topic_open = 1 AND topic_status = 0", $user->ID ) ); 464 $slugs = self::clean_slugs( $slugs ); 465 if ( $contributor = $wpdb->get_col( $wpdb->prepare( "SELECT `object_id` FROM `" . PLUGINS_TABLE_PREFIX . "meta` WHERE `object_type` = 'bb_topic' AND `meta_key` = 'contributors' AND `meta_value` LIKE %s", '%"' . str_replace( array( '%', '_' ), array( '\\%', '\\_' ), $user->user_login ) . '"%' ) ) ) { 466 if ( $contributor_slugs = $wpdb->get_col( "SELECT `topic_slug` FROM `" . PLUGINS_TABLE_PREFIX . "topics` WHERE `topic_id` IN (" . join( ',', $contributor ) . ") AND topic_open = 1 AND topic_status = 0" ) ) { 467 $slugs = array_unique( array_merge( $slugs, $contributor_slugs ) ); 468 } 469 } 475 476 $prefix = $wpdb->base_prefix . WPORG_PLUGIN_DIRECTORY_BLOGID . '_'; 477 $slugs = $wpdb->get_col( $wpdb->prepare( 478 "SELECT post_name 479 FROM {$prefix}posts AS p 480 LEFT JOIN {$prefix}term_relationships AS tr ON p.ID = tr.object_id 481 LEFT JOIN {$prefix}term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id 482 LEFT JOIN {$prefix}terms AS t ON tt.term_id = t.term_id 483 WHERE tt.taxonomy = 'plugin_contributors' AND p.post_status = 'publish' AND p.post_type = 'plugin' AND t.slug = %s 484 ORDER BY p.post_title ASC", 485 $user_nicename 486 ) ); 487 470 488 return $slugs; 471 489 }
Note: See TracChangeset
for help on using the changeset viewer.