WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] WP Post Ratings Time Range for Highest Ratings (7 posts)

  1. haagendazs1
    Member
    Posted 6 years ago #

    Hi,

    I'm using the WP-PostRatings plugin and I'm trying to make something like a "Highest Rated For This Week" feature. Is there a way to do this, by limiting the highest rated ones displayed to only the past week? Or past month, or whatever.

    I looked around and this seemed like it might be useful:

    <?php if (function_exists('get_highest_rated')): ?>

      <?php
      $mylimit=7*(60*60*24);
      if ( (current_time(timestamp) - get_the_time('U') - (get_settings('gmt_offset') * 3600) ) < $mylimit)
      { ?>
      <?php get_highest_rated('post', 5); ?>
      <?php } ?>

    <?php endif; ?>

    I found that edit for another function on some other thread, and thought it might work, but it's not working for some reason.

    Any help is greatly appreciated :) Thanks

  2. Lester Chan
    Member
    Posted 6 years ago #

    time range is not possible at the moment unless you modified the sql query in get_highest_rated()

  3. haagendazs1
    Member
    Posted 6 years ago #

    Hi GamerZ,

    Thanks for your reply. How would I do this SQL query to make it work?

    Thanks

  4. Lester Chan
    Member
    Posted 6 years ago #

    I have the function, but I got no time to mod it to work with WP 2.3 and later I need people to test it. I will add this function in to the latest version of postratings

  5. mushon
    Member
    Posted 6 years ago #

    I would love to use it too. Let us know if you need some beta testers.

    thanks!

  6. cyberpunk2020
    Member
    Posted 5 years ago #

    Did anything come out of this? I would love to use it, too.

  7. Lester Chan
    Member
    Posted 5 years ago #

    Yes, it is in the readme.html under Usage Tab

Topic Closed

This topic has been closed to new replies.

About this Topic