Views widget shows N/A problem but plugin works fine
-
As a WP-PostViews user, I love it so much. But one day, the widget shows N/A problem.
Can you help me ?
Thank you so much.
-
“one day” type of problem is very difficult to solve because there are a lot of factors. Does the post views of the post still displays if you use
<?php the_views(); ?>
?Check your condition of the widget, what is the mode you stated for the widget?
Sorry about that… The post views displays well. Everything’s alright except the widget.
It works well in almost one year. But a few days ago, after server faults, the widget always display N/A(everything else is alright). I tried reinstall WP-PostViews and google this problem, but it doesn’t work.
There are two screenshot about the widget:
http://diygod.qiniudn.com/Screenshot from 2015-02-25 14:19:12.png
http://diygod.qiniudn.com/Screenshot from 2015-02-25 14:19:24.pngHave you any idea? What can I do to debug it?
Thank you so much.
What widget type are you using? Most Viewed? Can you take a screenshot of the widget settings.
There are two screenshot about the widget:
http://diygod.qiniudn.com/Screenshot from 2015-02-25 14:19:12.png
http://diygod.qiniudn.com/Screenshot from 2015-02-25 14:19:24.png
Thank you so much.
Add this after line 302 https://github.com/lesterchan/wp-postviews/blob/master/wp-postviews.php#L302
var_dump("SELECT DISTINCT $wpdb->posts.*, (meta_value+0) AS views FROM $wpdb->posts LEFT JOIN $wpdb->postmeta ON $wpdb->postmeta.post_id = $wpdb->posts.ID WHERE post_date < '".current_time('mysql')."' AND $where AND post_status = 'publish' AND meta_key = 'views' AND post_password = '' ORDER BY views DESC LIMIT $limit");
and let me know the output here and run that query using phpmyadminThe output:
string(275) "SELECT DISTINCT wp_posts.*, (meta_value+0) AS views FROM wp_posts LEFT JOIN wp_postmeta ON wp_postmeta.post_id = wp_posts.ID WHERE post_date < '2015-02-25 22:36:22' AND 1=1 AND post_status = 'publish' AND meta_key = 'views' AND post_password = '' ORDER BY views DESC LIMIT 10"
Run that query using phpmyadmin:
SQL 查询: SELECT DISTINCT wp_posts.*, (meta_value+0) AS views FROM wp_posts LEFT JOIN wp_postmeta ON wp_postmeta.post_id = wp_posts.ID WHERE post_date < '2015-02-25 22:36:22' AND 1=1 AND post_status = 'publish' AND meta_key = 'views' AND post_password = '' ORDER BY views DESC LIMIT 10 MySQL 返回: #126 - Incorrect key file for table '/tmp/#sql_6154_0.MYI'; try to repair it
What should I do next?
It’s very kind of you. Thank you very much.
Looks like your database is corrupted. You probably should contact your host about it or Google for solutions based on the error
- The topic ‘Views widget shows N/A problem but plugin works fine’ is closed to new replies.