real_current_date( 'Y-m-d', '-0', $rangestart_utime ); $rangeenddate = $WP_Statistics->real_current_date( 'Y-m-d', '-0', $rangeend_utime ); if ( array_key_exists( 'phrase', $_GET ) ) { $phrase = $_GET['phrase']; $title = $_GET['phrase']; $referr_field = '&phrase=' . $phrase; } else { $phrase = ''; $phrase_field = null; } $get_urls = array(); $total = 0; if ( $phrase ) { $q_string = $wpdb->prepare( "SELECT `words` , count(`words`) as `count` FROM `{$wpdb->prefix}statistics_search` WHERE `words` LIKE %s AND `words` <> '' AND `last_counter` BETWEEN %s AND %s GROUP BY `words` order by `count` DESC", '%' . $phrase . '%', $rangestartdate, $rangeenddate ); $result = $wpdb->get_results( $q_string ); $total = count( $result ); } else { $q_string = $wpdb->prepare( "SELECT `words` , count(`words`) as `count` FROM `{$wpdb->prefix}statistics_search` WHERE `words` <> '' AND `last_counter` BETWEEN %s AND %s GROUP BY `words` order by `count` DESC", $rangestartdate, $rangeenddate ); $result = $wpdb->get_results( $q_string ); $total = count( $result ); } ?>