Yasr – Yet Another Stars Rating - Version 0.5.6

Version Description

  • Code cleanup and speed improvement on the [yasr_most_or_highest_rated_posts] chart
  • Bug fixes in setting page
Download this release

Release Info

Developer Dudo
Plugin Icon 128x128 Yasr – Yet Another Stars Rating
Version 0.5.6
Comparing to
See all releases

Code changes from version 0.5.5 to 0.5.6

js/yasr-admin.js CHANGED
@@ -1,3 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  /****** Yasr Metabox overall rating ******/
2
 
3
  function yasrDisplayOverallMetabox(defaultbox, postid, nonce) {
@@ -253,7 +271,7 @@
253
 
254
  /****** Yasr Settings Page ******/
255
 
256
- function YasrSettingsPage (activeTab, nMultiSet, autoInsertEnabled, nonceShortcodeOverall, customText) {
257
 
258
  //-------------------General Settings Code---------------------
259
 
@@ -272,7 +290,7 @@
272
  jQuery('.yasr-auto-insert-options-class').prop('disabled', true);
273
  });
274
 
275
- if (customText == 0) {
276
  jQuery('.yasr-general-options-text-before').prop('disabled', true);
277
  }
278
 
@@ -430,73 +448,6 @@
430
  } //end if active_tab=='manage_multi'
431
 
432
 
433
- //******* Charts page **************
434
- if (activeTab == 'charts_options') {
435
-
436
- //Begin custom top10 highest rated
437
- jQuery('#yasr-pro-customize-overall-off').prop('checked', true);
438
- jQuery('.yasr-pro-customize-overall').prop('disabled', true);
439
- jQuery('#yasr-pro-customize-overall-div').hide();
440
-
441
- jQuery('#yasr-pro-customize-overall-on').on('click', function(){
442
- jQuery('#yasr-pro-customize-overall-div').toggle('slow');
443
- jQuery('.yasr-pro-customize-overall').prop('disabled', false);
444
- });
445
-
446
- jQuery('#yasr-pro-customize-overall-off').on('click', function(){
447
- jQuery('.yasr-pro-customize-overall').prop('disabled', true);
448
- jQuery('#yasr-pro-customize-overall-div').hide();
449
- });
450
-
451
- jQuery('#yasr-pro-customize-charts-text-before-after-overall-no').on('click', function() {
452
- jQuery('#yasr-pro-charts-options-text-before-after-overall-string').prop('disabled', true);
453
- });
454
-
455
- //when button is clicked do this actions
456
- jQuery('#yasr-pro-customize-overall-button').on('click', function() {
457
-
458
- var rows = jQuery('#yasr-pro-customize-charts-rows-number-overall').val();
459
-
460
- var size = jQuery("input[type='radio'][name='yasr-pro-charts-options-size']:checked").val();
461
-
462
- var text_position = jQuery("input[type='radio'][name='yasr-pro-charts-options-text-before-after-overall']:checked").val();
463
-
464
- var text = jQuery('#yasr-pro-charts-options-text-before-after-overall-string').val();
465
-
466
- if (text_position == 'no') {
467
- var shortcode = '[yasr_pro_top_10_overall_rating_custom rows=' + rows + ' size=' + size + ']';
468
- }
469
-
470
- else {
471
- var shortcode = '[yasr_pro_top_10_overall_rating_custom rows=' + rows + ' size=' + size + ' text_position=' + text_position + ' text=' + text + ']';
472
- }
473
-
474
- jQuery('#yasr-pro-shortcode-custom-overall').text(shortcode);
475
- jQuery('#yasr-pro-shortcode-custom-overall-div').show();
476
-
477
- jQuery('#yasr-pro-save-shortcode-overall-button').on('click', function() {
478
-
479
- var data = {
480
- action: 'yasr_pro_send_shortcode_overall',
481
- shortcode: shortcode,
482
- nonce: nonceShortcodeOverall
483
- };
484
-
485
- //Send value to the Server
486
- jQuery.post(ajaxurl, data, function(response) {
487
- jQuery('#yasr-pro-ajax-response-shortcode-overall').text(response);
488
- }) ;
489
-
490
- });
491
-
492
- });
493
-
494
-
495
-
496
- //End custom top10 highest rated
497
-
498
- }
499
-
500
  }
501
 
502
  /****** End Yasr Settings Page ******/
@@ -703,4 +654,4 @@
703
 
704
  });
705
 
706
- /****** End yasr db functions ******/
1
+ /*
2
+
3
+ Copyright 2014 Dario Curvino (email : d.curvino@tiscali.it)
4
+
5
+ This program is free software: you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation, either version 2 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with this program. If not, see <http://www.gnu.org/licenses/>
17
+ */
18
+
19
  /****** Yasr Metabox overall rating ******/
20
 
21
  function yasrDisplayOverallMetabox(defaultbox, postid, nonce) {
271
 
272
  /****** Yasr Settings Page ******/
273
 
274
+ function YasrSettingsPage (activeTab, nMultiSet, autoInsertEnabled, nonceShortcodeOverall) {
275
 
276
  //-------------------General Settings Code---------------------
277
 
290
  jQuery('.yasr-auto-insert-options-class').prop('disabled', true);
291
  });
292
 
293
+ if (jQuery('#yasr_text_before_star_off').is(':checked')) {
294
  jQuery('.yasr-general-options-text-before').prop('disabled', true);
295
  }
296
 
448
  } //end if active_tab=='manage_multi'
449
 
450
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
451
  }
452
 
453
  /****** End Yasr Settings Page ******/
654
 
655
  });
656
 
657
+ /****** End yasr db functions ******/
js/yasr-admin.min.js DELETED
@@ -1 +0,0 @@
1
- function yasrDisplayOverallMetabox(e,t,n){if(e=="stars"){yasrPrintEventSendOverallWithStars(t,n)}else if(e=="numbers"){yasrPrintEventSendOverallWithNumbers(t,n)}}function yasrPrintEventSendOverallWithStars(e,t){jQuery("#yasr_rateit_overall").on("rated",function(){jQuery("#loader-overall-rating").show();var n=jQuery(this);var r=n.rateit("value");var r=r.toFixed(1);var i={action:"yasr_send_overall_rating",nonce:t,rating:r,post_id:e};jQuery.post(ajaxurl,i,function(e){jQuery("#loader-overall-rating").hide();jQuery("#yasr_rateit_overall_value").text(e)})});jQuery("#yasr_rateit_overall").on("reset",function(){jQuery("#loader-overall-rating").show();var n=jQuery(this);var r="-1";var i={action:"yasr_send_overall_rating",nonce:t,rating:r,post_id:e};jQuery.post(ajaxurl,i,function(e){jQuery("#loader-overall-rating").hide();jQuery("#yasr_rateit_overall_value").text(e)})})}function yasrPrintEventSendOverallWithNumbers(e,t){jQuery("#yasr-send-overall-numbers").on("click",function(){var n=jQuery("#yasr-vote-overall-numbers-int").val();var r=jQuery("#yasr-vote-overall-numbers-dec").val();var i=n+"."+r;var s={action:"yasr_send_overall_rating",nonce:t,rating:i,post_id:e};jQuery.post(ajaxurl,s,function(e){jQuery("#yasr-overall-numbers-saved-confirm").text(e)});return false;preventDefault()})}function yasrDisplayMultiMetabox(t,n,r,i){if(t>1){jQuery("#yasr-button-select-set").on("click",function(){var t={action:"yasr_send_id_nameset",set_id:jQuery("#select_set").val(),post_id:n};jQuery("#yasr-loader-select-multi-set").show();jQuery.post(ajaxurl,t,function(e){jQuery("#yasr-loader-select-multi-set").hide();jQuery("#yasr_rateit_multi_rating").html(e);jQuery(".rateit").rateit();jQuery(".multi").on("rated",function(){var e=jQuery(this);var t=e.rateit("value");var t=t.toFixed(1);var i=e.attr("id");var s=jQuery("#select_set").val();jQuery("#yasr-loader-multi-set-field-"+i).show();var o={action:"yasr_send_id_field_with_vote",nonce:r,rating:t,post_id:n,id_field:i,set_type:s};jQuery.post(ajaxurl,o,function(){jQuery("#yasr-loader-multi-set-field-"+i).hide()})});jQuery(".multi").on("reset",function(){var e=jQuery(this);var t="0";var i=e.attr("id");var s=jQuery("#select_set").val();jQuery("#yasr-loader-multi-set-field-"+i).show();var o={action:"yasr_send_id_field_with_vote",nonce:r,rating:t,post_id:n,id_field:i,set_type:s};jQuery.post(ajaxurl,o,function(){jQuery("#yasr-loader-multi-set-field-"+i).hide()})})});return false;e.preventDefault()})}else if(t==1){var s={action:"yasr_send_id_nameset",set_id:i,post_id:n};jQuery.post(ajaxurl,s,function(e){jQuery("#yasr_rateit_multi_rating").html(e);jQuery(".rateit").rateit();jQuery(".multi").on("rated",function(){var e=jQuery(this);var t=e.rateit("value");var t=t.toFixed(1);var s=e.attr("id");jQuery("#yasr-loader-multi-set-field-"+s).show();var o={action:"yasr_send_id_field_with_vote",nonce:r,rating:t,post_id:n,id_field:s,set_type:i};jQuery.post(ajaxurl,o,function(){jQuery("#yasr-loader-multi-set-field-"+s).hide()})});jQuery(".multi").on("reset",function(){var e=jQuery(this);var t="0";var s=e.attr("id");var o=i;jQuery("#yasr-loader-multi-set-field-"+s).show();var u={action:"yasr_send_id_field_with_vote",nonce:r,rating:t,post_id:n,id_field:s,set_type:o};jQuery.post(ajaxurl,u,function(){jQuery("#yasr-loader-multi-set-field-"+s).hide()})})})}}function YasrSettingsPage(e,t,n,r,i){if(e=="general_settings"){if(n==0){jQuery(".yasr-auto-insert-options-class").prop("disabled",true)}jQuery("#yasr_auto_insert_radio_on").on("click",function(){jQuery(".yasr-auto-insert-options-class").prop("disabled",false)});jQuery("#yasr_auto_insert_radio_off").on("click",function(){jQuery(".yasr-auto-insert-options-class").prop("disabled",true)});if(i==0){jQuery(".yasr-general-options-text-before").prop("disabled",true)}jQuery("#yasr_text_before_star_on").on("click",function(){jQuery(".yasr-general-options-text-before").prop("disabled",false);jQuery("#yasr-general-options-custom-text-before-overall").val("Our Score");jQuery("#yasr-general-options-custom-text-before-visitor").val("Our Reader Score");jQuery("#yasr-general-options-custom-text-already-rated").val("You have already voted this article with")});jQuery("#yasr_text_before_star_off").on("click",function(){jQuery(".yasr-general-options-text-before").prop("disabled",true)});jQuery("#yasr-color-scheme-preview-link").on("click",function(){jQuery("#yasr-color-scheme-preview").toggle("slow");return false});jQuery("#yasr-snippet-explained-link").on("click",function(){jQuery("#yasr-snippet-explained").toggle("slow");return false});jQuery("#import-gdstar").on("click",function(){jQuery("#yasr-import-gdstar-div").toggle()});jQuery("#import-button").on("click",function(){var e={action:"yasr_import_step1"};jQuery.post(ajaxurl,e,function(e){jQuery("#result-import").html(e)})});jQuery("#result-import").on("click",".yasr-result-step-1",function(){var e={action:"yasr_import_multi_set"};jQuery.post(ajaxurl,e,function(e){jQuery("#result-import").append(e)})});jQuery("#result-import").on("click",".yasr-result-step-2",function(){location.reload(true)})}if(e=="manage_multi"){jQuery("#yasr-multi-set-doc-link").on("click",function(){jQuery("#yasr-multi-set-doc-box").toggle("slow")});jQuery("#yasr-multi-set-doc-link-hide").on("click",function(){jQuery("#yasr-multi-set-doc-box").toggle("slow")});if(t==1){var s=jQuery("#yasr-edit-form-number-elements").attr("value");s++;jQuery("#yasr-add-field-edit-multiset").on("click",function(){if(s>9){jQuery("#yasr-element-limit").show();jQuery("#yasr-add-field-edit-multiset").hide();return false}var e=jQuery(document.createElement("tr"));e.html('<td colspan="2">Element #'+s+' <input type="text" name="edit-multi-set-element-'+s+'" value="" ></td>');e.appendTo("#yasr-table-form-edit-multi-set");s++})}if(t>1){jQuery("#yasr-button-select-set-edit-form").on("click",function(){var e={action:"yasr_get_multi_set",set_id:jQuery("#yasr_select_edit_set").val()};jQuery.post(ajaxurl,e,function(e){jQuery("#yasr-multi-set-response").show();jQuery("#yasr-multi-set-response").html(e)});return false;preventDefault()});jQuery(document).ajaxComplete(function(){var e=jQuery("#yasr-edit-form-number-elements").attr("value");e++;jQuery("#yasr-add-field-edit-multiset").on("click",function(){if(e>9){jQuery("#yasr-element-limit").show();jQuery("#yasr-add-field-edit-multiset").hide();return false}var t=jQuery(document.createElement("tr"));t.html('<td colspan="2">Element #'+e+' <input type="text" name="edit-multi-set-element-'+e+'" value="" ></td>');t.appendTo("#yasr-table-form-edit-multi-set");e++})})}}if(e=="charts_options"){jQuery("#yasr-pro-customize-overall-off").prop("checked",true);jQuery(".yasr-pro-customize-overall").prop("disabled",true);jQuery("#yasr-pro-customize-overall-div").hide();jQuery("#yasr-pro-customize-overall-on").on("click",function(){jQuery("#yasr-pro-customize-overall-div").toggle("slow");jQuery(".yasr-pro-customize-overall").prop("disabled",false)});jQuery("#yasr-pro-customize-overall-off").on("click",function(){jQuery(".yasr-pro-customize-overall").prop("disabled",true);jQuery("#yasr-pro-customize-overall-div").hide()});jQuery("#yasr-pro-customize-charts-text-before-after-overall-no").on("click",function(){jQuery("#yasr-pro-charts-options-text-before-after-overall-string").prop("disabled",true)});jQuery("#yasr-pro-customize-overall-button").on("click",function(){var e=jQuery("#yasr-pro-customize-charts-rows-number-overall").val();var t=jQuery("input[type='radio'][name='yasr-pro-charts-options-size']:checked").val();var n=jQuery("input[type='radio'][name='yasr-pro-charts-options-text-before-after-overall']:checked").val();var i=jQuery("#yasr-pro-charts-options-text-before-after-overall-string").val();if(n=="no"){var s="[yasr_pro_top_10_overall_rating_custom rows="+e+" size="+t+"]"}else{var s="[yasr_pro_top_10_overall_rating_custom rows="+e+" size="+t+" text_position="+n+" text="+i+"]"}jQuery("#yasr-pro-shortcode-custom-overall").text(s);jQuery("#yasr-pro-shortcode-custom-overall-div").show();jQuery("#yasr-pro-save-shortcode-overall-button").on("click",function(){var e={action:"yasr_pro_send_shortcode_overall",shortcode:s,nonce:r};jQuery.post(ajaxurl,e,function(e){jQuery("#yasr-pro-ajax-response-shortcode-overall").text(e)})})})}}function yasrShortcodeCreator(e){jQuery("#yasr-link-tab-charts").on("click",function(){jQuery("#yasr-link-tab-main").removeClass("nav-tab-active");jQuery("#yasr-link-tab-charts").addClass("nav-tab-active");jQuery("#yasr-content-tab-main").hide();jQuery("#yasr-content-tab-charts").show()});jQuery("#yasr-link-tab-main").on("click",function(){jQuery("#yasr-link-tab-charts").removeClass("nav-tab-active");jQuery("#yasr-link-tab-main").addClass("nav-tab-active");jQuery("#yasr-content-tab-charts").hide();jQuery("#yasr-content-tab-main").show()});jQuery("#yasr-overall").on("click",function(){jQuery("#yasr-overall-choose-size").toggle("slow")});jQuery("#yasr-overall-insert-small").on("click",function(){var e='[yasr_overall_rating size="small"]';tinyMCE.activeEditor.execCommand("mceInsertContent",0,e);jQuery("#yasr-tinypopup-form").dialog("close")});jQuery("#yasr-overall-insert-medium").on("click",function(){var e='[yasr_overall_rating size="medium"]';tinyMCE.activeEditor.execCommand("mceInsertContent",0,e);jQuery("#yasr-tinypopup-form").dialog("close")});jQuery("#yasr-overall-insert-large").on("click",function(){var e='[yasr_overall_rating size="large"]';tinyMCE.activeEditor.execCommand("mceInsertContent",0,e);jQuery("#yasr-tinypopup-form").dialog("close")});jQuery("#yasr-visitor-votes").on("click",function(){jQuery("#yasr-visitor-choose-size").toggle("slow")});jQuery("#yasr-visitor-insert-small").on("click",function(){var e='[yasr_visitor_votes size="small"]';tinyMCE.activeEditor.execCommand("mceInsertContent",0,e);jQuery("#yasr-tinypopup-form").dialog("close")});jQuery("#yasr-visitor-insert-medium").on("click",function(){var e='[yasr_visitor_votes size="medium"]';tinyMCE.activeEditor.execCommand("mceInsertContent",0,e);jQuery("#yasr-tinypopup-form").dialog("close")});jQuery("#yasr-visitor-insert-large").on("click",function(){var e='[yasr_visitor_votes size="large"]';tinyMCE.activeEditor.execCommand("mceInsertContent",0,e);jQuery("#yasr-tinypopup-form").dialog("close")});if(e>1){jQuery(".yasr_tinymce_select_set").on("click",function(){var e=jQuery("input:radio[name=yasr_tinymce_pick_set]:checked").val();var t="[yasr_multiset setid=";t+=e;t+="]";tinyMCE.activeEditor.execCommand("mceInsertContent",0,t);jQuery("#yasr-tinypopup-form").dialog("close")})}else if(e==1){jQuery("#yasr-single-set").on("click",function(){var e=jQuery("#yasr-single-set").val();var t="[yasr_multiset setid=";t+=e;t+="]";tinyMCE.activeEditor.execCommand("mceInsertContent",0,t);jQuery("#yasr-tinypopup-form").dialog("close")})}jQuery("#yasr-top-10-overall-rating").on("click",function(){var e="[yasr_top_ten_highest_rated]";tinyMCE.activeEditor.execCommand("mceInsertContent",0,e);jQuery("#yasr-tinypopup-form").dialog("close")});jQuery("#yasr-10-highest-most-rated").on("click",function(){var e="[yasr_most_or_highest_rated_posts]";tinyMCE.activeEditor.execCommand("mceInsertContent",0,e);jQuery("#yasr-tinypopup-form").dialog("close")});jQuery("#yasr-5-active-reviewers").on("click",function(){var e="[yasr_top_5_reviewers]";tinyMCE.activeEditor.execCommand("mceInsertContent",0,e);jQuery("#yasr-tinypopup-form").dialog("close")});jQuery("#yasr-top-10-active-users").on("click",function(){var e="[yasr_top_ten_active_users]";tinyMCE.activeEditor.execCommand("mceInsertContent",0,e);jQuery("#yasr-tinypopup-form").dialog("close")})}jQuery(document).ready(function(){jQuery(".yasr-log-pagenum").on("click",function(){jQuery("#yasr-loader-log-metabox").show();var e={action:"yasr_change_log_page",pagenum:jQuery(this).val()};jQuery.post(ajaxurl,e,function(e){jQuery("#yasr-loader-log-metabox").hide();jQuery("#yasr-log-container").html(e)})});jQuery(document).ajaxComplete(function(){jQuery(".yasr-log-page-num").on("click",function(){jQuery("#yasr-loader-log-metabox").show();var e={action:"yasr_change_log_page",pagenum:jQuery(this).val()};jQuery.post(ajaxurl,e,function(e){jQuery("#yasr-log-container").html(e)})})})})
 
js/yasr-front.js CHANGED
@@ -1,6 +1,24 @@
1
- /****** Yasr shortcode page ******/
2
 
3
- function yasrVisitorsVotes(tooltipValues, postid, ajaxurl, size, loggedUser, voteIfUserAlredyRated, votes, votesNumber, loaderHtml, nonceVisitor) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
  jQuery("#yasr_rateit_visitor_votes").bind('over', function (event, value) { jQuery(this).attr('title', tooltipValues[value-1]); });
6
 
@@ -118,7 +136,6 @@
118
 
119
  } //End function yasr visitor votes
120
 
121
-
122
  function yasrMostOrHighestRatedChart (ajaxurl) {
123
 
124
  //Link do nothing
@@ -167,4 +184,5 @@
167
 
168
  }
169
 
170
- /****** End Yasr shortcode page ******/
 
1
+ /*
2
 
3
+ Copyright 2014 Dario Curvino (email : d.curvino@tiscali.it)
4
+
5
+ This program is free software: you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation, either version 2 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with this program. If not, see <http://www.gnu.org/licenses/>
17
+ */
18
+
19
+ /****** Yasr shortcode functions file ******/
20
+
21
+ function yasrVisitorsVotes (tooltipValues, postid, ajaxurl, size, loggedUser, voteIfUserAlredyRated, votes, votesNumber, loaderHtml, nonceVisitor) {
22
 
23
  jQuery("#yasr_rateit_visitor_votes").bind('over', function (event, value) { jQuery(this).attr('title', tooltipValues[value-1]); });
24
 
136
 
137
  } //End function yasr visitor votes
138
 
 
139
  function yasrMostOrHighestRatedChart (ajaxurl) {
140
 
141
  //Link do nothing
184
 
185
  }
186
 
187
+
188
+ /****** Yasr shortcode functions file ******/
js/yasr-front.min.js DELETED
@@ -1 +0,0 @@
1
- function yasrVisitorsVotes(e,t,n,r,i,s,o,u,a,f){function p(){jQuery("#yasr_rateit_visitor_votes").on("rated",function(){var e=jQuery(this);var i=e.rateit("value");var i=i.toFixed(1);jQuery("#yasr_visitor_votes").html(a);var s={action:"yasr_send_visitor_rating",rating:i,post_id:t,size:r,nonce_visitor:f};jQuery.post(n,s,function(e){jQuery("#yasr_visitor_votes").html(e);jQuery(".rateit").rateit();jQuery.cookie(l,i,{expires:360})})})}jQuery("#yasr_rateit_visitor_votes").bind("over",function(t,n){jQuery(this).attr("title",e[n-1])});var l="yasr_visitor_vote_"+t;if(s=="0"){s=false}if(!i){if(jQuery.cookie(l)){var c=jQuery.cookie(l);var h={action:"yasr_readonly_visitor_shortcode",size:r,rating:c,votes:o,votes_number:u,post_id:t};jQuery.post(n,h,function(e){jQuery("#yasr_visitor_votes").html(e);jQuery(".rateit").rateit()})}else{p()}}else{if(jQuery.cookie(l)||s!=""){jQuery("#yasr-rateit-visitor-votes-logged-rated").on("rated",function(){var e=jQuery(this);var i=e.rateit("value");var i=i.toFixed(1);jQuery("#yasr_visitor_votes").html(a);var s={action:"yasr_update_visitor_rating",rating:i,post_id:t,size:r,nonce_visitor:f};jQuery.post(n,s,function(e){jQuery("#yasr_visitor_votes").html(e);jQuery(".rateit").rateit();jQuery.cookie(l,i,{expires:360})})})}else if(!jQuery.cookie(l)&&s==""){p()}}}function yasrMostOrHighestRatedChart(e){jQuery("#yasr_multi_chart_link_to_nothing").on("click",function(){return false});var t={action:"yasr_multi_chart_most_highest"};jQuery.post(e,t,function(e){jQuery(".yasr-most-or-highest-rated-posts").html(e);jQuery(".rateit").rateit();jQuery(".yasr-highest-rated-posts").hide();jQuery("#yasr_multi_chart_highest").on("click",function(){jQuery(".yasr-most-rated-posts").hide();jQuery(".yasr-highest-rated-posts").show();return false});jQuery("#yasr_multi_chart_most").on("click",function(){jQuery(".yasr-highest-rated-posts").hide();jQuery(".yasr-most-rated-posts").show();return false})})}
 
languages/yasr-de_DE.mo CHANGED
Binary file
languages/yasr-de_DE.po CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: YASR lenguages\n"
4
- "POT-Creation-Date: 2014-09-15 18:43+0100\n"
5
- "PO-Revision-Date: 2014-09-15 18:43+0100\n"
6
  "Last-Translator: Dario <thedudoworld@gmail.com>\n"
7
  "Language-Team: \n"
8
  "Language: de_DE\n"
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: YASR lenguages\n"
4
+ "POT-Creation-Date: 2014-09-15 18:44+0100\n"
5
+ "PO-Revision-Date: 2014-09-15 18:44+0100\n"
6
  "Last-Translator: Dario <thedudoworld@gmail.com>\n"
7
  "Language-Team: \n"
8
  "Language: de_DE\n"
languages/yasr.mo CHANGED
Binary file
languages/yasr.pot CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: YASR lenguages\n"
4
- "POT-Creation-Date: 2014-09-15 18:43+0100\n"
5
- "PO-Revision-Date: 2014-09-15 18:43+0100\n"
6
  "Last-Translator: Dario <thedudoworld@gmail.com>\n"
7
  "Language-Team: \n"
8
  "Language: En\n"
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: YASR lenguages\n"
4
+ "POT-Creation-Date: 2014-09-15 18:44+0100\n"
5
+ "PO-Revision-Date: 2014-09-15 18:44+0100\n"
6
  "Last-Translator: Dario <thedudoworld@gmail.com>\n"
7
  "Language-Team: \n"
8
  "Language: En\n"
lib/yasr-ajax-functions.php CHANGED
@@ -1,5 +1,23 @@
1
  <?php
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  if ( ! defined( 'ABSPATH' ) ) exit('You\'re not allowed to see this page'); // Exit if accessed directly
4
 
5
  /*************************** Admin ajax functions ***********************/
@@ -1095,112 +1113,4 @@ add_action( 'wp_ajax_yasr_change_log_page', 'yasr_change_log_page_callback' );
1095
 
1096
  } //End callback function
1097
 
1098
-
1099
-
1100
- /****** Order yasr_multi_chart ******/
1101
-
1102
- add_action ( 'wp_ajax_yasr_multi_chart_most_highest', 'yasr_multi_chart_most_highest_callback' );
1103
- add_action ( 'wp_ajax_nopriv_yasr_multi_chart_most_highest', 'yasr_multi_chart_most_highest_callback' );
1104
-
1105
- function yasr_multi_chart_most_highest_callback () {
1106
-
1107
- global $wpdb;
1108
-
1109
- $query_result_most_rated = $wpdb->get_results("SELECT post_id, number_of_votes, sum_votes
1110
- FROM " . YASR_VOTES_TABLE . ", $wpdb->posts AS p
1111
- WHERE post_id = p.ID
1112
- AND number_of_votes >= 1
1113
- AND p.post_status = 'publish'
1114
- ORDER BY number_of_votes DESC, sum_votes DESC LIMIT 10");
1115
-
1116
- $query_result_highest = $wpdb->get_results("SELECT (sum_votes / number_of_votes) as result, post_id, number_of_votes
1117
- FROM " . YASR_VOTES_TABLE . ", $wpdb->posts AS p
1118
- WHERE post_id = p.ID
1119
- AND number_of_votes >= 2
1120
- AND p.post_status = 'publish'
1121
- ORDER BY result DESC, number_of_votes DESC LIMIT 10
1122
- ");
1123
-
1124
- if ($query_result_most_rated) {
1125
-
1126
- echo ( "<table class=\"yasr-most-rated-posts\">
1127
- <tr>
1128
- <th>Post / Page</th>
1129
- <th>Order By:&nbsp;&nbsp; <a href=\"#\" id=\"yasr_multi_chart_link_to_nothing\">Most Rated</a> | <a href=\"#\" id=\"yasr_multi_chart_highest\">Highest Rated</a></th>
1130
- </tr>"
1131
- );
1132
-
1133
- foreach ($query_result_most_rated as $result) {
1134
-
1135
- $rating = $result->sum_votes / $result->number_of_votes;
1136
-
1137
- $rating = round($rating, 1);
1138
-
1139
- $post_title = get_the_title($result->post_id);
1140
-
1141
- $link = get_permalink($result->post_id); //Get permalink from post it
1142
-
1143
- echo ( "<tr>
1144
- <td width=\"60%\"><a href=\"$link\">$post_title</a></td>
1145
- <td width=\"40%\"><div id=\"yasr_visitor_votes\"><div class=\"rateit medium\" data-rateit-starwidth=\"24\" data-rateit-starheight=\"24\" data-rateit-value=\"$rating\" data-rateit-step=\"0.1\" data-rateit-resetable=\"false\" data-rateit-readonly=\"true\"></div>
1146
- <br /> [" . __("Total:" , "yasr") . "$result->number_of_votes &nbsp;&nbsp;&nbsp;" . __("Average" , "yasr") . " $rating]
1147
- </td>
1148
- </tr>"
1149
-
1150
- );
1151
-
1152
-
1153
- } //End foreach
1154
-
1155
- echo ("</table>") ;
1156
-
1157
- } //End if $query_result_most_rated)
1158
-
1159
- else {
1160
- _e("You've not enought data","yasr");
1161
- echo "<br />";
1162
- }
1163
-
1164
-
1165
- if ($query_result_highest) {
1166
-
1167
- echo ( "<table class=\"yasr-highest-rated-posts\">
1168
- <tr>
1169
- <th>Post / Page</th>
1170
- <th>Order By:&nbsp;&nbsp; <a href=\"#\" id=\"yasr_multi_chart_most\">Most Rated</a> | <a href=\"#\" id=\"yasr_multi_chart_link_to_nothing\">Highest Rated</a></th>
1171
- </tr>"
1172
-
1173
- );
1174
-
1175
- foreach ($query_result_highest as $result) {
1176
-
1177
- $rating = round($result->result, 1);
1178
-
1179
- $post_title = get_the_title($result->post_id);
1180
-
1181
- $link = get_permalink($result->post_id); //Get permalink from post it
1182
-
1183
- echo ("<tr>
1184
- <td width=\"60%\"><a href=\"$link\">$post_title</a></td>
1185
- <td width=\"40%\"><div id=\"yasr_visitor_votes\"><div class=\"rateit medium\" data-rateit-starwidth=\"24\" data-rateit-starheight=\"24\" data-rateit-value=\"$rating\" data-rateit-step=\"0.1\" data-rateit-resetable=\"false\" data-rateit-readonly=\"true\"></div>
1186
- <br /> [" . __("Total:" , "yasr") . "$result->number_of_votes &nbsp;&nbsp;&nbsp;" . __("Average" , "yasr") . " $rating]
1187
- </td>
1188
- </tr>");
1189
-
1190
-
1191
- } //End foreach
1192
-
1193
- echo "</table>";
1194
-
1195
- } //end if $query_result
1196
-
1197
- else {
1198
- _e("You've not enought data","yasr");
1199
- echo "<br />";
1200
- }
1201
-
1202
- die();
1203
-
1204
- } //End function
1205
-
1206
- ?>
1
  <?php
2
 
3
+ /*
4
+
5
+ Copyright 2014 Dario Curvino (email : d.curvino@tiscali.it)
6
+
7
+ This program is free software: you can redistribute it and/or modify
8
+ it under the terms of the GNU General Public License as published by
9
+ the Free Software Foundation, either version 2 of the License, or
10
+ (at your option) any later version.
11
+
12
+ This program is distributed in the hope that it will be useful,
13
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ GNU General Public License for more details.
16
+
17
+ You should have received a copy of the GNU General Public License
18
+ along with this program. If not, see <http://www.gnu.org/licenses/>
19
+ */
20
+
21
  if ( ! defined( 'ABSPATH' ) ) exit('You\'re not allowed to see this page'); // Exit if accessed directly
22
 
23
  /*************************** Admin ajax functions ***********************/
1113
 
1114
  } //End callback function
1115
 
1116
+ ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/yasr-db-functions.php CHANGED
@@ -1,5 +1,23 @@
1
  <?php
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  if ( ! defined( 'ABSPATH' ) ) exit('You\'re not allowed to see this page'); // Exit if accessed directly
4
 
5
  /****** Install yasr functions ******/
@@ -415,4 +433,4 @@ function yasr_check_if_user_already_voted() {
415
 
416
  }
417
 
418
- ?>
1
  <?php
2
 
3
+ /*
4
+
5
+ Copyright 2014 Dario Curvino (email : d.curvino@tiscali.it)
6
+
7
+ This program is free software: you can redistribute it and/or modify
8
+ it under the terms of the GNU General Public License as published by
9
+ the Free Software Foundation, either version 2 of the License, or
10
+ (at your option) any later version.
11
+
12
+ This program is distributed in the hope that it will be useful,
13
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ GNU General Public License for more details.
16
+
17
+ You should have received a copy of the GNU General Public License
18
+ along with this program. If not, see <http://www.gnu.org/licenses/>
19
+ */
20
+
21
  if ( ! defined( 'ABSPATH' ) ) exit('You\'re not allowed to see this page'); // Exit if accessed directly
22
 
23
  /****** Install yasr functions ******/
433
 
434
  }
435
 
436
+ ?>
lib/yasr-functions.php CHANGED
@@ -1,5 +1,23 @@
1
  <?php
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  if ( ! defined( 'ABSPATH' ) ) exit('You\'re not allowed to see this page'); // Exit if accessed directly
4
 
5
 
@@ -28,7 +46,7 @@ if ( ! defined( 'ABSPATH' ) ) exit('You\'re not allowed to see this page'); // E
28
 
29
  wp_enqueue_script( 'rateit', YASR_JS_DIR . 'jquery.rateit.min.js' , array('jquery'), '1.0.22', TRUE );
30
  wp_enqueue_script( 'cookie', YASR_JS_DIR . 'jquery-cookie.min.js' , array('jquery', 'rateit'), '1.4.0', TRUE );
31
- wp_enqueue_script( 'yasrfront', YASR_JS_DIR . 'yasr-front.min.js' , array('jquery', 'rateit'), '1.0.00', TRUE );
32
 
33
  }
34
 
@@ -40,7 +58,7 @@ if ( ! defined( 'ABSPATH' ) ) exit('You\'re not allowed to see this page'); // E
40
  wp_enqueue_script( 'rateit', YASR_JS_DIR . 'jquery.rateit.min.js' , array('jquery'), '1.0.20', TRUE );
41
  wp_enqueue_script( 'jquery-ui-dialog' );
42
 
43
- wp_enqueue_script( 'yasradmin', YASR_JS_DIR . 'yasr-admin.min.js' , array('jquery', 'rateit'), '1.0.00', TRUE );
44
 
45
 
46
  }
@@ -392,4 +410,4 @@ add_action( 'admin_init', 'yasr_get_custom_post_type');
392
 
393
  }
394
 
395
- ?>
1
  <?php
2
 
3
+ /*
4
+
5
+ Copyright 2014 Dario Curvino (email : d.curvino@tiscali.it)
6
+
7
+ This program is free software: you can redistribute it and/or modify
8
+ it under the terms of the GNU General Public License as published by
9
+ the Free Software Foundation, either version 2 of the License, or
10
+ (at your option) any later version.
11
+
12
+ This program is distributed in the hope that it will be useful,
13
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ GNU General Public License for more details.
16
+
17
+ You should have received a copy of the GNU General Public License
18
+ along with this program. If not, see <http://www.gnu.org/licenses/>
19
+ */
20
+
21
  if ( ! defined( 'ABSPATH' ) ) exit('You\'re not allowed to see this page'); // Exit if accessed directly
22
 
23
 
46
 
47
  wp_enqueue_script( 'rateit', YASR_JS_DIR . 'jquery.rateit.min.js' , array('jquery'), '1.0.22', TRUE );
48
  wp_enqueue_script( 'cookie', YASR_JS_DIR . 'jquery-cookie.min.js' , array('jquery', 'rateit'), '1.4.0', TRUE );
49
+ wp_enqueue_script( 'yasrfront', YASR_JS_DIR . 'yasr-front.js' , array('jquery', 'rateit'), '1.0.00', TRUE );
50
 
51
  }
52
 
58
  wp_enqueue_script( 'rateit', YASR_JS_DIR . 'jquery.rateit.min.js' , array('jquery'), '1.0.20', TRUE );
59
  wp_enqueue_script( 'jquery-ui-dialog' );
60
 
61
+ wp_enqueue_script( 'yasradmin', YASR_JS_DIR . 'yasr-admin.js' , array('jquery', 'rateit'), '1.0.00', TRUE );
62
 
63
 
64
  }
410
 
411
  }
412
 
413
+ ?>
lib/yasr-settings-functions.php CHANGED
@@ -1,5 +1,23 @@
1
  <?php
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
  /****** Add yasr general option ******/
5
 
@@ -196,6 +214,13 @@
196
  }
197
 
198
  function yasr_custom_text_callback($option) {
 
 
 
 
 
 
 
199
  ?>
200
 
201
  <input type='radio' name='yasr_general_options[text_before_stars]' value='1' id='yasr_text_before_star_on' <?php if ($option['text_before_stars']==1) echo " checked='checked' "; ?> />
@@ -208,17 +233,17 @@
208
 
209
  <br /> <br />
210
 
211
- <input type='text' name='yasr_general_options[text_before_overall]' id="yasr-general-options-custom-text-before-overall" class='yasr-general-options-text-before' value='<?php echo ("$option[text_before_overall]"); ?>' maxlength="40"/>
212
  <?php _e('Custom text to display before Overall Rating', 'yasr')?>
213
 
214
  <br /> <br />
215
 
216
- <input type='text' name='yasr_general_options[text_before_visitor_rating]' id="yasr-general-options-custom-text-before-visitor" class='yasr-general-options-text-before' value='<?php echo ("$option[text_before_visitor_rating]"); ?>' maxlength="40"/>
217
  <?php _e('Custom text to display before Visitor Rating', 'yasr')?>
218
 
219
  <br /> <br />
220
 
221
- <input type='text' name='yasr_general_options[custom_text_user_voted]' id="yasr-general-options-custom-text-already-rated" class='yasr-general-options-text-before' value='<?php echo "$option[custom_text_user_voted]"; ?>' maxlength="60"/>
222
  <?php _e('Custom text to display when a non logged user has already rated', 'yasr')?>
223
 
224
 
@@ -1337,4 +1362,4 @@ function yasr_insert_gdstar_multi_value($multi_datas) {
1337
  /****************************END IMPORT FUNCTIONS******************************/
1338
 
1339
 
1340
- ?>
1
  <?php
2
 
3
+ /*
4
+
5
+ Copyright 2014 Dario Curvino (email : d.curvino@tiscali.it)
6
+
7
+ This program is free software: you can redistribute it and/or modify
8
+ it under the terms of the GNU General Public License as published by
9
+ the Free Software Foundation, either version 2 of the License, or
10
+ (at your option) any later version.
11
+
12
+ This program is distributed in the hope that it will be useful,
13
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ GNU General Public License for more details.
16
+
17
+ You should have received a copy of the GNU General Public License
18
+ along with this program. If not, see <http://www.gnu.org/licenses/>
19
+ */
20
+
21
 
22
  /****** Add yasr general option ******/
23
 
214
  }
215
 
216
  function yasr_custom_text_callback($option) {
217
+
218
+ $text_before_overall = htmlspecialchars("$option[text_before_overall]");
219
+
220
+ $text_before_visitor_rating = htmlspecialchars("$option[text_before_visitor_rating]");
221
+
222
+ $custom_text_user_votes = htmlentities("$option[custom_text_user_voted]");
223
+
224
  ?>
225
 
226
  <input type='radio' name='yasr_general_options[text_before_stars]' value='1' id='yasr_text_before_star_on' <?php if ($option['text_before_stars']==1) echo " checked='checked' "; ?> />
233
 
234
  <br /> <br />
235
 
236
+ <input type='text' name='yasr_general_options[text_before_overall]' id="yasr-general-options-custom-text-before-overall" class='yasr-general-options-text-before' <?php printf('value="%s"', $text_before_overall); ?> maxlength="40"/>
237
  <?php _e('Custom text to display before Overall Rating', 'yasr')?>
238
 
239
  <br /> <br />
240
 
241
+ <input type='text' name='yasr_general_options[text_before_visitor_rating]' id="yasr-general-options-custom-text-before-visitor" class='yasr-general-options-text-before' <?php printf('value="%s"', $text_before_visitor_rating); ?> maxlength="40"/>
242
  <?php _e('Custom text to display before Visitor Rating', 'yasr')?>
243
 
244
  <br /> <br />
245
 
246
+ <input type='text' name='yasr_general_options[custom_text_user_voted]' id="yasr-general-options-custom-text-already-rated" class='yasr-general-options-text-before' <?php printf('value="%s"', $custom_text_user_votes); ?> maxlength="60"/>
247
  <?php _e('Custom text to display when a non logged user has already rated', 'yasr')?>
248
 
249
 
1362
  /****************************END IMPORT FUNCTIONS******************************/
1363
 
1364
 
1365
+ ?>
lib/yasr-shortcode-functions.php CHANGED
@@ -1,5 +1,23 @@
1
  <?php
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  if ( ! defined( 'ABSPATH' ) ) exit('You\'re not allowed to see this page'); // Exit if accessed directly
4
 
5
  /****** Add shortcode for overall rating ******/
@@ -438,11 +456,96 @@ add_shortcode ('yasr_most_or_highest_rated_posts', 'yasr_most_or_highest_rated_p
438
 
439
  function yasr_most_or_highest_rated_posts_callback () {
440
 
441
- $image = YASR_IMG_DIR . "/loader.gif";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
442
 
443
- $loader_html = "<div id=\"loader-most-highest-chart\" >&nbsp; " . __("Chart is loading, please wait","yasr") . " <img src= \" $image \"></div>";
444
 
445
- $shortcode_html = "<div class=\"yasr-most-or-highest-rated-posts\" >" . $loader_html . "</div>";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
446
 
447
  ?>
448
 
@@ -450,10 +553,7 @@ function yasr_most_or_highest_rated_posts_callback () {
450
 
451
  jQuery(document).ready(function() {
452
 
453
- var ajaxurl = <?php echo (json_encode(admin_url('admin-ajax.php'))); ?>;
454
-
455
- yasrMostOrHighestRatedChart (ajaxurl);
456
-
457
 
458
  });
459
 
1
  <?php
2
 
3
+ /*
4
+
5
+ Copyright 2014 Dario Curvino (email : d.curvino@tiscali.it)
6
+
7
+ This program is free software: you can redistribute it and/or modify
8
+ it under the terms of the GNU General Public License as published by
9
+ the Free Software Foundation, either version 2 of the License, or
10
+ (at your option) any later version.
11
+
12
+ This program is distributed in the hope that it will be useful,
13
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ GNU General Public License for more details.
16
+
17
+ You should have received a copy of the GNU General Public License
18
+ along with this program. If not, see <http://www.gnu.org/licenses/>
19
+ */
20
+
21
  if ( ! defined( 'ABSPATH' ) ) exit('You\'re not allowed to see this page'); // Exit if accessed directly
22
 
23
  /****** Add shortcode for overall rating ******/
456
 
457
  function yasr_most_or_highest_rated_posts_callback () {
458
 
459
+ $shortcode_html = "";
460
+
461
+ global $wpdb;
462
+
463
+ $query_result_most_rated = $wpdb->get_results("SELECT post_id, number_of_votes, sum_votes
464
+ FROM " . YASR_VOTES_TABLE . ", $wpdb->posts AS p
465
+ WHERE post_id = p.ID
466
+ AND number_of_votes >= 1
467
+ AND p.post_status = 'publish'
468
+ ORDER BY number_of_votes DESC, sum_votes DESC LIMIT 10");
469
+
470
+ $query_result_highest = $wpdb->get_results("SELECT (sum_votes / number_of_votes) as result, post_id, number_of_votes
471
+ FROM " . YASR_VOTES_TABLE . ", $wpdb->posts AS p
472
+ WHERE post_id = p.ID
473
+ AND number_of_votes >= 2
474
+ AND p.post_status = 'publish'
475
+ ORDER BY result DESC, number_of_votes DESC LIMIT 10
476
+ ");
477
+
478
+ if ($query_result_most_rated) {
479
+
480
+ $shortcode_html .= "<table class=\"yasr-most-rated-posts\">
481
+ <tr>
482
+ <th>Post / Page</th>
483
+ <th>Order By:&nbsp;&nbsp; <a href=\"#\" id=\"yasr_multi_chart_link_to_nothing\">Most Rated</a> | <a href=\"#\" id=\"yasr_multi_chart_highest\">Highest Rated</a></th>
484
+ </tr>"
485
+ ;
486
+
487
+ foreach ($query_result_most_rated as $result) {
488
+
489
+ $rating = $result->sum_votes / $result->number_of_votes;
490
+
491
+ $rating = round($rating, 1);
492
+
493
+ $post_title = get_the_title($result->post_id);
494
+
495
+ $link = get_permalink($result->post_id); //Get permalink from post it
496
+
497
+ $shortcode_html .= "<tr>
498
+ <td width=\"60%\"><a href=\"$link\">$post_title</a></td>
499
+ <td width=\"40%\"><div id=\"yasr_visitor_votes\"><div class=\"rateit medium\" data-rateit-starwidth=\"24\" data-rateit-starheight=\"24\" data-rateit-value=\"$rating\" data-rateit-step=\"0.1\" data-rateit-resetable=\"false\" data-rateit-readonly=\"true\"></div>
500
+ <br /> [" . __("Total:" , "yasr") . "$result->number_of_votes &nbsp;&nbsp;&nbsp;" . __("Average" , "yasr") . " $rating]
501
+ </td>
502
+ </tr>";
503
+
504
+
505
+ } //End foreach
506
+
507
+ $shortcode_html .= "</table>" ;
508
+
509
+ } //End if $query_result_most_rated)
510
+
511
+ else {
512
+ $shortcode_html = __("You've not enought data","yasr") . "<br />";
513
+ }
514
+
515
+
516
+ if ($query_result_highest) {
517
+
518
+ $shortcode_html .= "<table class=\"yasr-highest-rated-posts\">
519
+ <tr>
520
+ <th>Post / Page</th>
521
+ <th>Order By:&nbsp;&nbsp; <a href=\"#\" id=\"yasr_multi_chart_most\">Most Rated</a> | <a href=\"#\" id=\"yasr_multi_chart_link_to_nothing\">Highest Rated</a></th>
522
+ </tr>";
523
 
524
+ foreach ($query_result_highest as $result) {
525
 
526
+ $rating = round($result->result, 1);
527
+
528
+ $post_title = get_the_title($result->post_id);
529
+
530
+ $link = get_permalink($result->post_id); //Get permalink from post it
531
+
532
+ $shortcode_html .= "<tr>
533
+ <td width=\"60%\"><a href=\"$link\">$post_title</a></td>
534
+ <td width=\"40%\"><div id=\"yasr_visitor_votes\"><div class=\"rateit medium\" data-rateit-starwidth=\"24\" data-rateit-starheight=\"24\" data-rateit-value=\"$rating\" data-rateit-step=\"0.1\" data-rateit-resetable=\"false\" data-rateit-readonly=\"true\"></div>
535
+ <br /> [" . __("Total:" , "yasr") . "$result->number_of_votes &nbsp;&nbsp;&nbsp;" . __("Average" , "yasr") . " $rating]
536
+ </td>
537
+ </tr>";
538
+
539
+
540
+ } //End foreach
541
+
542
+ $shortcode_html .= "</table>";
543
+
544
+ } //end if $query_result
545
+
546
+ else {
547
+ $shortcode_html = __("You've not enought data","yasr") . "<br />";
548
+ }
549
 
550
  ?>
551
 
553
 
554
  jQuery(document).ready(function() {
555
 
556
+ yasrMostOrHighestRatedChart ();
 
 
 
557
 
558
  });
559
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
3
  Tags: 5 star, admin, administrator, AJAX, five-star, javascript, jquery, post rating, posts, rate, rating, rating platform, rating system, ratings, review, reviews, rich snippets, seo, star, star rating, stars, vote, Votes, voting, voting contest, schema, serp
4
  Requires at least: 3.5
5
  Tested up to: 4.0
6
- Stable tag: 0.5.5
7
  License: GPL2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -84,6 +84,10 @@ Of course not: you can easily add it on the visual editor just by clicking on th
84
 
85
  == Changelog ==
86
 
 
 
 
 
87
  = 0.5.5 =
88
  * All the javascript have been moved from inline to external. It can be minimized so it's faster. DELETE ALL YOUR CACHES
89
  * Fixed a possible bug if user manually delete data in a table
3
  Tags: 5 star, admin, administrator, AJAX, five-star, javascript, jquery, post rating, posts, rate, rating, rating platform, rating system, ratings, review, reviews, rich snippets, seo, star, star rating, stars, vote, Votes, voting, voting contest, schema, serp
4
  Requires at least: 3.5
5
  Tested up to: 4.0
6
+ Stable tag: 0.5.6
7
  License: GPL2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
84
 
85
  == Changelog ==
86
 
87
+ = 0.5.6 =
88
+ * Code cleanup and speed improvement on the [yasr_most_or_highest_rated_posts] chart
89
+ * Bug fixes in setting page
90
+
91
  = 0.5.5 =
92
  * All the javascript have been moved from inline to external. It can be minimized so it's faster. DELETE ALL YOUR CACHES
93
  * Fixed a possible bug if user manually delete data in a table
yasr-metabox-multiple-rating.php CHANGED
@@ -1,5 +1,23 @@
1
  <?php
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  if ( ! defined( 'ABSPATH' ) ) exit('You\'re not allowed to see this page'); // Exit if accessed directly
4
 
5
  $multi_set=yasr_get_multi_set();
1
  <?php
2
 
3
+ /*
4
+
5
+ Copyright 2014 Dario Curvino (email : d.curvino@tiscali.it)
6
+
7
+ This program is free software: you can redistribute it and/or modify
8
+ it under the terms of the GNU General Public License as published by
9
+ the Free Software Foundation, either version 2 of the License, or
10
+ (at your option) any later version.
11
+
12
+ This program is distributed in the hope that it will be useful,
13
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ GNU General Public License for more details.
16
+
17
+ You should have received a copy of the GNU General Public License
18
+ along with this program. If not, see <http://www.gnu.org/licenses/>
19
+ */
20
+
21
  if ( ! defined( 'ABSPATH' ) ) exit('You\'re not allowed to see this page'); // Exit if accessed directly
22
 
23
  $multi_set=yasr_get_multi_set();
yasr-metabox-overall-rating.php CHANGED
@@ -1,5 +1,23 @@
1
  <?php
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  if ( ! defined( 'ABSPATH' ) ) exit('You\'re not allowed to see this page'); // Exit if accessed directly
4
 
5
  $post_id=get_the_ID();
1
  <?php
2
 
3
+ /*
4
+
5
+ Copyright 2014 Dario Curvino (email : d.curvino@tiscali.it)
6
+
7
+ This program is free software: you can redistribute it and/or modify
8
+ it under the terms of the GNU General Public License as published by
9
+ the Free Software Foundation, either version 2 of the License, or
10
+ (at your option) any later version.
11
+
12
+ This program is distributed in the hope that it will be useful,
13
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ GNU General Public License for more details.
16
+
17
+ You should have received a copy of the GNU General Public License
18
+ along with this program. If not, see <http://www.gnu.org/licenses/>
19
+ */
20
+
21
  if ( ! defined( 'ABSPATH' ) ) exit('You\'re not allowed to see this page'); // Exit if accessed directly
22
 
23
  $post_id=get_the_ID();
yasr-settings-page.php CHANGED
@@ -1,5 +1,23 @@
1
  <?php
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  if ( ! defined( 'ABSPATH' ) ) exit('You\'re not allowed to see this page'); // Exit if accessed directly
4
 
5
  if ( !current_user_can( 'manage_options' ) ) {
@@ -315,7 +333,7 @@ $n_multi_set = NULL;
315
 
316
 
317
 
318
- <script type="text/javascript">
319
 
320
  jQuery( document ).ready(function() {
321
 
@@ -325,10 +343,8 @@ $n_multi_set = NULL;
325
 
326
  var autoInsertEnabled = <?php echo (json_encode(YASR_AUTO_INSERT_ENABLED)); ?>;
327
 
328
- var customText = <?php echo (json_encode(YASR_TEXT_BEFORE_STARS)); ?>
329
-
330
- YasrSettingsPage(activeTab, nMultiSet, autoInsertEnabled, customText);
331
 
332
  }); //End jquery document ready
333
 
334
- </script>
1
  <?php
2
 
3
+ /*
4
+
5
+ Copyright 2014 Dario Curvino (email : d.curvino@tiscali.it)
6
+
7
+ This program is free software: you can redistribute it and/or modify
8
+ it under the terms of the GNU General Public License as published by
9
+ the Free Software Foundation, either version 2 of the License, or
10
+ (at your option) any later version.
11
+
12
+ This program is distributed in the hope that it will be useful,
13
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ GNU General Public License for more details.
16
+
17
+ You should have received a copy of the GNU General Public License
18
+ along with this program. If not, see <http://www.gnu.org/licenses/>
19
+ */
20
+
21
  if ( ! defined( 'ABSPATH' ) ) exit('You\'re not allowed to see this page'); // Exit if accessed directly
22
 
23
  if ( !current_user_can( 'manage_options' ) ) {
333
 
334
 
335
 
336
+ <script type="text/javascript">
337
 
338
  jQuery( document ).ready(function() {
339
 
343
 
344
  var autoInsertEnabled = <?php echo (json_encode(YASR_AUTO_INSERT_ENABLED)); ?>;
345
 
346
+ YasrSettingsPage(activeTab, nMultiSet, autoInsertEnabled);
 
 
347
 
348
  }); //End jquery document ready
349
 
350
+ </script>
yet-another-stars-rating.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Yet Another Stars Rating
4
  * Plugin URI: http://wordpress.org/plugins/yet-another-stars-rating/
5
  * Description: Rating system with rich snippets
6
- * Version: 0.5.5
7
  * Author: Dario Curvino
8
  * Author URI: http://profiles.wordpress.org/dudo/
9
  * License: GPL2
@@ -28,7 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
28
  */
29
 
30
 
31
- define('YASR_VERSION_NUM', '0.5.5');
32
 
33
  //Plugin absolute path
34
  define( "YASR_ABSOLUTE_PATH", dirname(__FILE__) );
3
  * Plugin Name: Yet Another Stars Rating
4
  * Plugin URI: http://wordpress.org/plugins/yet-another-stars-rating/
5
  * Description: Rating system with rich snippets
6
+ * Version: 0.5.6
7
  * Author: Dario Curvino
8
  * Author URI: http://profiles.wordpress.org/dudo/
9
  * License: GPL2
28
  */
29
 
30
 
31
+ define('YASR_VERSION_NUM', '0.5.6');
32
 
33
  //Plugin absolute path
34
  define( "YASR_ABSOLUTE_PATH", dirname(__FILE__) );