diff --git a/includes/postratings-activation.php b/includes/postratings-activation.php
index 0411b3b..5994ad1 100644
--- a/includes/postratings-activation.php
+++ b/includes/postratings-activation.php
@@ -58,8 +58,8 @@ function ratings_activate() {
// Add In Options (4 Records)
add_option('postratings_image', 'stars' );
add_option('postratings_max', '5' );
- add_option('postratings_template_vote', '%RATINGS_IMAGES_VOTE% (%RATINGS_USERS% '.__('votes', 'wp-postratings').__(',', 'wp-postratings').' '.__('average', 'wp-postratings').': %RATINGS_AVERAGE% '.__('out of', 'wp-postratings').' %RATINGS_MAX%)
%RATINGS_TEXT%' );
- add_option('postratings_template_text', '%RATINGS_IMAGES% (%RATINGS_USERS% '.__('votes', 'wp-postratings').__(',', 'wp-postratings').' '.__('average', 'wp-postratings').': %RATINGS_AVERAGE% '.__('out of', 'wp-postratings').' %RATINGS_MAX%'.__(',', 'wp-postratings').' '.__('rated', 'wp-postratings').')' );
+ add_option('postratings_template_vote', '%RATINGS_IMAGES_VOTE% (%RATINGS_USERS% %RATINGS_VOTE_TEXT%'.__(',', 'wp-postratings').' '.__('average', 'wp-postratings').': %RATINGS_AVERAGE% '.__('out of', 'wp-postratings').' %RATINGS_MAX%)
%RATINGS_TEXT%' );
+ add_option('postratings_template_text', '%RATINGS_IMAGES% (%RATINGS_USERS% %RATINGS_VOTE_TEXT%'.__(',', 'wp-postratings').' '.__('average', 'wp-postratings').': %RATINGS_AVERAGE% '.__('out of', 'wp-postratings').' %RATINGS_MAX%'.__(',', 'wp-postratings').' '.__('rated', 'wp-postratings').')' );
add_option('postratings_template_none', '%RATINGS_IMAGES_VOTE% ('.__('No Ratings Yet', 'wp-postratings').')
%RATINGS_TEXT%' );
// Database Upgrade For WP-PostRatings 1.02
add_option('postratings_logging_method', '3' );
@@ -74,13 +74,16 @@ function ratings_activate() {
// Database Upgrade For WP-PostRatings 1.20
add_option('postratings_ratingsvalue', array(1,2,3,4,5) );
add_option('postratings_customrating', 0 );
- add_option('postratings_template_permission', '%RATINGS_IMAGES% (%RATINGS_USERS% '.__('votes', 'wp-postratings').__(',', 'wp-postratings').' '.__('average', 'wp-postratings').': %RATINGS_AVERAGE% '.__('out of', 'wp-postratings').' %RATINGS_MAX%)
'.__('You need to be a registered member to rate this.', 'wp-postratings').'' );
+ add_option('postratings_template_permission', '%RATINGS_IMAGES% (%RATINGS_USERS% %RATINGS_VOTE_TEXT%'.__(',', 'wp-postratings').' '.__('average', 'wp-postratings').': %RATINGS_AVERAGE% '.__('out of', 'wp-postratings').' %RATINGS_MAX%)
'.__('You need to be a registered member to rate this.', 'wp-postratings').'' );
// Database Upgrade For WP-PostRatings 1.30
- add_option('postratings_template_mostrated', '
%POST_TITLE% - %RATINGS_USERS% '.__('votes', 'wp-postratings').'' );
+ add_option('postratings_template_mostrated', '%POST_TITLE% - %RATINGS_USERS% %RATINGS_VOTE_TEXT%'.'' );
// Database Upgrade For WP-PostRatings 1.50
delete_option('widget_ratings_highest_rated');
delete_option('widget_ratings_most_rated');
+ add_option('postratings_vote_text_singular', 'vote' );
+ add_option('postratings_vote_text_plural', 'votes' );
+
// Index
$index = $wpdb->get_results( "SHOW INDEX FROM $wpdb->ratings;" );
$key_name = array();
diff --git a/postratings-options.php b/postratings-options.php
index 07db9c4..bc5b2cd 100644
--- a/postratings-options.php
+++ b/postratings-options.php
@@ -45,6 +45,8 @@
$postratings_richsnippet = intval($_POST['postratings_richsnippet']);
$postratings_ratingstext_array = $_POST['postratings_ratingstext'];
$postratings_ratingstext = array();
+ $postratings_vote_text_singular = sanitize_text_field(trim($_POST['postratings_vote_text_singular']));
+ $postratings_vote_text_plural = sanitize_text_field(trim($_POST['postratings_vote_text_plural']));
if( ! empty( $postratings_ratingstext_array ) && is_array( $postratings_ratingstext_array ) ) {
foreach( $postratings_ratingstext_array as $ratingstext ) {
$postratings_ratingstext[] = wp_kses_post(trim( $ratingstext ));
@@ -79,6 +81,8 @@
$update_ratings_queries[] = update_option('postratings_logging_method', $postratings_logging_method);
$update_ratings_queries[] = update_option('postratings_allowtorate', $postratings_allowtorate);
$update_ratings_queries[] = update_option('postratings_options', $postratings_options);
+ $update_ratings_queries[] = update_option('postratings_vote_text_singular', $postratings_vote_text_singular);
+ $update_ratings_queries[] = update_option('postratings_vote_text_plural', $postratings_vote_text_plural);
$update_ratings_text[] = __('Custom Rating', 'wp-postratings');
$update_ratings_text[] = __('Ratings Template Vote', 'wp-postratings');
$update_ratings_text[] = __('Ratings Template Voted', 'wp-postratings');
@@ -94,6 +98,8 @@
$update_ratings_text[] = __('Logging Method', 'wp-postratings');
$update_ratings_text[] = __('Allow To Vote Option', 'wp-postratings');
$update_ratings_text[] = __('Ratings Settings', 'wp-postratings');
+ $update_ratings_text[] = __('Custom vote text (singular)', 'wp-postratings');
+ $update_ratings_text[] = __('Custom vote text (plural)', 'wp-postratings');
$i = 0;
$text = '';
foreach($update_ratings_queries as $update_ratings_query) {
@@ -124,22 +130,22 @@ function ratings_updown_templates(template, print) {
var default_template;
switch(template) {
case "vote":
- default_template = "%RATINGS_IMAGES_VOTE% (%RATINGS_SCORE% %RATINGS_USERS% )
%RATINGS_TEXT%";
+ default_template = "%RATINGS_IMAGES_VOTE% (%RATINGS_SCORE% %RATINGS_USERS% %RATINGS_VOTE_TEXT%)
%RATINGS_TEXT%";
break;
case "text":
- default_template = "%RATINGS_IMAGES% (%RATINGS_SCORE% %RATINGS_USERS% )";
+ default_template = "%RATINGS_IMAGES% (%RATINGS_SCORE% %RATINGS_USERS% %RATINGS_VOTE_TEXT% )";
break;
case "permission":
- default_template = "%RATINGS_IMAGES% (%RATINGS_SCORE% %RATINGS_USERS% )
";
+ default_template = "%RATINGS_IMAGES% (%RATINGS_SCORE% %RATINGS_USERS% %RATINGS_VOTE_TEXT% )
";
break;
case "none":
default_template = "%RATINGS_IMAGES_VOTE% ()
%RATINGS_TEXT%";
break;
case "highestrated":
- default_template = "%POST_TITLE% (%RATINGS_SCORE% %RATINGS_USERS% )";
+ default_template = "%POST_TITLE% (%RATINGS_SCORE% %RATINGS_USERS% %RATINGS_VOTE_TEXT%)";
break;
case "mostrated":
- default_template = "%POST_TITLE% - %RATINGS_USERS% ";
+ default_template = "%POST_TITLE% - %RATINGS_USERS% %RATINGS_VOTE_TEXT%";
break;
}
if(print) {
@@ -152,13 +158,13 @@ function ratings_default_templates(template, print) {
var default_template;
switch(template) {
case "vote":
- default_template = "%RATINGS_IMAGES_VOTE% (%RATINGS_USERS% : %RATINGS_AVERAGE% %RATINGS_MAX%)
%RATINGS_TEXT%";
+ default_template = "%RATINGS_IMAGES_VOTE% (%RATINGS_USERS% %RATINGS_VOTE_TEXT% : %RATINGS_AVERAGE% %RATINGS_MAX%)
%RATINGS_TEXT%";
break;
case "text":
- default_template = "%RATINGS_IMAGES% (%RATINGS_USERS% : %RATINGS_AVERAGE% %RATINGS_MAX% )";
+ default_template = "%RATINGS_IMAGES% (%RATINGS_USERS% %RATINGS_VOTE_TEXT% : %RATINGS_AVERAGE% %RATINGS_MAX% )";
break;
case "permission":
- default_template = "%RATINGS_IMAGES% (%RATINGS_USERS% : %RATINGS_AVERAGE% %RATINGS_MAX%)
";
+ default_template = "%RATINGS_IMAGES% (%RATINGS_USERS% %RATINGS_VOTE_TEXT% : %RATINGS_AVERAGE% %RATINGS_MAX%)
";
break;
case "none":
default_template = "%RATINGS_IMAGES_VOTE% ()
%RATINGS_TEXT%";
@@ -167,7 +173,7 @@ function ratings_default_templates(template, print) {
default_template = "%POST_TITLE% %RATINGS_IMAGES% (%RATINGS_AVERAGE% %RATINGS_MAX%)";
break;
case "mostrated":
- default_template = "%POST_TITLE% - %RATINGS_USERS% ";
+ default_template = "%POST_TITLE% - %RATINGS_USERS% %RATINGS_VOTE_TEXT%";
break;
}
if(print) {
@@ -363,6 +369,21 @@ function set_custom(custom, max) {
+
+