ID; $ac_api_key = get_user_meta($userid, "ac_api_key", true ); $ac_syncid = get_user_meta($userid, "ac_syncid", true ); echo '
'; if ( strlen( $ac_api_key ) == 0 || strlen( $ac_syncid ) == 0 ) { $connect_url = admin_url( "admin.php?page=atcontent/dashboard.php" ); $img_url = plugins_url( 'assets/logo.png', dirname( __FILE__ ) ); echo 'Connect your account to AtContent

and get advanced analytics of your blog
'; return; } if ( current_user_can( 'edit_posts' ) ) { global $wpdb; $offset = 0; $limit = 20; $posts_id = array(); do { $posts = $wpdb->get_results( " SELECT ID, post_title, post_author FROM {$wpdb->posts} WHERE post_status = 'publish' AND post_author = {$userid} AND post_type = 'post' ORDER BY ID LIMIT {$offset},{$limit} " ); foreach ( $posts as $post ) { $ac_postid = get_post_meta( $post->ID, "ac_postid", true ); if ( strlen( $ac_postid ) > 0 ) { array_push( $posts_id, $ac_postid ); } } $wpdb->flush(); $offset += $limit; } while ( count( $posts ) > 0 ); $response = atcontent_api_readership( site_url(), json_encode( $posts_id ), $ac_api_key ); ?>
+
views via AtContent
for the last 12 hours
views on your blog

Get details

ID; if ( !user_can( $userid, "publish_posts" ) ) return; $img_url = plugins_url( 'assets/logo.png', dirname( __FILE__ ) ); wp_add_dashboard_widget('atcontent_dashboard_widget', ' AtContent', 'atcontent_dashboard_widget_function'); global $wp_meta_boxes; $normal_dashboard = $wp_meta_boxes['dashboard']['normal']['core']; $atcontent_dashboard_widget = array('atcontent_dashboard_widget' => $normal_dashboard['atcontent_dashboard_widget']); unset($normal_dashboard['atcontent_dashboard_widget']); $sorted_dashboard = array_merge($atcontent_dashboard_widget, $normal_dashboard); $wp_meta_boxes['dashboard']['normal']['core'] = $sorted_dashboard; } ?>