Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
jmd_rate: A CSS star rater
<txp:jmd_rate/>
is a comprehensive CSS star rater that features customizable output, article_custom for ratings, and a rating-CSS generator.
Requirements
- TXP 4.0.6
- PHP 5
- A star image (example image, Illustrator file)
Example syntax
<txp:hide>Either in an article or article form:</txp:hide>
<txp:jmd_rate>
<txp:if_jmd_rate_votes>
<p>
Currently rated <txp:jmd_rate_rating/>/<txp:jmd_rate_max/> after <txp:jmd_rate_votes singular="vote" plural="votes"/>.
</p>
<txp:else/>
<p>
This article hasn’t been rated.
</p>
</txp:if_jmd_rate_votes>
<txp:jmd_rate_display/>
<txp:if_jmd_rate_voted>
<p>
Thanks for voting.
</p>
</txp:if_jmd_rate_voted>
</txp:jmd_rate>
For <txp:jmd_rate_article/>
:
<txp:hide>Page or form template:</txp:hide>
<ol>
<txp:jmd_rate_article form="highest_rated" max_value="10" min_value="8" section="articles" />
</ol>
<txp:hide>Article form: highest_rated</txp:hide>
<li>
<txp:permlink>
<txp:title/>
</txp:permlink>:
<txp:jmd_rate>
<txp:jmd_rate_rating/>/<txp:jmd_rate_max/>
</txp:jmd_rate>
</li>
Credits
Many thanks to the following people:
- Jukka Svahn for tons of plugin help
- Mary Fredborg for showing me the ropes of admin plugins
- Michael Manfre for schooling me with PHP classes and database design
- Jeremy Amos for eliminating a query
- Ruud van Melick’s zem_contact_reborn for the fcgi redirect
- Rogie King for the CSS star rater
- ClimaxDesigns for initial PHP
Edit: Wrong version number (0.3 instead of 0.4).
Last edited by jm (2009-06-12 06:23:44)
Offline
Offline
#3 2008-03-05 09:23:14
- candyman
- Member
- From: Italy
- Registered: 2006-08-08
- Posts: 684
Re: jmd_rate: A CSS star rater
It would be nice to add the “half-star” option, in case, for example, I’d like to rate a film with 2.5 stars out of 5 (filling the relative custom field).
Offline
Re: jmd_rate: A CSS star rater
candyman wrote:
It would be nice to add the “half-star” option, in case, for example, I’d like to rate a film with 2.5 stars out of 5
Or just make it out of 10 and stick to integers :-P
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: jmd_rate: A CSS star rater
Hehe nice Stef. candyman, integers make sense for the star input, but the plugin calculates the overall rating, which can draw half stars.
I’ve got a newer, more customizable version almost complete. It should be done later on today. It’s up.
Last edited by jm (2008-03-06 13:33:29)
Offline
#6 2008-03-06 10:01:03
- Niconemo
- Member
- From: Rhône-Alpes, France
- Registered: 2005-04-18
- Posts: 557
Re: jmd_rate: A CSS star rater
:-(
Looks nice… but :
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /mysitepath/textpattern/lib/txplib_misc.php(574) : eval()’d code on line 166
Erreur lors du chargement du plugin ci-dessus jmd_rate
Between step 2 an 3 of the “Getting started”…
Nico
Offline
Offline
#8 2008-03-06 15:04:54
- Niconemo
- Member
- From: Rhône-Alpes, France
- Registered: 2005-04-18
- Posts: 557
Re: jmd_rate: A CSS star rater
Thanks !
edit :
;-) There is a difference :
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /mysitepath/textpattern/lib/txplib_misc.php(574) : eval()’d code on line 303
Erreur lors du chargement du plugin ci-dessusjmd_rate
Last edited by Niconemo (2008-03-06 15:07:04)
Nico
Offline
Offline
#10 2008-03-06 19:51:43
- candyman
- Member
- From: Italy
- Registered: 2006-08-08
- Posts: 684
Re: jmd_rate: A CSS star rater
Ops, I didn’t read carefully… I thought it was a plugin to set the star rating in review by the author of the article and not a system to allow the reader to vote the article itself…
Offline
#11 2008-03-08 17:28:07
- Niconemo
- Member
- From: Rhône-Alpes, France
- Registered: 2005-04-18
- Posts: 557
Re: jmd_rate: A CSS star rater
Gocom wrote:
Niconemo, are you sure that you are using it on PHP5? The version 0.1 beta worked for me, when we were testing it out.
Oh my… I’m completely sorry ! You’re right. My default setting for all site is PHP 5.0.2 but I’m currently testing on a site that was set to PHP 4 (don’t remember why… probably because of an old plugin…).
Everything seems to work with the default 4 star rater (I’ve got some troubles when testing with 5 stars but it’s probably my fault again, I’ll try again later)
Thanks for all !
Nico
Offline
Re: jmd_rate: A CSS star rater
0.3 is up! This fixes the irritating fcgi redirect bug, so jmd_rate should work on all servers. Next stop: Ajax!
Offline