pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

PHP pastebin - collaborative debugging tool View Help


Posted by _ck_ on Wed 22 Jul 18:30
report abuse | download | new post

  1.                 if ( ! empty($groupby) )
  2.                         $groupby = 'GROUP BY ' . $groupby;
  3.                 if ( !empty( $orderby ) )
  4.                         $orderby = 'ORDER BY ' . $orderby;
  5.                 $found_rows = '';
  6.                 // if ( !empty($limits) )
  7.                 //      $found_rows = 'SQL_CALC_FOUND_ROWS';
  8.  
  9.                 // $request = " SELECT $found_rows $distinct $fields FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby $limits";
  10.                 $request = " SELECT $distinct $fields FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby $limits";
  11.                 $this->request = apply_filters('posts_request', $request);
  12.  
  13.                 $this->posts = $wpdb->get_results($this->request);
  14.                 // Raw results filter.  Prior to status checks.
  15.                 $this->posts = apply_filters('posts_results', $this->posts);
  16.  
  17.                 if ( !empty($this->posts) && $this->is_comment_feed && $this->is_singular ) {
  18.                         $cjoin = apply_filters('comment_feed_join', '');
  19.                         $cwhere = apply_filters('comment_feed_where', "WHERE comment_post_ID = '{$this->posts[0]->ID}' AND comment_approved = '1'");
  20.                         $comments_request = "SELECT $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere ORDER BY comment_date_gmt DESC LIMIT " . get_option('posts_per_rss');
  21.                         $this->comments = $wpdb->get_results($comments_request);
  22.                         $this->comment_count = count($this->comments);
  23.                 }
  24.  
  25.                 if ( !empty($limits) ) {
  26.                         // $found_posts_query = apply_filters( 'found_posts_query', 'SELECT FOUND_ROWS()' );
  27.                         $count="$distinct $fields"; $first=strpos($count,','); if ($first!==false) {$count=substr($count,0,$first-1);}
  28.                         $found_posts_query = " SELECT count($count) FROM $wpdb->posts $join WHERE 1=1 $where $groupby";
  29.                         $this->found_posts = $wpdb->get_var( $found_posts_query );
  30.                         $this->found_posts = apply_filters( 'found_posts', $this->found_posts );
  31.                         $this->max_num_pages = ceil($this->found_posts / $q['posts_per_page']);
  32.                 }

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with @@


Remember me so that I can delete my post