Support » Plugin: Kodex Posts likes » How are votes logged?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Pierre Lebedel

    (@pierre-lebedel)

    Hi !
    The votes are stored in the postmeta table, with meta keys kodex_post_likes and kodex_post_likes.
    The value is an associative array, with the key :

    1. Logged user : MD5 of current user id
      • Non-logged user : MD5 of user’s IP address

    In a normal usage, an user can’t vote twice, because his action replace his previous action in the array that is stored.

    Thanks to use the plugin !

    Thanks for that.

    So essentially if a user liked a post when they logged in and then changed device or IP their vote would still be logged in the DB. Also I know there is a time period you set for the votes to be visible on the dashboard but will the likes on a post get cleared out when this date is reached or will they just no longer show up in the backend?

    Thanks

    Plugin Author Pierre Lebedel

    (@pierre-lebedel)

    In the dashboard, only the last votes are shown, but all votes are retained in the database.
    I know how to identify the user who vote is not optimal, but it’s the only solution I found for the plugin kept simple …

    Ok thanks – as long as likes will not be removed or anything from the database after the time limit then that’s great!

    Fantastic plugin by the way.

    how can disable guest voting? I want to prevent logged out users to vote because otherwise people can vote twice simply by logging out.

    Plugin Author Pierre Lebedel

    (@pierre-lebedel)

    Hi!
    Actually, ou have to write some php code to do this.
    I think I will develop this functionnality soon if I have some time.

    If ou want that now, you have to modify the single.php template of your theme, by doing something like this :

    <?php if( is_user_logged_in() ){
       do_shortcode( '[kodex_post_like_buttons]' );
    } ?>

    and disable the default display in the options.

    Thanks. Also another question – is it possible to query posts that have received a Like in a certain time period? For example I’d like to display most liked posts last month.

    I guess there must also be a timestamp logged for each Like/Dislike to achieve this?
    Is there a timestamp in post meta for each Like?

    Plugin Author Pierre Lebedel

    (@pierre-lebedel)

    Hi!
    It is possible to display liked articles in a period (this is done on the dashboard of the administration), but unfortunately it is not easy …
    In reality, you have to get all the votes, and extract those whose period corresponds to that sought.
    You can find an example of the procedure in the file admin/class-kodex-posts-likes-admin.php between the lines 210 and 237.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘How are votes logged?’ is closed to new replies.