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( 'referr', $_GET ) ) { $referr = $_GET['referr']; $title = $_GET['referr']; $referr_field = '&referr=' . $referr; } else { $referr = ''; $referr_field = null; } $get_urls = array(); $total = 0; if ( $referr ) { $result = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM `{$wpdb->prefix}statistics_visitor` WHERE `referred` LIKE %s AND referred <> '' AND `last_counter` BETWEEN %s AND %s ORDER BY `{$wpdb->prefix}statistics_visitor`.`ID` DESC", '%' . $referr . '%', $rangestartdate, $rangeenddate ) ); $total = count( $result ); } else { $result = $wpdb->get_results( $wpdb->prepare( "SELECT referred FROM {$wpdb->prefix}statistics_visitor WHERE referred <> '' AND `last_counter` BETWEEN %s AND %s", $rangestartdate, $rangeenddate ) ); $urls = array(); foreach ( $result as $item ) { $url = parse_url( $item->referred ); if ( empty( $url['host'] ) || stristr( get_bloginfo( 'url' ), $url['host'] ) ) { continue; } $urls[] = $url['scheme'] . '://' . $url['host']; } $get_urls = array_count_values( $urls ); $total = count( $get_urls ); } ?>

html_sanitize_referrer( $referr ) ); } else { $paneltitle = __( 'Top Referring Sites', 'wp-statistics' ); }; ?>

"; if ( $total > 0 ) { // Initiate pagination object with appropriate arguments $pagesPerSection = 10; $options = array( 25, "All" ); $stylePageOff = "pageOff"; $stylePageOn = "pageOn"; $styleErrors = "paginationErrors"; $styleSelect = "paginationSelect"; $Pagination = new WP_Statistics_Pagination( $total, $pagesPerSection, $options, false, $stylePageOff, $stylePageOn, $styleErrors, $styleSelect ); $start = $Pagination->getEntryStart(); $end = $Pagination->getEntryEnd(); if ( $referr ) { if ( $WP_Statistics->get_option( 'search_converted' ) ) { $result = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM `{$wpdb->prefix}statistics_search` INNER JOIN `{$wpdb->prefix}statistics_visitor` on {$wpdb->prefix}statistics_search.`visitor` = {$wpdb->prefix}statistics_visitor.`ID` WHERE `host` = %s AND {$wpdb->prefix}statistics_visitor.`last_counter` BETWEEN %s AND %s ORDER BY `{$wpdb->prefix}statistics_search`.`ID` DESC LIMIT %d, %d", $referr, $rangestartdate, $rangeenddate, $start, $end ) ); } foreach ( $result as $item ) { echo "
"; echo ""; echo "
" . date( get_option( 'date_format' ), strtotime( $item->last_counter ) ) . " - {$item->ip}
"; echo "
"; echo "
"; if ( array_search( strtolower( $item->agent ), array( 'chrome', 'firefox', 'msie', 'opera', 'safari', ) ) !== false ) { $agent = "agent . ".png' class='log-tools' title='{$item->agent}'/>"; } else { $agent = "
"; } echo "
agent}'>{$agent}"; echo $WP_Statistics->get_referrer_link( $item->referred, 100 ) . '
'; echo "
"; } } else { arsort( $get_urls ); $get_urls = array_slice( $get_urls, $start, $end ); $i = $start; foreach ( $get_urls as $items => $value ) { $i ++; $referrer_html = $WP_Statistics->html_sanitize_referrer( $items ); $referrer_html = parse_url( $referrer_html )['host']; echo "
"; echo ""; echo "
" . __( 'References', 'wp-statistics' ) . ': ' . number_format_i18n( $value ) . '
'; echo "
"; echo "
" . $WP_Statistics->get_referrer_link( $items, 100 ) . '
'; echo "
"; } } } echo '
'; ?>
0 ) { echo $Pagination->display(); ?>

getCurrentPage(), $Pagination->getTotalPages() ); ?>