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: Tips & Tricks For WP-PostRatings  (Read 96553 times)

0 Members and 1 Guest are viewing this topic.

Offline Ttech

  • Official Support
  • Global Moderator
  • *****
  • Posts: 4,296
    • View Profile
Tips & Tricks For WP-PostRatings
« on: 06 December 2006, 01:27 »
Here's a list of different tips and tricks to make WP-PostRatings work differently. :)

Hide Post Ratings For Non-Members:
Code: [Select]
<?php
if($user_ID && function_exists('the_ratings')) {
the_ratings();
}
?>



The following one will "disable" Post Rating if there is X amount of users on line that way if you use Digg your database will not crash with all the requests. Note : This requires Users Online.
Code: [Select]
<?php
$online 
$wpdb->get_var("SELECT COUNT(*) FROM $wpdb->useronline");
if(
intval($online) > 100) { // E.G. 100 or 200
the_ratings();

?>



If Post Ratings is being put on its own line and you do not want that to happen you can try this code
Code: [Select]
<?php if(function_exists('the_ratings')) { the_ratings('span'); } ?>


Users who want to remove all the post rating data from their posts now can simply use a little MySQL code thanks to vexx.
Code: [Select]
DELETE FROM wp_postmeta WHERE meta_key = "ratings_score" OR meta_key = "ratings_users" OR meta_key = "ratings_average"You can run this code from PHPmyAdmin or another similar tool. :) Enjoy!



To allow users to rate only once per day,
Open up postratings.php
Find:
Code: [Select]
$get_rated = $wpdb->get_var("SELECT rating_ip FROM $wpdb->ratings WHERE rating_postid = $post_id AND rating_ip = '".get_ipaddress()."'");Replace:
Code: [Select]
$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: [Select]
$rate_cookie = setcookie("rated_".$post_id, $ratings_value[$rate-1], time() + 30000000, COOKIEPATH);Replace:
Code: [Select]
$rate_cookie = setcookie("rated_".$post_id, $ratings_value[$rate-1], time() + (24*60*60), COOKIEPATH);


To solve Special Characters Issue
Quote
Go To WP-Admin -> Design -> Widgets -> Most Rated Widget OR Highest Rated Widget. Click on the Configure icon and then set the post title cut off characters to 0
« Last Edit: 08 December 2008, 12:15 by GaMerZ »
Learning and Helping one day at a time.




DevNode.org Operator - The IRC network for Programers

Offline peperivera

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Tips & Tricks For WP-PostRatings
« Reply #1 on: 31 December 2006, 01:37 »
 ??? hmmm... I'm sure I saw some instructions somewhere on how to keep the ratings from showing up on specific post or pages...  could you add them here? Pretty please. :)

Offline Ttech

  • Official Support
  • Global Moderator
  • *****
  • Posts: 4,296
    • View Profile
Re: Tips & Tricks For WP-PostRatings
« Reply #2 on: 31 December 2006, 04:03 »
Yeah, if I remember correctly, I made that code, but I don't remember where (what topic) it was on the old forum. So I'll search for you though. :)
Learning and Helping one day at a time.




DevNode.org Operator - The IRC network for Programers

Offline peperivera

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Tips & Tricks For WP-PostRatings
« Reply #3 on: 03 January 2007, 07:40 »
 :) thanks Ttech.

Offline Ttech

  • Official Support
  • Global Moderator
  • *****
  • Posts: 4,296
    • View Profile
Re: Tips & Tricks For WP-PostRatings
« Reply #4 on: 03 January 2007, 15:59 »
No problem...
Learning and Helping one day at a time.




DevNode.org Operator - The IRC network for Programers

Offline locomo

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Tips & Tricks For WP-PostRatings
« Reply #5 on: 06 January 2007, 06:34 »
Hi - I was wondering if it is possible to allow users to reset their vote. Thanks for this great plugin!
____     ____     ____
http://pilotadvice.com

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,692
    • View Profile
  • WordPress Version: WordPress 3.0.x
  • Theme Name: lesterchan.net v3.4
Re: Tips & Tricks For WP-PostRatings
« Reply #6 on: 06 January 2007, 09:34 »
For WP-PostRatings 1.05, it is possible. It is under Ratings -> Manage Ratings.

Under "Post Ratings Data/Logs", For "Delete Type:" choose "Logs And Data", For "Post ID(s):", key in the post IDs you want to reset.

++ lesterchan.net - Lester Chan's Website

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.

Offline Ttech

  • Official Support
  • Global Moderator
  • *****
  • Posts: 4,296
    • View Profile
Re: Tips & Tricks For WP-PostRatings
« Reply #7 on: 06 January 2007, 15:51 »
For WP-PostRatings 1.05, it is possible. It is under Ratings -> Manage Ratings.

Under "Post Ratings Data/Logs", For "Delete Type:" choose "Logs And Data", For "Post ID(s):", key in the post IDs you want to reset.
Delete logs and data? Was that from the post ratings uninstaller I gave you? :)
Learning and Helping one day at a time.




DevNode.org Operator - The IRC network for Programers

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,692
    • View Profile
  • WordPress Version: WordPress 3.0.x
  • Theme Name: lesterchan.net v3.4
Re: Tips & Tricks For WP-PostRatings
« Reply #8 on: 07 January 2007, 06:52 »
the idea was =D

++ lesterchan.net - Lester Chan's Website

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.

Offline Ttech

  • Official Support
  • Global Moderator
  • *****
  • Posts: 4,296
    • View Profile
Re: Tips & Tricks For WP-PostRatings
« Reply #9 on: 07 January 2007, 14:17 »
Cool... :) Thanks
Learning and Helping one day at a time.




DevNode.org Operator - The IRC network for Programers

Offline locomo

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Tips & Tricks For WP-PostRatings
« Reply #10 on: 09 January 2007, 03:19 »
oh, I actually meant to ask if a user could reset their vote directly from within the UI without having to go to Dashboard - with a little "reset my vote" button. I'm trying to keep things as simple as possible for my users.. i'm happy to do some of the leg work if you could point me in the right direction

thanks!
____     ____     ____
http://pilotadvice.com

Offline Ttech

  • Official Support
  • Global Moderator
  • *****
  • Posts: 4,296
    • View Profile
Re: Tips & Tricks For WP-PostRatings
« Reply #11 on: 09 January 2007, 23:37 »
Hmm, no not that I know of.
Learning and Helping one day at a time.




DevNode.org Operator - The IRC network for Programers

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,692
    • View Profile
  • WordPress Version: WordPress 3.0.x
  • Theme Name: lesterchan.net v3.4
Re: Tips & Tricks For WP-PostRatings
« Reply #12 on: 10 January 2007, 03:44 »
hmm not at the moment, why would user reset their own vote? Normally ratings system seldom have that feature.

++ lesterchan.net - Lester Chan's Website

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.

Offline peperivera

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Tips & Tricks For WP-PostRatings
« Reply #13 on: 17 January 2007, 05:25 »
 :) Hey guys.... any luck finding that code that went missing.  :-\ maybe you just forgot about me.  :( ;)

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,692
    • View Profile
  • WordPress Version: WordPress 3.0.x
  • Theme Name: lesterchan.net v3.4
Re: Tips & Tricks For WP-PostRatings
« Reply #14 on: 17 January 2007, 06:24 »
sorry but what code?

++ lesterchan.net - Lester Chan's Website

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.

Offline peperivera

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Tips & Tricks For WP-PostRatings
« Reply #15 on: 17 January 2007, 06:55 »
Quote
Huh? hmmm... I'm sure I saw some instructions somewhere on how to keep the ratings from showing up on specific post or pages...  could you add them here? Pretty please.

Quote
Yeah, if I remember correctly, I made that code, but I don't remember where (what topic) it was on the old forum. So I'll search for you though. Smiley

;D That one. ;)

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,692
    • View Profile
  • WordPress Version: WordPress 3.0.x
  • Theme Name: lesterchan.net v3.4
Re: Tips & Tricks For WP-PostRatings
« Reply #16 on: 17 January 2007, 07:16 »
i going to restore the old forum soon. ttech said he will look for u?

EDIT: if not you can try searching http://forums.lesterchan.net/old
« Last Edit: 17 January 2007, 10:52 by GaMerZ »

++ lesterchan.net - Lester Chan's Website

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.

Offline Ttech

  • Official Support
  • Global Moderator
  • *****
  • Posts: 4,296
    • View Profile
Re: Tips & Tricks For WP-PostRatings
« Reply #17 on: 17 January 2007, 14:05 »
Its not on the old forums. I thought I posted  my remade code. I'll post that here when I turn on my computer. I'm using my iPAQ right now. :)
Learning and Helping one day at a time.




DevNode.org Operator - The IRC network for Programers

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,692
    • View Profile
  • WordPress Version: WordPress 3.0.x
  • Theme Name: lesterchan.net v3.4
Re: Tips & Tricks For WP-PostRatings
« Reply #18 on: 17 January 2007, 16:24 »
cool, use to have ipaq.

++ lesterchan.net - Lester Chan's Website

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.

Offline Ttech

  • Official Support
  • Global Moderator
  • *****
  • Posts: 4,296
    • View Profile
Re: Tips & Tricks For WP-PostRatings
« Reply #19 on: 17 January 2007, 21:02 »
What happened to it? :)
  I have the HP iPAQ Mobile Media Companion rx3000 series (with the built in camera). :)
Learning and Helping one day at a time.




DevNode.org Operator - The IRC network for Programers