Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: [archived] tcm_rating: TXP Rating System
Does it show up on this page?
Offline
Re: [archived] tcm_rating: TXP Rating System
Is there any good way to do this to store the IP forever for each article rating to not allow a rating ever again?
Offline
Re: [archived] tcm_rating: TXP Rating System
yes – it seems to be working perfectly now.
Offline
Re: [archived] tcm_rating: TXP Rating System
Does anyone have any ideas on the best way to make this so any IP is not allowed to ever vote more than once?
Offline
Re: [archived] tcm_rating: TXP Rating System
you can just check whether the $previous query is successful
Offline
Re: [archived] tcm_rating: TXP Rating System
oh duh! wow I feel dumb. I changed it to just return the form if there is no previous if(!previous) and not return it if there is!
I had some other people check it, so I know that it is working now.
Thanks so much tmacwrig (your plugin rocks)
Offline
Re: [archived] tcm_rating: TXP Rating System
I’ll have to try this out on an upcoming site I’m working on. Would it be easy to create a list of the top rated articles with the data from this plugin? Thanks.
Offline
Re: [archived] tcm_rating: TXP Rating System
i’m with chris… Any way that someone could write a plugin to return the top ‘n’ ratings in an ordered list with some options?
Offline
Re: [archived] tcm_rating: TXP Rating System
anybody?
Offline
Re: [archived] tcm_rating: TXP Rating System
it’s possible, of course (a little processor-heavy), but honestly it will take some work. Here are just a few starters
The gist of it:
<pre>
change this line so that it gets all ratings
$ratings = safe_rows(“rating”, “txp_tcm_ratings”, “parentid = $id”);
like so
$ratings = safe_rows(“rating”, “txp_tcm_ratings”, “ORDER BY parentid”);
—————————————————————————
Process each parentid one by one – you will have to make $total an array, or create a new array that takes each $total value after the quick computations are done
—————————————————————————-
After you have an array of $parentids and $totals, copy a lot of the code from “publish.php”‘s “doArticles” function and after that returns an array of articles, sort that array (via one of the php array_sort functions) by the rating.
</pre>
That’s my “pseudocode” explanation on how to do it.
Offline
Re: [archived] tcm_rating: TXP Rating System
wow that sucks… forget that idea i guess :-\
perhaps it would be easier just to sort by date and find the most recent rated… even though that defeats the purpose of what I wanted to do.
Offline
Re: [archived] tcm_rating: TXP Rating System
Maybe a suggestion for a new version of this plugin would be to do the math while saving to the database. If this were to work, instead of saving each rating separately, the database would have one table for each article and have a section for IPs, number of ratings and average rating. Wouldn’t this be a lot faster in the end and allow for things like the x-amount of top rated articles?
Offline