';
$authors_list = wp_list_authors(
'html=0&style=none&echo=0&exclude_admin=0&optioncount=0&show_fullname=1&hide_empty=1&orderby=name&order=ASC'
);
$authors_array = explode( ',', $authors_list );
foreach ( $authors_array as $value ) {
$author_obj = get_user_by( 'slug', $value );
if ( $author_obj !== false ) {
// Check to see if this tag is the one that is currently selected.
if ( $author_obj->ID === $author ) {
$selected = ' SELECTED';
} else {
$selected = '';
}
$html .= '
';
}
}
$html .= '';
$html .= '
';
$html .= '
';
list( $daysToDisplay, $rangestart_utime, $rangeend_utime ) = wp_statistics_date_range_calculator(
$daysToDisplay,
$rangestart,
$rangeend
);
wp_statistics_date_range_selector(
WP_Statistics::$page['authors'],
$daysToDisplay,
null,
null,
'&preauthor=' . $author,
$html
);
$args = array(
'author' => $author,
);
$posts = get_posts( $args );
$visit_total = 0;
$daysInThePast = (int) ( ( time() - $rangeend_utime ) / 86400 );
$posts_stats = array();
$visits = array();
// Setup the array, otherwise PHP may throw an error.
foreach ( $posts as $post ) {
$posts_stats[ $post->ID ] = 0;
}
for ( $i = $daysToDisplay; $i >= 0; $i -- ) {
$date[] = "'" . $WP_Statistics->Real_Current_Date( 'M j', '-' . $i, $rangeend_utime ) . "'";
$stat = 0;
foreach ( $posts as $post ) {
$temp_stat = wp_statistics_pages( '-' . (int) ( $i + $daysInThePast ), null, $post->ID );
$posts_stats[ $post->ID ] += $temp_stat;
$stat = $temp_stat;
}
$visits[] = $stat;
$visit_total += $stat;
}
?>