All Good Things Must Come To An End

As you all know, I have been doing WordPress plugins and supporting it for the past 6 years. These 6 years of my life, I have been through my polytechnic education, my national service as well as my university education.

I just graduated from university in December 2009 and have been looking for full-time jobs. I am offered a full-time job and will be starting work on 1st February 2010.

I regret to say that I am NOT ABLE to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

However, I WILL still update my plugins whenever I can and you still can report bugs to me via email and I will try to fix it.


Author Topic: To allow users to rate only once per day, how?  (Read 1207 times)

0 Members and 1 Guest are viewing this topic.

Offline RGT

  • Newbie
  • *
  • Posts: 3
    • View Profile
  • WordPress Version: WordPress 2.9.x
To allow users to rate only once per day, how?
« on: 16 February 2010, 16:28 »
Hi, i use

WordPress 2.9.2
Theme Name: WP-CHATTER
Blog URL: http://www.todohit.com/
PostRatings 1.50
PHP 5.2.12
MYSQL 5.0.89-community-log

I do this:

To allow users to rate only once per day,
Open up postratings.php

Find:
Code:
$get_rated = $wpdb->get_var("SELECT rating_ip FROM $wpdb->ratings WHERE rating_postid = $post_id AND rating_ip = '".get_ipaddress()."'");Replace:
Code:
$get_rated = $wpdb->get_var("SELECT rating_ip FROM $wpdb->ratings WHERE rating_postid = $post_id AND rating_ip = '".get_ipaddress()."' AND AND rating_timestamp <= '".(current_time('timestamp')-86400)."'"");

Find:
Code:
$rate_cookie = setcookie("rated_".$post_id, $ratings_value[$rate-1], time() + 30000000, COOKIEPATH);Replace:
Code:
$rate_cookie = setcookie("rated_".$post_id, $ratings_value[$rate-1], time() + (24*60*60), COOKIEPATH);

I use that code, but I get an error when i run the web.

 :-[
« Last Edit: 18 February 2010, 15:18 by RGT »

Offline RGT

  • Newbie
  • *
  • Posts: 3
    • View Profile
  • WordPress Version: WordPress 2.9.x
Re: To allow users to rate only once per day, how?
« Reply #1 on: 18 February 2010, 15:22 »
Hi, Someone can help me?

Offline Hitcliff

  • Newbie
  • *
  • Posts: 1
    • View Profile
  • WordPress Version: WordPress 2.8.x
  • Theme Name: none
Re: To allow users to rate only once per day, how?
« Reply #2 on: 19 April 2010, 12:41 »
have recently faced the same problem... no matter what i tried, can't find the solution( looking forward to getting any help here!
Can't live without music found by mp3 search :)

Offline mike3050

  • Newbie
  • *
  • Posts: 1
    • View Profile
  • WordPress Version: WordPress 2.8.x
  • Theme Name: Elegant
Re: To allow users to rate only once per day, how?
« Reply #3 on: 21 May 2010, 20:59 »
I would like to know to,also if it works with latest version.
Get auto insurance quotes and protect your car now!

Offline elizool99

  • Newbie
  • *
  • Posts: 3
    • View Profile
  • WordPress Version: WordPress 2.8.x
  • Theme Name: Arras Theme
Re: To allow users to rate only once per day, how?
« Reply #4 on: 22 May 2010, 09:39 »
What dont u modify the options in Adminpanel > Rating > Rating Options

Offline vero216

  • Newbie
  • *
  • Posts: 1
    • View Profile
  • WordPress Version: WordPress 2.8.x
  • Theme Name: My own theme
Re: To allow users to rate only once per day, how?
« Reply #5 on: 19 July 2010, 08:25 »
It will help to write the error given.Its much more easier to find out what is the problem.
Can i Download my self ? Just in case :)