comment_content ) ); } function highlight( $post, $words, $content ) { if ( isset( $post->comment_id ) ) { $comment = get_comment( $post->comment_id ); $highlight = new Highlighter( $this->gather( $comment ), $words, true ); if ( $highlight->has_matches() ) { $highlight->zoom( $this->before, $this->after ); $highlight->mark_words(); if ( $this->include == 'content' ) return sprintf( __( '
Comment: %s
', 'search-unleashed' ), $highlight->get() ); else if ($this->include == 'link') return sprintf( __( 'Comment by %s: %s
', 'search-unleashed' ), $this->get_comment_author_link( $comment ), $highlight->get() ); else if ($this->include == 'name') return sprintf( __( 'Comment by %s: %s
', 'search-unleashed' ), apply_filters( 'comment_author', apply_filters( 'get_comment_author', $comment->comment_author ) ), $highlight->get() ); } } return ''; } function get_comment_author_link( $comment ) { $url = apply_filters( 'get_comment_author_url', $comment->comment_author_url ); $author = apply_filters( 'comment_author', apply_filters( 'get_comment_author', $comment->comment_author ) ); if ( empty( $url ) || 'http://' == $url ) $return = $author; else $return = "$author"; return apply_filters( 'get_comment_author_link', $return ); } function name () { return __( 'Comment content', 'search-unleashed' ); } function field_name() { return 'comment_content'; } function load( $config ) { if ( isset( $config['before'] ) ) $this->before = $config['before']; if ( isset( $config['after'] ) ) $this->after = $config['after']; if ( isset( $config['include'] ) ) $this->include = $config['include']; } function edit () { global $wpdb; $available = $wpdb->get_results( "SELECT meta_key FROM {$wpdb->postmeta} WHERE meta_key NOT LIKE '%_wp%' GROUP BY meta_key ORDER BY meta_key" ); ?>