Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Lester Chan

    (@gamerz)

    “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?

    Thread Starter DIYgod

    (@diygod)

    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.png

    Have you any idea? What can I do to debug it?

    Thank you so much.

    Plugin Author Lester Chan

    (@gamerz)

    What widget type are you using? Most Viewed? Can you take a screenshot of the widget settings.

    Thread Starter DIYgod

    (@diygod)

    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.

    Plugin Author Lester Chan

    (@gamerz)

    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 phpmyadmin

    Thread Starter DIYgod

    (@diygod)

    The 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.

    Plugin Author Lester Chan

    (@gamerz)

    Looks like your database is corrupted. You probably should contact your host about it or Google for solutions based on the error

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Views widget shows N/A problem but plugin works fine’ is closed to new replies.