Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Dec 17th, 2012  |  syntax: None  |  size: 1.02 KB  |  views: 36  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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));