Textpattern CMS support forum

You are not logged in. Register | Login | Help

#41 2012-05-30 07:31:07

Gocom
Plugin Author
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,530
Website

Re: cbe_helpful: Visitors can rate articles (based on wlk_helpful)

jakob wrote:

Jukka has a newer version of rah_external_output in the works on his github page that uses forms and does away with the own table and admin pane. That necessitates a small change to your safe_upsert to cbe_helpful_enabled in the creation of two forms.

As jakob notes, the next release of rah_external_output will migrate away from its own database table and interface to Textpattern’s native form templates.

Claire, you can find the new version Jakob mention and working documentation at https://github.com/gocom/rah_external_output.

If you wish to support and use rah_eo v1.0 and later, the rows pretty much are needed to be inserted to txp_form table instead of the current rah_external_output. Don’t worry about migrating and rah_eo updaters, rah_eo has its own migration script in places that runs on updates. This covers already existing cbe_helpful installation on rah_eo’s part.

Rah_eo’s snippets work similarly as they do now, as frontend goes. As rah_eo’s documentation mentions, the plugin uses prefixed forms, and supports both (inline) header lines and file extensions. Knowing that, the current database insert lines for cbe_helpful could be changed to something as following;

safe_upsert(
	'txp_form',
	"name='rah_eo_cbe_helpful_ajax.html',
	Form='{$code}'",
	"name='rah_eo_cbe_helpful_ajax.html'"
);

safe_upsert(
	'txp_form',
	"name='rah_eo_cbe_helpful_js.js',
	Form='{$js}'",
	"name='rah_eo_cbe_helpful_js.js'"
);

No other changes should be required as far as I’m aware, apart from a version check that checks which rah_eo version is installed etc. As it those lines add Forms you could also just run those queries no matter what the rah_eo version is as the txp_form table is part of the Textpattern core. The next release version of rah_eo which implements the new db structure and Forms integration will be numbered plainly as 1.0, which you can use to base a version number check (e.g. using PHP’s version_compare) if you may.

Last edited by Gocom (2012-05-30 07:37:01)

Offline

#42 2012-05-30 10:55:39

CeBe
Plugin Author
From: Caen - Fr
Registered: 2010-06-25
Posts: 344
Website

Re: cbe_helpful: Visitors can rate articles (based on wlk_helpful)

I didn’t realize how much of rah_external_output had changed and improved. Thank you for pointing that out.

Remembered also about Jakob’s suggestions.

It appears that after a front-side update, it’s time to work on the plugin’s admin side.

Offline

#43 2012-05-30 22:17:38

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,416
Website

Re: cbe_helpful: Visitors can rate articles (based on wlk_helpful)

Remembered also about Jakob’s suggestions

I found this problem occurs when you use cbe_helpful inside an li list…

If it’s any help, the problem I described here can be (partially) resolved by adding wraptag="ul" so that the li’s inserted by the function are correctly wrapped. You might still want to address the correct wrapping of the li’s if the wraptag is not set.


TXP Builders – finely-crafted code, design and txp

Offline

#44 2012-07-16 13:57:18

CeBe
Plugin Author
From: Caen - Fr
Registered: 2010-06-25
Posts: 344
Website

Re: cbe_helpful: Visitors can rate articles (based on wlk_helpful)

Fresh today : v0.5 ! It supports new rah_external_output database structure. The old one is no longer supported.
Download link is in the original post.

It also checks if all table are present and restore them if not. But be careful : if only one table is missing, it is restored but the others are left untouched. It can lead to inconsistencies between data.

To discuss a little further :

  • The plugin doesn’t offer saving/restoring backups. I think this is the webmaster to decide (via phpMyAdmin, or rss_admin_db_manager).
  • I assume that when the plugin is deleted, it’s because it will no longer be used. If data are to be saved, backup should be performed first.
  • If the plugin is temporarily paused, just deactivate it. All preferences and data will remain.

Finally, I failed to reproduce the bug. With something like

<ul>
<li>Vote</li>
<li><txp:cbe_helpful /></li>
</ul>

… sorry, but it works.
What are your codes ?

Last edited by CeBe (2012-07-16 18:37:34)

Offline

#45 2012-07-18 10:47:00

douglgm
Member
From: Bristol
Registered: 2006-08-23
Posts: 182
Website

Re: cbe_helpful: Visitors can rate articles (based on wlk_helpful)

Hi Claire, Just trying to get the plugin working on a development setup for an internal project and encountered a small problem – the js from rah_external_output isn’t loading.

The website is set up at the following URL: http://webserver/intranet <- not that it’s installed in a subfolder.

Looking in my error console it looks like it’s trying to load:

http://webserver/?rah_external_output=cbe_helpful_js

Rather than:

http://webserver/intranet/?rah_external_output=cbe_helpful_js (which displays the correct js if entered manually)

My Site URL set in the textpattern preferences is: webserver/intranet

Is this a problem with my setup?

Thanks, Doug.

Offline

#46 2012-07-18 11:45:42

CeBe
Plugin Author
From: Caen - Fr
Registered: 2010-06-25
Posts: 344
Website

Re: cbe_helpful: Visitors can rate articles (based on wlk_helpful)

douglgm a écrit:

My Site URL set in the textpattern preferences is: webserver/intranet

Is this a problem with my setup?

Not at all. Error is my own >.<
BTW, there is the same problem with the ajax snippet.
Just wait a little bit, I will post a correction today.
Thank you.

Last edited by CeBe (2012-07-18 11:46:00)

Offline

#47 2012-07-18 12:10:24

douglgm
Member
From: Bristol
Registered: 2006-08-23
Posts: 182
Website

Re: cbe_helpful: Visitors can rate articles (based on wlk_helpful)

Thanks for the quick response Claire. I look forward to the fix! :-)

Offline

#48 2012-07-18 12:12:59

CeBe
Plugin Author
From: Caen - Fr
Registered: 2010-06-25
Posts: 344
Website

Re: cbe_helpful: Visitors can rate articles (based on wlk_helpful)

v0.5.1 published !
Sorry for the inconvience, and thank you for having reported :)

Last edited by CeBe (2012-07-18 12:16:03)

Offline

#49 2012-07-18 12:22:09

douglgm
Member
From: Bristol
Registered: 2006-08-23
Posts: 182
Website

Re: cbe_helpful: Visitors can rate articles (based on wlk_helpful)

That was fast! Happy to report that it’s working fine now! Thanks for the great plug-in!

Offline

#50 2012-10-17 13:57:22

douglgm
Member
From: Bristol
Registered: 2006-08-23
Posts: 182
Website

Re: cbe_helpful: Visitors can rate articles (based on wlk_helpful)

Claire, any chance you could add a way to display the separate yes and no numbers in an article-list context? These don’t need to be clickable to vote, just displaying the values?

It would be nice to be able to display the number of “Thumbs Up” and Thumbs Down” next to an article summary rather than just the score.

Thanks,Doug.

Offline

Board footer

Powered by FluxBB