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']; } else { $referr = ''; } $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['host']; } $get_urls = array_count_values($urls); $total = count( $get_urls ); } ?>


:

"; 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( $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 ) ); } if( $referr ) { 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 ""; echo "
"; } } else { arsort( $get_urls ); $get_urls = array_slice($get_urls, $start, $end); $i = 0; foreach( $get_urls as $items => $value) { $i++; echo "
"; echo "
{$i} - {$items}
"; echo "
".__('References', 'wp_statistics').": " . number_format_i18n($value) . "
"; echo "
"; echo ""; echo "
"; } } } echo "
"; ?>
0 ) { echo $Pagination->display(); ?>

getCurrentPage() . ' ' . __('From', 'wp_statistics') . ' ' . $Pagination->getTotalPages(); ?>