Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#61 2009-11-14 05:04:43

aswihart
Member
From: Pittsburgh, PA
Registered: 2006-07-22
Posts: 345
Website

Re: jmd_rate: A CSS star rater

Running 4.2. I have gbp_permanent_links making my link structure section / category / ID, but this plugin keeps it’s rating links referenced to the url structure in admin->preferences. I am able to get it to work if I turn off gpb_permanent_links. With gbp_permanent_links activated, I get a 404 error and no rating is logged.

EDIT: Just realized if I set the admin url preference to ?=messy, the rating links at least follow the structure I set in gbp_permanent_links: section / category / ID, but there is no @&rating=x” after them. All 4 stars are simply a link to the article you are already viewing. Even if I manually type in the predicted URL, http://site.com/section/category/ID&rating=x”, all it does is reload the article page and no rating gets logged.

Any ideas on getting this plugin to play nice with gbp_permanent_links?

Last edited by aswihart (2009-11-14 17:25:27)

Offline

#62 2009-11-14 17:26:21

aswihart
Member
From: Pittsburgh, PA
Registered: 2006-07-22
Posts: 345
Website

Re: jmd_rate: A CSS star rater

Another issue, jmd_rate_article isn’t working, anyone have it working on 4.2? This is what I see in debugging mode

Tag error: <txp:jmd_rate_article section="cases" form="cases" /> ->  Textpattern Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and  ORDER BY rating DESC LIMIT 10' at line 1
SELECT parentid, avg(value) AS rating FROM jmd_rate GROUP BY parentid HAVING rating BETWEEN  and  ORDER BY rating DESC LIMIT 10
textpattern/lib/txplib_misc.php(594) : eval()'d code:280 getRows()  on line 85
textpattern/lib/txplib_db.php:85 trigger_error()
textpattern/lib/txplib_db.php:272 safe_query()
textpattern/lib/txplib_misc.php(594) : eval()'d code:280 getRows()
textpattern/publish.php:1106 jmd_rate_article()
textpattern/publish.php:1028 processTags()
textpattern/publish/taghandlers.php:2625 parse()
textpattern/publish.php:1106 if_individual_article()
textpattern/publish.php:1041 processTags()
textpattern/publish.php:506 parse()
index.php:45 textpattern()

Last edited by aswihart (2009-11-14 17:30:43)

Offline

#63 2009-11-14 21:25:08

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: jmd_rate: A CSS star rater

aswihart wrote:

Another issue, jmd_rate_article isn’t working, anyone have it working on 4.2? This is what I see in debugging mode

Tag error: <txp:jmd_rate_article section="cases" form="cases" /> ->

You need to specify a min_value and max_value (see first post). It works on 4.2 (tested – John’s issue was resolved via email [unable to replicate and resolved itself]).

Regarding your link issue, you’ll need to edit the redirect in setRating to work with gbp_permanent_links and keep links in messy mode (that’s what the plugin uses for building links).

Offline

#64 2009-11-14 21:53:38

aswihart
Member
From: Pittsburgh, PA
Registered: 2006-07-22
Posts: 345
Website

Re: jmd_rate: A CSS star rater

Ok, I had taken those out thinking it might help, but they were there before with no difference. But, this is what I get in debugging mode now (any way to limit the height of the code box below?):

Tag error: <txp:jmd_rate_article section="cases" form="cases" max_value="10" min_value="0" /> ->  Textpattern Notice: Unknown tag attribute: max_value  on line 699
textpattern/lib/txplib_misc.php:699 trigger_error()
textpattern/lib/txplib_misc.php(594) : eval()'d code:278 lAtts()
textpattern/publish.php:1106 jmd_rate_article()
textpattern/publish.php:1028 processTags()
textpattern/publish/taghandlers.php:2625 parse()
textpattern/publish.php:1106 if_individual_article()
textpattern/publish.php:1041 processTags()
textpattern/publish.php:506 parse()
index.php:45 textpattern()
Tag error: <txp:jmd_rate_article section="cases" form="cases" max_value="10" min_value="0" /> ->  Textpattern Notice: Unknown tag attribute: min_value  on line 699
textpattern/lib/txplib_misc.php:699 trigger_error()
textpattern/lib/txplib_misc.php(594) : eval()'d code:278 lAtts()
textpattern/publish.php:1106 jmd_rate_article()
textpattern/publish.php:1028 processTags()
textpattern/publish/taghandlers.php:2625 parse()
textpattern/publish.php:1106 if_individual_article()
textpattern/publish.php:1041 processTags()
textpattern/publish.php:506 parse()
index.php:45 textpattern()
Tag error: <txp:jmd_rate_article section="cases" form="cases" max_value="10" min_value="0" /> ->  Textpattern Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and  ORDER BY rating DESC LIMIT 10' at line 1
SELECT parentid, avg(value) AS rating FROM jmd_rate GROUP BY parentid HAVING rating BETWEEN  and  ORDER BY rating DESC LIMIT 10
textpattern/lib/txplib_misc.php(594) : eval()'d code:280 getRows()  on line 85
textpattern/lib/txplib_db.php:85 trigger_error()
textpattern/lib/txplib_db.php:272 safe_query()
textpattern/lib/txplib_misc.php(594) : eval()'d code:280 getRows()
textpattern/publish.php:1106 jmd_rate_article()
textpattern/publish.php:1028 processTags()
textpattern/publish/taghandlers.php:2625 parse()
textpattern/publish.php:1106 if_individual_article()
textpattern/publish.php:1041 processTags()
textpattern/publish.php:506 parse()
index.php:45 textpattern()

jm wrote:

you’ll need to edit the redirect in setRating to work with gbp_permanent_links

Thanks for the info. Any guidance on how to do this would also be very much appreciated. Does it matter that it didn’t log a rating when I manually typed in the expected url (http://site.com/section/category/id&rating=x)?

Last edited by aswihart (2009-11-14 22:13:59)

Offline

#65 2009-11-15 16:37:41

aswihart
Member
From: Pittsburgh, PA
Registered: 2006-07-22
Posts: 345
Website

Re: jmd_rate: A CSS star rater

Just noticed the stars don’t render correctly in IE8. Well, they actually render fine after you’ve voted and it’s just displaying the stars statically, but when you haven’t voted, there is no a:hover effect, and there are just the different colored rows of four stars stacked vertically on one another.

-jmd_rate_stars in IE8

EDIT: This no longer happens, there was some conflicting plugin or CSS that caused my display problems on IE8. To be clear, the CSS for the stars works fine on IE8.

Checking IE6, this is what you see on “already voted” pages: jmd_rate_stars in IE6. On the bright side, at least you can tell what the rating is by the top row of stars.

It may be more trouble than it’s worth trying to get it to display properly on IE6, but if anyone has done so, please share! I saw you mentioned earlier in reference to IE6 that you might need height: 1% in there somewhere. Any guidance on this would be very much appreciated, as all the computers at work where I expect people to access my website are running IE6! I know, for the love of god.

Last edited by aswihart (2009-11-16 21:00:35)

Offline

#66 2009-12-03 22:00:49

aswihart
Member
From: Pittsburgh, PA
Registered: 2006-07-22
Posts: 345
Website

Re: jmd_rate: A CSS star rater

Is there a way to make the rating links generated by jmd_rate ignore gbp_permanent_links? I know you said I could edit the redirect in setRating. I’m not sure if that is accomplishing the same thing my solution does: I now have a working solution where I make the links on the article pages myself:

<li><a href='http://radres.info/index.php?id=<txp:article_id />&rating=1'>one star</a></li>
<li><a href='http://radres.info/index.php?id=<txp:article_id />&rating=2'>two stars</a></li>
<li><a href='http://radres.info/index.php?id=<txp:article_id />&rating=3'>three stars</a></li>
<li><a href='http://radres.info/index.php?id=<txp:article_id />&rating=4'>four stars</a></li>

Just wondering if there’s a way to keep using gbp_permanent links, and also keep the pretty stars and automatically generated links from jmd_rate somehow. As I mentioned in a prior post, when I manually type the custom url structure followed by &rating=4, no rating gets logged. However, if I just use the messy url structure as in my workaround above, ratings get logged fine, even with gbp_permanent_links enabled.

Regarding my debug output in an earlier post, does that give you any insights into what is going on with jmd_rate_article? Think it’s a 4.2 specific issue?

Last edited by aswihart (2010-01-23 13:58:46)

Offline

#67 2009-12-07 06:06:48

aswihart
Member
From: Pittsburgh, PA
Registered: 2006-07-22
Posts: 345
Website

Re: jmd_rate: A CSS star rater

jm, I know you have greater callings in life than to listen to my persistent nagging, but I still thought I’d offer a feature request. You currently can limit votes by IP. Would it be possible to limit votes by logged in user?

I’m trying to develop a community driven teaching website for Radiology residents, and your plugin is already playing a major role, letting me assign ratings to the cases residents submit. Once I get sorting by rating working (issues detailed in earlier posts), jmd_rate will make it possible to display the highest educational value cases first, and this is a very important feature.

To make the ratings meaningful, it is most helpful to keep voting limited to residents with valid logins. I’m accomplishing this easily with rvm_privileged. It would be even more helpful to limit voting to once per resident. At our workplace, we are sharing and bouncing between many computers (IP’s) all the time, so limiting voting by IP isn’t as useful. Just hoping that somewhere down the line this is a feature you could look into adding to your already amazing plugin. But enough nagging, thank you for what you’ve already done with this and other plugins, it is already a major contribution to the Txp community.

P.S. Is it possible to make a “copy” of this plugin, change some of the tags names (e.g. jmd_rate2…), and allow for multiple ratings this way? I was thinking that in addition to a case quality rating, rating by difficulty would also be useful.

Last edited by aswihart (2009-12-07 06:56:36)

Offline

#68 2010-01-18 17:39:52

aswihart
Member
From: Pittsburgh, PA
Registered: 2006-07-22
Posts: 345
Website

Re: jmd_rate: A CSS star rater

Being a complete moron (but just having a stroke of normal intelligence), I figured out the reason the jmd_rate_article tag wasn’t working was because I was using max_value and min_value for the attributes instead of max_rating and min_rating, now it works perfectly! Although I doubt there are many who would be stuck on this as long as I was, it’s probably not a bad idea to update your first post to reflect this inaccuracy, jm.

Offline

#69 2010-02-02 03:36:56

benbruce
Plugin Author
Registered: 2006-01-13
Posts: 328
Website

Re: jmd_rate: A CSS star rater

aswihart and jm re: “You need to specify a min_value and max_value.”

I had this same issue. Looked in the code and it’s actually looking for “max_rating” and “min_rating”. Changed the attributes in the tag, and now it’s working fine.

Offline

#70 2010-02-02 18:52:33

WebKat
Member
Registered: 2007-01-16
Posts: 301

Re: jmd_rate: A CSS star rater

Can someone please take pity on me and give me some sample CSS code that will make this look good? Right now I get a ridiculously narrow and tall list with just a bunch of text…



WebKat

Offline

#71 2010-02-09 13:49:14

wornout
Member
From: Italy
Registered: 2009-01-20
Posts: 256
Website

Re: jmd_rate: A CSS star rater

I’ve got some problems using plug-in.
I see the list of votes but after selecting one of these the pages reload the same and no record is insert in DB.
I don’t know where is the problem!!!
I use Txp 4.2.0

Can someone help me?

Offline

#72 2010-02-15 04:39:28

aswihart
Member
From: Pittsburgh, PA
Registered: 2006-07-22
Posts: 345
Website

Re: jmd_rate: A CSS star rater

For anyone interested, you can use custom fields with jmd_rate_article (the article_custom equivalent for listing articles by rating with jmd_rate) by editing the plugin code manually. Look for this code:

function jmd_rate_article($atts)
{
    extract(lAtts(array(

…and below in the list of variables, enter 'customfieldname' => '_%',. You’ll want to keep that _% in there, which serves as the default value, and basically matches any article with a non-empty value for that custom field, or else you can put some other default value if you like.

Soon after that part in the plugin code you’ll find this:

   foreach ($matching as $article)
    {
        $out .= article_custom(array(

…after this in the list of variables, just add this: 'customfieldname' => '$customfieldname',. Now you should be able to use custom fields as attributes in the jmd_rate_article tag, just like with article_custom.

@wornout – Are you using clean or dirty urls?

Offline

Board footer

Powered by FluxBB