Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2005-01-07 04:37:50

paularms
Member
From: University of Minnesota
Registered: 2004-10-21
Posts: 155
Website

Re: [archived] tcm_rating: TXP Rating System

Does it show up on this page?

Offline

#26 2005-01-07 07:42:28

paularms
Member
From: University of Minnesota
Registered: 2004-10-21
Posts: 155
Website

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

#27 2005-01-07 13:01:13

tmacwrig
Archived Plugin Author
Registered: 2004-03-06
Posts: 204
Website

Re: [archived] tcm_rating: TXP Rating System

yes – it seems to be working perfectly now.

Offline

#28 2005-01-09 23:38:05

paularms
Member
From: University of Minnesota
Registered: 2004-10-21
Posts: 155
Website

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

#29 2005-01-09 23:52:43

tmacwrig
Archived Plugin Author
Registered: 2004-03-06
Posts: 204
Website

Re: [archived] tcm_rating: TXP Rating System

you can just check whether the $previous query is successful

Offline

#30 2005-01-10 00:17:47

paularms
Member
From: University of Minnesota
Registered: 2004-10-21
Posts: 155
Website

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

#31 2005-01-10 20:51:29

chrisrhee
Member
Registered: 2004-07-01
Posts: 33
Website

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

#32 2005-01-10 23:51:55

paularms
Member
From: University of Minnesota
Registered: 2004-10-21
Posts: 155
Website

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

#33 2005-01-14 15:42:46

paularms
Member
From: University of Minnesota
Registered: 2004-10-21
Posts: 155
Website

Re: [archived] tcm_rating: TXP Rating System

anybody?

Offline

#34 2005-01-14 20:49:01

tmacwrig
Archived Plugin Author
Registered: 2004-03-06
Posts: 204
Website

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

#35 2005-01-14 23:09:22

paularms
Member
From: University of Minnesota
Registered: 2004-10-21
Posts: 155
Website

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

#36 2005-01-15 03:24:04

paularms
Member
From: University of Minnesota
Registered: 2004-10-21
Posts: 155
Website

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

Board footer

Powered by FluxBB