Extension talk:CommunityVoice

From mediawiki.org

How to display top-rated titles in a category[edit]

Please give me some advice!My website need display top 10 titles in a category!

Used Where?[edit]

Hi there, on what WM wiki is this used? SJ

I asked this very question yesterday, see User_talk:Trevor_Parscal, being used on http://usability.wikimedia.org/ --Dr DBW | talk 03:02, 27 February 2009 (UTC)Reply
  • TrailWIKI.us I use it on my site, Hiking website for Washington State.

MySQL error[edit]

I receive this error:

Error returned by MySQL database is «1146: Table 'YOURWIKI.cv_ratings_votes' doesn't exist (localhost)».

But what does the following mean?

Check your privileges, one of the possibles reasons it is the user have enough rights to create the tables required. Then try to run manually the Initialize.php through the shell. Go to the Mediawiki extensions folder and write the following code.

\php Initialize.php --confirm=yes


Could you explain it in detail?

--dvL 09:58, 2 March 2009 (UTC)Reply


When using CommunityVoice, certain database tables need to exist in your database. To create these tables, you need to run some code. The code you need to run is not a web page though, so you need to have access to the command line. If you are installing on your local computer you can just open up a command prompt or terminal (depending what your operating system calls it) and type "cd <path-to-my-wiki>" for example, where <path-to-my-wiki> is the full file path to your wiki installation. from there you can type "cd extensions/CommunityVoice/CLI" to change to the directory which contains the command line interface scripts for the CommunityVoice extension. Finally you can run the line mentioned above: "php Initialize.php --confirm=yes" which invokes the php program, tells it to run the Initialize.php script and passes yes as the value for the confirm argument. The script will run and create the database tables for you. Please note you may have to have root access to perform these operations - in which case you might need to use the sudo command before invoking php like "sudo php Initialize.php --confirm=yes". All of this information is part of a very common process for preparing your wiki for use with certain extensions. I hope that is clear and helpful. 75.149.49.114 17:35, 3 March 2009 (UTC)Reply


Thanks, this was very helpful..
--dvL 08:14, 4 March 2009 (UTC)Reply
Edit: I entered this as admin..
C:\xampp\php>php C:\xampp\htdocs\wiki\extensions\CommunityVoice\CLI\Initialize.php --confirm=yes
Note, you don't have to be root user on your computer (which is what sudo does), but potentially root user in your db depending on how its set up. Bawolff 06:12, 20 November 2011 (UTC)Reply

db prefix is another cause for sql errors[edit]

All of my tables are prefixed with mw_ which is ok for all extensions but for some reason CommunityVoice.sql ignores that. Fixing this was easy with phpmyadmin I just renamed 'cv_ratings_votes' to 'mw_cv_ratings_votes'.

Or you edit communityvoice.sql before running initialize.php. Change /*wgDBprefix*/ to Your_Wikis_DB_Tables_Prefix. Drhirn 13:48, 17 November 2011 (UTC)Reply

Strange behavior[edit]

Another question: The "strange behavior" problem (<communityvoice-ratings-scale-stats> message instead of the correct message 0 / 5 (0 votes cast)) that is mentioned on the main page seems to be resolved at the Wikimedia nomination site. What was changed?

--dvL 09:57, 4 March 2009 (UTC)Reply

Yes, what was changed?? -- 15:15, 16 March 2009 (GMT)

That type of message indicates i18n files didn't get loaded properly. Bawolff 06:12, 20 November 2011 (UTC)Reply

Not working with IE and Opera[edit]

Only FF shows this extension corect..

This has been fixed in r48522. The cause was the use of null as a key in a JavaScript object.

Failing to register[edit]

Running MW 1.15aSVN and having set

  1. require_once( "$IP/extensions/ClientSide.php" );
  2. require_once( "$IP/extensions/CommunityVoice/CommunityVoice.php" );

in LocalSettings returns the following error:

Warning: call_user_func(CommunityVoice::registerModules) [function.call-user-func]: Unable to call CommunityVoice::registerModules() in /chroots/dwadmin/home/dwadmin/htdocs/includes/Setup.php on line 310

Both files exist and are at their proper places :/

Was there a resolution to this?[edit]

  • I'm getting the same problem. Was there ever a resolution to this?
  • It seems I'm third to report this problem. I'm running mediawiki 1.13.2 and I require_once the correct php files, I know because in special:version both ClientSide and CommunityVoice appear but I get the same error above - Unable to call CommunityVoice::registerModules(). --80.179.206.193 13:33, 9 December 2009 (UTC)Reply
  • solved it, you have to go and edit extensions/CommunityVoice/CommunityVoice.php and instead of registering the php method as 'CommunityVoice::registerModules', register it as an array like so: array('CommunityVoice', 'registerModules'). Just as stated here: http://php.net/manual/en/function.call-user-func.php in the parameter 'function'.
It's probably related to what version of php you are using. Bawolff 06:12, 20 November 2011 (UTC)Reply

Quickie review[edit]

Couple quick notes...

  • Some functions in ClientSide look like they duplicate code in Xml.php
  • handleScaleVoteCall looks like it will return old data from slave, so reported total after vote will not include the vote (which has only just been inserted to the master)

-- brion 18:37, 13 May 2009 (UTC)Reply


Is it possible to install the DB without Commandline-Access (phpMyAdmin)?[edit]

Hi,

i have no commandline on my webspace/server, but i can access the DB through phpMyAdmin.

Could anyone tell how exactly the table has to be named/formed?

78.52.99.77 17:51, 12 October 2009 (UTC)Reply

Yes, it is.[edit]

I found this interesting looking file CommunityVoice/CommunityVoice.sql - and adapted it to my needs, using my "absolute-non-existing-MySQL-Trial-and-Error-Know-How".

This is how it went:

  • Login to your phpMyAdmin
  • Click on SQL which gives you a Window where you can copy&paste some SQL-Commands
  • Copied this code into the window and executed it by clicking on OK (adapt yourtableprefix accordingly):
CREATE TABLE yourtableprefix_cv_ratings_votes (
    -- Category of item being rated
    vot_category VARBINARY(255) NOT NULL default '',
    -- Title of item being rated
    vot_title VARBINARY(255) NOT NULL default '',
    -- User who made the rating, 0 for anons (however it shoudn't be allowed)
    vot_user INTEGER NOT NULL default 0,
    -- Value of rating
    vot_rating INTEGER NOT NULL default 0,
    -- 
    INDEX vot_category_title ( vot_category, vot_title ),
    INDEX vot_category_title_user ( vot_category, vot_title, vot_user ),
    INDEX vot_category_title_rating ( vot_category, vot_title, vot_rating )
);

Works ;)

78.52.99.77 18:15, 12 October 2009 (UTC)Reply


Is it possible to call CommunityVoice-MediaWiki-Extension-Function from MonoBook.php?[edit]

Asked this Question in mwusers-Forum:

Answers taken here or there.

85.177.88.207 15:52, 13 October 2009 (UTC)Reply

Can't do multiple ratings on one page[edit]

They all clump up where the first rating is defined. I'm assuming this bug has to do with an html element referenced by id and not by class or something. Anyway, this officially killed my ability to use this extension. Also another thing is that the transparent png's are no good for ie6.

Just my 2 cents.

--80.179.206.193 15:23, 9 December 2009 (UTC)Reply

You can have multiple ratings per page but you would need to rename the extension and create a new extension so you have two extensions on your site that are the same extension with different names and different databases. My site Trail WIKI uses this extension for user ratings and trail difficulty ratings on all the pages on the site. We made a copy of the extension and changed all references that call CommunityVoice and changed them to DifficultyRating and created a second database with a different name. You can see it in action at http://www.trailwiki.us/wiki/Cady_Ridge

special:ratings parser hook not being set, no errors[edit]

I've installed:

  • ClientSide (Version 0.1.1) (r60437)
  • CommunityVoice (Version 0.1.0) (r60437)

from calling SVN checkout. Both of them show being installed. However, it is not registering the ratings:scale tag (it's not showing up on the Version page, like it does on usability.wikimedia.org, or parsing them when using). No httpd/log'd errors. Any suggestions? JonathanWilliford 03:23, 28 December 2009 (UTC)Reply

Database: One voting, one entry?[edit]

Hi, i just tried to make two votes on my wiki and found that there's two entries. If my wiki, for example, has only 1000 pages, but there's 100,000 ratings, it means that i'm going to have 100,000 entries only for so small number of pages. Is it possible to make a change on it in the future?

vot_category vot_title vot_user vot_rating CATEGORY TITLE 1 4 CATEGORY TITLE 2 5

Allow anonymous users to vote[edit]

hi, i'm wondering if it's possible to allow unregistered users to vote? Thanks! --Dullmau 21:34, 9 June 2010 (UTC)Reply

i would like to know this as well. --62.178.208.236 08:04, 6 September 2010 (UTC)Reply

I would love to know this as well? Anyone? --Fox15rider 03:01, 7 December 2011 (UTC)Reply

In the absence of any other answers - I have tweaked code in Ratings.php (Community Voice/Modules/...) in order to get this result on my wiki. Hope it helps. Uzgen 14:32, 7 December 2011 (UTC)

Please comment (add "//") the relevant lines in Ratings.php as per below:
line 105 (old): $wgUser->isLoggedIn() &&
line 105 (new): //$wgUser->isLoggedIn() &&

line 214 (old): !$userVoted &&
line 214 (new): !$userVoted //&&

line 216 (old): $wgUser->isLoggedIn()
line 216 (new): //$wgUser->isLoggedIn()
thank you for the response but that does not seem to work. I get the following error.
Parse error: syntax error, unexpected ')' in /../../../extensions/CommunityVoice/Modules/Ratings.php on line 217
I think their may be a couple other places needed to be commented out. Did you recently do this or are you just remembering back to when you did. Maybe you could upload your ratings.php file. --Fox15rider 17:28, 7 December 2011 (UTC)Reply

Ok I figured it out.. Uzgen you where correct.. I missed the Line edit on 214. I commented out the hole line instead of just the &&.. Thanks Uzgen! --Fox15rider 17:35, 7 December 2011 (UTC)Reply

Glad to be of help... Uzgen 23:57, 7 December 2011 (UTC)

Nothing shows up after I've installed CommunityVoice - Help?[edit]

I've installed on my wiki on this page: http://www.theoxfordunderground.com/index.php/Test

The page currently simply consists of a stub sentence and a ratings bar. No rating bar shows up for me. I've gone through and made sure everything is installed correctly and the table exists properly etc. I've tried all sorts of different categories (existing) and names of pages (existing). I've tried non-existent categories and phrases. --Shanarosenberg 23:18, 12 June 2010 (UTC)Reply

OK I solved this myself -- I put the require in LocalSettings.php at the end instead of at the beginning of the file. Hope this helps anyone else with the same trouble. --Shanarosenberg 22:39, 14 June 2010 (UTC)Reply

Note, that's true with most extensions. Bawolff 06:12, 20 November 2011 (UTC)Reply

quite similar Problem: Installed it on a mw-1.17: I see rating-bar as anonymus user (without possibility to vote of course), but logged in, I see nothing. Any Idea for help ? --78.41.144.41 10:30, 28 September 2011 (UTC)Reply

This is fixed now. Re-download the extension. (If using extension distributor chose the trunk version). Bawolff 06:12, 20 November 2011 (UTC)Reply
I have the same problem of being able to see the ratings-bar when logged out, but not when logged in. I see that there's a javascript error of Uncaught TypeError: Cannot call method 'appendChild' of null, which at least from what I read seems to occur due to the javascript running before the page is loaded. The problematic function call is looking for a div tag which I am able to locate in the rendered HTML. I'm using the versions of CommunityVoice and ClientSide straight from svn, and am running MW 1.16.5 with PHP 5.1.6 (on a server where I can't upgrade to a later version of PHP). However, I've actually been able to get it to work with MW 1.18alpha and PHP 5.3.2 on a different wiki. --Mr3641 (talk) 14:08, 10 May 2012 (UTC)Reply

Rating Start in Sidebar?[edit]

I want to use set Rating-Stars in left Sidebar. The goal is to have these stars on every page without have to change every page. So I modified Mediawiki:Sidebar and added the fallowing code. But no Rating Stars were visible.

*Rating
{{#tag:ratings:scale||category="{{NAMESPACE}}"|title="{{PAGENAME}}"}}
Probably not going to work... Bawolff 06:12, 20 November 2011 (UTC)Reply

Missing class: CsHtml[edit]

I am running CV 'out of the box', and I get the Apache error

Class 'CsHtml' not found in [installdir]/extensions/CommunityVoice/Modules/Ratings.php on line 176 

I am using

MediaWiki 1.15.3
ClientSide 0.1.0
CommunityVoice 0.1.0

Thanks

Install ClientSide extension. Bawolff 06:12, 20 November 2011 (UTC)Reply

Auto Add to Category[edit]

Is it possible to automatically add articles to categories based on how many stars they have? Say have a all articles with 0-1 star added to a category called "1 star".. All articles with 2 stars added to a category called "2 stars". And so on? --Fox15rider 16:07, 8 December 2011 (UTC)Reply

Move page but CommunityVoice does not follow[edit]

When I move a page to a new page name CommunityVoice does not follow. If the page previously had votes I have to go into the database and change the database entry to the new name. Is there a way to do this automatically? --~ TrailWIKI.us 20:00, 12 January 2012 (UTC)Reply

Conflicts with Cite extension[edit]

Whenever I use Communityvoice, it appears that the list of references earlier on the page is reset. For example, I use the ref-tag to create a few footnotes, and a references tag at the end of the page to display them. However if I use the rating code somewhere in between, the references tag does not display anything. If I have note 1, note 2, the rating widget, note 3 and note 4, then references will display only note 3 and 4 labeled as 1 and 2. Somehow Communityvoice seems to empty or reset the list when it is called. Have checked the code but can't find any obvious interference. --admin @ Naturopedia.se

Compatibility with MediaWiki 1.29 and Higher[edit]

I currently have MediaWiki 1.29.1. I've added CommunityVoice REL1_29 2017-06-14T01:03:59, 92deee1. The CommunityVoice.js is still leveraging deprecated JavaScript methods such as addHandler. What's the game plan? Release notes from MediaWiki 1.29

  • Removed wikibits global methods deprecated since MediaWiki 1.17 (T122755):