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 ' To activate AtContent features, please, connect your blog to AtContent
'; atcontent_ga("Dashboard", "WordPress Dashboard"); return; } $connect_result = atcontent_api_connectgate( $ac_api_key, $userid, get_site_url(), admin_url("admin-ajax.php") ); if ( $connect_result["IsOK"] == TRUE ) { update_user_meta( $userid, "ac_oneclick_repost", "1" ); } if ( current_user_can( 'edit_posts' ) ) { global $wpdb; $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' " ); $posts_id = array(); 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 ); } } $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; } ?>