mirror of
https://bitbucket.org/vertlach/iusethis.git
synced 2024-05-05 10:38:29 +03:00
Forked, renamed, butchered and applied.
This commit is contained in:
parent
bfd067c9fd
commit
0439e5b3fe
102
ApiIUT.php
Normal file
102
ApiIUT.php
Normal file
|
@ -0,0 +1,102 @@
|
|||
<?php
|
||||
/**
|
||||
* IUseThis API module
|
||||
*/
|
||||
class ApiIUT extends ApiBase {
|
||||
|
||||
/**
|
||||
* @var vote Instance of the IUT class, set in execute() below
|
||||
*/
|
||||
private $vote;
|
||||
|
||||
/**
|
||||
* Main entry point.
|
||||
*/
|
||||
public function execute() {
|
||||
$user = $this->getUser();
|
||||
|
||||
// Get the request parameters
|
||||
$params = $this->extractRequestParams();
|
||||
|
||||
$action = $params['what'];
|
||||
|
||||
// If the "what" param isn't present, we don't know what to do!
|
||||
if ( !$action || $action === null ) {
|
||||
$this->dieUsageMsg( 'missingparam' );
|
||||
}
|
||||
|
||||
// Need to have sufficient user rights to proceed...
|
||||
if ( !$user->isAllowed( 'iusethis' ) ) {
|
||||
$this->dieUsageMsg( 'badaccess-group0' );
|
||||
}
|
||||
|
||||
// Ensure that the page ID is present and that it really is numeric
|
||||
$pageId = $params['pageId'];
|
||||
|
||||
if ( !$pageId || $pageId === null || !is_numeric( $pageId ) ) {
|
||||
$this->dieUsageMsg( array( 'missingparam', 'pageId' ) );
|
||||
}
|
||||
|
||||
$this->vote = new Vote( $pageId );
|
||||
|
||||
switch ( $action ) {
|
||||
case 'delete':
|
||||
$this->vote->delete();
|
||||
$output = $this->vote->count( 1 );
|
||||
break;
|
||||
case 'vote':
|
||||
case 'iusethis':
|
||||
default:
|
||||
$this->vote->insert();
|
||||
$output = $this->vote->count( 1 );
|
||||
break;
|
||||
}
|
||||
|
||||
// Top level
|
||||
$this->getResult()->addValue( null, $this->getModuleName(),
|
||||
array( 'result' => $output )
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function needsToken() {
|
||||
return 'csrf';
|
||||
}
|
||||
|
||||
public function isWriteMode() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getAllowedParams() {
|
||||
return array(
|
||||
'what' => array(
|
||||
ApiBase::PARAM_TYPE => 'string',
|
||||
ApiBase::PARAM_REQUIRED => true
|
||||
),
|
||||
'pageId' => array(
|
||||
ApiBase::PARAM_TYPE => 'integer',
|
||||
ApiBase::PARAM_REQUIRED => true
|
||||
),
|
||||
'type' => array(
|
||||
ApiBase::PARAM_TYPE => 'string',
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ApiBase::getExamplesMessages()
|
||||
*/
|
||||
protected function getExamplesMessages() {
|
||||
return array(
|
||||
'action=voteny&what=vote&pageId=666' => 'apihelp-voteny-example-1',
|
||||
'action=voteny&what=delete&pageId=666' => 'apihelp-voteny-example-2',
|
||||
'action=voteny&what=vote&type=stars&pageId=666' => 'apihelp-voteny-example-3',
|
||||
'action=voteny&what=delete&type=stars&pageId=666' => 'apihelp-voteny-example-4',
|
||||
'action=voteny&what=multi&type=stars&pageId=666' => 'apihelp-voteny-example-5'
|
||||
);
|
||||
}
|
||||
}
|
143
ApiVoteNY.php
143
ApiVoteNY.php
|
@ -1,143 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* VoteNY API module
|
||||
*
|
||||
* @file
|
||||
* @ingroup API
|
||||
* @date 21 November 2015
|
||||
* @see https://www.mediawiki.org/wiki/API:Extensions#ApiSampleApiExtension.php
|
||||
*/
|
||||
class ApiVoteNY extends ApiBase {
|
||||
|
||||
/**
|
||||
* @var Vote|VoteStars Instance of the Vote or VoteStars class, set in execute() below
|
||||
*/
|
||||
private $vote;
|
||||
|
||||
/**
|
||||
* Main entry point.
|
||||
*/
|
||||
public function execute() {
|
||||
$user = $this->getUser();
|
||||
|
||||
// Get the request parameters
|
||||
$params = $this->extractRequestParams();
|
||||
|
||||
$action = $params['what'];
|
||||
|
||||
// If the "what" param isn't present, we don't know what to do!
|
||||
if ( !$action || $action === null ) {
|
||||
$this->dieUsageMsg( 'missingparam' );
|
||||
}
|
||||
|
||||
// Need to have sufficient user rights to proceed...
|
||||
if ( !$user->isAllowed( 'voteny' ) ) {
|
||||
$this->dieUsageMsg( 'badaccess-group0' );
|
||||
}
|
||||
|
||||
// Ensure that the page ID is present and that it really is numeric
|
||||
$pageId = $params['pageId'];
|
||||
|
||||
if ( !$pageId || $pageId === null || !is_numeric( $pageId ) ) {
|
||||
$this->dieUsageMsg( array( 'missingparam', 'pageId' ) );
|
||||
}
|
||||
|
||||
// Vote value is needed for actual vote actions, i.e. everything but "delete"
|
||||
$voteValue = $params['voteValue'];
|
||||
|
||||
if ( !( $voteValue || $voteValue === null ) && $action !== 'delete' ) {
|
||||
$this->dieUsageMsg( array( 'missingparam', 'voteValue' ) );
|
||||
}
|
||||
|
||||
// Set the private class member variable and do something...
|
||||
if ( isset( $params['type'] ) && $params['type'] && $params['type'] == 'stars' ) {
|
||||
$this->vote = new VoteStars( $pageId );
|
||||
|
||||
switch ( $action ) {
|
||||
case 'delete':
|
||||
$this->vote->delete();
|
||||
$output = $this->vote->display();
|
||||
break;
|
||||
case 'multi':
|
||||
if ( $this->vote->UserAlreadyVoted() ) {
|
||||
$this->vote->delete();
|
||||
}
|
||||
$this->vote->insert( $voteValue );
|
||||
$output = $this->vote->displayScore();
|
||||
break;
|
||||
case 'vote':
|
||||
default:
|
||||
if ( $this->vote->UserAlreadyVoted() ) {
|
||||
$this->vote->delete();
|
||||
}
|
||||
$this->vote->insert( $voteValue );
|
||||
$output = $this->vote->display( $voteValue );
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
$this->vote = new Vote( $pageId );
|
||||
|
||||
switch ( $action ) {
|
||||
case 'delete':
|
||||
$this->vote->delete();
|
||||
$output = $this->vote->count( 1 );
|
||||
break;
|
||||
case 'vote':
|
||||
default:
|
||||
$this->vote->insert( $voteValue );
|
||||
$output = $this->vote->count( 1 );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Top level
|
||||
$this->getResult()->addValue( null, $this->getModuleName(),
|
||||
array( 'result' => $output )
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function needsToken() {
|
||||
return 'csrf';
|
||||
}
|
||||
|
||||
public function isWriteMode() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getAllowedParams() {
|
||||
return array(
|
||||
'what' => array(
|
||||
ApiBase::PARAM_TYPE => 'string',
|
||||
ApiBase::PARAM_REQUIRED => true
|
||||
),
|
||||
'pageId' => array(
|
||||
ApiBase::PARAM_TYPE => 'integer',
|
||||
ApiBase::PARAM_REQUIRED => true
|
||||
),
|
||||
'voteValue' => array(
|
||||
ApiBase::PARAM_TYPE => 'integer',
|
||||
),
|
||||
'type' => array(
|
||||
ApiBase::PARAM_TYPE => 'string',
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ApiBase::getExamplesMessages()
|
||||
*/
|
||||
protected function getExamplesMessages() {
|
||||
return array(
|
||||
'action=voteny&what=vote&pageId=666' => 'apihelp-voteny-example-1',
|
||||
'action=voteny&what=delete&pageId=666' => 'apihelp-voteny-example-2',
|
||||
'action=voteny&what=vote&type=stars&pageId=666&voteValue=3' => 'apihelp-voteny-example-3',
|
||||
'action=voteny&what=delete&type=stars&pageId=666' => 'apihelp-voteny-example-4',
|
||||
'action=voteny&what=multi&type=stars&pageId=666&voteValue=4' => 'apihelp-voteny-example-5'
|
||||
);
|
||||
}
|
||||
}
|
101
IUT.js
Normal file
101
IUT.js
Normal file
|
@ -0,0 +1,101 @@
|
|||
/**
|
||||
* JavaScript functions for Vote extension.
|
||||
*
|
||||
* TODO: Should refactor this into a jQuery widget.
|
||||
* The widget should get a PageID in its constructor so it can work on any page
|
||||
* for any page and with multiple instances per page.
|
||||
*
|
||||
* @constructor
|
||||
*
|
||||
* @author Jack Phoenix <jack@countervandalism.net>
|
||||
* @author Daniel A. R. Werner < daniel.a.r.werner@gmail.com >
|
||||
*/
|
||||
var IUT = function IUT() {
|
||||
this.clearRatingTimer = null;
|
||||
this.voted_new = [];
|
||||
this.id = 0;
|
||||
this.last_id = 0;
|
||||
this.imagePath = mw.config.get( 'wgExtensionAssetsPath' ) + '/VoteNY/images/';
|
||||
|
||||
/**
|
||||
* Called when voting through the green square voting box
|
||||
*
|
||||
* @param TheVote
|
||||
* @param PageID Integer: internal ID number of the current article
|
||||
*/
|
||||
this.clickVote = function( TheVote, PageID ) {
|
||||
( new mw.Api() ).postWithToken( 'edit', {
|
||||
action: 'iusethis',
|
||||
format: 'json',
|
||||
what: 'vote',
|
||||
pageId: PageID,
|
||||
voteValue: TheVote
|
||||
} ).done( function( data ) {
|
||||
$( '#PollVotes' ).html( data.iusethis.result );
|
||||
$( '#Answer' ).html(
|
||||
'<a href="javascript:void(0);" class="vote-unvote-link">' +
|
||||
mediaWiki.msg( 'iusethis-unvote-link' ) + '</a>'
|
||||
);
|
||||
} );
|
||||
};
|
||||
|
||||
/**
|
||||
* Called when removing your vote through the green square voting box
|
||||
*
|
||||
* @param PageID Integer: internal ID number of the current article
|
||||
*/
|
||||
this.unVote = function( PageID ) {
|
||||
( new mw.Api() ).postWithToken( 'edit', {
|
||||
action: 'voteny',
|
||||
format: 'json',
|
||||
what: 'delete',
|
||||
pageId: PageID
|
||||
} ).done( function( data ) {
|
||||
$( '#PollVotes' ).html( data.iusethis.result );
|
||||
$( '#Answer' ).html(
|
||||
'<a href="javascript:void(0);" class="vote-vote-link">' +
|
||||
mediaWiki.msg( 'iusethis-link' ) + '</a>'
|
||||
);
|
||||
} );
|
||||
};
|
||||
|
||||
this.startClearRating = function( id, rating, voted ) {
|
||||
var voteNY = this;
|
||||
this.clearRatingTimer = setTimeout( function() {
|
||||
voteNY.clearRating( id, 0, rating, voted );
|
||||
}, 200 );
|
||||
};
|
||||
|
||||
this.clearRating = function( id, num, prev_rating, voted ) {
|
||||
if ( this.voted_new[id] ) {
|
||||
voted = this.voted_new[id];
|
||||
}
|
||||
};
|
||||
|
||||
this.updateRating = function( id, num, prev_rating ) {
|
||||
if ( this.clearRatingTimer && this.last_id == id ) {
|
||||
clearTimeout( this.clearRatingTimer );
|
||||
}
|
||||
this.clearRating( id, num, prev_rating );
|
||||
for ( var x = 1; x <= num; x++ ) {
|
||||
$( '#rating_' + id + '_' + x ).attr( 'src', this.imagePath + 'star_voted.gif' );
|
||||
}
|
||||
this.last_id = id;
|
||||
};
|
||||
};
|
||||
|
||||
// TODO: Make event handlers part of a widget as described in the VoteNY's TODO and reduce this
|
||||
// code to instantiating such a widget for the current wiki page if required.
|
||||
$( function() {
|
||||
var vote = new IUT();
|
||||
|
||||
// Green voting box's link
|
||||
$( '.vote-action' ).on( 'click', '> a', function( event ) {
|
||||
if ( $( this ).hasClass( 'vote-unvote-link' ) ) {
|
||||
vote.unVote( mw.config.get( 'wgArticleId' ) );
|
||||
} else {
|
||||
vote.clickVote( 1, mw.config.get( 'wgArticleId' ) );
|
||||
}
|
||||
} );
|
||||
|
||||
} );
|
194
IUTClass.php
Normal file
194
IUTClass.php
Normal file
|
@ -0,0 +1,194 @@
|
|||
<?php
|
||||
/**
|
||||
* Vote class - class for handling vote-related functions (counting
|
||||
* the average score of a given page, inserting/updating/removing a vote etc.)
|
||||
*
|
||||
* @file
|
||||
* @ingroup Extensions
|
||||
*/
|
||||
class IUT {
|
||||
public $PageID = 0;
|
||||
public $Userid = 0;
|
||||
public $Username = null;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param int $pageID Article ID number
|
||||
*/
|
||||
public function __construct( $pageID ) {
|
||||
global $wgUser;
|
||||
|
||||
$this->PageID = $pageID;
|
||||
$this->Username = $wgUser->getName();
|
||||
$this->Userid = $wgUser->getID();
|
||||
}
|
||||
|
||||
/**
|
||||
* Counts all votes, fetching the data from memcached if available
|
||||
* or from the database if memcached isn't available
|
||||
*
|
||||
* @return int Amount of votes
|
||||
*/
|
||||
function count() {
|
||||
global $wgMemc;
|
||||
|
||||
$key = wfMemcKey( 'vote', 'count', $this->PageID );
|
||||
$data = $wgMemc->get( $key );
|
||||
|
||||
// Try cache
|
||||
if ( $data ) {
|
||||
wfDebug( "Loading vote count for page {$this->PageID} from cache\n" );
|
||||
$vote_count = $data;
|
||||
} else {
|
||||
$dbr = wfGetDB( DB_SLAVE );
|
||||
$vote_count = 0;
|
||||
$res = $dbr->select(
|
||||
'IUseThis',
|
||||
'COUNT(*) AS votecount',
|
||||
array( 'vote_page_id' => $this->PageID ),
|
||||
__METHOD__
|
||||
);
|
||||
$row = $dbr->fetchObject( $res );
|
||||
if ( $row ) {
|
||||
$vote_count = $row->votecount;
|
||||
}
|
||||
$wgMemc->set( $key, $vote_count );
|
||||
}
|
||||
|
||||
return $vote_count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear caches - memcached, parser cache and Squid cache
|
||||
*/
|
||||
function clearCache() {
|
||||
global $wgUser, $wgMemc;
|
||||
|
||||
// Kill internal cache
|
||||
$wgMemc->delete( wfMemcKey( 'iusethis', 'count', $this->PageID ) );
|
||||
$wgMemc->delete( wfMemcKey( 'iusethis', 'avg', $this->PageID ) );
|
||||
|
||||
// Purge squid
|
||||
$pageTitle = Title::newFromID( $this->PageID );
|
||||
if ( is_object( $pageTitle ) ) {
|
||||
$pageTitle->invalidateCache();
|
||||
$pageTitle->purgeSquid();
|
||||
|
||||
// Kill parser cache
|
||||
$article = new Article( $pageTitle, /* oldid */0 );
|
||||
$parserCache = ParserCache::singleton();
|
||||
$parserKey = $parserCache->getKey( $article, $wgUser );
|
||||
$wgMemc->delete( $parserKey );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the user's vote from the database, purges normal caches.
|
||||
*/
|
||||
function delete() {
|
||||
$dbw = wfGetDB( DB_MASTER );
|
||||
$dbw->delete(
|
||||
'IUseThis',
|
||||
array(
|
||||
'vote_page_id' => $this->PageID,
|
||||
'username' => $this->Username
|
||||
),
|
||||
__METHOD__
|
||||
);
|
||||
|
||||
$this->clearCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* Inserts a new vote into the IUseThis database table
|
||||
*/
|
||||
function insert() {
|
||||
global $wgRequest;
|
||||
$dbw = wfGetDB( DB_MASTER );
|
||||
wfSuppressWarnings(); // E_STRICT whining
|
||||
$voteDate = date( 'Y-m-d H:i:s' );
|
||||
wfRestoreWarnings();
|
||||
if ( $this->UserAlreadyVoted() == false ) {
|
||||
$dbw->insert(
|
||||
'IUseThis',
|
||||
array(
|
||||
'username' => $this->Username,
|
||||
'vote_user_id' => $this->Userid,
|
||||
'vote_page_id' => $this->PageID,
|
||||
'vote_date' => $voteDate,
|
||||
'vote_ip' => $wgRequest->getIP(),
|
||||
),
|
||||
__METHOD__
|
||||
);
|
||||
|
||||
$this->clearCache();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a user has already voted
|
||||
*
|
||||
* @return bool|int False if s/he hasn't, otherwise returns the
|
||||
* value of 'vote_value' column from Vote DB table
|
||||
*/
|
||||
function UserAlreadyVoted() {
|
||||
$dbr = wfGetDB( DB_SLAVE );
|
||||
$s = $dbr->selectRow(
|
||||
'IUseThis',
|
||||
array(
|
||||
'vote_page_id' => $this->PageID,
|
||||
'username' => $this->Username
|
||||
),
|
||||
__METHOD__
|
||||
);
|
||||
if ( $s === false ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the green voting box
|
||||
*
|
||||
* @return string HTML output
|
||||
*/
|
||||
function display() {
|
||||
global $wgUser;
|
||||
|
||||
$voted = $this->UserAlreadyVoted();
|
||||
|
||||
$make_vote_box_clickable = '';
|
||||
if ( $voted == false ) {
|
||||
$make_vote_box_clickable = ' vote-clickable';
|
||||
}
|
||||
|
||||
$output = "<div class=\"vote-box{$make_vote_box_clickable}\" id=\"votebox\">";
|
||||
$output .= '<span id="PollVotes" class="vote-number">' . $this->count() . ' people use this joke </span>';
|
||||
$output .= '<span id="Answer" class="vote-action">';
|
||||
|
||||
if ( !$wgUser->isAllowed( 'iusethis' ) ) {
|
||||
// @todo FIXME: this is horrible. If we don't have enough
|
||||
// permissions to vote, we should tell the end-user /that/,
|
||||
// not require them to log in!
|
||||
$login = SpecialPage::getTitleFor( 'Userlogin' );
|
||||
$output .= '<a class="votebutton" href="' .
|
||||
htmlspecialchars( $login->getFullURL() ) . '" rel="nofollow">' .
|
||||
"I use this" . '</a>';
|
||||
} else {
|
||||
if ( !wfReadOnly() ) {
|
||||
if ( $voted == false ) {
|
||||
$output .= '<a href="javascript:void(0);" class="vote-vote-link">' .
|
||||
"I use this" . '</a>';
|
||||
} else {
|
||||
$output .= '<a href="javascript:void(0);" class="vote-unvote-link">' .
|
||||
"I don't use this" . '</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
$output .= '</span>';
|
||||
$output .= '</div>';
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
117
IUTHooks.php
Normal file
117
IUTHooks.php
Normal file
|
@ -0,0 +1,117 @@
|
|||
<?php
|
||||
/**
|
||||
* All hooked functions used by IUseThis extension.
|
||||
*
|
||||
* @file
|
||||
* @ingroup Extensions
|
||||
*/
|
||||
class IUTHooks {
|
||||
|
||||
/**
|
||||
* Set up the <vote> parser hook.
|
||||
*
|
||||
* @param Parser $parser
|
||||
* @return bool
|
||||
*/
|
||||
public static function registerParserHook( &$parser ) {
|
||||
$parser->setHook( 'iusethis', array( 'IUTHooks', 'renderVote' ) );
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback function for registerParserHook.
|
||||
*
|
||||
* @param string $input User-supplied input, unused
|
||||
* @param array $args User-supplied arguments
|
||||
* @param Parser $parser Instance of Parser, unused
|
||||
* @return string HTML
|
||||
*/
|
||||
public static function renderVote( $input, $args, $parser ) {
|
||||
global $wgOut, $wgUser;
|
||||
|
||||
// Disable parser cache (sadly we have to do this, because the caching is
|
||||
// messing stuff up; we want to show an up-to-date rating instead of old
|
||||
// or totally wrong rating, i.e. another page's rating...)
|
||||
$parser->disableCache();
|
||||
|
||||
// Add CSS & JS
|
||||
// In order for us to do this *here* instead of having to do this in
|
||||
// registerParserHook(), we must've disabled parser cache
|
||||
$parser->getOutput()->addModuleStyles( 'ext.IUseThis.styles' );
|
||||
if ( $wgUser->isAllowed( 'iusethis' ) ) {
|
||||
$parser->getOutput()->addModules( 'ext.IUseThis.scripts' );
|
||||
}
|
||||
|
||||
$output = null;
|
||||
$title = $wgOut->getTitle();
|
||||
if ( $title ) {
|
||||
$articleID = $title->getArticleID();
|
||||
$vote = new Vote( $articleID );
|
||||
|
||||
$output = $vote->display();
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* For the Renameuser extension.
|
||||
*
|
||||
* @param RenameuserSQL $renameUserSQL
|
||||
* @return bool
|
||||
*/
|
||||
public static function onUserRename( $renameUserSQL ) {
|
||||
$renameUserSQL->tables['IUseThis'] = array( 'username', 'vote_user_id' );
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Main function to get the number of votes for a specific page
|
||||
*
|
||||
* @param Title $title Page to get votes for
|
||||
* @return int Number of votes for the given page
|
||||
*/
|
||||
public static function getNumberOfVotesPage( Title $title ) {
|
||||
global $wgMemc;
|
||||
|
||||
$id = $title->getArticleID();
|
||||
|
||||
$key = wfMemcKey( 'iusethis', 'magic-word-page', $id );
|
||||
$data = $wgMemc->get( $key );
|
||||
|
||||
if ( $data ) {
|
||||
return $data;
|
||||
} else {
|
||||
$dbr = wfGetDB( DB_SLAVE );
|
||||
|
||||
$voteCount = (int)$dbr->selectField(
|
||||
'IUseThis',
|
||||
'COUNT(*) AS count',
|
||||
array( 'vote_page_id' => $id ),
|
||||
__METHOD__
|
||||
);
|
||||
|
||||
$wgMemc->set( $key, $voteCount, 3600 );
|
||||
|
||||
return $voteCount;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the necessary database table when the user runs
|
||||
* maintenance/update.php.
|
||||
*
|
||||
* @param DatabaseUpdater $updater
|
||||
* @return bool
|
||||
*/
|
||||
public static function addTable( $updater ) {
|
||||
$dbt = $updater->getDB()->getType();
|
||||
$file = __DIR__ . "/iusethis.$dbt";
|
||||
if ( file_exists( $file ) ) {
|
||||
$updater->addExtensionUpdate( array( 'addTable', 'IUseThis', $file, true ) );
|
||||
} else {
|
||||
throw new MWException( "IUseThis does not support $dbt." );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,194 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* A special page to display the highest rated pages on the wiki.
|
||||
*
|
||||
* This special page supports filtering by category and namespace, so
|
||||
* {{Special:TopRatings/Adventure Games/0/10}} will show 10 ratings where the
|
||||
* pages are in the "Adventure Games" category and the pages are in the main
|
||||
* (0) namespace.
|
||||
*
|
||||
* @file
|
||||
* @ingroup Extensions
|
||||
* @date 11 December 2011
|
||||
* @license To the extent that it is possible, this code is in the public domain
|
||||
*/
|
||||
class SpecialTopRatings extends IncludableSpecialPage {
|
||||
|
||||
/**
|
||||
* Constructor -- set up the new special page
|
||||
*/
|
||||
public function __construct() {
|
||||
parent::__construct( 'TopRatings' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the special page
|
||||
*
|
||||
* @param mixed|null $par Parameter passed to the special page or null
|
||||
*/
|
||||
public function execute( $par ) {
|
||||
// Set the page title, robot policies, etc.
|
||||
$this->setHeaders();
|
||||
|
||||
$out = $this->getOutput();
|
||||
$user = $this->getUser();
|
||||
|
||||
$categoryName = $namespace = '';
|
||||
|
||||
// Parse the parameters passed to the special page
|
||||
// Make sure that the limit parameter passed to the special page is
|
||||
// an integer and that it's less than 100 (performance!)
|
||||
if ( isset( $par ) && is_numeric( $par ) && $par < 100 ) {
|
||||
$limit = intval( $par );
|
||||
} elseif ( isset( $par ) && !is_numeric( $par ) ) {
|
||||
// $par is a string...assume that we can explode() it
|
||||
$exploded = explode( '/', $par );
|
||||
$categoryName = $exploded[0];
|
||||
$namespace = ( isset( $exploded[1] ) ? intval( $exploded[1] ) : $namespace );
|
||||
$limit = ( isset( $exploded[2] ) ? intval( $exploded[2] ) : 50 );
|
||||
} else {
|
||||
$limit = 50;
|
||||
}
|
||||
|
||||
// Add CSS
|
||||
$out->addModuleStyles( 'ext.voteNY.styles' );
|
||||
/* scroll down some lines to see why I'm not including JS here anymore
|
||||
if ( $user->isAllowed( 'voteny' ) ) {
|
||||
$out->addModules( 'ext.voteNY.scripts' );
|
||||
}
|
||||
*/
|
||||
|
||||
$ratings = array();
|
||||
$output = '';
|
||||
|
||||
$dbr = wfGetDB( DB_SLAVE );
|
||||
$tables = $where = $joinConds = array();
|
||||
$whatToSelect = array( 'DISTINCT vote_page_id', 'SUM(vote_value) AS vote_value_sum' );
|
||||
|
||||
// By default we have no category and no namespace
|
||||
$tables = array( 'Vote' );
|
||||
$where = array( 'vote_page_id <> 0' );
|
||||
|
||||
// isset(), because 0 is a totally valid NS
|
||||
if ( !empty( $categoryName ) && isset( $namespace ) ) {
|
||||
$tables = array( 'Vote', 'page', 'categorylinks' );
|
||||
$where = array(
|
||||
'vote_page_id <> 0',
|
||||
'cl_to' => str_replace( ' ', '_', $categoryName ),
|
||||
'page_namespace' => $namespace
|
||||
);
|
||||
$joinConds = array(
|
||||
'categorylinks' => array( 'INNER JOIN', 'cl_from = page_id' ),
|
||||
'page' => array( 'INNER JOIN', 'page_id = vote_page_id' )
|
||||
);
|
||||
}
|
||||
|
||||
// Perform the SQL query with the given conditions; the basic idea is
|
||||
// that we get $limit (however, 100 or less) unique page IDs from the
|
||||
// Vote table. The GROUP BY is to make SUM(vote_value) give the SUM of
|
||||
// all vote_values for a page. If a category and a namespace have been
|
||||
// given, we also do an INNER JOIN with page and categorylinks table
|
||||
// to get the correct data.
|
||||
$res = $dbr->select(
|
||||
$tables,
|
||||
$whatToSelect,
|
||||
$where,
|
||||
__METHOD__,
|
||||
array( 'GROUP BY' => 'vote_page_id', 'LIMIT' => intval( $limit ) ),
|
||||
$joinConds
|
||||
);
|
||||
|
||||
foreach ( $res as $row ) {
|
||||
// Add the results to the $ratings array
|
||||
// For example: $ratings[1] = 11 = page with the page ID 1 has 11
|
||||
// votes
|
||||
$ratings[$row->vote_page_id] = (int)$row->vote_value_sum;
|
||||
}
|
||||
|
||||
// If we have some ratings, start building HTML output
|
||||
if ( !empty( $ratings ) ) {
|
||||
/* XXX dirrrrrrty hack! because when we include this page, the JS
|
||||
* is not included, but we want things to work still
|
||||
* Actually, this is way harder than what it looks like.
|
||||
* The JS uses wgArticleId but when directly viewing Special:TopRatings,
|
||||
* wgArticleId is zero, because special pages aren't articles.
|
||||
* As for including the special page, then wgArticleId would likely
|
||||
* point at the ID of the page that includes {{Special:TopRatings}},
|
||||
* which would be stupid and wrong.
|
||||
* Besides, shouldn't you check out the images/pages that you're gonna
|
||||
* vote for? Yeah, that's what I thought, too.
|
||||
if ( $this->including() && $user->isAllowed( 'voteny' ) ) {
|
||||
global $wgExtensionAssetsPath;
|
||||
$output .= '<script type="text/javascript" src="' .
|
||||
$wgExtensionAssetsPath . '/VoteNY/Vote.js"></script>';
|
||||
}
|
||||
*/
|
||||
|
||||
// yes, array_keys() is needed
|
||||
foreach ( array_keys( $ratings ) as $discardThis => $pageId ) {
|
||||
$titleObj = Title::newFromId( $pageId );
|
||||
if ( !( $titleObj instanceof Title ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$vote = new VoteStars( $pageId );
|
||||
$output .= '<div class="user-list-rating">' .
|
||||
Linker::link(
|
||||
$titleObj,
|
||||
$titleObj->getPrefixedText() // prefixed, so that the namespace shows!
|
||||
) . $this->msg( 'word-separator' )->escaped() . // i18n overkill? ya betcha...
|
||||
$this->msg( 'parentheses', $ratings[$pageId] )->escaped() .
|
||||
'</div>';
|
||||
|
||||
$id = mt_rand(); // AFAIK these IDs are and originally were totally random...
|
||||
$output .= "<div id=\"rating_stars_{$id}\">" .
|
||||
$vote->displayStars(
|
||||
$id,
|
||||
self::getAverageRatingForPage( $pageId ),
|
||||
false
|
||||
) . '</div>';
|
||||
$output .= "<div id=\"rating_{$id}\" class=\"rating-total\">" .
|
||||
$vote->displayScore() .
|
||||
'</div>';
|
||||
}
|
||||
} else {
|
||||
// Nothing? Well, display an informative error message rather than
|
||||
// a blank page or somesuch.
|
||||
$output .= $this->msg( 'topratings-no-pages' )->escaped();
|
||||
}
|
||||
|
||||
// Output everything!
|
||||
$out->addHTML( $output );
|
||||
}
|
||||
|
||||
/**
|
||||
* Static version of Vote::getAverageVote().
|
||||
*
|
||||
* @param $pageId Integer: ID of the page for which we want to get the avg.
|
||||
* rating
|
||||
* @return Integer: average vote for the given page (ID)
|
||||
*/
|
||||
public static function getAverageRatingForPage( $pageId ) {
|
||||
global $wgMemc;
|
||||
|
||||
$key = wfMemcKey( 'vote', 'avg', $pageId );
|
||||
$data = $wgMemc->get( $key );
|
||||
$voteAvg = 0;
|
||||
|
||||
if ( $data ) {
|
||||
wfDebug( "Loading vote avg for page {$pageId} from cache (TopRatings)\n" );
|
||||
$voteAvg = $data;
|
||||
} else {
|
||||
$dbr = wfGetDB( DB_SLAVE );
|
||||
$voteAvg = (int)$dbr->selectField(
|
||||
'Vote',
|
||||
'AVG(vote_value) AS VoteAvg',
|
||||
array( 'vote_page_id' => $pageId ),
|
||||
__METHOD__
|
||||
);
|
||||
$wgMemc->set( $key, $voteAvg );
|
||||
}
|
||||
|
||||
return $voteAvg;
|
||||
}
|
||||
}
|
63
Vote.css
63
Vote.css
|
@ -1,63 +0,0 @@
|
|||
/* CSS for Vote extension */
|
||||
.vote-box {
|
||||
background-color: #68BD46;
|
||||
height: 30px;
|
||||
padding: 13px 0px 0px;
|
||||
text-align: center;
|
||||
width: 43px;
|
||||
}
|
||||
|
||||
.vote-number {
|
||||
color: #FFF;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.vote-action {
|
||||
text-align: center;
|
||||
width: 43px;
|
||||
}
|
||||
|
||||
.vote-action a {
|
||||
font-weight: bold;
|
||||
font-size: 11px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.rating-score {
|
||||
background-color: #68BD46;
|
||||
color: #FFF;
|
||||
float: left;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
padding: 1px 8px 0px;
|
||||
margin: 1px 7px 0px 0px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.ratings-top {
|
||||
position: absolute;
|
||||
top: 37px !important;
|
||||
right: 0px !important;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.rating-section img {
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
|
||||
.rating-voted {
|
||||
color: #666666;
|
||||
line-height: 10px;
|
||||
font-size: 9px;
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
}
|
||||
|
||||
/* Styling for the (n votes) after rating box/stars */
|
||||
.rating-total {
|
||||
color: #666;
|
||||
font-weight: bold;
|
||||
font-size: 11px;
|
||||
margin: 3px 0px 0px 0px;
|
||||
}
|
200
Vote.js
200
Vote.js
|
@ -1,200 +0,0 @@
|
|||
/**
|
||||
* JavaScript functions for Vote extension.
|
||||
*
|
||||
* TODO: Should refactor this into a jQuery widget.
|
||||
* The widget should get a PageID in its constructor so it can work on any page
|
||||
* for any page and with multiple instances per page.
|
||||
*
|
||||
* @constructor
|
||||
*
|
||||
* @author Jack Phoenix <jack@countervandalism.net>
|
||||
* @author Daniel A. R. Werner < daniel.a.r.werner@gmail.com >
|
||||
*/
|
||||
var VoteNY = function VoteNY() {
|
||||
this.MaxRating = 5;
|
||||
this.clearRatingTimer = null;
|
||||
this.voted_new = [];
|
||||
this.id = 0;
|
||||
this.last_id = 0;
|
||||
this.imagePath = mw.config.get( 'wgExtensionAssetsPath' ) + '/VoteNY/images/';
|
||||
|
||||
/**
|
||||
* Called when voting through the green square voting box
|
||||
*
|
||||
* @param TheVote
|
||||
* @param PageID Integer: internal ID number of the current article
|
||||
*/
|
||||
this.clickVote = function( TheVote, PageID ) {
|
||||
( new mw.Api() ).postWithToken( 'edit', {
|
||||
action: 'voteny',
|
||||
format: 'json',
|
||||
what: 'vote',
|
||||
pageId: PageID,
|
||||
voteValue: TheVote
|
||||
} ).done( function( data ) {
|
||||
$( '#PollVotes' ).html( data.voteny.result );
|
||||
$( '#Answer' ).html(
|
||||
'<a href="javascript:void(0);" class="vote-unvote-link">' +
|
||||
mediaWiki.msg( 'voteny-unvote-link' ) + '</a>'
|
||||
);
|
||||
} );
|
||||
};
|
||||
|
||||
/**
|
||||
* Called when removing your vote through the green square voting box
|
||||
*
|
||||
* @param PageID Integer: internal ID number of the current article
|
||||
*/
|
||||
this.unVote = function( PageID ) {
|
||||
( new mw.Api() ).postWithToken( 'edit', {
|
||||
action: 'voteny',
|
||||
format: 'json',
|
||||
what: 'delete',
|
||||
pageId: PageID
|
||||
} ).done( function( data ) {
|
||||
$( '#PollVotes' ).html( data.voteny.result );
|
||||
$( '#Answer' ).html(
|
||||
'<a href="javascript:void(0);" class="vote-vote-link">' +
|
||||
mediaWiki.msg( 'voteny-link' ) + '</a>'
|
||||
);
|
||||
} );
|
||||
};
|
||||
|
||||
/**
|
||||
* Called when adding a vote after a user has clicked the yellow voting stars
|
||||
*
|
||||
* @param PageID Integer: internal ID number of the current article
|
||||
* @param id Integer: ID of the current rating star
|
||||
* @param action Integer: controls which AJAX function will be called
|
||||
*/
|
||||
this.clickVoteStars = function( TheVote, PageID, id, action ) {
|
||||
this.voted_new[id] = TheVote;
|
||||
var actionName;
|
||||
if ( action == 3 ) {
|
||||
actionName = 'stars'; // all other values but 'multi' are ignored anyway
|
||||
}
|
||||
if ( action == 5 ) {
|
||||
actionName = 'multi';
|
||||
}
|
||||
|
||||
( new mw.Api() ).postWithToken( 'edit', {
|
||||
action: 'voteny',
|
||||
type: 'stars',
|
||||
what: actionName,
|
||||
voteValue: TheVote,
|
||||
pageId: PageID
|
||||
} ).done( function( data ) {
|
||||
$( '#rating_' + id ).html( data.voteny.result );
|
||||
} );
|
||||
};
|
||||
|
||||
/**
|
||||
* Called when removing your vote through the yellow voting stars
|
||||
*
|
||||
* @param PageID Integer: internal ID number of the current article
|
||||
* @param id Integer: ID of the current rating star
|
||||
*/
|
||||
this.unVoteStars = function( PageID, id ) {
|
||||
( new mw.Api() ).postWithToken( 'edit', {
|
||||
action: 'voteny',
|
||||
what: 'delete',
|
||||
type: 'stars',
|
||||
pageId: PageID
|
||||
} ).done( function( data ) {
|
||||
$( '#rating_' + id ).html( data.voteny.result );
|
||||
} );
|
||||
};
|
||||
|
||||
this.startClearRating = function( id, rating, voted ) {
|
||||
var voteNY = this;
|
||||
this.clearRatingTimer = setTimeout( function() {
|
||||
voteNY.clearRating( id, 0, rating, voted );
|
||||
}, 200 );
|
||||
};
|
||||
|
||||
this.clearRating = function( id, num, prev_rating, voted ) {
|
||||
if ( this.voted_new[id] ) {
|
||||
voted = this.voted_new[id];
|
||||
}
|
||||
|
||||
for ( var x = 1; x <= this.MaxRating; x++ ) {
|
||||
var star_on, old_rating;
|
||||
if ( voted ) {
|
||||
star_on = 'voted';
|
||||
old_rating = voted;
|
||||
} else {
|
||||
star_on = 'on';
|
||||
old_rating = prev_rating;
|
||||
}
|
||||
var ratingElement = $( '#rating_' + id + '_' + x );
|
||||
if ( !num && old_rating >= x ) {
|
||||
ratingElement.attr( 'src', this.imagePath + 'star_' + star_on + '.gif' );
|
||||
} else {
|
||||
ratingElement.attr( 'src', this.imagePath + 'star_off.gif' );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.updateRating = function( id, num, prev_rating ) {
|
||||
if ( this.clearRatingTimer && this.last_id == id ) {
|
||||
clearTimeout( this.clearRatingTimer );
|
||||
}
|
||||
this.clearRating( id, num, prev_rating );
|
||||
for ( var x = 1; x <= num; x++ ) {
|
||||
$( '#rating_' + id + '_' + x ).attr( 'src', this.imagePath + 'star_voted.gif' );
|
||||
}
|
||||
this.last_id = id;
|
||||
};
|
||||
};
|
||||
|
||||
// TODO: Make event handlers part of a widget as described in the VoteNY's TODO and reduce this
|
||||
// code to instantiating such a widget for the current wiki page if required.
|
||||
$( function() {
|
||||
var vote = new VoteNY();
|
||||
|
||||
// Green voting box's link
|
||||
$( '.vote-action' ).on( 'click', '> a', function( event ) {
|
||||
if ( $( this ).hasClass( 'vote-unvote-link' ) ) {
|
||||
vote.unVote( mw.config.get( 'wgArticleId' ) );
|
||||
} else {
|
||||
vote.clickVote( 1, mw.config.get( 'wgArticleId' ) );
|
||||
}
|
||||
} );
|
||||
|
||||
// Rating stars
|
||||
// Note: this uses $( 'body' ).on( 'actionName', 'selector'
|
||||
// instead of $( 'selector' ).actionName so that the hover effects work
|
||||
// correctly even *after* you've voted (say, if you wanted to change your
|
||||
// vote with the star ratings without reloading the page).
|
||||
$( 'body' ).on( 'click', '.vote-rating-star', function() {
|
||||
var that = $( this );
|
||||
vote.clickVoteStars(
|
||||
that.data( 'vote-the-vote' ),
|
||||
$( this ).data( 'page-id' ),
|
||||
that.data( 'vote-id' ),
|
||||
that.data( 'vote-action' )
|
||||
);
|
||||
} ).on( 'mouseover', '.vote-rating-star', function() {
|
||||
var that = $( this );
|
||||
vote.updateRating(
|
||||
that.data( 'vote-id' ),
|
||||
that.data( 'vote-the-vote' ),
|
||||
that.data( 'vote-rating' )
|
||||
);
|
||||
} ).on( 'mouseout', '.vote-rating-star', function() {
|
||||
var that = $( this );
|
||||
vote.startClearRating(
|
||||
that.data( 'vote-id' ),
|
||||
that.data( 'vote-rating' ),
|
||||
that.data( 'vote-voted' )
|
||||
);
|
||||
} );
|
||||
|
||||
// Remove vote (rating stars)
|
||||
$( 'body' ).on( 'click', '.vote-remove-stars-link', function() {
|
||||
vote.unVoteStars(
|
||||
$( this ).data( 'page-id' ),
|
||||
$( this ).data( 'vote-id' )
|
||||
);
|
||||
} );
|
||||
} );
|
367
VoteClass.php
367
VoteClass.php
|
@ -1,367 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Vote class - class for handling vote-related functions (counting
|
||||
* the average score of a given page, inserting/updating/removing a vote etc.)
|
||||
*
|
||||
* @file
|
||||
* @ingroup Extensions
|
||||
*/
|
||||
class Vote {
|
||||
public $PageID = 0;
|
||||
public $Userid = 0;
|
||||
public $Username = null;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param int $pageID Article ID number
|
||||
*/
|
||||
public function __construct( $pageID ) {
|
||||
global $wgUser;
|
||||
|
||||
$this->PageID = $pageID;
|
||||
$this->Username = $wgUser->getName();
|
||||
$this->Userid = $wgUser->getID();
|
||||
}
|
||||
|
||||
/**
|
||||
* Counts all votes, fetching the data from memcached if available
|
||||
* or from the database if memcached isn't available
|
||||
*
|
||||
* @return int Amount of votes
|
||||
*/
|
||||
function count() {
|
||||
global $wgMemc;
|
||||
|
||||
$key = wfMemcKey( 'vote', 'count', $this->PageID );
|
||||
$data = $wgMemc->get( $key );
|
||||
|
||||
// Try cache
|
||||
if ( $data ) {
|
||||
wfDebug( "Loading vote count for page {$this->PageID} from cache\n" );
|
||||
$vote_count = $data;
|
||||
} else {
|
||||
$dbr = wfGetDB( DB_SLAVE );
|
||||
$vote_count = 0;
|
||||
$res = $dbr->select(
|
||||
'Vote',
|
||||
'COUNT(*) AS votecount',
|
||||
array( 'vote_page_id' => $this->PageID ),
|
||||
__METHOD__
|
||||
);
|
||||
$row = $dbr->fetchObject( $res );
|
||||
if ( $row ) {
|
||||
$vote_count = $row->votecount;
|
||||
}
|
||||
$wgMemc->set( $key, $vote_count );
|
||||
}
|
||||
|
||||
return $vote_count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the average score of all votes
|
||||
*
|
||||
* @return int Formatted average number of votes (something like 3.50)
|
||||
*/
|
||||
function getAverageVote() {
|
||||
global $wgMemc;
|
||||
$key = wfMemcKey( 'vote', 'avg', $this->PageID );
|
||||
$data = $wgMemc->get( $key );
|
||||
|
||||
$voteAvg = 0;
|
||||
if ( $data ) {
|
||||
wfDebug( "Loading vote avg for page {$this->PageID} from cache\n" );
|
||||
$voteAvg = $data;
|
||||
} else {
|
||||
$dbr = wfGetDB( DB_SLAVE );
|
||||
$res = $dbr->select(
|
||||
'Vote',
|
||||
'AVG(vote_value) AS voteavg',
|
||||
array( 'vote_page_id' => $this->PageID ),
|
||||
__METHOD__
|
||||
);
|
||||
$row = $dbr->fetchObject( $res );
|
||||
if ( $row ) {
|
||||
$voteAvg = $row->voteavg;
|
||||
}
|
||||
$wgMemc->set( $key, $voteAvg );
|
||||
}
|
||||
|
||||
return number_format( $voteAvg, 2 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear caches - memcached, parser cache and Squid cache
|
||||
*/
|
||||
function clearCache() {
|
||||
global $wgUser, $wgMemc;
|
||||
|
||||
// Kill internal cache
|
||||
$wgMemc->delete( wfMemcKey( 'vote', 'count', $this->PageID ) );
|
||||
$wgMemc->delete( wfMemcKey( 'vote', 'avg', $this->PageID ) );
|
||||
|
||||
// Purge squid
|
||||
$pageTitle = Title::newFromID( $this->PageID );
|
||||
if ( is_object( $pageTitle ) ) {
|
||||
$pageTitle->invalidateCache();
|
||||
$pageTitle->purgeSquid();
|
||||
|
||||
// Kill parser cache
|
||||
$article = new Article( $pageTitle, /* oldid */0 );
|
||||
$parserCache = ParserCache::singleton();
|
||||
$parserKey = $parserCache->getKey( $article, $wgUser );
|
||||
$wgMemc->delete( $parserKey );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the user's vote from the database, purges normal caches and
|
||||
* updates SocialProfile's statistics, if SocialProfile is active.
|
||||
*/
|
||||
function delete() {
|
||||
$dbw = wfGetDB( DB_MASTER );
|
||||
$dbw->delete(
|
||||
'Vote',
|
||||
array(
|
||||
'vote_page_id' => $this->PageID,
|
||||
'username' => $this->Username
|
||||
),
|
||||
__METHOD__
|
||||
);
|
||||
|
||||
$this->clearCache();
|
||||
|
||||
// Update social statistics if SocialProfile extension is enabled
|
||||
if ( class_exists( 'UserStatsTrack' ) ) {
|
||||
$stats = new UserStatsTrack( $this->Userid, $this->Username );
|
||||
$stats->decStatField( 'vote' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Inserts a new vote into the Vote database table
|
||||
*
|
||||
* @param int $voteValue
|
||||
*/
|
||||
function insert( $voteValue ) {
|
||||
global $wgRequest;
|
||||
$dbw = wfGetDB( DB_MASTER );
|
||||
wfSuppressWarnings(); // E_STRICT whining
|
||||
$voteDate = date( 'Y-m-d H:i:s' );
|
||||
wfRestoreWarnings();
|
||||
if ( $this->UserAlreadyVoted() == false ) {
|
||||
$dbw->insert(
|
||||
'Vote',
|
||||
array(
|
||||
'username' => $this->Username,
|
||||
'vote_user_id' => $this->Userid,
|
||||
'vote_page_id' => $this->PageID,
|
||||
'vote_value' => $voteValue,
|
||||
'vote_date' => $voteDate,
|
||||
'vote_ip' => $wgRequest->getIP(),
|
||||
),
|
||||
__METHOD__
|
||||
);
|
||||
|
||||
$this->clearCache();
|
||||
|
||||
// Update social statistics if SocialProfile extension is enabled
|
||||
if ( class_exists( 'UserStatsTrack' ) ) {
|
||||
$stats = new UserStatsTrack( $this->Userid, $this->Username );
|
||||
$stats->incStatField( 'vote' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a user has already voted
|
||||
*
|
||||
* @return bool|int False if s/he hasn't, otherwise returns the
|
||||
* value of 'vote_value' column from Vote DB table
|
||||
*/
|
||||
function UserAlreadyVoted() {
|
||||
$dbr = wfGetDB( DB_SLAVE );
|
||||
$s = $dbr->selectRow(
|
||||
'Vote',
|
||||
array( 'vote_value' ),
|
||||
array(
|
||||
'vote_page_id' => $this->PageID,
|
||||
'username' => $this->Username
|
||||
),
|
||||
__METHOD__
|
||||
);
|
||||
if ( $s === false ) {
|
||||
return false;
|
||||
} else {
|
||||
return $s->vote_value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the green voting box
|
||||
*
|
||||
* @return string HTML output
|
||||
*/
|
||||
function display() {
|
||||
global $wgUser;
|
||||
|
||||
$voted = $this->UserAlreadyVoted();
|
||||
|
||||
$make_vote_box_clickable = '';
|
||||
if ( $voted == false ) {
|
||||
$make_vote_box_clickable = ' vote-clickable';
|
||||
}
|
||||
|
||||
$output = "<div class=\"vote-box{$make_vote_box_clickable}\" id=\"votebox\">";
|
||||
$output .= '<span id="PollVotes" class="vote-number">' . $this->count() . '</span>';
|
||||
$output .= '</div>';
|
||||
$output .= '<div id="Answer" class="vote-action">';
|
||||
|
||||
if ( !$wgUser->isAllowed( 'voteny' ) ) {
|
||||
// @todo FIXME: this is horrible. If we don't have enough
|
||||
// permissions to vote, we should tell the end-user /that/,
|
||||
// not require them to log in!
|
||||
$login = SpecialPage::getTitleFor( 'Userlogin' );
|
||||
$output .= '<a class="votebutton" href="' .
|
||||
htmlspecialchars( $login->getFullURL() ) . '" rel="nofollow">' .
|
||||
wfMessage( 'voteny-link' )->plain() . '</a>';
|
||||
} else {
|
||||
if ( !wfReadOnly() ) {
|
||||
if ( $voted == false ) {
|
||||
$output .= '<a href="javascript:void(0);" class="vote-vote-link">' .
|
||||
wfMessage( 'voteny-link' )->plain() . '</a>';
|
||||
} else {
|
||||
$output .= '<a href="javascript:void(0);" class="vote-unvote-link">' .
|
||||
wfMessage( 'voteny-unvote-link' )->plain() . '</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
$output .= '</div>';
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Class for generating star rating stars.
|
||||
*/
|
||||
class VoteStars extends Vote {
|
||||
|
||||
public $maxRating = 5;
|
||||
|
||||
/**
|
||||
* Displays voting stars
|
||||
*
|
||||
* @param bool $voted Has the user already voted? False by default
|
||||
* @return string HTML output
|
||||
*/
|
||||
function display( $voted = false ) {
|
||||
global $wgUser;
|
||||
|
||||
$overall_rating = $this->getAverageVote();
|
||||
|
||||
if ( $voted ) {
|
||||
$display_stars_rating = $voted;
|
||||
} else {
|
||||
$display_stars_rating = $this->getAverageVote();
|
||||
}
|
||||
|
||||
$id = '';
|
||||
|
||||
// Should probably be $this->PageID or something?
|
||||
// 'cause we define $id just above as an empty string...duh
|
||||
$output = '<div id="rating_' . $id . '">';
|
||||
$output .= '<div class="rating-score">';
|
||||
$output .= '<div class="voteboxrate">' . $overall_rating . '</div>';
|
||||
$output .= '</div>';
|
||||
$output .= '<div class="rating-section">';
|
||||
$output .= $this->displayStars( $id, $display_stars_rating, $voted );
|
||||
$count = $this->count();
|
||||
if ( isset( $count ) ) {
|
||||
$output .= ' <span class="rating-total">(' .
|
||||
wfMessage( 'voteny-votes', $count )->parse() . ')</span>';
|
||||
}
|
||||
$already_voted = $this->UserAlreadyVoted();
|
||||
if ( $already_voted && $wgUser->isLoggedIn() ) {
|
||||
$output .= '<div class="rating-voted">' .
|
||||
wfMessage( 'voteny-gave-this', $already_voted )->parse() .
|
||||
" </div>
|
||||
<a href=\"javascript:void(0);\" class=\"vote-remove-stars-link\" data-page-id=\"{$this->PageID}\" data-vote-id=\"{$id}\">("
|
||||
. wfMessage( 'voteny-remove' )->plain() .
|
||||
')</a>';
|
||||
}
|
||||
$output .= '</div>
|
||||
<div class="rating-clear">
|
||||
</div>';
|
||||
|
||||
$output .= '</div>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the actual star images, depending on the state of the user's mouse
|
||||
*
|
||||
* @param int $id ID of the rating (div) element
|
||||
* @param int $rating Average rating
|
||||
* @param int $voted
|
||||
* @return string Generated <img> tag
|
||||
*/
|
||||
function displayStars( $id, $rating, $voted ) {
|
||||
global $wgExtensionAssetsPath;
|
||||
|
||||
if ( !$rating ) {
|
||||
$rating = 0;
|
||||
}
|
||||
if ( !$voted ) {
|
||||
$voted = 0;
|
||||
}
|
||||
$output = '';
|
||||
|
||||
for ( $x = 1; $x <= $this->maxRating; $x++ ) {
|
||||
if ( !$id ) {
|
||||
$action = 3;
|
||||
} else {
|
||||
$action = 5;
|
||||
}
|
||||
$output .= "<img class=\"vote-rating-star\" data-vote-the-vote=\"{$x}\"" .
|
||||
" data-page-id=\"{$this->PageID}\"" .
|
||||
" data-vote-id=\"{$id}\" data-vote-action=\"{$action}\" data-vote-rating=\"{$rating}\"" .
|
||||
" data-vote-voted=\"{$voted}\" id=\"rating_{$id}_{$x}\"" .
|
||||
" src=\"{$wgExtensionAssetsPath}/VoteNY/images/star_";
|
||||
switch ( true ) {
|
||||
case $rating >= $x:
|
||||
if ( $voted ) {
|
||||
$output .= 'voted';
|
||||
} else {
|
||||
$output .= 'on';
|
||||
}
|
||||
break;
|
||||
case ( $rating > 0 && $rating < $x && $rating > ( $x - 1 ) ):
|
||||
$output .= 'half';
|
||||
break;
|
||||
case ( $rating < $x ):
|
||||
$output .= 'off';
|
||||
break;
|
||||
}
|
||||
|
||||
$output .= '.gif" alt="" />';
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the average score for the current page
|
||||
* and the total amount of votes.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function displayScore() {
|
||||
$count = $this->count();
|
||||
return wfMessage( 'voteny-community-score', '<b>' . $this->getAverageVote() . '</b>' )
|
||||
->numParams( $count )->text() .
|
||||
' (' . wfMessage( 'voteny-ratings' )->numParams( $count )->parse() . ')';
|
||||
}
|
||||
|
||||
}
|
223
VoteHooks.php
223
VoteHooks.php
|
@ -1,223 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* All hooked functions used by VoteNY extension.
|
||||
*
|
||||
* @file
|
||||
* @ingroup Extensions
|
||||
*/
|
||||
class VoteHooks {
|
||||
|
||||
/**
|
||||
* Set up the <vote> parser hook.
|
||||
*
|
||||
* @param Parser $parser
|
||||
* @return bool
|
||||
*/
|
||||
public static function registerParserHook( &$parser ) {
|
||||
$parser->setHook( 'vote', array( 'VoteHooks', 'renderVote' ) );
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback function for registerParserHook.
|
||||
*
|
||||
* @param string $input User-supplied input, unused
|
||||
* @param array $args User-supplied arguments
|
||||
* @param Parser $parser Instance of Parser, unused
|
||||
* @return string HTML
|
||||
*/
|
||||
public static function renderVote( $input, $args, $parser ) {
|
||||
global $wgOut, $wgUser;
|
||||
|
||||
// Disable parser cache (sadly we have to do this, because the caching is
|
||||
// messing stuff up; we want to show an up-to-date rating instead of old
|
||||
// or totally wrong rating, i.e. another page's rating...)
|
||||
$parser->disableCache();
|
||||
|
||||
// Add CSS & JS
|
||||
// In order for us to do this *here* instead of having to do this in
|
||||
// registerParserHook(), we must've disabled parser cache
|
||||
$parser->getOutput()->addModuleStyles( 'ext.voteNY.styles' );
|
||||
if ( $wgUser->isAllowed( 'voteny' ) ) {
|
||||
$parser->getOutput()->addModules( 'ext.voteNY.scripts' );
|
||||
}
|
||||
|
||||
// Define variable - 0 means that we'll get that green voting box by default
|
||||
$type = 0;
|
||||
|
||||
// Determine what kind of a voting gadget the user wants: a box or pretty stars?
|
||||
if ( preg_match( "/^\s*type\s*=\s*(.*)/mi", $input, $matches ) ) {
|
||||
$type = htmlspecialchars( $matches[1] );
|
||||
} elseif ( !empty( $args['type'] ) ) {
|
||||
$type = intval( $args['type'] );
|
||||
}
|
||||
|
||||
$output = null;
|
||||
$title = $wgOut->getTitle();
|
||||
if ( $title ) {
|
||||
$articleID = $title->getArticleID();
|
||||
switch( $type ) {
|
||||
case 0:
|
||||
$vote = new Vote( $articleID );
|
||||
break;
|
||||
case 1:
|
||||
$vote = new VoteStars( $articleID );
|
||||
break;
|
||||
default:
|
||||
$vote = new Vote( $articleID );
|
||||
}
|
||||
|
||||
$output = $vote->display();
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* For the Renameuser extension.
|
||||
*
|
||||
* @param RenameuserSQL $renameUserSQL
|
||||
* @return bool
|
||||
*/
|
||||
public static function onUserRename( $renameUserSQL ) {
|
||||
$renameUserSQL->tables['Vote'] = array( 'username', 'vote_user_id' );
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign a value to {{NUMBEROFVOTES}}. First we try memcached and if that
|
||||
* fails, we fetch it directly from the database and cache it for 24 hours.
|
||||
*
|
||||
* @param Parser $parser
|
||||
* @param $cache
|
||||
* @param string $magicWordId Magic word ID
|
||||
* @param int $ret Return value (number of votes)
|
||||
* @return bool
|
||||
*/
|
||||
public static function assignValueToMagicWord( &$parser, &$cache, &$magicWordId, &$ret ) {
|
||||
global $wgMemc;
|
||||
|
||||
if ( $magicWordId == 'NUMBEROFVOTES' ) {
|
||||
$key = wfMemcKey( 'vote', 'magic-word' );
|
||||
$data = $wgMemc->get( $key );
|
||||
if ( $data != '' ) {
|
||||
// We have it in cache? Oh goody, let's just use the cached value!
|
||||
wfDebugLog(
|
||||
'VoteNY',
|
||||
'Got the amount of votes from memcached'
|
||||
);
|
||||
// return value
|
||||
$ret = $data;
|
||||
} else {
|
||||
// Not cached → have to fetch it from the database
|
||||
$dbr = wfGetDB( DB_SLAVE );
|
||||
$voteCount = (int)$dbr->selectField(
|
||||
'Vote',
|
||||
'COUNT(*) AS count',
|
||||
array(),
|
||||
__METHOD__
|
||||
);
|
||||
wfDebugLog( 'VoteNY', 'Got the amount of votes from DB' );
|
||||
// Store the count in cache...
|
||||
// (86400 = seconds in a day)
|
||||
$wgMemc->set( $key, $voteCount, 86400 );
|
||||
// ...and return the value to the user
|
||||
$ret = $voteCount;
|
||||
}
|
||||
} elseif ( $magicWordId == 'NUMBEROFVOTESPAGE' ) {
|
||||
$ret = VoteHooks::getNumberOfVotesPage( $parser->getTitle() );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Main function to get the number of votes for a specific page
|
||||
*
|
||||
* @param Title $title Page to get votes for
|
||||
* @return int Number of votes for the given page
|
||||
*/
|
||||
public static function getNumberOfVotesPage( Title $title ) {
|
||||
global $wgMemc;
|
||||
|
||||
$id = $title->getArticleID();
|
||||
|
||||
$key = wfMemcKey( 'vote', 'magic-word-page', $id );
|
||||
$data = $wgMemc->get( $key );
|
||||
|
||||
if ( $data ) {
|
||||
return $data;
|
||||
} else {
|
||||
$dbr = wfGetDB( DB_SLAVE );
|
||||
|
||||
$voteCount = (int)$dbr->selectField(
|
||||
'Vote',
|
||||
'COUNT(*) AS count',
|
||||
array( 'vote_page_id' => $id ),
|
||||
__METHOD__
|
||||
);
|
||||
|
||||
$wgMemc->set( $key, $voteCount, 3600 );
|
||||
|
||||
return $voteCount;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Hook for parser function {{NUMBEROFVOTESPAGE:<page>}}
|
||||
*
|
||||
* @param Parser $parser
|
||||
* @param string $pagename Page name
|
||||
* @return int Amount of votes for the given page
|
||||
*/
|
||||
public static function getNumberOfVotesPageParser( $parser, $pagename ) {
|
||||
$title = Title::newFromText( $pagename );
|
||||
|
||||
if ( !$title instanceof Title ) {
|
||||
$title = $parser->getTitle();
|
||||
}
|
||||
|
||||
return VoteHooks::getNumberOfVotesPage( $title );
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the magic word ID for {{NUMBEROFVOTES}} and {{NUMBEROFVOTESPAGE}}
|
||||
*
|
||||
* @param array $variableIds Array of pre-existing variable IDs
|
||||
* @return bool
|
||||
*/
|
||||
public static function registerVariableId( &$variableIds ) {
|
||||
$variableIds[] = 'NUMBEROFVOTES';
|
||||
$variableIds[] = 'NUMBEROFVOTESPAGE';
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hook to setup parser function {{NUMBEROFVOTESPAGE:<page>}}
|
||||
*
|
||||
* @param Parser $parser
|
||||
* @return bool
|
||||
*/
|
||||
public static function setupNumberOfVotesPageParser( &$parser ) {
|
||||
$parser->setFunctionHook( 'NUMBEROFVOTESPAGE', 'VoteHooks::getNumberOfVotesPageParser', Parser::SFH_NO_HASH );
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the necessary database table when the user runs
|
||||
* maintenance/update.php.
|
||||
*
|
||||
* @param DatabaseUpdater $updater
|
||||
* @return bool
|
||||
*/
|
||||
public static function addTable( $updater ) {
|
||||
$dbt = $updater->getDB()->getType();
|
||||
$file = __DIR__ . "/vote.$dbt";
|
||||
if ( file_exists( $file ) ) {
|
||||
$updater->addExtensionUpdate( array( 'addTable', 'Vote', $file, true ) );
|
||||
} else {
|
||||
throw new MWException( "VoteNY does not support $dbt." );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Aliases for Special:TopRatings
|
||||
*
|
||||
* @file
|
||||
* @ingroup Extensions
|
||||
*/
|
||||
// @codingStandardsIgnoreFile
|
||||
|
||||
$specialPageAliases = array();
|
||||
|
||||
/** English (English) */
|
||||
$specialPageAliases['en'] = array(
|
||||
'TopRatings' => array( 'TopRatings' ),
|
||||
);
|
|
@ -1,11 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Internationalization file for magic words.
|
||||
*/
|
||||
|
||||
$magicWords = array();
|
||||
|
||||
$magicWords['en'] = array(
|
||||
'NUMBEROFVOTES' => array( 0, 'NUMBEROFVOTES' ),
|
||||
'NUMBEROFVOTESPAGE' => array( 0, 'NUMBEROFVOTESPAGE' ),
|
||||
);
|
|
@ -1,83 +1,62 @@
|
|||
{
|
||||
"name": "VoteNY",
|
||||
"version": "2.8",
|
||||
"name": "IUseThis",
|
||||
"version": "1.0",
|
||||
"author": [
|
||||
"Alexander Yakovlev",
|
||||
"Aaron Wright",
|
||||
"David Pean",
|
||||
"Jack Phoenix"
|
||||
],
|
||||
"license-name": "GPL-2.0+",
|
||||
"url": "https://www.mediawiki.org/wiki/Extension:VoteNY",
|
||||
"descriptionmsg": "voteny-desc",
|
||||
"type": "parserhook",
|
||||
"SpecialPages": {
|
||||
"TopRatings": "SpecialTopRatings"
|
||||
"APIModules": {
|
||||
"iusethis": "ApiIUT"
|
||||
},
|
||||
"MessagesDirs": {
|
||||
"VoteNY": [
|
||||
"IUseThis": [
|
||||
"i18n"
|
||||
]
|
||||
},
|
||||
"APIModules": {
|
||||
"voteny": "ApiVoteNY"
|
||||
},
|
||||
"ExtensionMessagesFiles": {
|
||||
"VoteNYAlias": "VoteNY.alias.php",
|
||||
"VoteNYMagic": "VoteNY.i18n.magic.php"
|
||||
},
|
||||
"AutoloadClasses": {
|
||||
"ApiVoteNY": "ApiVoteNY.php",
|
||||
"Vote": "VoteClass.php",
|
||||
"VoteStars": "VoteClass.php",
|
||||
"SpecialTopRatings": "SpecialTopRatings.php",
|
||||
"VoteHooks": "VoteHooks.php"
|
||||
"ApiIUT": "ApiIUT.php",
|
||||
"IUT": "IUTClass.php",
|
||||
"IUTHooks": "IUTHooks.php"
|
||||
},
|
||||
"Hooks": {
|
||||
"ParserFirstCallInit": [
|
||||
"VoteHooks::registerParserHook",
|
||||
"VoteHooks::setupNumberOfVotesPageParser"
|
||||
"IUTHooks::registerParserHook"
|
||||
],
|
||||
"RenameUserSQL": [
|
||||
"VoteHooks::onUserRename"
|
||||
],
|
||||
"ParserGetVariableValueSwitch": [
|
||||
"VoteHooks::assignValueToMagicWord"
|
||||
],
|
||||
"MagicWordwgVariableIDs": [
|
||||
"VoteHooks::registerVariableId"
|
||||
"IUTHooks::onUserRename"
|
||||
],
|
||||
"LoadExtensionSchemaUpdates": [
|
||||
"VoteHooks::addTable"
|
||||
"IUTHooks::addTable"
|
||||
]
|
||||
},
|
||||
"ResourceFileModulePaths": {
|
||||
"localBasePath": "",
|
||||
"remoteExtPath": "VoteNY"
|
||||
"remoteExtPath": "IUT"
|
||||
},
|
||||
"ResourceModules": {
|
||||
"ext.voteNY.scripts": {
|
||||
"scripts": "Vote.js",
|
||||
"messages": [
|
||||
"voteny-link",
|
||||
"voteny-unvote-link"
|
||||
],
|
||||
"scripts": "IUT.js",
|
||||
"dependencies": [ "mediawiki.api" ],
|
||||
"position": "bottom"
|
||||
},
|
||||
"ext.voteNY.styles": {
|
||||
"styles": "Vote.css",
|
||||
"styles": "IUT.css",
|
||||
"position": "top"
|
||||
}
|
||||
},
|
||||
"AvailableRights": [
|
||||
"voteny"
|
||||
"iusethis"
|
||||
],
|
||||
"GroupPermissions": {
|
||||
"*": {
|
||||
"voteny": false
|
||||
"iusethis": false
|
||||
},
|
||||
"user": {
|
||||
"voteny": true
|
||||
"iusethis": true
|
||||
}
|
||||
},
|
||||
"manifest_version": 1
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Xuacu"
|
||||
]
|
||||
},
|
||||
"apihelp-voteny-description": "Módulu API VoteNY",
|
||||
"apihelp-voteny-param-what": "Aición a facer; los valores válidos son 'vote' (cuadru de votu verde), 'multi' (estrelles de votación) o 'delete' (desaniciar un votu dau anteriormente)",
|
||||
"apihelp-voteny-param-pageId": "ID de páxina de la páxina onde ta/tan el cuadru de votu o estrelles",
|
||||
"apihelp-voteny-param-voteValue": "Valor numbéricu del votu ente 1 y 5",
|
||||
"apihelp-voteny-param-type": "Configuralo como 'stars' pa llamar a les estrelles de votación (clas VoteStars PHP), d'otra manera úsase'l cuadru de votu verde (clas Vote PHP)",
|
||||
"apihelp-voteny-example-1": "Unviar un votu a la páxina que tien el númberu d'ID 666",
|
||||
"apihelp-voteny-example-2": "Desaniciar el votu de la páxina que tien el númberu d'ID 666",
|
||||
"apihelp-voteny-example-3": "Unviar un votu (3 estrelles de 5) a la páxina que tien el númberu d'ID 666",
|
||||
"apihelp-voteny-example-4": "Desaniciar el votu de la páxina que tien el númberu d'ID 666 qu'usa la puntuación d'estrelles",
|
||||
"apihelp-voteny-example-5": "Unviar un votu (4 estrelles de 5) a la páxina que tien el númberu d'ID 666, desaniciando'l votu anterior si lu hai",
|
||||
"voteny-desc": "Votación basada en JavaScript cola etiqueta <tt><vote></tt>",
|
||||
"voteny-link": "Votar",
|
||||
"voteny-unvote-link": "retirar el votu",
|
||||
"voteny-community-score": "{{PLURAL:$2|puntuación|puntuaciones}} de la comunidá: $1",
|
||||
"voteny-ratings": "{{PLURAL:$1|una valoración|$1 valoraciones}}",
|
||||
"voteny-remove": "desaniciar",
|
||||
"voteny-gave-this": "dio-y a esto un $1",
|
||||
"voteny-votes": "{{PLURAL:$1|un votu|$1 votos}}",
|
||||
"topratings": "Páxines meyor calificaes",
|
||||
"topratings-no-pages": "Nun hai páxines meyor calificaes",
|
||||
"right-voteny": "Votar páxines"
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"පසිඳු කාවින්ද"
|
||||
]
|
||||
},
|
||||
"voteny-remove": "премахване"
|
||||
}
|
18
i18n/ca.json
18
i18n/ca.json
|
@ -1,18 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Toniher"
|
||||
]
|
||||
},
|
||||
"voteny-desc": "Votació basada en JavaScript amb l'etiqueta <tt><vote></tt>",
|
||||
"voteny-link": "Vota",
|
||||
"voteny-unvote-link": "anul·la el vot",
|
||||
"voteny-community-score": "puntuació comunitària: $1",
|
||||
"voteny-ratings": "{{PLURAL:$1|una valoració|$1 valoracions}}",
|
||||
"voteny-remove": "anul·la",
|
||||
"voteny-gave-this": "vau donar-li un $1",
|
||||
"voteny-votes": "{{PLURAL:$1|un vot|$1 vots}}",
|
||||
"topratings": "Pàgines més valorades",
|
||||
"topratings-no-pages": "No hi ha cap pàgina valorada.",
|
||||
"right-voteny": "Pàgines de votació"
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Умар"
|
||||
]
|
||||
},
|
||||
"voteny-unvote-link": "юхадаккха харжар"
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Kghbln"
|
||||
]
|
||||
},
|
||||
"voteny-gave-this": "Sie haben eine $1 vergeben."
|
||||
}
|
20
i18n/de.json
20
i18n/de.json
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Kghbln",
|
||||
"Metalhead64",
|
||||
"Purodha"
|
||||
]
|
||||
},
|
||||
"voteny-desc": "Ergänzt das Tag <tt><vote></tt> zum Durchführen JavaScript-gestützter Abstimmungen",
|
||||
"voteny-link": "Abstimmen",
|
||||
"voteny-unvote-link": "Stimme zurücknehmen",
|
||||
"voteny-community-score": "{{PLURAL:$2|Punktestand|Punktestände}} der Gemeinschaft: $1",
|
||||
"voteny-ratings": "{{PLURAL:$1|eine Bewertung|$1 Bewertungen}}",
|
||||
"voteny-remove": "entfernen",
|
||||
"voteny-gave-this": "Du hast eine $1 vergeben.",
|
||||
"voteny-votes": "{{PLURAL:$1|eine Stimme|$1 Stimmen}}",
|
||||
"topratings": "Höchstbewertete Seiten",
|
||||
"topratings-no-pages": "Es sind keine höchstbewerteten Seiten vorhanden.",
|
||||
"right-voteny": "Abstimmen über Seiten"
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Erdemaslancan",
|
||||
"Mirzali"
|
||||
]
|
||||
},
|
||||
"voteny-link": "Rey",
|
||||
"voteny-unvote-link": "rey mede",
|
||||
"voteny-community-score": "Puwanê şêlıki: $1",
|
||||
"voteny-ratings": "{{PLURAL:$1|yew nırğnayış|$1 nırğnayışi}}",
|
||||
"voteny-remove": "wedare",
|
||||
"voteny-votes": "{{PLURAL:$1|yew rey|$1 reyi}}",
|
||||
"right-voteny": "Pelê reydayışi"
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Michawiki"
|
||||
]
|
||||
},
|
||||
"voteny-desc": "Wótgłosowanje z toflicku <tt><vote></tt> na zakłaźe JavaScripta",
|
||||
"voteny-link": "Wótgłosowaś",
|
||||
"voteny-unvote-link": "Wótgłosowanje anulěrowaś",
|
||||
"voteny-community-score": "Licba głosow zgromaźeństwa: $1",
|
||||
"voteny-ratings": "{{PLURAL:$1|jadno pógódnośenje|$1 pógódnośeni|$1 pógódnośenja|$1 pógódnośenjow}}",
|
||||
"voteny-remove": "wótpóraś",
|
||||
"voteny-gave-this": "sy toś tomu $1 dał",
|
||||
"voteny-votes": "{{PLURAL:$1|jaden głos|$1 głosa|$1 głose|$1 głosow}}",
|
||||
"topratings": "Nejwuše pógódnośone boki",
|
||||
"topratings-no-pages": "Žedne nejwuše pógódnośone boki.",
|
||||
"right-voteny": "Wótgłosowańske boki"
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Nirajan pant"
|
||||
]
|
||||
},
|
||||
"apihelp-voteny-param-pageId": "पन्नाआ पन्ना ID जाँ मतदान बगस/तारा छ/छन"
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Chase me ladies, I'm the Cavalry"
|
||||
]
|
||||
},
|
||||
"voteny-desc": "JavaScript-based voting with the <tt><vote></tt> tag",
|
||||
"voteny-link": "Vote",
|
||||
"voteny-unvote-link": "unvote",
|
||||
"voteny-community-score": "community score: $1",
|
||||
"voteny-ratings": "{{PLURAL:$1|one rating|$1 ratings}}",
|
||||
"voteny-remove": "remove",
|
||||
"voteny-gave-this": "you gave this a $1",
|
||||
"voteny-votes": "{{PLURAL:$1|one vote|$1 votes}}",
|
||||
"topratings": "Top rated pages",
|
||||
"topratings-no-pages": "No top rated pages.",
|
||||
"right-voteny": "Vote pages"
|
||||
}
|
26
i18n/en.json
26
i18n/en.json
|
@ -1,29 +1,13 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Alexander Yakovlev <keloero@oreolek.ru>",
|
||||
"Aaron Wright <aaron.wright@gmail.com>",
|
||||
"David Pean <david.pean@gmail.com>"
|
||||
]
|
||||
},
|
||||
"apihelp-voteny-description": "VoteNY API module",
|
||||
"apihelp-voteny-param-what": "Action to take; valid values are 'vote' (green voting box), 'multi' (voting stars) or 'delete' (delete a previously given vote)",
|
||||
"apihelp-voteny-param-pageId": "Page ID of the page where the voting box/stars is/are",
|
||||
"apihelp-voteny-param-voteValue": "Numerical vote value between 1 and 5",
|
||||
"apihelp-voteny-param-type": "Set this to 'stars' to call the voting stars (VoteStars PHP class), otherwise the green vote box (Vote PHP class) is used",
|
||||
"apihelp-voteny-example-1": "Cast a vote for the page which has the ID number 666",
|
||||
"apihelp-voteny-example-2": "Delete your vote from the page which has the ID number 666",
|
||||
"apihelp-voteny-example-3": "Cast a vote (3 stars out of 5) for the page which has the ID number 666",
|
||||
"apihelp-voteny-example-4": "Delete your vote from the page which has the ID number 666 which is using the star rating",
|
||||
"apihelp-voteny-example-5": "Cast a vote (4 stars out of 5) for the page which has the ID number 666, deleting your previous vote, if any",
|
||||
"voteny-desc": "JavaScript-based voting with the <tt><vote></tt> tag",
|
||||
"voteny-link": "Vote",
|
||||
"voteny-unvote-link": "unvote",
|
||||
"voteny-community-score": "community {{PLURAL:$2|score|scores}}: $1",
|
||||
"voteny-ratings": "{{PLURAL:$1|one rating|$1 ratings}}",
|
||||
"voteny-remove": "remove",
|
||||
"voteny-gave-this": "you gave this a $1",
|
||||
"voteny-votes": "{{PLURAL:$1|one vote|$1 votes}}",
|
||||
"topratings": "Top rated pages",
|
||||
"topratings-no-pages": "No top rated pages.",
|
||||
"right-voteny": "Vote pages"
|
||||
"iusethis-link": "I use this",
|
||||
"iusethis-unvote-link": "I don't use this",
|
||||
"iusethis-remove": "remove",
|
||||
"right-iusethis": "Vote for 'I use this'"
|
||||
}
|
||||
|
|
19
i18n/es.json
19
i18n/es.json
|
@ -1,19 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Armando-Martin",
|
||||
"Matiia"
|
||||
]
|
||||
},
|
||||
"voteny-desc": "Votación basada en JavaScript con la etiqueta <tt><vote></tt>",
|
||||
"voteny-link": "Votar",
|
||||
"voteny-unvote-link": "Eliminar voto",
|
||||
"voteny-community-score": "{{PLURAL:$2|puntuación|puntuaciones}} de la comunidad: $1",
|
||||
"voteny-ratings": "{{PLURAL:$1|una valoración|$1 valoraciones}}",
|
||||
"voteny-remove": "eliminar",
|
||||
"voteny-gave-this": "le diste a esto un $1",
|
||||
"voteny-votes": "{{PLURAL:$1|un voto|$1 votos}}",
|
||||
"topratings": "Páginas más valoradas",
|
||||
"topratings-no-pages": "No hay páginas mejor valoradas",
|
||||
"right-voteny": "Páginas de votación"
|
||||
}
|
20
i18n/fa.json
20
i18n/fa.json
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Ebraminio",
|
||||
"Mjbmr",
|
||||
"Omidh"
|
||||
]
|
||||
},
|
||||
"voteny-desc": "سامانهای بر اساس جاوااسکریپت برای رایگیری با تگ <tt><vote></tt>",
|
||||
"voteny-link": "رأی دهی",
|
||||
"voteny-unvote-link": "حذف رأی",
|
||||
"voteny-community-score": "امتیاز کلی: $1",
|
||||
"voteny-ratings": "{{PLURAL:$1|یک امتیاز|$1 امتیاز}}",
|
||||
"voteny-remove": "حذف",
|
||||
"voteny-gave-this": "شما $1 امتیاز دادید",
|
||||
"voteny-votes": "{{PLURAL:$1|یک رای|$1 رای}}",
|
||||
"topratings": "صفحات دارای امتیاز بالا",
|
||||
"topratings-no-pages": "صفحههایی با امتیاز بالا وجود ندارند.",
|
||||
"right-voteny": "صفحههای رأی"
|
||||
}
|
17
i18n/fi.json
17
i18n/fi.json
|
@ -1,17 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Jack Phoenix <jack@countervandalism.net>",
|
||||
"Nike"
|
||||
]
|
||||
},
|
||||
"voteny-link": "Äänestä",
|
||||
"voteny-unvote-link": "poista ääni",
|
||||
"voteny-community-score": "yhteisön antama pistemäärä: $1",
|
||||
"voteny-ratings": "{{PLURAL:$1|yksi arvostelu|$1 arvostelua}}",
|
||||
"voteny-remove": "poista",
|
||||
"voteny-gave-this": "annoit {{PLURAL:$1|yhden tähden|$1 tähteä}}",
|
||||
"voteny-votes": "{{PLURAL:$1|yksi ääni|$1 ääntä}}",
|
||||
"topratings": "Huippusivut",
|
||||
"topratings-no-pages": "Ei huippusivuja."
|
||||
}
|
31
i18n/fr.json
31
i18n/fr.json
|
@ -1,31 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Crochet.david",
|
||||
"Jack Phoenix <jack@countervandalism.net>",
|
||||
"Tititou36",
|
||||
"Gomoko"
|
||||
]
|
||||
},
|
||||
"apihelp-voteny-description": "Module d’API VoteNY",
|
||||
"apihelp-voteny-param-what": "Action à entreprendre ; les valeurs valides sont 'vote' (case de vote verte), 'multi' (étoiles de vote) ou 'delete' (supprime un vote déjà donné)",
|
||||
"apihelp-voteny-param-pageId": "ID de la page où se situe la case de vote/les étoiles",
|
||||
"apihelp-voteny-param-voteValue": "Valeur numérique du vote entre 1 et 5",
|
||||
"apihelp-voteny-param-type": "Mettre cela à 'stars' pour appeler les étoiles de vote (classe PHP VoteStars), sinon la case de vote verte (classe PHP Vote) est utilisée",
|
||||
"apihelp-voteny-example-1": "Mettre un vote pour la page qui a le numéro d’ID 666",
|
||||
"apihelp-voteny-example-2": "Supprimer votre vote de la page qui a le numéro d’ID 666",
|
||||
"apihelp-voteny-example-3": "Mettre un vote (3 étoiles sur 5) pour la page qui a le numéro d’ID 666",
|
||||
"apihelp-voteny-example-4": "Supprimer votre vote de la page qui a le numéro d’ID 666 en utilisant la notation par étoiles",
|
||||
"apihelp-voteny-example-5": "Mettre un vote (4 étoiles sur 5) pour la page de numéro d’ID 666, en supprimant votre vote précédent s’il y en avait un",
|
||||
"voteny-desc": "Système de vote en JavaScript avec la balise <tt><vote></tt>",
|
||||
"voteny-link": "Voter",
|
||||
"voteny-unvote-link": "supprimer vote",
|
||||
"voteny-community-score": "{{PLURAL:$2|note|notes}} de la communauté : $1",
|
||||
"voteny-ratings": "{{PLURAL:$1|une note|$1 notes}}",
|
||||
"voteny-remove": "supprimer",
|
||||
"voteny-gave-this": "Vous avez noté $1",
|
||||
"voteny-votes": "{{PLURAL:$1|un vote|$1 votes}}",
|
||||
"topratings": "Pages les mieux notées",
|
||||
"topratings-no-pages": "Aucune page notée.",
|
||||
"right-voteny": "Pages de vote"
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"ChrisPtDe"
|
||||
]
|
||||
},
|
||||
"voteny-link": "Votar",
|
||||
"voteny-unvote-link": "enlevar lo voto",
|
||||
"voteny-community-score": "mârca de la comunôtât : $1",
|
||||
"voteny-ratings": "{{PLURAL:$1|yona èstimacion|$1 èstimacions}}",
|
||||
"voteny-remove": "enlevar",
|
||||
"voteny-gave-this": "vos éd balyê $1",
|
||||
"voteny-votes": "{{PLURAL:$1|yon voto|$1 votos}}",
|
||||
"right-voteny": "Votar des pâges"
|
||||
}
|
29
i18n/gl.json
29
i18n/gl.json
|
@ -1,29 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Toliño",
|
||||
"Elisardojm"
|
||||
]
|
||||
},
|
||||
"apihelp-voteny-description": "Módulo de API VoteNY",
|
||||
"apihelp-voteny-param-what": "Acción a realizar; os valores válidos son 'vote' (caixa de voto verde), 'multi' (estrelas de voto) ou 'delete' (borrar un voto dado previamente).",
|
||||
"apihelp-voteny-param-pageId": "Identificador da páxina onde está/n a caixa de voto/estrelas",
|
||||
"apihelp-voteny-param-voteValue": "Valor numérico de voto entre 1 e 5",
|
||||
"apihelp-voteny-param-type": "Fixa isto a 'stars' para chamar ás estrelas de voto (VoteStars PHP class), noutro caso usarase a caixa de voto verde (Vote PHP class)",
|
||||
"apihelp-voteny-example-1": "Votar pola páxina que ten o número de identificación 666",
|
||||
"apihelp-voteny-example-2": "Borrar o seu voto da páxina que ten o número de identificación 666",
|
||||
"apihelp-voteny-example-3": "Votar (3 estrelas sobre 5) para a páxina que ten o número de identificación 666",
|
||||
"apihelp-voteny-example-4": "Borrar o seu voto da páxina que ten o número de identificación 666 que está usando a notación por estrelas",
|
||||
"apihelp-voteny-example-5": "Votar (4 estrelas sobre 5) para a páxina que ten o número de identificación 666, borrando o seu voto previo, se existe",
|
||||
"voteny-desc": "Sistema de votación en JavaScript coa etiqueta <tt><vote></tt>",
|
||||
"voteny-link": "Votar",
|
||||
"voteny-unvote-link": "retirar o voto",
|
||||
"voteny-community-score": "{{PLURAL:$2|puntuación|puntuacións}} da comunidade: $1",
|
||||
"voteny-ratings": "{{PLURAL:$1|unha valoración|$1 valoracións}}",
|
||||
"voteny-remove": "eliminar",
|
||||
"voteny-gave-this": "vostede deu un $1",
|
||||
"voteny-votes": "{{PLURAL:$1|un voto|$1 votos}}",
|
||||
"topratings": "Páxinas mellor valoradas",
|
||||
"topratings-no-pages": "Non hai ningunha páxina valorada.",
|
||||
"right-voteny": "Votar páxinas"
|
||||
}
|
20
i18n/he.json
20
i18n/he.json
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Yona b",
|
||||
"חיים",
|
||||
"Guycn2"
|
||||
]
|
||||
},
|
||||
"voteny-desc": "הצבעה מבוססת JavaScript עם התג <tt><vote></tt>",
|
||||
"voteny-link": "הצבעה",
|
||||
"voteny-unvote-link": "הסר הצבעה",
|
||||
"voteny-community-score": "ציון הקהילה: $1",
|
||||
"voteny-ratings": "{{PLURAL:$1|מדרג אחד|$1 מדרגים}}",
|
||||
"voteny-remove": "הסרה",
|
||||
"voteny-gave-this": "נתת לזה $1",
|
||||
"voteny-votes": "{{PLURAL:$1|הצבעה אחת|$1 הצבעות}}",
|
||||
"topratings": "דפים המדורגים ביותר",
|
||||
"topratings-no-pages": "דפים שדורגו הכי פחות פעמים.",
|
||||
"right-voteny": "הצבעה על דפים"
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Michawiki"
|
||||
]
|
||||
},
|
||||
"voteny-desc": "Wothłosowanje z tafličku <tt><vote></tt> na zakładźe JavaScripta",
|
||||
"voteny-link": "Wothłosować",
|
||||
"voteny-unvote-link": "Wothłosowanje anulować",
|
||||
"voteny-community-score": "Ličba hłosow zhromadźenstwa: $1",
|
||||
"voteny-ratings": "{{PLURAL:$1|jedne pohódnoćenje|$1 pohódnoćeni|$1 pohódnoćenja|$1 pohódnoćenjow}}",
|
||||
"voteny-remove": "wotstronić",
|
||||
"voteny-gave-this": "sy tutomu $1 dał",
|
||||
"voteny-votes": "{{PLURAL:$1|jedyn hłós|$1 hłosaj|$1 hłosy|$1 hłosow}}",
|
||||
"topratings": "Najwyše pohódnoćene strony",
|
||||
"topratings-no-pages": "Žane najwyše pohódnoćene strony.",
|
||||
"right-voteny": "Wothłosowanske strony"
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"පසිඳු කාවින්ද"
|
||||
]
|
||||
},
|
||||
"voteny-remove": "hapus"
|
||||
}
|
19
i18n/it.json
19
i18n/it.json
|
@ -1,19 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Beta16",
|
||||
"Darth Kule"
|
||||
]
|
||||
},
|
||||
"voteny-desc": "Sistema di voto basato su JavaScript con il tag <tt><vote></tt>",
|
||||
"voteny-link": "Vota",
|
||||
"voteny-unvote-link": "rimuovi voto",
|
||||
"voteny-community-score": "{{PLURAL:$2|punteggio|punteggi}} della comunità: $1",
|
||||
"voteny-ratings": "{{PLURAL:$1|un giudizio|$1 giudizi}}",
|
||||
"voteny-remove": "rimuovi",
|
||||
"voteny-gave-this": "hai dato $1",
|
||||
"voteny-votes": "{{PLURAL:$1|un voto|$1 voti}}",
|
||||
"topratings": "Pagine migliori",
|
||||
"topratings-no-pages": "Nessuna pagina migliore.",
|
||||
"right-voteny": "Vota le pagine"
|
||||
}
|
19
i18n/ja.json
19
i18n/ja.json
|
@ -1,19 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Shirayuki",
|
||||
"Otokoume"
|
||||
]
|
||||
},
|
||||
"voteny-desc": "<tt><vote></tt> タグを使用した、JavaScript ベースの投票",
|
||||
"voteny-link": "投票",
|
||||
"voteny-unvote-link": "投票取り消し",
|
||||
"voteny-community-score": "コミュニティでの{{PLURAL:$2|得点}}: $1",
|
||||
"voteny-ratings": "{{PLURAL:$1|$1 件の評価}}",
|
||||
"voteny-remove": "除去",
|
||||
"voteny-gave-this": "あなたはこれを $1 と評価しました",
|
||||
"voteny-votes": "{{PLURAL:$1|$1 票}}",
|
||||
"topratings": "評価が高いページ",
|
||||
"topratings-no-pages": "評価が高いページはありません。",
|
||||
"right-voteny": "ページに投票"
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"David1010"
|
||||
]
|
||||
},
|
||||
"voteny-link": "ხმის მიცემა",
|
||||
"voteny-remove": "წაშლა"
|
||||
}
|
20
i18n/ko.json
20
i18n/ko.json
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"아라",
|
||||
"Ykhwong"
|
||||
]
|
||||
},
|
||||
"apihelp-voteny-description": "VoteNY API 모듈",
|
||||
"voteny-desc": "<tt><vote></tt> 태그로 자바스크립트 기반 투포",
|
||||
"voteny-link": "투표",
|
||||
"voteny-unvote-link": "투표 취소",
|
||||
"voteny-community-score": "공동체 {{PLURAL:$2|점수}}: $1",
|
||||
"voteny-ratings": "{{PLURAL:$1|평가 한 개|평가 $1개}}",
|
||||
"voteny-remove": "제거",
|
||||
"voteny-gave-this": "이것을 $1(으)로 주었습니다",
|
||||
"voteny-votes": "{{PLURAL:$1|한 표|$1표}}",
|
||||
"topratings": "평가가 높은 문서",
|
||||
"topratings-no-pages": "평가가 높은 문서가 없습니다.",
|
||||
"right-voteny": "문서 투표"
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Purodha"
|
||||
]
|
||||
},
|
||||
"voteny-desc": "Afschtemmonge met JavaSkrep övver dä Befähl <code lang=\"en\"><vote></code>.",
|
||||
"voteny-link": "Afschtemme",
|
||||
"voteny-unvote-link": "Schtemm zerökträke",
|
||||
"voteny-community-score": "Jemeinschafflejje Pünkscher: $1",
|
||||
"voteny-ratings": "{{PLURAL:$1|Ein Bewertong|$1 Bewertonge|Kein Bewertonge}}",
|
||||
"voteny-remove": "fott nämme",
|
||||
"voteny-gave-this": "Do häs en $1 verjovve.",
|
||||
"voteny-votes": "{{PLURAL:$1|Ein Schtemm|$1 Schtemme|Kein Schtemme}}",
|
||||
"topratings": "Sigge met de hühste Bewertonge",
|
||||
"topratings-no-pages": "Kein Sigge met hühste Bewertonge jefonge.",
|
||||
"right-voteny": "Övver Siige afschtemme"
|
||||
}
|
15
i18n/lb.json
15
i18n/lb.json
|
@ -1,15 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Robby"
|
||||
]
|
||||
},
|
||||
"apihelp-voteny-param-voteValue": "Numeresche Wäert fir d'Ofstëmmung tëscht 1 a 5",
|
||||
"apihelp-voteny-example-2": "Läscht Är Stëmm vun der Säit mat der ID-Nummer 666",
|
||||
"voteny-link": "Ofstëmmen",
|
||||
"voteny-unvote-link": "Stëmm zréckzéien",
|
||||
"voteny-remove": "ewechhuelen",
|
||||
"voteny-gave-this": "Dir hutt eng $1 ofginn",
|
||||
"voteny-votes": "({{PLURAL:$1|eng Stëmm|$1 Stëmmen}})",
|
||||
"right-voteny": "Ofstëmmen iwwer Säiten"
|
||||
}
|
28
i18n/mk.json
28
i18n/mk.json
|
@ -1,28 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Bjankuloski06"
|
||||
]
|
||||
},
|
||||
"apihelp-voteny-description": "Приложнички модул VoteNY",
|
||||
"apihelp-voteny-param-what": "Дејството што ќе се преземе; се прифаќаат вредностите „vote“ (зелено гласачка кутија), „multi“ (гласачки ѕвездички) или „delete“ (бришење на претходно даден глас)",
|
||||
"apihelp-voteny-param-pageId": "Назнака на страницата кајшто се наоѓа(ат) гласачката кутија/ѕвездички",
|
||||
"apihelp-voteny-param-voteValue": "Бројчена вредност на гласот меѓу 1 и 5",
|
||||
"apihelp-voteny-param-type": "Укажете „stars“ за да се повикаат гласачките ѕвездички (PHP-класа VoteStars); во спротивно ќе се користи зелената гласачка кутија (PHP-класа Vote)",
|
||||
"apihelp-voteny-example-1": "Дај глас за страница со број 666",
|
||||
"apihelp-voteny-example-2": "Избришете го вашиот глас од страницата со број 666",
|
||||
"apihelp-voteny-example-3": "Дајте глас (3 од 5 ѕвездички) за страницата со назнака 666",
|
||||
"apihelp-voteny-example-4": "Избриеште го гласот од страница со назнака 666 која користи оценување со ѕвездички",
|
||||
"apihelp-voteny-example-5": "Дајте глас (4 од 5 ѕвездички) за страницата со број 666, бришејќи го претходниот глас, ако го има",
|
||||
"voteny-desc": "Гласање на основа на JavaScript со ознаката <tt><vote></tt>",
|
||||
"voteny-link": "Гласај",
|
||||
"voteny-unvote-link": "повлечи глас",
|
||||
"voteny-community-score": "{{PLURAL:$2|оценка|оценки}} од заедницата: $1",
|
||||
"voteny-ratings": "{{PLURAL:$1|една оценка|$1 оценки}}",
|
||||
"voteny-remove": "отстрани",
|
||||
"voteny-gave-this": "страницава ја оценивте со $1",
|
||||
"voteny-votes": "{{PLURAL:$1|еден глас|$1 гласа}}",
|
||||
"topratings": "Водечки страници",
|
||||
"topratings-no-pages": "Нема водечки страници.",
|
||||
"right-voteny": "Гласање за страници"
|
||||
}
|
18
i18n/ms.json
18
i18n/ms.json
|
@ -1,18 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Anakmalaysia"
|
||||
]
|
||||
},
|
||||
"voteny-desc": "Pengundian berasaskan JavaScript dengan teg <tt><vote></tt>",
|
||||
"voteny-link": "Undi",
|
||||
"voteny-unvote-link": "tarik balik undi",
|
||||
"voteny-community-score": "markah komuniti: $1",
|
||||
"voteny-ratings": "$1 penilaian",
|
||||
"voteny-remove": "buang",
|
||||
"voteny-gave-this": "anda memberi yang ini $1",
|
||||
"voteny-votes": "$1 undian",
|
||||
"topratings": "Halaman undian tertinggi",
|
||||
"topratings-no-pages": "Tiada halaman undian tertinggi.",
|
||||
"right-voteny": "Mengundi halaman"
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"C.R."
|
||||
]
|
||||
},
|
||||
"voteny-desc": "Sistema 'e voto basato ncopp'a JavaScript c' 'o tag <tt><vote></tt>",
|
||||
"voteny-link": "Vota",
|
||||
"voteny-unvote-link": "leva voto",
|
||||
"voteny-community-score": "punteggio d' 'a communità: $1",
|
||||
"voteny-ratings": "{{PLURAL:$1|nu judizio|$1 ghiudizie}}",
|
||||
"voteny-remove": "leva",
|
||||
"voteny-gave-this": "hè dato $1",
|
||||
"voteny-votes": "{{PLURAL:$1|nu voto|$1 vote}}",
|
||||
"topratings": "Paggene cchiù mmeglio vutate",
|
||||
"topratings-no-pages": "Nun ce sta paggena mmeglio.",
|
||||
"right-voteny": "Vota 'e paggene"
|
||||
}
|
19
i18n/nl.json
19
i18n/nl.json
|
@ -1,19 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Mitchel Corstjens",
|
||||
"Siebrand"
|
||||
]
|
||||
},
|
||||
"voteny-desc": "Op JavaScript gebaseerde peilingen met het label <code><vote></code>",
|
||||
"voteny-link": "Stemmen",
|
||||
"voteny-unvote-link": "stem intrekken",
|
||||
"voteny-community-score": "gemeenschapsscore: $1",
|
||||
"voteny-ratings": "{{PLURAL:$1|één waardering|$1 waarderingen}}",
|
||||
"voteny-remove": "verwijderen",
|
||||
"voteny-gave-this": "u heeft een $1 gegeven",
|
||||
"voteny-votes": "{{PLURAL:$1|één stem|$1 stemmen}}",
|
||||
"topratings": "Meest gewaardeerde pagina's",
|
||||
"topratings-no-pages": "Er zijn nog geen meest gewaardeerde pagina's.",
|
||||
"right-voteny": "Op pagina's stemmen"
|
||||
}
|
15
i18n/pl.json
15
i18n/pl.json
|
@ -1,15 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Chrumps"
|
||||
]
|
||||
},
|
||||
"apihelp-voteny-description": "Moduł API VoteNY",
|
||||
"voteny-link": "Głosuj",
|
||||
"voteny-unvote-link": "Anuluj",
|
||||
"voteny-community-score": "Wynik wśród społeczności: $1",
|
||||
"voteny-ratings": "{{PLURAL:$1|1 głos|$1 głosy|$1 głosów}}",
|
||||
"voteny-remove": "usuń",
|
||||
"voteny-gave-this": "Oceniłeś to na $1",
|
||||
"voteny-votes": "{{PLURAL:$1|1 głos|$1 głosy|$1 głosów}}"
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Borichèt",
|
||||
"Dragonòt"
|
||||
]
|
||||
},
|
||||
"voteny-desc": "Votassion basà dzor JavaScript con la tichëtta <tt><vote></tt>",
|
||||
"voteny-link": "Voté",
|
||||
"voteny-unvote-link": "scancelé vot",
|
||||
"voteny-community-score": "Pontegi dla comunità: $1",
|
||||
"voteny-ratings": "{{PLURAL:$1|na valutassion|$1 valutassion}}",
|
||||
"voteny-remove": "gava",
|
||||
"voteny-gave-this": "It l'has daje un $1",
|
||||
"voteny-votes": "{{PLURAL:$1|un vot|$1 vot}}",
|
||||
"topratings": "Le pàgine valutà mej",
|
||||
"topratings-no-pages": "Gnun-e pàgine valutà.",
|
||||
"right-voteny": "Pàgine ëd vot"
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Ahmed-Najib-Biabani-Ibrahimkhel"
|
||||
]
|
||||
},
|
||||
"right-voteny": "د رايې مخونه"
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Luckas"
|
||||
]
|
||||
},
|
||||
"voteny-link": "Votar",
|
||||
"voteny-remove": "remover",
|
||||
"voteny-votes": "{{PLURAL:$1|um voto|$1 votos}}"
|
||||
}
|
|
@ -9,25 +9,8 @@
|
|||
"Umherirrender"
|
||||
]
|
||||
},
|
||||
"apihelp-voteny-description": "{{doc-apihelp-description|voteny}}",
|
||||
"apihelp-voteny-param-what": "{{doc-apihelp-param|voteny|what}}",
|
||||
"apihelp-voteny-param-pageId": "{{doc-apihelp-param|voteny|pageId}}",
|
||||
"apihelp-voteny-param-voteValue": "{{doc-apihelp-param|voteny|voteValue}}",
|
||||
"apihelp-voteny-param-type": "{{doc-apihelp-param|voteny|type}}",
|
||||
"apihelp-voteny-example-1": "{{doc-apihelp-example|voteny}}",
|
||||
"apihelp-voteny-example-2": "{{doc-apihelp-example|voteny}}",
|
||||
"apihelp-voteny-example-3": "{{doc-apihelp-example|voteny}}",
|
||||
"apihelp-voteny-example-4": "{{doc-apihelp-example|voteny}}",
|
||||
"apihelp-voteny-example-5": "{{doc-apihelp-example|voteny}}",
|
||||
"voteny-desc": "{{desc|name=Vote NY|url=https://www.mediawiki.org/wiki/Extension:VoteNY}}",
|
||||
"voteny-link": "Link title\n{{Identical|Vote}}",
|
||||
"voteny-unvote-link": "Displayed to the user after their vote has been successfully added; they can click on this link to remove their vote.\n{{Identical|Unvote}}",
|
||||
"voteny-community-score": "Community score is the average of votes a page has been given.\n\nParameters:\n* $1 - the actual score in numbers (i.e. 4.5 or 3)\n* $2 - score count for PLURAL support",
|
||||
"voteny-ratings": "Parameters:\n* $1 - the number of ratings, if said number is greater than 1\n{{Identical|Rating}}",
|
||||
"voteny-remove": "Link title, clicking on this link removes your vote. Refer to the [[mw:File:VoteNY.png|image]] for details.\n{{Identical|Remove}}",
|
||||
"voteny-gave-this": "Followed by the action link text {{msg-mw|Voteny-remove}}.\n\nParameter:\n* $1 - a number, the vote the user gave to the page.\n\nRefer to the [[mw:File:VoteNY.png|image]] for details.",
|
||||
"voteny-votes": "Parameters:\n* $1 - number of votes\n{{Identical|Vote}}",
|
||||
"topratings": "{{doc-special|TopRatings}}",
|
||||
"topratings-no-pages": "Displayed on Special:TopRatings if there are no top rated pages, i.e. if no pages have been rated on the wiki at all.",
|
||||
"right-voteny": "{{doc-right|voteny}}\nRight to place a vote on pages with the extension."
|
||||
"iusethis-link": "Link title\n{{Identical|I use this}}",
|
||||
"iusethis-unvote-link": "Displayed to the user after their vote has been successfully added; they can click on this link to remove their vote.\n{{Identical|I don't use this}}",
|
||||
"iusethis-remove": "Link title, clicking on this link removes your vote. Refer to the [[mw:File:VoteNY.png|image]] for details.\n{{Identical|Remove}}",
|
||||
"right-iusethis": "{{doc-right|iusethis}}\nRight to place a vote on pages with the extension."
|
||||
}
|
||||
|
|
10
i18n/ro.json
10
i18n/ro.json
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Minisarm",
|
||||
"Stelistcristi"
|
||||
]
|
||||
},
|
||||
"voteny-link": "Votați",
|
||||
"voteny-remove": "elimină"
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Joetaras"
|
||||
]
|
||||
},
|
||||
"voteny-desc": "Votazione ca se base sus a JavaScript cu 'u tag <tt><vote></tt>",
|
||||
"voteny-link": "Vote",
|
||||
"voteny-unvote-link": "no vutà",
|
||||
"voteny-community-score": "pundegge d'a comunitate: $1",
|
||||
"voteny-ratings": "{{PLURAL:$1|'na valutazione|$1 valutaziune}}",
|
||||
"voteny-remove": "live",
|
||||
"voteny-gave-this": "Tu è date quiste $1",
|
||||
"voteny-votes": "{{PLURAL:$1|'nu vote|$1 vote}}",
|
||||
"topratings": "Pàggene cchiù vutate",
|
||||
"topratings-no-pages": "Pàggene ca no stonne 'ngape a le vote.",
|
||||
"right-voteny": "Vote le vôsce"
|
||||
}
|
19
i18n/ru.json
19
i18n/ru.json
|
@ -1,19 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Kaganer",
|
||||
"Okras"
|
||||
]
|
||||
},
|
||||
"voteny-desc": "Голосование на основе JavaScript с использованием тега <tt><vote></tt>",
|
||||
"voteny-link": "Голосовать",
|
||||
"voteny-unvote-link": "отменить выбор",
|
||||
"voteny-community-score": "{{PLURAL:$2|оценка|оценки}} сообщества: $1",
|
||||
"voteny-ratings": "{{PLURAL:$1|$1 балл|$1 балла|$1 баллов}}",
|
||||
"voteny-remove": "отменить",
|
||||
"voteny-gave-this": "Вы поставили $1",
|
||||
"voteny-votes": "{{PLURAL:$1|$1 голос|$1 голоса|$1 голосов}}",
|
||||
"topratings": "Самые популярные страницы",
|
||||
"topratings-no-pages": "Нет популярных страниц.",
|
||||
"right-voteny": "Страницы голосований"
|
||||
}
|
17
i18n/si.json
17
i18n/si.json
|
@ -1,17 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"පසිඳු කාවින්ද"
|
||||
]
|
||||
},
|
||||
"voteny-link": "ඡන්දය දෙන්න",
|
||||
"voteny-unvote-link": "මනාපය ලබා නොදෙන්න",
|
||||
"voteny-community-score": "ප්රජා ලකුණ: $1",
|
||||
"voteny-ratings": "{{PLURAL:$1|තරාතිරමක්|තරාතිරම් $1 ක්}}",
|
||||
"voteny-remove": "ඉවත් කරන්න",
|
||||
"voteny-gave-this": "ඔබ මෙයට $1 දී ඇත",
|
||||
"voteny-votes": "{{PLURAL:$1|මනාපයක්|මනාප $1 ක්}}",
|
||||
"topratings": "ඉහළ ශ්රේණිගත පිටු",
|
||||
"topratings-no-pages": "ඉහළ ශ්රේණිගත පිටු නොමැත.",
|
||||
"right-voteny": "මනාප පිටු"
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Milicevic01"
|
||||
]
|
||||
},
|
||||
"right-voteny": "гласање за странице"
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Milicevic01"
|
||||
]
|
||||
},
|
||||
"right-voteny": "glasanje za stranice"
|
||||
}
|
18
i18n/sv.json
18
i18n/sv.json
|
@ -1,18 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"WikiPhoenix"
|
||||
]
|
||||
},
|
||||
"voteny-desc": "JavaScript-baserad omröstning med taggen <tt><vote></tt>",
|
||||
"voteny-link": "Rösta",
|
||||
"voteny-unvote-link": "ta bort röst",
|
||||
"voteny-community-score": "{{PLURAL:$2|gemenskapspoäng}}: $1",
|
||||
"voteny-ratings": "{{PLURAL:$1|ett betyg|$1 betyg}}",
|
||||
"voteny-remove": "ta bort",
|
||||
"voteny-gave-this": "du gav detta $1",
|
||||
"voteny-votes": "{{PLURAL:$1|en röst|$1 röster}}",
|
||||
"topratings": "Topplistade sidor",
|
||||
"topratings-no-pages": "Inga topplistade sidor.",
|
||||
"right-voteny": "Omröstningssidor"
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"மதனாஹரன்"
|
||||
]
|
||||
},
|
||||
"voteny-link": "வாக்களி",
|
||||
"voteny-remove": "நீக்கு"
|
||||
}
|
19
i18n/tl.json
19
i18n/tl.json
|
@ -1,19 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"AnakngAraw",
|
||||
"TheSleepyhollow02"
|
||||
]
|
||||
},
|
||||
"voteny-desc": "Botohan na nakabatay sa JavaScript na mayroong tatak na <tt><bumoto></tt>",
|
||||
"voteny-link": "Bumoto",
|
||||
"voteny-unvote-link": "huwag bumoto",
|
||||
"voteny-community-score": "puntos ng pamayanan: $1",
|
||||
"voteny-ratings": "{{PLURAL:$1|isang pag-aantas|$1 mga pag-aantas}}",
|
||||
"voteny-remove": "tanggalin",
|
||||
"voteny-gave-this": "binigyan mo ito ng isang $1",
|
||||
"voteny-votes": "{{PLURAL:$1| isang boto| $1 mga boto}}",
|
||||
"topratings": "Mga pahinang nangunguna sa pag-aantas",
|
||||
"topratings-no-pages": "Walang mga pahinang nangunguna sa pag-aantas.",
|
||||
"right-voteny": "Iboto ang mga pahina"
|
||||
}
|
29
i18n/uk.json
29
i18n/uk.json
|
@ -1,29 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Base",
|
||||
"Piramidion"
|
||||
]
|
||||
},
|
||||
"apihelp-voteny-description": "Модуль API VoteNY",
|
||||
"apihelp-voteny-param-what": "Дія, яку виконати; дійсними значеннями є 'vote' (зелене поле для голосування), 'multi' (зірочки голосування) або 'delete' (вилучити попередній голос)",
|
||||
"apihelp-voteny-param-pageId": "Ідентифікатор сторінки, на якій розміщені поле/зірочки голосування",
|
||||
"apihelp-voteny-param-voteValue": "Числове значення голосування між 1 і 5",
|
||||
"apihelp-voteny-param-type": "Встановіть це значення як 'stars', щоб викликати зірочки голосування (PHP-клас VoteStars), в іншому випадку буде використано зелене поле голосування (PHP-клас Vote)",
|
||||
"apihelp-voteny-example-1": "Проголосувати для сторінки з ідентифікатором 666",
|
||||
"apihelp-voteny-example-2": "Вилучити Ваш голос зі сторінки з ідентифікатором 666",
|
||||
"apihelp-voteny-example-3": "Проголосувати (3 зірки з 5) для сторінки з ідентифікатором 666",
|
||||
"apihelp-voteny-example-4": "Вилучити голосування зі сторінки з ідентифікатором 666, яка використовує рейтинг у зірочках",
|
||||
"apihelp-voteny-example-5": "Проголосувати (4 зірки з 5) для сторінки з ідентифікатором 666, вилучивши Ваш попередній голос, якщо такий був",
|
||||
"voteny-desc": "Голосування на основі JavaScript із теґом <tt><vote></tt>",
|
||||
"voteny-link": "Голосувати",
|
||||
"voteny-unvote-link": "скасувати голос",
|
||||
"voteny-community-score": "{{PLURAL:$2|середня оцінка|середні оцінки}}: $1",
|
||||
"voteny-ratings": "{{PLURAL:$1|один голос|$1 голоси|$1 голосів}}",
|
||||
"voteny-remove": "вилучити",
|
||||
"voteny-gave-this": "Ви оцінили це як $1",
|
||||
"voteny-votes": "{{PLURAL:$1|один голос|$1 голоси|$1 голосів}}",
|
||||
"topratings": "Сторінки із найвищим оцінками",
|
||||
"topratings-no-pages": "Сторінки із не найвищими оцінками.",
|
||||
"right-voteny": "Голосувати за сторінки"
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Obonggi"
|
||||
]
|
||||
},
|
||||
"apihelp-voteny-param-voteValue": "投票值喺1到5之間",
|
||||
"apihelp-voteny-example-4": "刪除你喺頁面上嘅投票,嗰個投票含有ID號碼666使用咗評星等級。"
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Shirayuki",
|
||||
"Yfdyh000",
|
||||
"Liuxinyu970226",
|
||||
"Hanyanbo98"
|
||||
]
|
||||
},
|
||||
"apihelp-voteny-description": "VoteNY API模块",
|
||||
"apihelp-voteny-param-what": "要进行的操作;有效值为“vote”(绿色投票框)、“multi”(投票星标)或“delete”(删除之前投出的投票)",
|
||||
"apihelp-voteny-param-pageId": "投票框/星标所在页面的页面ID",
|
||||
"apihelp-voteny-param-voteValue": "数字投票值(1~5之间)",
|
||||
"apihelp-voteny-param-type": "将此设置为“stars”来调用投票星标(投票星标PHP类),否则会使用绿色投票框(投票框PHP类)",
|
||||
"apihelp-voteny-example-1": "为ID为666的页面投出一票",
|
||||
"apihelp-voteny-example-2": "删除您为ID为666的页面投出的票",
|
||||
"apihelp-voteny-example-3": "为ID为666的页面投出一票(5颗星中的3颗)",
|
||||
"apihelp-voteny-example-4": "删除您为ID为666的页面(使用星级)投出的票",
|
||||
"apihelp-voteny-example-5": "为ID为666的页面投出一票(5颗星中的4颗),并删除您之前的投票(如果有)",
|
||||
"voteny-desc": "基于JavaScript的投票与<tt><vote></tt>标签",
|
||||
"voteny-link": "投票",
|
||||
"voteny-unvote-link": "消票",
|
||||
"voteny-community-score": "社区{{PLURAL:$2|分数}}:$1",
|
||||
"voteny-ratings": "{{PLURAL:$1|$1人评分}}",
|
||||
"voteny-remove": "删除",
|
||||
"voteny-gave-this": "您给了$1分",
|
||||
"voteny-votes": "{{PLURAL:$1|$1票}}",
|
||||
"topratings": "最受好评的页面",
|
||||
"topratings-no-pages": "没有最受好评的页面。",
|
||||
"right-voteny": "投票页面"
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Justincheng12345",
|
||||
"Shirayuki"
|
||||
]
|
||||
},
|
||||
"voteny-desc": "基於JavaScript的投票與<tt><vote></tt>標記",
|
||||
"voteny-link": "投票",
|
||||
"voteny-unvote-link": "取消投票",
|
||||
"voteny-community-score": "社羣積分:$1",
|
||||
"voteny-ratings": "{{PLURAL:$1|$1個評級}}",
|
||||
"voteny-remove": "移除",
|
||||
"voteny-gave-this": "你給了$1分",
|
||||
"voteny-votes": "{{PLURAL:$1|$1票}}",
|
||||
"topratings": "最受好評的頁面",
|
||||
"topratings-no-pages": "沒有最受好評的頁面。",
|
||||
"right-voteny": "投票頁面"
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 637 B |
Binary file not shown.
Before Width: | Height: | Size: 631 B |
Binary file not shown.
Before Width: | Height: | Size: 627 B |
Binary file not shown.
Before Width: | Height: | Size: 612 B |
|
@ -1,4 +1,4 @@
|
|||
CREATE TABLE /*_*/Vote (
|
||||
CREATE TABLE /*_*/IUseThis (
|
||||
-- Internal ID to identify between different vote tags on different pages
|
||||
`vote_id` int(11) NOT NULL auto_increment PRIMARY KEY,
|
||||
-- Username (if any) of the person who voted
|
||||
|
@ -7,15 +7,12 @@ CREATE TABLE /*_*/Vote (
|
|||
`vote_user_id` int(11) NOT NULL default '0',
|
||||
-- ID of the page where the vote tag is in
|
||||
`vote_page_id` int(11) NOT NULL default '0',
|
||||
-- Value of the vote (ranging from 1 to 5)
|
||||
`vote_value` char(1) character set latin1 collate latin1_bin NOT NULL default '',
|
||||
-- Timestamp when the vote was cast
|
||||
`vote_date` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
-- IP address of the user who voted
|
||||
`vote_ip` varchar(45) NOT NULL default ''
|
||||
) /*$wgDBTableOptions*/;
|
||||
|
||||
CREATE INDEX vote_page_id_index ON /*_*/Vote (vote_page_id);
|
||||
CREATE INDEX valueidx ON /*_*/Vote (vote_value);
|
||||
CREATE INDEX usernameidx ON /*_*/Vote (username);
|
||||
CREATE INDEX vote_date ON /*_*/Vote (vote_date);
|
||||
CREATE INDEX vote_page_id_index ON /*_*/IUseThis (vote_page_id);
|
||||
CREATE INDEX usernameidx ON /*_*/IUseThis (username);
|
||||
CREATE INDEX vote_date ON /*_*/IUseThis (vote_date);
|
|
@ -1,21 +0,0 @@
|
|||
CREATE TABLE "Vote" (
|
||||
-- Internal ID to identify between different vote tags on different pages
|
||||
vote_id SERIAL NOT NULL PRIMARY KEY,
|
||||
-- Username (if any) of the person who voted
|
||||
username varchar(255) NOT NULL default '0',
|
||||
-- User ID of the person who voted
|
||||
vote_user_id integer NOT NULL default '0',
|
||||
-- ID of the page where the vote tag is in
|
||||
vote_page_id integer NOT NULL default '0',
|
||||
-- Value of the vote (ranging from 1 to 5)
|
||||
vote_value integer NOT NULL,
|
||||
-- Timestamp when the vote was cast
|
||||
vote_date timestamp without time zone NOT NULL,
|
||||
-- IP address of the user who voted
|
||||
vote_ip varchar(45) NOT NULL default ''
|
||||
) /*$wgDBTableOptions*/;
|
||||
|
||||
CREATE INDEX vote_page_id_index ON "Vote" (vote_page_id);
|
||||
CREATE INDEX valueidx ON "Vote" (vote_value);
|
||||
CREATE INDEX usernameidx ON "Vote" (username);
|
||||
CREATE INDEX vote_date ON "Vote" (vote_date);
|
Loading…
Reference in a new issue