Extension talk:W4G Rating Bar

Bug in read-only mode
Mediawiki 0.16: When in read-only mode, going to a page with a rating bar will print out a whole HTML page of Special:Lockdb screenshot (some content removed)

The ... is returned from the AJAX query. I see you have some code in SpecialW4GRB_body.php for handling read-only requests, so presume it works in earlier versions of MW. Possibly an issue with MW AJAX requests in read-only mode?

As a very cheap and incomplete workaround I've replaced w4g_rb.php:617

with

Bcoughlan 00:57, 26 December 2010 (UTC)
 * Nicely spotted, thanks. Fixed in next version. Patheticcockroach 17:29, 26 December 2010 (UTC)

Bug (w/ workaround): rating bar does not show when a page is created
If you create a page and put a rating bar in it, it will not show up the first time.

This is caused by: if(!$page_obj->setFullPageName($fullpagename)) { return array(''.wfMsg('w4g_rb-no_page_with_this_name',$fullpagename).' ', 'noparse' => true, 'isHTML' => true); }

in function W4GrbShowRatingBar (w4g_rb.php).

Only happens when you put a rating bar in while creating a page, doesn't happen when editing an existing page.

Workaround:

In w4g_rb.php, add a line at the start of function W4GrbShowRatingBar with the text "$parser->disableCache;" Bcoughlan 00:57, 26 December 2010 (UTC)


 * Yup, the problem with this solution is that it will disable the cache on all pages which use the extension. I guess I could make it an option, though, until I find better... Patheticcockroach 23:03, 23 December 2010 (UTC)
 * I think the problem has to do with the page not existing when the bar is generated. Perhaps it's possible to disable the cache only if the page doesn't exist? Something like $title = Title::newFromText($parser->getTitle->mPrefixedText); if (!$title) $parser->disableCache; (Haven't tested that) Bcoughlan 00:57, 26 December 2010 (UTC)
 * Thanks again and a lot, I can't believe I didn't think about that and am now in the process of slamming my head against the wall ;) Fixed in the next version too. Patheticcockroach 17:38, 26 December 2010 (UTC)
 * Hehe, glad to help. It's only an issue for me because I have a bot generating a lot of pages with rating bars in them. Thanks. Bcoughlan 19:18, 26 December 2010 (UTC)

Can not be downloaded~
I found the download page "official page"(this page),but I can not download it from that page. I can not unzip it.(.7z)--Xlsoul 04:47, 30 July 2010 (UTC)
 * The current development builds are packed often and kept as back-ups, so I used a rather common, open source archiver that gave a much better compression (7-Zip). Here's version 1.9-dev-19 as a zip. Patheticcockroach 05:54, 30 July 2010 (UTC)
 * Thanks a lot!This is my first-time asking for help on talk page.I am not good at English.Actually,I mean that I can download the 7zip document but I can not unzip it normally,like "Unsupported compression method for xxx.js".I think that it's my computer's issues.(My friend download it and unzip it easily).Thank you.In addition,can W4G Rating Bar be used as a star like AjaxRatingScript?That extension can only show one rating in one page and it's mandatory so it's not used for me.Rating Bar can do it.Can W4G do it too?--Xlsoul 11:31, 30 July 2010 (UTC)
 * Yeah, I guessed it was more of a decompression problem ;). We even used LZMA2 so maybe old 7-Zip versions don't like it (not sure though, as it seems my old IZarc can deal with them). Anyway, the star style is, as mentioned in "Features removed compared to the previous version", not available in this extension. We had to focus on one single style to put everything in place and make sure an unlimited number of bars can work together on a same page. The stars are not scheduled to come back yet. The first priorities are fixing the bugs we might still find, and then improve the current bar layout (I got some ideas but couldn't implement them yet). When all that is done and solidly tested, maybe we'll be introducing back some of the removed features. This choice of simplicity over features was made to reduce code complexity and chances of bugs: no more big features until we're sure we have a very stable version to rely on, which is what we really lacked with the previous Rating Bar 1.1. Patheticcockroach 14:22, 30 July 2010 (UTC)

Fatal error
I install 2.0b2 in mediawiki 1.15.4 which is installed in XAMPP 1.7.2(php 5.3.0+apache 2.2+MySql 5.1.37) but got following errors: Fatal error: Call to undefined method OutputPage::getTitle in D:\xampp\htdocs\mediawiki-1.15.4\extensions\W4GRatingBar\w4g_rb.php on line 143
 * Hi, this extension requires MediaWiki 1.16. Yet this error is strange because we didn't get it when testing on MW 1.15.4... But still, try upgrading to 1.16 first :) Patheticcockroach 14:50, 6 August 2010 (UTC)

You can't display more than 1 rating bar(s) on the same page.
I had my administrator install the W4G rating bar, but when I try to use it I get the above error. Here is my page: http://www.vtk.org/Wiki/VTK/Sandbox/Ratings - anyone have any idea what is going wrong? Daviddoria 16:41, 2 September 2010 (UTC)
 * Hi, did he configure $wgW4GRB_Settings['max-bars-per-page'] properly? (default is currently 1, ie limits to 1 bar per page) Patheticcockroach 19:37, 2 September 2010 (UTC)
 * I'm sure he didn't change anything from the defaults. The default of 1 sounds fine - but it seems to be allowing 0, right? Is there a way for me, as a user, to check the value of that variable? Daviddoria 11:57, 3 September 2010 (UTC)
 * Actually, I do see a working rating bar on the page you link to. (I misread, I thought you wanted to add one more.) As a user the only way to check that variable is to try to display more than the maximum allowed amount of rating bars. Patheticcockroach 16:14, 3 September 2010 (UTC)
 * What the heck, it is working now. That is very strange... but great! Sorry for the noise and thanks for the help. Daviddoria 18:55, 3 September 2010 (UTC)

You can't display more than 1 rating bar(s) on the same page (ONLY WHEN LOGGED IN!)
There were too many indents above to continue :). When I am not logged in to the wiki, the voting bar is displayed properly. When I am not logged in (anonymously viewing), the bar is not displayed, but rather I see "You can't display more than 1 rating bar(s) on the same page". Thoughts on this? Daviddoria 19:01, 3 September 2010 (UTC)
 * That's really weird, for me the bar was visible when anonymous but not when logged in (but when logged in I could see it in preview mode). I then purged the page and now I can see it in both cases... Patheticcockroach 06:48, 4 September 2010 (UTC)
 * Hm, you're right. I added it to another page, it didn't work, I purged, and then it worked. Is this a bug? This could be quite annoying to do for hundreds of pages haha. Daviddoria 13:13, 4 September 2010 (UTC)
 * Actually, this time I purged and now there is an error "you need to enable java script to vote" http://www.vtk.org/Wiki/VTK/Examples/Cxx/SimpleOperations/DistanceBetweenPoints - Thoughts? Daviddoria 13:24, 4 September 2010 (UTC)
 * About the Javascript issue, it's caused by the £%!#!** parser which adds a stupid paragraph within the script tag when the bar is loaded in a div... to fix it simply add a line break in w4g_rg.php on line 633 just after (ie, before the ). About the bar count, I really don't see what the problem can be, I don't manage to reproduce it on my test installation... I guess the easiest way would be to configure the limit to 2. Patheticcockroach 16:46, 4 September 2010 (UTC)

Sort pages by rank
I plan to put these on hundreds of pages - is there a way to "show all pages with a rating bar and sort them in order of their ranking?" Daviddoria 19:01, 3 September 2010 (UTC)
 * The top list can list all pages with a least a vote, but otherwise there's no way to list pages with the bar on but with no votes. The syntax for this would be like  (and you'd need to configure the max number of items, too) Patheticcockroach 07:06, 4 September 2010 (UTC)
 * Perfect, this is exactly what I wanted. Daviddoria 13:13, 4 September 2010 (UTC)

NC
Is it okay to put this extension on a website that will be supported through ads and/or donations? Smile Lee 04:54, 1 October 2010 (UTC)
 * The license seems actually unclear about that. My original intention was just to apply it to how you use/distribute the code itself or to patent commercial usages, for instance:
 * you can't sell the code or create modified versions of it
 * you can't make a commercial service that revolves essentially around the code
 * But you can use the extension as is to enrich a MediaWiki site as long as it's free (gratis), even if it contains ads or is funded by non-mandatory donations. Patheticcockroach 09:51, 1 October 2010 (UTC)

Thank you so much for clearing that up. Awesome extension btw.

p.s. I used Wiki4Games for a quick brush-up before I did recent run of Sonic & Knuckles. Smile Lee 10:25, 1 October 2010 (UTC)
 * No problem, don't hesitate to add yourself to the "who's using it" list ;) Patheticcockroach 07:14, 2 October 2010 (UTC)

Star style rating
Hi there.

Why was the star rating style removed? It was what my users want! Now I can't move to this newer version. Which is a real shame as I like the look of the new security. I would have thought Star ratings were far more common that percentages.

Thanks mitchelln 15:41, 8 October 2010 (UTC)
 * Hi, the star style was removed because it was a real pain to get it working along with the other style (among other things, the crazy MediaWiki parser didn't help - it's indeed the cause of the last big bug of 2.0-rc1, reported a bit higher by Daviddoria). With the tiny development time I had, a choice had to be made, and naturally I chose what I use on Wiki4Games. Of course, this choice has its downsides, but at least now the code is crystal clear (kind of ^^) while the old one was a total mess. Patheticcockroach 10:09, 17 October 2010 (UTC)

Database prefixes
If you integrate the installer for this into update.php (see LiquidThreads and ConfirmAccount for examples), you can put /*$wgDBprefix*/ in the SQL and the updater will handle prefixes automatically. :-) —Emufarmers(T 22:44, 12 February 2011 (UTC)
 * Ah for some reason I stopped receiving notifications for the talk page... I'll have a look at that, I've always wondered how to include automated database actions into extension but never knew where to start. Patheticcockroach 09:51, 9 March 2011 (UTC)

New core feature: "Article feedback"
Article feedback may be the way to go. I'm glad I waited ;) --Subfader 16:25, 21 February 2011 (UTC)
 * Well, this extension is primarily developed for a video game rating system, not for rating articles. So yeah, if you need to rate articles, that Article feedback thing is probably better for you :) Patheticcockroach 10:07, 9 March 2011 (UTC)