Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2008-01-08 17:06:56

Niconemo
Member
From: Rhône-Alpes, France
Registered: 2005-04-18
Posts: 557

Re: wlk_helpful, a rating plugin

Walker wrote:

I uploaded a new version that should fix the problem. — I created new Create Table statements that are more compatible.
(1 thing to note, the database tables are created when you visit the “Presentation” tab (technically the “Pages” tab).

Great job: it’s OK now ! I’m playing with…

One thing that is sure is that it will need a few customisation/internationalisation features ;-)

Last edited by Niconemo (2008-01-08 17:07:19)


Nico

Offline

#17 2008-01-09 16:39:49

Niconemo
Member
From: Rhône-Alpes, France
Registered: 2005-04-18
Posts: 557

Re: wlk_helpful, a rating plugin

Sorry, it’s me again.
I can’t figure out how to use this

quoted from plugin help :

Put this tag in that page: <txp:wlk_helpful_ajax /> (Tell it which=“ratio” to have it count by ratio rather than positivity—simple.)

I tried (as a tag in wlk_helpful_ajax page) :

  • <txp:wlk_helpful_ajax />
  • <txp:wlk_helpful_ajax which="ratio" />
  • <txp:wlk_helpful_ajax which="positivity" />

But each one has the same result :

  • Helpful?
  • 1 Yes
  • 1 No

But I probably misunderstood the plugin help…
Where I’m I wrong ?
How it is supposed to work ?

Last edited by Niconemo (2008-01-09 16:40:14)


Nico

Offline

#18 2008-01-09 16:49:21

Walker
Plugin Author
From: Boston, MA
Registered: 2004-02-24
Posts: 592
Website

Re: wlk_helpful, a rating plugin

txp:wlk_helpful_ajax receives the ajax calls from the plugin and resturns the results of those calls to the client’s browser.

txp:wlk_helpful is the “Helpful Yes/No” html output.

Offline

#19 2008-01-09 16:49:56

Walker
Plugin Author
From: Boston, MA
Registered: 2004-02-24
Posts: 592
Website

Re: wlk_helpful, a rating plugin

If you want me to look at your install, email me.

Offline

#20 2008-01-10 10:55:36

Niconemo
Member
From: Rhône-Alpes, France
Registered: 2005-04-18
Posts: 557

Re: wlk_helpful, a rating plugin

Thank you… I don’t want to bother you…

No problem about the general use of the plugin. I’ts working :

With <txp:wlk_helpful_ajax /> the default tag pasted in the “wlk_helpful_ajax” named page

I have by default :

  • Helpful?
  • 0 Yes
  • 0 No

If I click on Yes, I have now :

  • Helpful?
  • 1 Yes
  • 0 No

So no problem about that. The plugin works perfectly.

But I wonder how to to use the ratio/positivity setting ? And what it is supposed to change for the visitor.

I hope I’m clear enough… (I’m an autodidact and my english is not perfect as you can see)
Otherwise, no problem, I’ll wait for english-speaking users to test the plugin… That will probably help ;-)

Last edited by Niconemo (2008-01-10 10:58:12)


Nico

Offline

#21 2008-01-10 14:52:34

Walker
Plugin Author
From: Boston, MA
Registered: 2004-02-24
Posts: 592
Website

Re: wlk_helpful, a rating plugin

If you add the attribute which="ratio" to the wlk_helpful_ajax tag (<txp:wlk_helpful_ajax which="ratio" />, it uses a ratio of good to total to find the overall rating of an article. Otherwise, by default, it determines the overall rating of an article by subtrating all the negative ratings from the positive ones.

Offline

#22 2008-01-10 16:19:11

Niconemo
Member
From: Rhône-Alpes, France
Registered: 2005-04-18
Posts: 557

Re: wlk_helpful, a rating plugin

OK. I think I understand. Thanks for the explanation !

I was thinking the purpose of this setting was to display :

  • Useful ? 2 (=5-3)
  • Yes
  • No

Instead of

  • Useful ?
  • 5 Yes
  • 3 No

Or something like that…

Edit:
and, by the way, if you plan to add such a feature, It wouldn’t be the last “thank you” I’d send to you ! ;-)

Last edited by Niconemo (2008-01-10 16:25:30)


Nico

Offline

#23 2008-01-10 16:25:28

Walker
Plugin Author
From: Boston, MA
Registered: 2004-02-24
Posts: 592
Website

Re: wlk_helpful, a rating plugin

erm?

This one:

  • Useful ?
  • 5 Yes
  • 3 No

always displays. I think seeing the negatives is debatably good/bad but it was in the design for the site that this plugin was originally built for.

Offline

#24 2008-01-11 12:12:00

blueprint
Member
From: Netherlands
Registered: 2006-03-05
Posts: 43
Website

Re: wlk_helpful, a rating plugin

A rating plugin is great!! However, I can’t make it worK.

I followed all the necessary steps (at least, that’s what I think):
1. I created a section “wlk_helpful_ajax” which refers to the page “wlk_helpful_ajax”
2. The only thing on the page “wlk_helpful_ajax” is: <txp:wlk_helpful_ajax />
3. In the head of all my pages I added:
<script type="text/javascript" src="<txp:link_to_home />textpattern/jquery.js"></script>
and
<script type="text/javascript" src="<txp:link_to_home />textpattern/wlk_helpful.js"></script>
(I put the wlk_helpful.js in the same directory as tjh jquery.js. And I checked on the generated page whether the script can be reached; e.g. in Firefox with the addon Webdeveloper, I can see the code of both javascripts)
4. I added the tag <txp:wlk_helpful /> in a form

What happens is: the list is displayed on the page:
  • Helpful?
  • 0 Yes
  • 0 No
    But clicking on Yes or No, makes you jump to the start of the page and nothing else.

Any clues on how to solve this???
Any suggestions are very much appreciated

Offline

#25 2008-01-11 14:21:20

Walker
Plugin Author
From: Boston, MA
Registered: 2004-02-24
Posts: 592
Website

Re: wlk_helpful, a rating plugin

Is the form an article form?

Also, check your DB and see if the tables (txp_wlk_helpful & txp_wlk_helpful_counts) actually got installed.

Offline

#26 2008-01-11 15:12:07

blueprint
Member
From: Netherlands
Registered: 2006-03-05
Posts: 43
Website

Re: wlk_helpful, a rating plugin

thanks for the suggestions.

The forms are indeed article forms.

I looked into the db and found that both tables were created. Furthermore, the table txp_wlk_helpful_counts is NOT empty; is has records for every article that I clicked on the helpful yes/no link. The field textpatterni_id has the right value for each record; however the fields pluses, minuses and count have the value 0 for every record.
The other table (txp_wlk_helpful) is empty.

Maybe this info can help??

Offline

#27 2008-01-11 15:17:04

Walker
Plugin Author
From: Boston, MA
Registered: 2004-02-24
Posts: 592
Website

Re: wlk_helpful, a rating plugin

If this is empty: txp_wlk_helpful, it means that your +/- clicks are having no affect (they’re never hitting the server, or never getting saved to the db).

txp_wlk_helpful_counts is a cache of the totals for each article and the rows in that table get created whenever an article with the counter is viewed (creates the default zero values)

Offline

#28 2008-01-11 17:27:58

blueprint
Member
From: Netherlands
Registered: 2006-03-05
Posts: 43
Website

Re: wlk_helpful, a rating plugin

This made it clear for me that the problem was with the javascript.

I looked into the script wk_helpful.js and I had to change line 6:
jQuery.post('/wlk_helpful_ajax', {"article_id":article_id,"up_down":'up'}, function(data){

into
jQuery.post('http://localhost/nb/wlk_helpful_ajax', {"article_id":article_id,"up_down":'up'}, function(data){

And then it worked (I’m testing this plugin om my PC, and the site is in a subdir called nb).
The only annoying thing is, that after clicking the cursor still goes to the top of the page.

Last edited by blueprint (2008-01-11 17:28:36)

Offline

#29 2008-01-11 17:32:53

Walker
Plugin Author
From: Boston, MA
Registered: 2004-02-24
Posts: 592
Website

Re: wlk_helpful, a rating plugin

Yeah, subdirectories would do it.

You just have to edit the js as you did….

The only annoying thing is, that after clicking the cursor still goes to the top of the page. <- you can get rid of this using jquery…..I’ll try to add it in sometime, but I’m hellishly busy right now.

Offline

#30 2008-01-11 21:09:30

Walker
Plugin Author
From: Boston, MA
Registered: 2004-02-24
Posts: 592
Website

Re: wlk_helpful, a rating plugin

I just uploaded a new version. If you has this plugin installed before, remove the wlk_helpful_counts table from your database and revisit the “Pages” tab, and it’ll recreate that table (correctly).

Offline

Board footer

Powered by FluxBB