SHARE
TWEET

Untitled

a guest Dec 17th, 2012 36 Never
  1. At around line 161, replace:
  2. $sql = "SELECT`post_name` FROM {$wpdb->prefix}posts
  3. WHERE `post_parent` = {$bp->groups->current_group->extras['gpage_id']} AND `post_type` = '{$this->page_slug}'
  4. ORDER BY `menu_order` ASC
  5. LIMIT 1";
  6. $bp->action_variables[0] = $wpdb->get_var($wpdb->prepare($sql));
  7.  
  8. with:
  9. $sql = "SELECT`post_name` FROM {$wpdb->prefix}posts
  10. WHERE `post_parent` = %d AND `post_type` = '%s'
  11. ORDER BY `menu_order` ASC
  12. LIMIT 1";
  13. $bp->action_variables[0] = $wpdb->get_var($wpdb->prepare($sql, $bp->groups->current_group->extras['gpage_id'], $this->page_slug));
  14.  
  15. And around line 188, replace:
  16. $sql  = "SELECT * FROM {$wpdb->prefix}posts WHERE`post_name`= '{$bp->action_variables[0]}' and`post_type`= '{$this->page_slug}' and`post_parent` = $gpage_id";
  17. $page = $wpdb->get_row($wpdb->prepare($sql));
  18.  
  19. with:
  20. $sql  = "SELECT * FROM {$wpdb->prefix}posts WHERE`post_name`= '%s' and`post_type`= '%s' and`post_parent` = %d";
  21. $page = $wpdb->get_row($wpdb->prepare($sql, $bp->action_variables[0], $this->page_slug, $gpage_id));
RAW Paste Data
Top