WP ULike - Version 1.6

Version Description

  • Added: Comment likes support.
  • Added: BuddyPress activity support.
  • Updated: language files.
Download this release

Release Info

Developer alimir
Plugin Icon 128x128 WP ULike
Version 1.6
Comparing to
See all releases

Code changes from version 1.5 to 1.6

assets/css/wp-ulike-rtl.css CHANGED
@@ -304,4 +304,19 @@ button.close {
304
  margin-left: -5px;
305
  border-bottom-color: #000000;
306
  border-width: 0 5px 5px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
307
  }
304
  margin-left: -5px;
305
  border-bottom-color: #000000;
306
  border-width: 0 5px 5px;
307
+ }
308
+
309
+ .badge {
310
+ display: inline-block;
311
+ min-width: 10px;
312
+ padding: 3px 7px;
313
+ font-size: 12px;
314
+ font-weight: 700;
315
+ line-height: 1;
316
+ color: #FFF;
317
+ text-align: center;
318
+ white-space: nowrap;
319
+ vertical-align: baseline;
320
+ background-color: #777;
321
+ border-radius: 10px;
322
  }
assets/css/wp-ulike.css CHANGED
@@ -305,4 +305,19 @@ button.close {
305
  margin-left: -5px;
306
  border-bottom-color: #000000;
307
  border-width: 0 5px 5px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
308
  }
305
  margin-left: -5px;
306
  border-bottom-color: #000000;
307
  border-width: 0 5px 5px;
308
+ }
309
+
310
+ .badge {
311
+ display: inline-block;
312
+ min-width: 10px;
313
+ padding: 3px 7px;
314
+ font-size: 12px;
315
+ font-weight: 700;
316
+ line-height: 1;
317
+ color: #FFF;
318
+ text-align: center;
319
+ white-space: nowrap;
320
+ vertical-align: baseline;
321
+ background-color: #777;
322
+ border-radius: 10px;
323
  }
assets/js/ulike-comment-function.txt ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function likeThisComment(commentId, n1, n2) {
2
+ if (commentId != '') {
3
+ jQuery('#wp-ulike-comment-' + commentId + ' .counter').html('<a class="loading"></a><span class="count-box">...</span>');
4
+ jQuery.ajax({
5
+ type:'POST',
6
+ url: ulike_obj.ajaxurl,
7
+ data:{
8
+ action:'ulikecommentprocess',
9
+ id: commentId
10
+ },
11
+ success: function(value) {
12
+ if(n1+n2 == 1){
13
+ jQuery('#wp-ulike-comment-' + commentId + ' .counter').html("<a onclick='likeThisComment("+commentId+",1,1)' class='text'>" + ulike_obj.likeText + "</a><span class='count-box'>"+value+"</span>");
14
+ }
15
+ else if(n1+n2 == 2){
16
+ jQuery('#wp-ulike-comment-' + commentId + ' .counter').html("<a onclick='likeThisComment("+commentId+",1,0)' class='text'>" + ulike_obj.disLikeText + "</a><span class='count-box'>"+value+"</span>");
17
+ }
18
+ else if(n1+n2 == 3){
19
+ jQuery('#wp-ulike-comment-' + commentId + ' .counter').html("<a class='text user-tooltip' title='Already Voted'>" + ulike_obj.likeText + "</a><span class='count-box'>"+value+"</span>");
20
+ }
21
+ }
22
+ });
23
+ }
24
+ }
assets/js/{function.txt → ulike-post-function.txt} RENAMED
File without changes
assets/js/wp-ulike.js CHANGED
@@ -1 +1 @@
1
- function likeThis(e,l,s){""!=e&&(jQuery("#wp-ulike-"+e+" .counter").html('<a class="loading"></a><span class="count-box">...</span>'),jQuery.ajax({type:"POST",url:ulike_obj.ajaxurl,data:{action:"ulikeprocess",id:e},success:function(a){l+s==1?jQuery("#wp-ulike-"+e+" .counter").html("<a onclick='likeThis("+e+",1,1)' class='text'>"+ulike_obj.likeText+"</a><span class='count-box'>"+a+"</span>"):l+s==2?jQuery("#wp-ulike-"+e+" .counter").html("<a onclick='likeThis("+e+",1,0)' class='text'>"+ulike_obj.disLikeText+"</a><span class='count-box'>"+a+"</span>"):l+s==3&&jQuery("#wp-ulike-"+e+" .counter").html("<a class='text user-tooltip' title='Already Voted'>"+ulike_obj.likeText+"</a><span class='count-box'>"+a+"</span>")}}))}if(!function(t){"use strict";var e=function(t,e){this.init("tooltip",t,e)};e.prototype={constructor:e,init:function(e,i,n){var o,s,r,a,l;for(this.type=e,this.$element=t(i),this.options=this.getOptions(n),this.enabled=!0,r=this.options.trigger.split(" "),l=r.length;l--;)a=r[l],"click"==a?this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this)):"manual"!=a&&(o="hover"==a?"mouseenter":"focus",s="hover"==a?"mouseleave":"blur",this.$element.on(o+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,t.proxy(this.leave,this)));this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(e){return e=t.extend({},t.fn[this.type].defaults,this.$element.data(),e),e.delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},enter:function(e){var i,n=t.fn[this.type].defaults,o={};return this._options&&t.each(this._options,function(t,e){n[t]!=e&&(o[t]=e)},this),i=t(e.currentTarget)[this.type](o).data(this.type),i.options.delay&&i.options.delay.show?(clearTimeout(this.timeout),i.hoverState="in",void(this.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show))):i.show()},leave:function(e){var i=t(e.currentTarget)[this.type](this._options).data(this.type);return this.timeout&&clearTimeout(this.timeout),i.options.delay&&i.options.delay.hide?(i.hoverState="out",void(this.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide))):i.hide()},show:function(){var e,i,n,o,s,r,a=t.Event("show");if(this.hasContent()&&this.enabled){if(this.$element.trigger(a),a.isDefaultPrevented())return;switch(e=this.tip(),this.setContent(),this.options.animation&&e.addClass("fade"),s="function"==typeof this.options.placement?this.options.placement.call(this,e[0],this.$element[0]):this.options.placement,e.detach().css({top:0,left:0,display:"block"}),this.options.container?e.appendTo(this.options.container):e.insertAfter(this.$element),i=this.getPosition(),n=e[0].offsetWidth,o=e[0].offsetHeight,s){case"bottom":r={top:i.top+i.height,left:i.left+i.width/2-n/2};break;case"top":r={top:i.top-o,left:i.left+i.width/2-n/2};break;case"left":r={top:i.top+i.height/2-o/2,left:i.left-n};break;case"right":r={top:i.top+i.height/2-o/2,left:i.left+i.width}}this.applyPlacement(r,s),this.$element.trigger("shown")}},applyPlacement:function(t,e){var i,n,o,s,r=this.tip(),a=r[0].offsetWidth,l=r[0].offsetHeight;r.offset(t).addClass(e).addClass("in"),i=r[0].offsetWidth,n=r[0].offsetHeight,"top"==e&&n!=l&&(t.top=t.top+l-n,s=!0),"bottom"==e||"top"==e?(o=0,t.left<0&&(o=-2*t.left,t.left=0,r.offset(t),i=r[0].offsetWidth,n=r[0].offsetHeight),this.replaceArrow(o-a+i,i,"left")):this.replaceArrow(n-l,n,"top"),s&&r.offset(t)},replaceArrow:function(t,e,i){this.arrow().css(i,t?50*(1-t/e)+"%":"")},setContent:function(){var t=this.tip(),e=this.getTitle();t.find(".tooltip-inner")[this.options.html?"html":"text"](e),t.removeClass("fade in top bottom left right")},hide:function(){function e(){var e=setTimeout(function(){i.off(t.support.transition.end).detach()},500);i.one(t.support.transition.end,function(){clearTimeout(e),i.detach()})}var i=this.tip(),n=t.Event("hide");return this.$element.trigger(n),n.isDefaultPrevented()?void 0:(i.removeClass("in"),t.support.transition&&this.$tip.hasClass("fade")?e():i.detach(),this.$element.trigger("hidden"),this)},fixTitle:function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("data-original-title"))&&t.attr("data-original-title",t.attr("title")||"").attr("title","")},hasContent:function(){return this.getTitle()},getPosition:function(){var e=this.$element[0];return t.extend({},"function"==typeof e.getBoundingClientRect?e.getBoundingClientRect():{width:e.offsetWidth,height:e.offsetHeight},this.$element.offset())},getTitle:function(){var t,e=this.$element,i=this.options;return t=e.attr("data-original-title")||("function"==typeof i.title?i.title.call(e[0]):i.title)},tip:function(){return this.$tip=this.$tip||t(this.options.template)},arrow:function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(e){var i=e?t(e.currentTarget)[this.type](this._options).data(this.type):this;i.tip().hasClass("in")?i.hide():i.show()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}};var i=t.fn.tooltip;t.fn.tooltip=function(i){return this.each(function(){var n=t(this),o=n.data("tooltip"),s="object"==typeof i&&i;o||n.data("tooltip",o=new e(this,s)),"string"==typeof i&&o[i]()})},t.fn.tooltip.Constructor=e,t.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},t.fn.tooltip.noConflict=function(){return t.fn.tooltip=i,this}}(window.jQuery),"undefined"==typeof jQuery)throw new Error("WP Ulike's JavaScript requires jQuery");if(+function(t){"use strict";function e(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(void 0!==t.style[i])return{end:e[i]};return!1}t.fn.emulateTransitionEnd=function(e){var i=!1,n=this;t(this).one("bsTransitionEnd",function(){i=!0});var o=function(){i||t(n).trigger(t.support.transition.end)};return setTimeout(o,e),this},t(function(){t.support.transition=e(),t.support.transition&&(t.event.special.bsTransitionEnd={bindType:t.support.transition.end,delegateType:t.support.transition.end,handle:function(e){return t(e.target).is(this)?e.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),"undefined"==typeof jQuery)throw new Error("WP Ulike's JavaScript requires jQuery");+function(t){"use strict";function e(e){return this.each(function(){var i=t(this),o=i.data("bs.alert");o||i.data("bs.alert",o=new n(this)),"string"==typeof e&&o[e].call(i)})}var i='[data-dismiss="alert"]',n=function(e){t(e).on("click",i,this.close)};n.VERSION="3.2.0",n.prototype.close=function(e){function i(){s.detach().trigger("closed.bs.alert").remove()}var n=t(this),o=n.attr("data-target");o||(o=n.attr("href"),o=o&&o.replace(/.*(?=#[^\s]*$)/,""));var s=t(o);e&&e.preventDefault(),s.length||(s=n.hasClass("alert")?n:n.parent()),s.trigger(e=t.Event("close.bs.alert")),e.isDefaultPrevented()||(s.removeClass("in"),t.support.transition&&s.hasClass("fade")?s.one("bsTransitionEnd",i).emulateTransitionEnd(150):i())};var o=t.fn.alert;t.fn.alert=e,t.fn.alert.Constructor=n,t.fn.alert.noConflict=function(){return t.fn.alert=o,this},t(document).on("click.bs.alert.data-api",i,n.prototype.close)}(jQuery),jQuery(document).ready(function(t){t(".user-tooltip").tooltip()});
1
+ function likeThis(e,l,s){""!=e&&(jQuery("#wp-ulike-"+e+" .counter").html('<a class="loading"></a><span class="count-box">...</span>'),jQuery.ajax({type:"POST",url:ulike_obj.ajaxurl,data:{action:"ulikeprocess",id:e},success:function(a){l+s==1?jQuery("#wp-ulike-"+e+" .counter").html("<a onclick='likeThis("+e+",1,1)' class='text'>"+ulike_obj.likeText+"</a><span class='count-box'>"+a+"</span>"):l+s==2?jQuery("#wp-ulike-"+e+" .counter").html("<a onclick='likeThis("+e+",1,0)' class='text'>"+ulike_obj.disLikeText+"</a><span class='count-box'>"+a+"</span>"):l+s==3&&jQuery("#wp-ulike-"+e+" .counter").html("<a class='text user-tooltip' title='Already Voted'>"+ulike_obj.likeText+"</a><span class='count-box'>"+a+"</span>")}}))}function likeThisComment(e,t,n){if(e!=""){jQuery("#wp-ulike-comment-"+e+" .counter").html('<a class="loading"></a><span class="count-box">...</span>');jQuery.ajax({type:"POST",url:ulike_obj.ajaxurl,data:{action:"ulikecommentprocess",id:e},success:function(r){if(t+n==1){jQuery("#wp-ulike-comment-"+e+" .counter").html("<a onclick='likeThisComment("+e+",1,1)' class='text'>"+ulike_obj.likeText+"</a><span class='count-box'>"+r+"</span>")}else if(t+n==2){jQuery("#wp-ulike-comment-"+e+" .counter").html("<a onclick='likeThisComment("+e+",1,0)' class='text'>"+ulike_obj.disLikeText+"</a><span class='count-box'>"+r+"</span>")}else if(t+n==3){jQuery("#wp-ulike-comment-"+e+" .counter").html("<a class='text user-tooltip' title='Already Voted'>"+ulike_obj.likeText+"</a><span class='count-box'>"+r+"</span>")}}})}}if(!function(t){"use strict";var e=function(t,e){this.init("tooltip",t,e)};e.prototype={constructor:e,init:function(e,i,n){var o,s,r,a,l;for(this.type=e,this.$element=t(i),this.options=this.getOptions(n),this.enabled=!0,r=this.options.trigger.split(" "),l=r.length;l--;)a=r[l],"click"==a?this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this)):"manual"!=a&&(o="hover"==a?"mouseenter":"focus",s="hover"==a?"mouseleave":"blur",this.$element.on(o+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,t.proxy(this.leave,this)));this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(e){return e=t.extend({},t.fn[this.type].defaults,this.$element.data(),e),e.delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},enter:function(e){var i,n=t.fn[this.type].defaults,o={};return this._options&&t.each(this._options,function(t,e){n[t]!=e&&(o[t]=e)},this),i=t(e.currentTarget)[this.type](o).data(this.type),i.options.delay&&i.options.delay.show?(clearTimeout(this.timeout),i.hoverState="in",void(this.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show))):i.show()},leave:function(e){var i=t(e.currentTarget)[this.type](this._options).data(this.type);return this.timeout&&clearTimeout(this.timeout),i.options.delay&&i.options.delay.hide?(i.hoverState="out",void(this.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide))):i.hide()},show:function(){var e,i,n,o,s,r,a=t.Event("show");if(this.hasContent()&&this.enabled){if(this.$element.trigger(a),a.isDefaultPrevented())return;switch(e=this.tip(),this.setContent(),this.options.animation&&e.addClass("fade"),s="function"==typeof this.options.placement?this.options.placement.call(this,e[0],this.$element[0]):this.options.placement,e.detach().css({top:0,left:0,display:"block"}),this.options.container?e.appendTo(this.options.container):e.insertAfter(this.$element),i=this.getPosition(),n=e[0].offsetWidth,o=e[0].offsetHeight,s){case"bottom":r={top:i.top+i.height,left:i.left+i.width/2-n/2};break;case"top":r={top:i.top-o,left:i.left+i.width/2-n/2};break;case"left":r={top:i.top+i.height/2-o/2,left:i.left-n};break;case"right":r={top:i.top+i.height/2-o/2,left:i.left+i.width}}this.applyPlacement(r,s),this.$element.trigger("shown")}},applyPlacement:function(t,e){var i,n,o,s,r=this.tip(),a=r[0].offsetWidth,l=r[0].offsetHeight;r.offset(t).addClass(e).addClass("in"),i=r[0].offsetWidth,n=r[0].offsetHeight,"top"==e&&n!=l&&(t.top=t.top+l-n,s=!0),"bottom"==e||"top"==e?(o=0,t.left<0&&(o=-2*t.left,t.left=0,r.offset(t),i=r[0].offsetWidth,n=r[0].offsetHeight),this.replaceArrow(o-a+i,i,"left")):this.replaceArrow(n-l,n,"top"),s&&r.offset(t)},replaceArrow:function(t,e,i){this.arrow().css(i,t?50*(1-t/e)+"%":"")},setContent:function(){var t=this.tip(),e=this.getTitle();t.find(".tooltip-inner")[this.options.html?"html":"text"](e),t.removeClass("fade in top bottom left right")},hide:function(){function e(){var e=setTimeout(function(){i.off(t.support.transition.end).detach()},500);i.one(t.support.transition.end,function(){clearTimeout(e),i.detach()})}var i=this.tip(),n=t.Event("hide");return this.$element.trigger(n),n.isDefaultPrevented()?void 0:(i.removeClass("in"),t.support.transition&&this.$tip.hasClass("fade")?e():i.detach(),this.$element.trigger("hidden"),this)},fixTitle:function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("data-original-title"))&&t.attr("data-original-title",t.attr("title")||"").attr("title","")},hasContent:function(){return this.getTitle()},getPosition:function(){var e=this.$element[0];return t.extend({},"function"==typeof e.getBoundingClientRect?e.getBoundingClientRect():{width:e.offsetWidth,height:e.offsetHeight},this.$element.offset())},getTitle:function(){var t,e=this.$element,i=this.options;return t=e.attr("data-original-title")||("function"==typeof i.title?i.title.call(e[0]):i.title)},tip:function(){return this.$tip=this.$tip||t(this.options.template)},arrow:function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(e){var i=e?t(e.currentTarget)[this.type](this._options).data(this.type):this;i.tip().hasClass("in")?i.hide():i.show()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}};var i=t.fn.tooltip;t.fn.tooltip=function(i){return this.each(function(){var n=t(this),o=n.data("tooltip"),s="object"==typeof i&&i;o||n.data("tooltip",o=new e(this,s)),"string"==typeof i&&o[i]()})},t.fn.tooltip.Constructor=e,t.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},t.fn.tooltip.noConflict=function(){return t.fn.tooltip=i,this}}(window.jQuery),"undefined"==typeof jQuery)throw new Error("WP Ulike's JavaScript requires jQuery");if(+function(t){"use strict";function e(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(void 0!==t.style[i])return{end:e[i]};return!1}t.fn.emulateTransitionEnd=function(e){var i=!1,n=this;t(this).one("bsTransitionEnd",function(){i=!0});var o=function(){i||t(n).trigger(t.support.transition.end)};return setTimeout(o,e),this},t(function(){t.support.transition=e(),t.support.transition&&(t.event.special.bsTransitionEnd={bindType:t.support.transition.end,delegateType:t.support.transition.end,handle:function(e){return t(e.target).is(this)?e.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),"undefined"==typeof jQuery)throw new Error("WP Ulike's JavaScript requires jQuery");+function(t){"use strict";function e(e){return this.each(function(){var i=t(this),o=i.data("bs.alert");o||i.data("bs.alert",o=new n(this)),"string"==typeof e&&o[e].call(i)})}var i='[data-dismiss="alert"]',n=function(e){t(e).on("click",i,this.close)};n.VERSION="3.2.0",n.prototype.close=function(e){function i(){s.detach().trigger("closed.bs.alert").remove()}var n=t(this),o=n.attr("data-target");o||(o=n.attr("href"),o=o&&o.replace(/.*(?=#[^\s]*$)/,""));var s=t(o);e&&e.preventDefault(),s.length||(s=n.hasClass("alert")?n:n.parent()),s.trigger(e=t.Event("close.bs.alert")),e.isDefaultPrevented()||(s.removeClass("in"),t.support.transition&&s.hasClass("fade")?s.one("bsTransitionEnd",i).emulateTransitionEnd(150):i())};var o=t.fn.alert;t.fn.alert=e,t.fn.alert.Constructor=n,t.fn.alert.noConflict=function(){return t.fn.alert=o,this},t(document).on("click.bs.alert.data-api",i,n.prototype.close)}(jQuery),jQuery(document).ready(function(t){t(".user-tooltip").tooltip()});
inc/wp-functions.php CHANGED
@@ -47,6 +47,25 @@
47
 
48
  }
49
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  //get user status (like or dislike)
51
  function get_user_status($post_ID,$user_ID){
52
  global $wpdb;
@@ -57,6 +76,16 @@
57
  return "dislike";
58
  }
59
 
 
 
 
 
 
 
 
 
 
 
60
  //get user style settings
61
  function get_user_style(){
62
  $btn_style = '';
@@ -100,6 +129,33 @@
100
  ";
101
  }
102
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  //Convert numbers of Likes with string (kilobyte) format.
104
  function wp_ulike_format_number($num){
105
  if ($num >= 1000 && get_option('wp_ulike_format_number') == '1'){
@@ -107,7 +163,7 @@
107
  }
108
  else
109
  return $num . '+';
110
- }
111
 
112
  //Shortcode function
113
  function wp_ulike_shortcode(){
@@ -125,4 +181,14 @@
125
  }
126
 
127
  add_filter('the_content', 'wp_put_ulike');
 
 
 
 
 
 
 
 
 
 
128
  }
47
 
48
  }
49
 
50
+ //get users comments data and list their avatar
51
+ function get_user_comments_data($CommentID,$user_ID){
52
+ global $wpdb;
53
+ $users_list = '';
54
+
55
+ $get_users = $wpdb->get_results("SELECT user_id FROM ".$wpdb->prefix."ulike_comments WHERE comment_id = '$CommentID'");
56
+
57
+ foreach ( $get_users as $get_user )
58
+ {
59
+ if ($user_ID != $get_user->user_id):
60
+ $user_info = get_userdata($get_user->user_id);
61
+ $users_list .= '<li><a class="user-tooltip" title="'.$user_info->display_name.'">'.get_avatar( $user_info->user_email, 32, '' , 'avatar').'</a></li>';
62
+ endif;
63
+ }
64
+
65
+ return $users_list;
66
+
67
+ }
68
+
69
  //get user status (like or dislike)
70
  function get_user_status($post_ID,$user_ID){
71
  global $wpdb;
76
  return "dislike";
77
  }
78
 
79
+ //get user comment status (like or dislike)
80
+ function get_user_comments_status($CommentID,$user_ID){
81
+ global $wpdb;
82
+ $like_status = $wpdb->get_var("SELECT status FROM ".$wpdb->prefix."ulike_comments WHERE comment_id = '$CommentID' AND user_id = '$user_ID'");
83
+ if ($like_status == "like")
84
+ return "like";
85
+ else
86
+ return "dislike";
87
+ }
88
+
89
  //get user style settings
90
  function get_user_style(){
91
  $btn_style = '';
129
  ";
130
  }
131
 
132
+ function wp_ulike_bp_activity_add($user_ID,$cp_ID,$type){
133
+ if (function_exists('bp_is_active') && get_option('wp_ulike_bp_activity_add') == '1') {
134
+ if($type=='comment'){
135
+ bp_activity_add( array(
136
+ 'user_id' => $user_ID,
137
+ 'action' => '<strong>'.bp_core_get_userlink($user_ID).'</strong> '.__('liked','alimir').' <strong>'.get_comment_author($cp_ID).'</strong> '.__('comment','alimir').'. (So far, '.get_comment_author($cp_ID).' has <span class="badge">'. get_comment_meta($cp_ID, '_commentliked', true) .'</span> likes for this comment)',
138
+ 'component' => 'wp_like',
139
+ 'type' => 'wp_like_group',
140
+ 'item_id' => $cp_ID
141
+ ));
142
+ }
143
+ else if($type=='post'){
144
+ $parent_title = get_the_title($cp_ID);
145
+ bp_activity_add( array(
146
+ 'user_id' => $user_ID,
147
+ 'action' => '<strong>'.bp_core_get_userlink($user_ID).'</strong> '.__('liked','alimir').' <a href="'.get_permalink($cp_ID). '" title="'.$parent_title.'">'.$parent_title.'</a>. (So far, This post has <span class="badge">'.get_post_meta($cp_ID, '_liked', true).'</span> likes)',
148
+ 'component' => 'wp_like',
149
+ 'type' => 'wp_like_group',
150
+ 'item_id' => $cp_ID
151
+ ));
152
+ }
153
+ }
154
+ else{
155
+ return '';
156
+ }
157
+ }
158
+
159
  //Convert numbers of Likes with string (kilobyte) format.
160
  function wp_ulike_format_number($num){
161
  if ($num >= 1000 && get_option('wp_ulike_format_number') == '1'){
163
  }
164
  else
165
  return $num . '+';
166
+ }
167
 
168
  //Shortcode function
169
  function wp_ulike_shortcode(){
181
  }
182
 
183
  add_filter('the_content', 'wp_put_ulike');
184
+ }
185
+
186
+ //add ULike button to the comments
187
+ if (get_option('wp_ulike_onComments') == '1' && !is_admin()) {
188
+ function wp_put_ulike_comments($content) {
189
+ $content.= wp_ulike_comments('put');
190
+ return $content;
191
+ }
192
+
193
+ add_filter('comment_text', 'wp_put_ulike_comments');
194
  }
inc/wp-options.php CHANGED
@@ -8,11 +8,13 @@ add_action('admin_menu', 'wp_ulike_adminMenu');
8
 
9
  function wp_ulike_register_mysettings() { // whitelist options
10
  register_setting( 'wp_ulike_options', 'wp_ulike_onPage' );
 
11
  register_setting( 'wp_ulike_options', 'wp_ulike_textOrImage' );
12
  register_setting( 'wp_ulike_options', 'wp_ulike_text' );
13
  register_setting( 'wp_ulike_options', 'wp_ulike_btn_text' );
14
  register_setting( 'wp_ulike_options', 'wp_ulike_dislike_text' );
15
  register_setting( 'wp_ulike_options', 'wp_ulike_onlyRegistered' );
 
16
  register_setting( 'wp_ulike_options', 'wp_ulike_user_like_box' );
17
  register_setting( 'wp_ulike_options', 'wp_ulike_format_number' );
18
  register_setting( 'wp_ulike_options', 'wp_ulike_style' );
@@ -75,16 +77,36 @@ function wp_ulike_settings_page() {
75
  <p class="description"><?php _e('If you disable this option, you have to put manually the code', 'alimir'); ?><code dir="ltr">&lt;?php if(function_exists('wp_ulike')) wp_ulike('get'); ?&gt;</code> <?php _e('wherever you want in your template.', 'alimir'); ?></p>
76
  </td>
77
  </tr>
 
 
 
 
 
 
 
 
 
 
78
  <tr>
79
  <th scope="row"><?php _e('Only registered Users', 'alimir'); ?></th>
80
  <td>
81
  <label for="wp_ulike_onlyRegistered">
82
  <input name="wp_ulike_onlyRegistered" id="wp_ulike_onlyRegistered" type="checkbox" value="1" <?php checked( '1', get_option( 'wp_ulike_onlyRegistered' ) ); ?> />
83
- <?php _e('<strong>Active</strong> this option.', 'alimir'); ?>
84
  </label>
85
  <p class="description"><?php _e('<strong>Only</strong> registered users have permission to like posts.', 'alimir'); ?></p>
86
  </td>
87
  </tr>
 
 
 
 
 
 
 
 
 
 
88
  <tr>
89
  <th scope="row"><?php _e('Show Users Like Box', 'alimir'); ?></th>
90
  <td>
8
 
9
  function wp_ulike_register_mysettings() { // whitelist options
10
  register_setting( 'wp_ulike_options', 'wp_ulike_onPage' );
11
+ register_setting( 'wp_ulike_options', 'wp_ulike_onComments' );
12
  register_setting( 'wp_ulike_options', 'wp_ulike_textOrImage' );
13
  register_setting( 'wp_ulike_options', 'wp_ulike_text' );
14
  register_setting( 'wp_ulike_options', 'wp_ulike_btn_text' );
15
  register_setting( 'wp_ulike_options', 'wp_ulike_dislike_text' );
16
  register_setting( 'wp_ulike_options', 'wp_ulike_onlyRegistered' );
17
+ register_setting( 'wp_ulike_options', 'wp_ulike_bp_activity_add' );
18
  register_setting( 'wp_ulike_options', 'wp_ulike_user_like_box' );
19
  register_setting( 'wp_ulike_options', 'wp_ulike_format_number' );
20
  register_setting( 'wp_ulike_options', 'wp_ulike_style' );
77
  <p class="description"><?php _e('If you disable this option, you have to put manually the code', 'alimir'); ?><code dir="ltr">&lt;?php if(function_exists('wp_ulike')) wp_ulike('get'); ?&gt;</code> <?php _e('wherever you want in your template.', 'alimir'); ?></p>
78
  </td>
79
  </tr>
80
+ <tr>
81
+ <th scope="row"><?php _e('Comment likes', 'alimir'); ?></th>
82
+ <td>
83
+ <label for="wp_ulike_onComments">
84
+ <input name="wp_ulike_onComments" id="wp_ulike_onComments" type="checkbox" value="1" <?php checked( '1', get_option( 'wp_ulike_onComments' ) ); ?> />
85
+ <?php _e('<strong>On all comments</strong> at the bottom of the comment', 'alimir'); ?>
86
+ </label>
87
+ <p class="description"><?php _e('If you disable this option, you have to put manually this code on comments text', 'alimir'); ?><code dir="ltr">&lt;?php if(function_exists('wp_ulike_comments')) wp_ulike_comments('get'); ?&gt;</code></p>
88
+ </td>
89
+ </tr>
90
  <tr>
91
  <th scope="row"><?php _e('Only registered Users', 'alimir'); ?></th>
92
  <td>
93
  <label for="wp_ulike_onlyRegistered">
94
  <input name="wp_ulike_onlyRegistered" id="wp_ulike_onlyRegistered" type="checkbox" value="1" <?php checked( '1', get_option( 'wp_ulike_onlyRegistered' ) ); ?> />
95
+ <?php _e('Activate', 'alimir'); ?>
96
  </label>
97
  <p class="description"><?php _e('<strong>Only</strong> registered users have permission to like posts.', 'alimir'); ?></p>
98
  </td>
99
  </tr>
100
+ <tr>
101
+ <th scope="row"><?php _e('BuddyPress Activity', 'alimir'); ?></th>
102
+ <td>
103
+ <label for="wp_ulike_bp_activity_add">
104
+ <input name="wp_ulike_bp_activity_add" id="wp_ulike_bp_activity_add" type="checkbox" value="1" <?php checked( '1', get_option( 'wp_ulike_bp_activity_add' ) ); ?> />
105
+ <?php _e('Activate', 'alimir'); ?>
106
+ </label>
107
+ <p class="description"><?php _e('insert new likes in buddyPress activity page', 'alimir'); ?></p>
108
+ </td>
109
+ </tr>
110
  <tr>
111
  <th scope="row"><?php _e('Show Users Like Box', 'alimir'); ?></th>
112
  <td>
inc/wp-script.php CHANGED
@@ -11,6 +11,8 @@ function enqueueScripts() {
11
  ));
12
  add_action('wp_ajax_ulikeprocess','wp_ulike_process');
13
  add_action('wp_ajax_nopriv_ulikeprocess', 'wp_ulike_process');
 
 
14
  }
15
 
16
  function enqueueStyle() {
11
  ));
12
  add_action('wp_ajax_ulikeprocess','wp_ulike_process');
13
  add_action('wp_ajax_nopriv_ulikeprocess', 'wp_ulike_process');
14
+ add_action('wp_ajax_ulikecommentprocess','wp_ulike_comments_process');
15
+ add_action('wp_ajax_nopriv_ulikecommentprocess', 'wp_ulike_comments_process');
16
  }
17
 
18
  function enqueueStyle() {
inc/wp-ulike-comments.php ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //main comments function
3
+ function wp_ulike_comments($arg) {
4
+
5
+ global $wpdb,$user_ID;
6
+ $CommentID = get_comment_ID();
7
+ $counter = '';
8
+ $get_like = get_comment_meta($CommentID, '_commentliked', true) != '' ? get_comment_meta($CommentID, '_commentliked', true) : '0';
9
+ $liked = wp_ulike_format_number($get_like);
10
+
11
+ if ( (get_option('wp_ulike_onlyRegistered') != '1') or (get_option('wp_ulike_onlyRegistered') == '1' && is_user_logged_in()) ){
12
+
13
+ if(is_user_logged_in()){
14
+ $user_status = $wpdb->get_var("SELECT COUNT(*) FROM ".$wpdb->prefix."ulike_comments WHERE comment_id = '$CommentID' AND user_id = '$user_ID'");
15
+
16
+ if(!isset($_COOKIE['comment-liked-'.$CommentID]) && $user_status == 0){
17
+ if (get_option('wp_ulike_textOrImage') == 'image') {
18
+ $counter = '<a onclick="likeThisComment('.$CommentID.', 1, 0);" class="image"></a><span class="count-box">'.$liked.'</span>';
19
+ }
20
+ else {
21
+ $counter = '<a onclick="likeThisComment('.$CommentID.', 1, 0);" class="text">'.get_option('wp_ulike_text').'</a><span class="count-box">'.$liked.'</span>';
22
+ }
23
+ }
24
+ else if($user_status != 0){
25
+ if(get_user_comments_status($CommentID,$user_ID) == "like"){
26
+ $counter = '<a onclick="likeThisComment('.$CommentID.', 1, 1);" class="text">'.get_option('wp_ulike_btn_text').'</a><span class="count-box">'.$liked.'</span>';
27
+ }
28
+ else if(get_user_comments_status($CommentID,$user_ID) == "dislike"){
29
+ $counter = '<a onclick="likeThisComment('.$CommentID.', 1, 0);" class="text">'.get_option('wp_ulike_dislike_text').'</a><span class="count-box">'.$liked.'</span>';
30
+ }
31
+ }
32
+
33
+ else if(isset($_COOKIE['comment-liked-'.$CommentID]) && $user_status == 0){
34
+ $counter = '<a class="text user-tooltip" title="'.__('Already Voted','alimir').'">'.get_option('wp_ulike_btn_text').'</a><span class="count-box">'.$liked.'</span>';
35
+ }
36
+ }
37
+ else{
38
+ if(!isset($_COOKIE['comment-liked-'.$CommentID])){
39
+
40
+ if (get_option('wp_ulike_textOrImage') == 'image') {
41
+ $counter = '<a onclick="likeThisComment('.$CommentID.', 1, 2);" class="image"></a><span class="count-box">'.$liked.'</span>';
42
+ }
43
+ else {
44
+ $counter = '<a onclick="likeThisComment('.$CommentID.', 1, 2);" class="text">'.get_option('wp_ulike_text').'</a><span class="count-box">'.$liked.'</span>';
45
+ }
46
+
47
+ }
48
+ else{
49
+
50
+ $counter = '<a class="text user-tooltip" title="'.__('Already Voted','alimir').'">'.get_option('wp_ulike_btn_text').'</a><span class="count-box">'.$liked.'</span>';
51
+
52
+ }
53
+ }
54
+
55
+ $wp_ulike = '<div id="wp-ulike-comment-'.$CommentID.'" class="wpulike">';
56
+ $wp_ulike .= '<div class="counter">'.$counter.'</div>';
57
+ $wp_ulike .= '</div>';
58
+
59
+ $user_data = get_user_comments_data($CommentID,$user_ID);
60
+ if(get_option('wp_ulike_user_like_box') == '1' && $user_data != '')
61
+ $wp_ulike .= '<p style="margin-top:5px">'.__('Users who have LIKED this comment:','alimir').'</p><ul id="tiles">' . $user_data . '</ul>';
62
+
63
+ if ($arg == 'put') {
64
+ return $wp_ulike;
65
+ }
66
+ else {
67
+ echo $wp_ulike;
68
+ }
69
+
70
+ }
71
+
72
+ else if (get_option('wp_ulike_onlyRegistered') == '1' && !is_user_logged_in()){
73
+ return '<p class="alert alert-info fade in" role="alert"><button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>'.__('You need to login in order to like this comment: ','alimir').'<a href="'.wp_login_url( get_permalink() ).'"> '.__('click here','alimir').' </a></p>';
74
+ }
75
+
76
+ }
77
+
78
+ //Process function
79
+ function wp_ulike_comments_process(){
80
+
81
+ global $wpdb,$user_ID;
82
+ $CommentID = $_POST['id'];
83
+ $like = get_comment_meta($CommentID, '_commentliked', true);
84
+ $user_status = $wpdb->get_var("SELECT COUNT(*) FROM ".$wpdb->prefix."ulike_comments WHERE comment_id = '$CommentID' AND user_id = '$user_ID'");
85
+
86
+ if($CommentID != '') {
87
+ if (!isset($_COOKIE['comment-liked-'.$CommentID]) && $user_status == 0) {
88
+ $newLike = $like + 1;
89
+ update_comment_meta($CommentID, '_commentliked', $newLike);
90
+
91
+ setcookie('comment-liked-'.$CommentID, time(), time()+3600*24*365, '/');
92
+
93
+ if(is_user_logged_in()):
94
+ $ip = wp_ulike_get_real_ip();
95
+ $wpdb->query("INSERT INTO ".$wpdb->prefix."ulike_comments VALUES ('', '$CommentID', NOW(), '$ip', '$user_ID', 'like')");
96
+ wp_ulike_bp_activity_add($user_ID,$CommentID,'comment');
97
+ endif;
98
+
99
+ echo wp_ulike_format_number($newLike);
100
+ }
101
+ else if ($user_status != 0) {
102
+ if(get_user_comments_status($CommentID,$user_ID) == "like"){
103
+ $newLike = $like - 1;
104
+ update_comment_meta($CommentID, '_commentliked', $newLike);
105
+
106
+ $wpdb->query("
107
+ UPDATE ".$wpdb->prefix."ulike_comments
108
+ SET status = 'dislike'
109
+ WHERE comment_id = '$CommentID' AND user_id = '$user_ID'
110
+ ");
111
+
112
+ echo wp_ulike_format_number($newLike);
113
+ }
114
+ else{
115
+ $newLike = $like + 1;
116
+ update_comment_meta($CommentID, '_commentliked', $newLike);
117
+
118
+ $wpdb->query("
119
+ UPDATE ".$wpdb->prefix."ulike_comments
120
+ SET status = 'like'
121
+ WHERE comment_id = '$CommentID' AND user_id = '$user_ID'
122
+ ");
123
+
124
+ echo wp_ulike_format_number($newLike);
125
+ }
126
+ }
127
+ else if (isset($_COOKIE['comment-liked-'.$CommentID])&& $user_status == 0){
128
+ echo wp_ulike_format_number($like);
129
+ }
130
+
131
+ }
132
+ die();
133
+ }
inc/wp-ulike-posts.php ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //main function
3
+ function wp_ulike($arg) {
4
+
5
+ global $post,$wpdb,$user_ID;
6
+ $post_ID = $post->ID;
7
+ $counter = '';
8
+ $get_like = get_post_meta($post_ID, '_liked', true) != '' ? get_post_meta($post_ID, '_liked', true) : '0';
9
+ $liked = wp_ulike_format_number($get_like);
10
+
11
+ if ( (get_option('wp_ulike_onlyRegistered') != '1') or (get_option('wp_ulike_onlyRegistered') == '1' && is_user_logged_in()) ){
12
+
13
+
14
+ if(is_user_logged_in()){
15
+ $user_status = $wpdb->get_var("SELECT COUNT(*) FROM ".$wpdb->prefix."ulike WHERE post_id = '$post_ID' AND user_id = '$user_ID'");
16
+
17
+ if(!isset($_COOKIE['liked-'.$post_ID]) && $user_status == 0){
18
+ if (get_option('wp_ulike_textOrImage') == 'image') {
19
+ $counter = '<a onclick="likeThis('.$post_ID.', 1, 0);" class="image"></a><span class="count-box">'.$liked.'</span>';
20
+ }
21
+ else {
22
+ $counter = '<a onclick="likeThis('.$post_ID.', 1, 0);" class="text">'.get_option('wp_ulike_text').'</a><span class="count-box">'.$liked.'</span>';
23
+ }
24
+ }
25
+ else if($user_status != 0){
26
+ if(get_user_status($post_ID,$user_ID) == "like"){
27
+ $counter = '<a onclick="likeThis('.$post_ID.', 1, 1);" class="text">'.get_option('wp_ulike_btn_text').'</a><span class="count-box">'.$liked.'</span>';
28
+ }
29
+ else if(get_user_status($post_ID,$user_ID) == "dislike"){
30
+ $counter = '<a onclick="likeThis('.$post_ID.', 1, 0);" class="text">'.get_option('wp_ulike_dislike_text').'</a><span class="count-box">'.$liked.'</span>';
31
+ }
32
+ }
33
+
34
+ else if(isset($_COOKIE['liked-'.$post_ID]) && $user_status == 0){
35
+ $counter = '<a class="text user-tooltip" title="'.__('Already Voted','alimir').'">'.get_option('wp_ulike_btn_text').'</a><span class="count-box">'.$liked.'</span>';
36
+ }
37
+ }
38
+ else{
39
+ if(!isset($_COOKIE['liked-'.$post_ID])){
40
+
41
+ if (get_option('wp_ulike_textOrImage') == 'image') {
42
+ $counter = '<a onclick="likeThis('.$post_ID.', 1, 2);" class="image"></a><span class="count-box">'.$liked.'</span>';
43
+ }
44
+ else {
45
+ $counter = '<a onclick="likeThis('.$post_ID.', 1, 2);" class="text">'.get_option('wp_ulike_text').'</a><span class="count-box">'.$liked.'</span>';
46
+ }
47
+
48
+ }
49
+ else{
50
+
51
+ $counter = '<a class="text user-tooltip" title="'.__('Already Voted','alimir').'">'.get_option('wp_ulike_btn_text').'</a><span class="count-box">'.$liked.'</span>';
52
+
53
+ }
54
+ }
55
+
56
+ $wp_ulike = '<div id="wp-ulike-'.$post_ID.'" class="wpulike">';
57
+ $wp_ulike .= '<div class="counter">'.$counter.'</div>';
58
+ $wp_ulike .= '</div>';
59
+
60
+
61
+ $user_data = get_user_data($post_ID,$user_ID);
62
+ if(get_option('wp_ulike_user_like_box') == '1' && $user_data != '')
63
+ $wp_ulike .= '<br /><p style="margin-top:5px">'.__('Users who have LIKED this post:','alimir').'</p><ul id="tiles">' . $user_data . '</ul>';
64
+
65
+ if ($arg == 'put') {
66
+ return $wp_ulike;
67
+ }
68
+ else {
69
+ echo $wp_ulike;
70
+ }
71
+
72
+ }
73
+
74
+ else if (get_option('wp_ulike_onlyRegistered') == '1' && !is_user_logged_in()){
75
+ return '<p class="alert alert-info fade in" role="alert"><button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>'.__('You need to login in order to like this post: ','alimir').'<a href="'.wp_login_url( get_permalink() ).'"> '.__('click here','alimir').' </a></p>';
76
+ }
77
+
78
+ }
79
+
80
+ //Process function
81
+ function wp_ulike_process(){
82
+
83
+ global $wpdb,$user_ID;
84
+ $post_ID = $_POST['id'];
85
+ $like = get_post_meta($post_ID, '_liked', true);
86
+ $user_status = $wpdb->get_var("SELECT COUNT(*) FROM ".$wpdb->prefix."ulike WHERE post_id = '$post_ID' AND user_id = '$user_ID'");
87
+
88
+ if($post_ID != '') {
89
+ if (!isset($_COOKIE['liked-'.$post_ID]) && $user_status == 0) {
90
+ $newLike = $like + 1;
91
+ update_post_meta($post_ID, '_liked', $newLike);
92
+
93
+ setcookie('liked-'.$post_ID, time(), time()+3600*24*365, '/');
94
+
95
+ if(is_user_logged_in()):
96
+ $ip = wp_ulike_get_real_ip();
97
+ $wpdb->query("INSERT INTO ".$wpdb->prefix."ulike VALUES ('', '$post_ID', NOW(), '$ip', '$user_ID', 'like')");
98
+ wp_ulike_bp_activity_add($user_ID,$post_ID,'post');
99
+ endif;
100
+
101
+ echo wp_ulike_format_number($newLike);
102
+ }
103
+ else if ($user_status != 0) {
104
+ if(get_user_status($post_ID,$user_ID) == "like"){
105
+ $newLike = $like - 1;
106
+ update_post_meta($post_ID, '_liked', $newLike);
107
+
108
+ $wpdb->query("
109
+ UPDATE ".$wpdb->prefix."ulike
110
+ SET status = 'dislike'
111
+ WHERE post_id = '$post_ID' AND user_id = '$user_ID'
112
+ ");
113
+
114
+ echo wp_ulike_format_number($newLike);
115
+ }
116
+ else{
117
+ $newLike = $like + 1;
118
+ update_post_meta($post_ID, '_liked', $newLike);
119
+
120
+ $wpdb->query("
121
+ UPDATE ".$wpdb->prefix."ulike
122
+ SET status = 'like'
123
+ WHERE post_id = '$post_ID' AND user_id = '$user_ID'
124
+ ");
125
+
126
+ echo wp_ulike_format_number($newLike);
127
+ }
128
+ }
129
+ else if (isset($_COOKIE['liked-'.$post_ID]) && $user_status == 0){
130
+ echo wp_ulike_format_number($like);
131
+ }
132
+ }
133
+ die();
134
+ }
lang/alimir-fa_IR.mo CHANGED
Binary file
lang/alimir-fa_IR.po CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: WP ULike\n"
4
- "POT-Creation-Date: 2014-10-15 18:38+0330\n"
5
- "PO-Revision-Date: 2014-10-15 18:38+0330\n"
6
  "Last-Translator: Alimir <info@alimir.ir>\n"
7
  "Language-Team: alimir.ir <info@alimir.ir>\n"
8
  "Language: fa_IR\n"
@@ -23,68 +23,60 @@ msgstr "وردپرس یولایک"
23
  #: ../wp-ulike.php:17
24
  msgid ""
25
  "WP ULike plugin allows to integrate Like Button into your WordPress website "
26
- "to allow your visitors to like pages and posts. Its very simple to use and "
27
- "support a widget to display the most liked posts."
28
  msgstr ""
29
  " افزونه ایرانی یولایک، یک سیستم آژاکسی ساده و کاربردی برای ایجاد قابلیت لایک "
30
- "(LIKE) در مطالب و نوشته های وردپرسی شماست و با بهره گیری از پنل تنظیمات، "
31
  "پشتیبانی کامل از شیوه نامه rtl، نمایش بیشترین مطالب لایک شده، قابلیت سفارشی "
32
  "سازی استایل ها و… تمامی قابلیت های یک سیستم خوب و حرفه ای رو در اختیار شما "
33
  "قرار میده."
34
 
35
- #: ../wp-ulike.php:56 ../inc/wp-widget.php:106
36
  msgid "Like"
37
  msgstr "لایک"
38
 
39
- #: ../wp-ulike.php:57
40
  msgid "You Like This"
41
- msgstr "شما این را پسندیده اید"
42
 
43
- #: ../wp-ulike.php:58
44
  msgid "You Dislike This"
45
- msgstr "شما این را نپسندیده اید"
46
 
47
- #: ../wp-ulike.php:121 ../wp-ulike.php:137
48
- msgid "Already Voted"
49
- msgstr "قبلا لایک کرده اید"
50
 
51
- #: ../wp-ulike.php:149
52
- msgid "Users who have LIKED this post:"
53
- msgstr "کاربرانی که این مطلب را پسندیده اند:"
54
-
55
- #: ../wp-ulike.php:161
56
- msgid "You need to login in order to like this post: "
57
- msgstr "برای امتیاز دهی به این مطلب، لطفا وارد شوید: "
58
-
59
- #: ../wp-ulike.php:161
60
- msgid "click here"
61
- msgstr "برای ورود کلیک کنید"
62
 
63
  #: ../inc/wp-options.php:4
64
  msgid "WP Ulike"
65
  msgstr "تنظیمات افزونه یولایک"
66
 
67
- #: ../inc/wp-options.php:32
68
  msgid "Configuration"
69
  msgstr "پیکربندی"
70
 
71
- #: ../inc/wp-options.php:38
72
  msgid "Image or text?"
73
  msgstr "متن یا تصویر؟"
74
 
75
- #: ../inc/wp-options.php:53
76
  msgid "Like Text"
77
  msgstr "متن دکمه لایک"
78
 
79
- #: ../inc/wp-options.php:61
80
  msgid "Dislike Text?"
81
  msgstr "متن دکمه دیسلایک"
82
 
83
- #: ../inc/wp-options.php:69
84
  msgid "Automatic display"
85
  msgstr "نمایش خودکار"
86
 
87
- #: ../inc/wp-options.php:73
88
  msgid ""
89
  "<strong>On all posts</strong> (home, archives, search) at the bottom of the "
90
  "post"
@@ -92,88 +84,111 @@ msgstr ""
92
  "<strong>نمایش در تمامی پست ها</strong> (خانه, بایگانی, جستجو)در بخش زیرین "
93
  "مطالب."
94
 
95
- #: ../inc/wp-options.php:75
96
  msgid "If you disable this option, you have to put manually the code"
97
  msgstr "اگر این قابلیت را غیر فعال کنید، باید به صورت دستی این کد را "
98
 
99
- #: ../inc/wp-options.php:75
100
  msgid "wherever you want in your template."
101
  msgstr "در قالب خود قرار دهید."
102
 
103
- #: ../inc/wp-options.php:79
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  msgid "Only registered Users"
105
  msgstr "محدودسازی لایک کاربران"
106
 
107
- #: ../inc/wp-options.php:83
108
- msgid "<strong>Active</strong> this option."
109
- msgstr "می خواهم این قابلیت را<strong>فعال</strong> کنم"
 
 
110
 
111
- #: ../inc/wp-options.php:85
112
  msgid "<strong>Only</strong> registered users have permission to like posts."
113
  msgstr ""
114
  "با فعال سازی این گزینه، <strong>تنها</strong> کاربران عضو شده، می توانند "
115
  "مطالب را لایک کنند."
116
 
117
- #: ../inc/wp-options.php:89
 
 
 
 
 
 
 
 
 
 
118
  msgid "Show Users Like Box"
119
  msgstr "نمایش باکس کاربران لایک کرده"
120
 
121
- #: ../inc/wp-options.php:93 ../inc/wp-options.php:103
122
- #: ../inc/wp-options.php:113
123
- msgid "Activate"
124
- msgstr "فعال سازی"
125
-
126
- #: ../inc/wp-options.php:95
127
  msgid "Active this option to show users avatar in like box."
128
  msgstr ""
129
  "با فعال سازی این گزینه، می توانید آواتار کاربران لایک کرده، را در زیر هر "
130
  "مطلب، نمایش دهید."
131
 
132
- #: ../inc/wp-options.php:99
133
  msgid "Format Number"
134
  msgstr "فرمت اعداد"
135
 
136
- #: ../inc/wp-options.php:105
137
  msgid "Convert numbers of Likes with string (kilobyte) format."
138
  msgstr ""
139
  "با فعال سازی این گزینه، می توانید اعداد بالای 1000 را با فرمت رشته ای "
140
  "(کیلوبایت) نمایش دهید."
141
 
142
- #: ../inc/wp-options.php:109
143
  msgid "Custom Style"
144
  msgstr "سفارشی سازی"
145
 
146
- #: ../inc/wp-options.php:115
147
  msgid "Active this option to see custom color settings."
148
  msgstr ""
149
  "با فعال سازی این گزینه، می توانید رنگ های دلخواه خود را در افزونه به کار "
150
  "ببرید."
151
 
152
- #: ../inc/wp-options.php:119
153
  msgid "Button style"
154
  msgstr "دکمه لایک"
155
 
156
- #: ../inc/wp-options.php:124 ../inc/wp-options.php:141
157
  msgid "Background"
158
  msgstr "رنگ پس زمینه"
159
 
160
- #: ../inc/wp-options.php:128 ../inc/wp-options.php:145
161
  msgid "Border Color"
162
  msgstr "رنگ حاشیه"
163
 
164
- #: ../inc/wp-options.php:132 ../inc/wp-options.php:149
165
  msgid "Text Color"
166
  msgstr "رنگ متن"
167
 
168
- #: ../inc/wp-options.php:136
169
  msgid "Counter Style"
170
  msgstr "باکس شمارنده"
171
 
172
- #: ../inc/wp-options.php:159
173
  msgid "Like this plugin?"
174
  msgstr "این پلاگین چندتا لایک داره؟!؟ :)"
175
 
176
- #: ../inc/wp-options.php:162
177
  msgid ""
178
  "Show your support by Rating 5 Star in <a href=\"http://wordpress.org/plugins/"
179
  "wp-ulike\"> Plugin Directory reviews</a>"
@@ -181,14 +196,14 @@ msgstr ""
181
  "حمایتتون رو از این افزونه، با امتیاز 5 ستاره در <a href=\"http://wordpress."
182
  "org/plugins/wp-ulike\">مخزن وردپرس</a> مشخص کنید..."
183
 
184
- #: ../inc/wp-options.php:163
185
  msgid ""
186
  "Follow me on <a href=\"https://www.facebook.com/alimir.ir\"> Facebook</a>"
187
  msgstr ""
188
  "دنیای وردپرس و برنامه نویسی را در <a href=\"https://www.facebook.com/alimir."
189
  "ir\"> فیسبوک</a> دنبال کنید..."
190
 
191
- #: ../inc/wp-options.php:164
192
  msgid ""
193
  "Plugin Author Blog: <a href=\"http://alimir.ir\"> Wordpress & Programming "
194
  "World.</a>"
@@ -196,6 +211,31 @@ msgstr ""
196
  "صفحه سازنده افزونه <a href=\"http://alimir.ir\"> دنیای وردپرس و برنامه "
197
  "نویسی</a>."
198
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
  #: ../inc/wp-widget.php:8
200
  msgid "WP Ulike - Most Liked Posts"
201
  msgstr "وردپرس یولایک - نمایش پرلایک ترین مطالب"
@@ -248,6 +288,9 @@ msgstr "سایز آواتار کاربران:"
248
  msgid "Activate user like count"
249
  msgstr "تعداد لایک های هر کاربر رو نمایش بده"
250
 
 
 
 
251
  #~ msgid "Show post count"
252
  #~ msgstr "نمایش شمارشگر"
253
 
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: WP ULike\n"
4
+ "POT-Creation-Date: 2014-10-25 22:08+0330\n"
5
+ "PO-Revision-Date: 2014-10-25 22:35+0330\n"
6
  "Last-Translator: Alimir <info@alimir.ir>\n"
7
  "Language-Team: alimir.ir <info@alimir.ir>\n"
8
  "Language: fa_IR\n"
23
  #: ../wp-ulike.php:17
24
  msgid ""
25
  "WP ULike plugin allows to integrate Like Button into your WordPress website "
26
+ "to allow your visitors to like pages, posts AND comments. Its very simple to "
27
+ "use and support a widget to display the most liked posts."
28
  msgstr ""
29
  " افزونه ایرانی یولایک، یک سیستم آژاکسی ساده و کاربردی برای ایجاد قابلیت لایک "
30
+ "(LIKE) در مطالب و دیدگاه های وردپرسی شماست و با بهره گیری از پنل تنظیمات، "
31
  "پشتیبانی کامل از شیوه نامه rtl، نمایش بیشترین مطالب لایک شده، قابلیت سفارشی "
32
  "سازی استایل ها و… تمامی قابلیت های یک سیستم خوب و حرفه ای رو در اختیار شما "
33
  "قرار میده."
34
 
35
+ #: ../wp-ulike.php:69 ../inc/wp-widget.php:106
36
  msgid "Like"
37
  msgstr "لایک"
38
 
39
+ #: ../wp-ulike.php:70
40
  msgid "You Like This"
41
+ msgstr "این را پسندیده اید"
42
 
43
+ #: ../wp-ulike.php:71
44
  msgid "You Dislike This"
45
+ msgstr "لغو پسندیدن"
46
 
47
+ #: ../inc/wp-functions.php:137 ../inc/wp-functions.php:147
48
+ msgid "liked"
49
+ msgstr " پسندید"
50
 
51
+ #: ../inc/wp-functions.php:137
52
+ msgid "comment"
53
+ msgstr " را در دیدگاهش"
 
 
 
 
 
 
 
 
54
 
55
  #: ../inc/wp-options.php:4
56
  msgid "WP Ulike"
57
  msgstr "تنظیمات افزونه یولایک"
58
 
59
+ #: ../inc/wp-options.php:34
60
  msgid "Configuration"
61
  msgstr "پیکربندی"
62
 
63
+ #: ../inc/wp-options.php:40
64
  msgid "Image or text?"
65
  msgstr "متن یا تصویر؟"
66
 
67
+ #: ../inc/wp-options.php:55
68
  msgid "Like Text"
69
  msgstr "متن دکمه لایک"
70
 
71
+ #: ../inc/wp-options.php:63
72
  msgid "Dislike Text?"
73
  msgstr "متن دکمه دیسلایک"
74
 
75
+ #: ../inc/wp-options.php:71
76
  msgid "Automatic display"
77
  msgstr "نمایش خودکار"
78
 
79
+ #: ../inc/wp-options.php:75
80
  msgid ""
81
  "<strong>On all posts</strong> (home, archives, search) at the bottom of the "
82
  "post"
84
  "<strong>نمایش در تمامی پست ها</strong> (خانه, بایگانی, جستجو)در بخش زیرین "
85
  "مطالب."
86
 
87
+ #: ../inc/wp-options.php:77
88
  msgid "If you disable this option, you have to put manually the code"
89
  msgstr "اگر این قابلیت را غیر فعال کنید، باید به صورت دستی این کد را "
90
 
91
+ #: ../inc/wp-options.php:77
92
  msgid "wherever you want in your template."
93
  msgstr "در قالب خود قرار دهید."
94
 
95
+ #: ../inc/wp-options.php:81
96
+ msgid "Comment likes"
97
+ msgstr "لایک در دیدگاه ها"
98
+
99
+ #: ../inc/wp-options.php:85
100
+ msgid "<strong>On all comments</strong> at the bottom of the comment"
101
+ msgstr "<strong>نمایش در تمامی دیدگاه ها</strong> در زیر متن هر دیدگاه"
102
+
103
+ #: ../inc/wp-options.php:87
104
+ msgid ""
105
+ "If you disable this option, you have to put manually this code on comments "
106
+ "text"
107
+ msgstr ""
108
+ "اگر این قابلیت را غیر فعال کنید، باید به صورت دستی این کد را در متن دیدگاه "
109
+ "ها قرار دهید "
110
+
111
+ #: ../inc/wp-options.php:91
112
  msgid "Only registered Users"
113
  msgstr "محدودسازی لایک کاربران"
114
 
115
+ #: ../inc/wp-options.php:95 ../inc/wp-options.php:105
116
+ #: ../inc/wp-options.php:115 ../inc/wp-options.php:125
117
+ #: ../inc/wp-options.php:135
118
+ msgid "Activate"
119
+ msgstr "فعال سازی"
120
 
121
+ #: ../inc/wp-options.php:97
122
  msgid "<strong>Only</strong> registered users have permission to like posts."
123
  msgstr ""
124
  "با فعال سازی این گزینه، <strong>تنها</strong> کاربران عضو شده، می توانند "
125
  "مطالب را لایک کنند."
126
 
127
+ #: ../inc/wp-options.php:101
128
+ msgid "BuddyPress Activity"
129
+ msgstr "فعالیت های بادی پرس"
130
+
131
+ #: ../inc/wp-options.php:107
132
+ msgid "insert new likes in buddyPress activity page"
133
+ msgstr ""
134
+ "با فعال سازی این گزینه، اطلاعات جدیدترین لایک ها به بخش فعالیت های بادی پرس "
135
+ "اضافه خواهد شد."
136
+
137
+ #: ../inc/wp-options.php:111
138
  msgid "Show Users Like Box"
139
  msgstr "نمایش باکس کاربران لایک کرده"
140
 
141
+ #: ../inc/wp-options.php:117
 
 
 
 
 
142
  msgid "Active this option to show users avatar in like box."
143
  msgstr ""
144
  "با فعال سازی این گزینه، می توانید آواتار کاربران لایک کرده، را در زیر هر "
145
  "مطلب، نمایش دهید."
146
 
147
+ #: ../inc/wp-options.php:121
148
  msgid "Format Number"
149
  msgstr "فرمت اعداد"
150
 
151
+ #: ../inc/wp-options.php:127
152
  msgid "Convert numbers of Likes with string (kilobyte) format."
153
  msgstr ""
154
  "با فعال سازی این گزینه، می توانید اعداد بالای 1000 را با فرمت رشته ای "
155
  "(کیلوبایت) نمایش دهید."
156
 
157
+ #: ../inc/wp-options.php:131
158
  msgid "Custom Style"
159
  msgstr "سفارشی سازی"
160
 
161
+ #: ../inc/wp-options.php:137
162
  msgid "Active this option to see custom color settings."
163
  msgstr ""
164
  "با فعال سازی این گزینه، می توانید رنگ های دلخواه خود را در افزونه به کار "
165
  "ببرید."
166
 
167
+ #: ../inc/wp-options.php:141
168
  msgid "Button style"
169
  msgstr "دکمه لایک"
170
 
171
+ #: ../inc/wp-options.php:146 ../inc/wp-options.php:163
172
  msgid "Background"
173
  msgstr "رنگ پس زمینه"
174
 
175
+ #: ../inc/wp-options.php:150 ../inc/wp-options.php:167
176
  msgid "Border Color"
177
  msgstr "رنگ حاشیه"
178
 
179
+ #: ../inc/wp-options.php:154 ../inc/wp-options.php:171
180
  msgid "Text Color"
181
  msgstr "رنگ متن"
182
 
183
+ #: ../inc/wp-options.php:158
184
  msgid "Counter Style"
185
  msgstr "باکس شمارنده"
186
 
187
+ #: ../inc/wp-options.php:181
188
  msgid "Like this plugin?"
189
  msgstr "این پلاگین چندتا لایک داره؟!؟ :)"
190
 
191
+ #: ../inc/wp-options.php:184
192
  msgid ""
193
  "Show your support by Rating 5 Star in <a href=\"http://wordpress.org/plugins/"
194
  "wp-ulike\"> Plugin Directory reviews</a>"
196
  "حمایتتون رو از این افزونه، با امتیاز 5 ستاره در <a href=\"http://wordpress."
197
  "org/plugins/wp-ulike\">مخزن وردپرس</a> مشخص کنید..."
198
 
199
+ #: ../inc/wp-options.php:185
200
  msgid ""
201
  "Follow me on <a href=\"https://www.facebook.com/alimir.ir\"> Facebook</a>"
202
  msgstr ""
203
  "دنیای وردپرس و برنامه نویسی را در <a href=\"https://www.facebook.com/alimir."
204
  "ir\"> فیسبوک</a> دنبال کنید..."
205
 
206
+ #: ../inc/wp-options.php:186
207
  msgid ""
208
  "Plugin Author Blog: <a href=\"http://alimir.ir\"> Wordpress & Programming "
209
  "World.</a>"
211
  "صفحه سازنده افزونه <a href=\"http://alimir.ir\"> دنیای وردپرس و برنامه "
212
  "نویسی</a>."
213
 
214
+ #: ../inc/wp-ulike-comments.php:34 ../inc/wp-ulike-comments.php:50
215
+ #: ../inc/wp-ulike-posts.php:35 ../inc/wp-ulike-posts.php:51
216
+ msgid "Already Voted"
217
+ msgstr "قبلا لایک کرده اید"
218
+
219
+ #: ../inc/wp-ulike-comments.php:61
220
+ msgid "Users who have LIKED this comment:"
221
+ msgstr "کاربرانی که این دیدگاه را پسندیده اند:"
222
+
223
+ #: ../inc/wp-ulike-comments.php:73
224
+ msgid "You need to login in order to like this comment: "
225
+ msgstr "برای امتیاز دهی به این دیدگاه، لطفا وارد شوید: "
226
+
227
+ #: ../inc/wp-ulike-comments.php:73 ../inc/wp-ulike-posts.php:75
228
+ msgid "click here"
229
+ msgstr "برای ورود کلیک کنید"
230
+
231
+ #: ../inc/wp-ulike-posts.php:63
232
+ msgid "Users who have LIKED this post:"
233
+ msgstr "کاربرانی که این مطلب را پسندیده اند:"
234
+
235
+ #: ../inc/wp-ulike-posts.php:75
236
+ msgid "You need to login in order to like this post: "
237
+ msgstr "برای امتیاز دهی به این مطلب، لطفا وارد شوید: "
238
+
239
  #: ../inc/wp-widget.php:8
240
  msgid "WP Ulike - Most Liked Posts"
241
  msgstr "وردپرس یولایک - نمایش پرلایک ترین مطالب"
288
  msgid "Activate user like count"
289
  msgstr "تعداد لایک های هر کاربر رو نمایش بده"
290
 
291
+ #~ msgid "<strong>Active</strong> this option."
292
+ #~ msgstr "می خواهم این قابلیت را<strong>فعال</strong> کنم"
293
+
294
  #~ msgid "Show post count"
295
  #~ msgstr "نمایش شمارشگر"
296
 
lang/alimir-fr_FR.mo CHANGED
Binary file
lang/alimir-fr_FR.po CHANGED
@@ -2,7 +2,7 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: WP ULike\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2014-10-02 18:47+0330\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: Alimir <info@alimir.ir>\n"
8
  "Language-Team: \n"
@@ -23,63 +23,47 @@ msgstr ""
23
  #: ../wp-ulike.php:17
24
  msgid ""
25
  "WP ULike plugin allows to integrate Like Button into your WordPress website "
26
- "to allow your visitors to like pages and posts. Its very simple to use and "
27
- "support a widget to display the most liked posts."
28
  msgstr ""
29
 
30
- #: ../wp-ulike.php:56 ../inc/wp-widget.php:106
31
  msgid "Like"
32
  msgstr ""
33
 
34
- #: ../wp-ulike.php:57
35
  msgid "You Like This"
36
  msgstr ""
37
 
38
- #: ../wp-ulike.php:58
39
  msgid "You Dislike This"
40
  msgstr ""
41
 
42
- #: ../wp-ulike.php:118 ../wp-ulike.php:134
43
- msgid "Already Voted"
44
- msgstr ""
45
-
46
- #: ../wp-ulike.php:146
47
- msgid "Users who have LIKED this post:"
48
- msgstr ""
49
-
50
- #: ../wp-ulike.php:158
51
- msgid "You need to login in order to like this post: "
52
- msgstr ""
53
-
54
- #: ../wp-ulike.php:158
55
- msgid "click here"
56
- msgstr ""
57
-
58
  #: ../inc/wp-options.php:4
59
  msgid "WP Ulike"
60
  msgstr ""
61
 
62
- #: ../inc/wp-options.php:31
63
  msgid "Configuration"
64
  msgstr "Configuration"
65
 
66
- #: ../inc/wp-options.php:37
67
  msgid "Image or text?"
68
  msgstr "Image ou texte?"
69
 
70
- #: ../inc/wp-options.php:52
71
  msgid "Like Text"
72
  msgstr ""
73
 
74
- #: ../inc/wp-options.php:60
75
  msgid "Dislike Text?"
76
  msgstr ""
77
 
78
- #: ../inc/wp-options.php:68
79
  msgid "Automatic display"
80
  msgstr "Affichage automatique"
81
 
82
- #: ../inc/wp-options.php:72
83
  msgid ""
84
  "<strong>On all posts</strong> (home, archives, search) at the bottom of the "
85
  "post"
@@ -87,88 +71,132 @@ msgstr ""
87
  "<strong>Pour tous les articles</strong> (accueil, archives, recherche) au "
88
  "fond de l'article."
89
 
90
- #: ../inc/wp-options.php:74
91
  msgid "If you disable this option, you have to put manually the code"
92
  msgstr ""
93
  "Si vous désactivez cette option, vous devez ajouter manuellement le code"
94
 
95
- #: ../inc/wp-options.php:74
96
  msgid "wherever you want in your template."
97
  msgstr "n'importe où vous le souhaitez dans votre thème."
98
 
99
- #: ../inc/wp-options.php:78
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  msgid "Only registered Users"
101
  msgstr ""
102
 
103
- #: ../inc/wp-options.php:82
104
- msgid "<strong>Active</strong> this option."
 
105
  msgstr ""
106
 
107
- #: ../inc/wp-options.php:84
108
  msgid "<strong>Only</strong> registered users have permission to like posts."
109
  msgstr ""
110
 
111
- #: ../inc/wp-options.php:88
112
  msgid "Show Users Like Box"
113
  msgstr ""
114
 
115
- #: ../inc/wp-options.php:92 ../inc/wp-options.php:102
116
- msgid "Activate"
117
  msgstr ""
118
 
119
- #: ../inc/wp-options.php:94
120
- msgid "Active this option to show users avatar in like box."
 
 
 
 
121
  msgstr ""
122
 
123
- #: ../inc/wp-options.php:98
124
  msgid "Custom Style"
125
  msgstr ""
126
 
127
- #: ../inc/wp-options.php:104
128
  msgid "Active this option to see custom color settings."
129
  msgstr ""
130
 
131
- #: ../inc/wp-options.php:108
132
  msgid "Button style"
133
  msgstr ""
134
 
135
- #: ../inc/wp-options.php:113 ../inc/wp-options.php:130
136
  msgid "Background"
137
  msgstr ""
138
 
139
- #: ../inc/wp-options.php:117 ../inc/wp-options.php:134
140
  msgid "Border Color"
141
  msgstr ""
142
 
143
- #: ../inc/wp-options.php:121 ../inc/wp-options.php:138
144
  msgid "Text Color"
145
  msgstr ""
146
 
147
- #: ../inc/wp-options.php:125
148
  msgid "Counter Style"
149
  msgstr ""
150
 
151
- #: ../inc/wp-options.php:148
152
  msgid "Like this plugin?"
153
  msgstr "Vous aimez ce plugin?"
154
 
155
- #: ../inc/wp-options.php:151
156
  msgid ""
157
  "Show your support by Rating 5 Star in <a href=\"http://wordpress.org/plugins/"
158
  "wp-ulike\"> Plugin Directory reviews</a>"
159
  msgstr ""
160
 
161
- #: ../inc/wp-options.php:152
162
  msgid ""
163
  "Follow me on <a href=\"https://www.facebook.com/alimir.ir\"> Facebook</a>"
164
  msgstr ""
165
 
166
- #: ../inc/wp-options.php:153
167
  msgid ""
168
  "Plugin Author Blog: <a href=\"http://alimir.ir\"> Wordpress & Programming "
169
  "World.</a>"
170
  msgstr ""
171
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
172
  #: ../inc/wp-widget.php:8
173
  msgid "WP Ulike - Most Liked Posts"
174
  msgstr ""
2
  msgstr ""
3
  "Project-Id-Version: WP ULike\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2014-10-25 01:51+0330\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: Alimir <info@alimir.ir>\n"
8
  "Language-Team: \n"
23
  #: ../wp-ulike.php:17
24
  msgid ""
25
  "WP ULike plugin allows to integrate Like Button into your WordPress website "
26
+ "to allow your visitors to like pages, posts AND comments. Its very simple to "
27
+ "use and support a widget to display the most liked posts."
28
  msgstr ""
29
 
30
+ #: ../wp-ulike.php:80 ../inc/wp-widget.php:106
31
  msgid "Like"
32
  msgstr ""
33
 
34
+ #: ../wp-ulike.php:81
35
  msgid "You Like This"
36
  msgstr ""
37
 
38
+ #: ../wp-ulike.php:82
39
  msgid "You Dislike This"
40
  msgstr ""
41
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  #: ../inc/wp-options.php:4
43
  msgid "WP Ulike"
44
  msgstr ""
45
 
46
+ #: ../inc/wp-options.php:33
47
  msgid "Configuration"
48
  msgstr "Configuration"
49
 
50
+ #: ../inc/wp-options.php:39
51
  msgid "Image or text?"
52
  msgstr "Image ou texte?"
53
 
54
+ #: ../inc/wp-options.php:54
55
  msgid "Like Text"
56
  msgstr ""
57
 
58
+ #: ../inc/wp-options.php:62
59
  msgid "Dislike Text?"
60
  msgstr ""
61
 
62
+ #: ../inc/wp-options.php:70
63
  msgid "Automatic display"
64
  msgstr "Affichage automatique"
65
 
66
+ #: ../inc/wp-options.php:74
67
  msgid ""
68
  "<strong>On all posts</strong> (home, archives, search) at the bottom of the "
69
  "post"
71
  "<strong>Pour tous les articles</strong> (accueil, archives, recherche) au "
72
  "fond de l'article."
73
 
74
+ #: ../inc/wp-options.php:76
75
  msgid "If you disable this option, you have to put manually the code"
76
  msgstr ""
77
  "Si vous désactivez cette option, vous devez ajouter manuellement le code"
78
 
79
+ #: ../inc/wp-options.php:76
80
  msgid "wherever you want in your template."
81
  msgstr "n'importe où vous le souhaitez dans votre thème."
82
 
83
+ #: ../inc/wp-options.php:80
84
+ msgid "Comment likes"
85
+ msgstr ""
86
+
87
+ #: ../inc/wp-options.php:84
88
+ msgid "<strong>On all comments</strong> at the bottom of the comment"
89
+ msgstr "<strong>Pour tous les commentaires</strong> au fond de commentaire."
90
+
91
+ #: ../inc/wp-options.php:86
92
+ msgid ""
93
+ "If you disable this option, you have to put manually this code on comments "
94
+ "text"
95
+ msgstr ""
96
+
97
+ #: ../inc/wp-options.php:90
98
  msgid "Only registered Users"
99
  msgstr ""
100
 
101
+ #: ../inc/wp-options.php:94 ../inc/wp-options.php:104
102
+ #: ../inc/wp-options.php:114 ../inc/wp-options.php:124
103
+ msgid "Activate"
104
  msgstr ""
105
 
106
+ #: ../inc/wp-options.php:96
107
  msgid "<strong>Only</strong> registered users have permission to like posts."
108
  msgstr ""
109
 
110
+ #: ../inc/wp-options.php:100
111
  msgid "Show Users Like Box"
112
  msgstr ""
113
 
114
+ #: ../inc/wp-options.php:106
115
+ msgid "Active this option to show users avatar in like box."
116
  msgstr ""
117
 
118
+ #: ../inc/wp-options.php:110
119
+ msgid "Format Number"
120
+ msgstr ""
121
+
122
+ #: ../inc/wp-options.php:116
123
+ msgid "Convert numbers of Likes with string (kilobyte) format."
124
  msgstr ""
125
 
126
+ #: ../inc/wp-options.php:120
127
  msgid "Custom Style"
128
  msgstr ""
129
 
130
+ #: ../inc/wp-options.php:126
131
  msgid "Active this option to see custom color settings."
132
  msgstr ""
133
 
134
+ #: ../inc/wp-options.php:130
135
  msgid "Button style"
136
  msgstr ""
137
 
138
+ #: ../inc/wp-options.php:135 ../inc/wp-options.php:152
139
  msgid "Background"
140
  msgstr ""
141
 
142
+ #: ../inc/wp-options.php:139 ../inc/wp-options.php:156
143
  msgid "Border Color"
144
  msgstr ""
145
 
146
+ #: ../inc/wp-options.php:143 ../inc/wp-options.php:160
147
  msgid "Text Color"
148
  msgstr ""
149
 
150
+ #: ../inc/wp-options.php:147
151
  msgid "Counter Style"
152
  msgstr ""
153
 
154
+ #: ../inc/wp-options.php:170
155
  msgid "Like this plugin?"
156
  msgstr "Vous aimez ce plugin?"
157
 
158
+ #: ../inc/wp-options.php:173
159
  msgid ""
160
  "Show your support by Rating 5 Star in <a href=\"http://wordpress.org/plugins/"
161
  "wp-ulike\"> Plugin Directory reviews</a>"
162
  msgstr ""
163
 
164
+ #: ../inc/wp-options.php:174
165
  msgid ""
166
  "Follow me on <a href=\"https://www.facebook.com/alimir.ir\"> Facebook</a>"
167
  msgstr ""
168
 
169
+ #: ../inc/wp-options.php:175
170
  msgid ""
171
  "Plugin Author Blog: <a href=\"http://alimir.ir\"> Wordpress & Programming "
172
  "World.</a>"
173
  msgstr ""
174
 
175
+ #: ../inc/wp-ulike-comments.php:34 ../inc/wp-ulike-comments.php:50
176
+ #: ../inc/wp-ulike-posts.php:35 ../inc/wp-ulike-posts.php:51
177
+ msgid "Already Voted"
178
+ msgstr ""
179
+
180
+ #: ../inc/wp-ulike-comments.php:61
181
+ msgid "Users who have LIKED this comment:"
182
+ msgstr ""
183
+
184
+ #: ../inc/wp-ulike-comments.php:73
185
+ msgid "You need to login in order to like this comment: "
186
+ msgstr ""
187
+
188
+ #: ../inc/wp-ulike-comments.php:73 ../inc/wp-ulike-posts.php:75
189
+ msgid "click here"
190
+ msgstr ""
191
+
192
+ #: ../inc/wp-ulike-posts.php:63
193
+ msgid "Users who have LIKED this post:"
194
+ msgstr ""
195
+
196
+ #: ../inc/wp-ulike-posts.php:75
197
+ msgid "You need to login in order to like this post: "
198
+ msgstr ""
199
+
200
  #: ../inc/wp-widget.php:8
201
  msgid "WP Ulike - Most Liked Posts"
202
  msgstr ""
lang/alimir-zh_CN.mo CHANGED
Binary file
lang/alimir-zh_CN.po CHANGED
@@ -2,7 +2,7 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: WP ULike\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2014-10-02 18:47+0330\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: Alimir <info@alimir.ir>\n"
8
  "Language-Team: 倡萌@WordPress大学 <admin@cmhello.com>\n"
@@ -24,135 +24,138 @@ msgstr "WP ULike"
24
  #: ../wp-ulike.php:17
25
  msgid ""
26
  "WP ULike plugin allows to integrate Like Button into your WordPress website "
27
- "to allow your visitors to like pages and posts. Its very simple to use and "
28
- "support a widget to display the most liked posts."
29
  msgstr ""
30
  "WP ULike 插件允许集成喜欢按钮到你的WordPress站点,让你的访客可以喜欢页面和文"
31
  "章。它非常简单易用,还支持通过小工具显示最多人喜欢的文章。"
32
 
33
- #: ../wp-ulike.php:56 ../inc/wp-widget.php:106
34
  msgid "Like"
35
  msgstr "喜欢"
36
 
37
- #: ../wp-ulike.php:57
38
  msgid "You Like This"
39
  msgstr "你喜欢这个"
40
 
41
- #: ../wp-ulike.php:58
42
  msgid "You Dislike This"
43
  msgstr "你不喜欢这个"
44
 
45
- #: ../wp-ulike.php:118 ../wp-ulike.php:134
46
- msgid "Already Voted"
47
- msgstr "已经投票"
48
-
49
- #: ../wp-ulike.php:146
50
- msgid "Users who have LIKED this post:"
51
- msgstr "喜欢该文章的用户:"
52
-
53
- #: ../wp-ulike.php:158
54
- msgid "You need to login in order to like this post: "
55
- msgstr "你需要登录后才能喜欢这篇文章:"
56
-
57
- #: ../wp-ulike.php:158
58
- msgid "click here"
59
- msgstr "点击这里"
60
-
61
  #: ../inc/wp-options.php:4
62
  msgid "WP Ulike"
63
  msgstr "WP Ulike"
64
 
65
- #: ../inc/wp-options.php:31
66
  msgid "Configuration"
67
  msgstr "配置"
68
 
69
- #: ../inc/wp-options.php:37
70
  msgid "Image or text?"
71
  msgstr "图片或文本?"
72
 
73
- #: ../inc/wp-options.php:52
74
  msgid "Like Text"
75
  msgstr "[喜欢]文本"
76
 
77
- #: ../inc/wp-options.php:60
78
  msgid "Dislike Text?"
79
  msgstr "[不喜欢]文本"
80
 
81
- #: ../inc/wp-options.php:68
82
  msgid "Automatic display"
83
  msgstr "自动显示"
84
 
85
- #: ../inc/wp-options.php:72
86
  msgid ""
87
  "<strong>On all posts</strong> (home, archives, search) at the bottom of the "
88
  "post"
89
  msgstr "<strong>在所有文章</strong>(首页、存档、搜索)文章的底部"
90
 
91
- #: ../inc/wp-options.php:74
92
  msgid "If you disable this option, you have to put manually the code"
93
  msgstr "如果你禁用这个选项,你必须手动添加代码 "
94
 
95
- #: ../inc/wp-options.php:74
96
  msgid "wherever you want in your template."
97
  msgstr " 到模板中你想要添加的地方。"
98
 
99
- #: ../inc/wp-options.php:78
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  msgid "Only registered Users"
101
  msgstr "只有已注册的用户"
102
 
103
- #: ../inc/wp-options.php:82
104
- msgid "<strong>Active</strong> this option."
105
- msgstr "<strong>激活</strong>这个选项"
 
106
 
107
- #: ../inc/wp-options.php:84
108
  msgid "<strong>Only</strong> registered users have permission to like posts."
109
  msgstr "<strong>只有</strong> 已注册的用户才有权限喜欢文章。"
110
 
111
- #: ../inc/wp-options.php:88
112
  msgid "Show Users Like Box"
113
  msgstr "显示用户喜欢盒子"
114
 
115
- #: ../inc/wp-options.php:92 ../inc/wp-options.php:102
116
- msgid "Activate"
117
- msgstr "激活"
118
-
119
- #: ../inc/wp-options.php:94
120
  msgid "Active this option to show users avatar in like box."
121
  msgstr "激活这个选项可以在喜欢盒子里显示用户头像"
122
 
123
- #: ../inc/wp-options.php:98
 
 
 
 
 
 
 
 
124
  msgid "Custom Style"
125
  msgstr ""
126
 
127
- #: ../inc/wp-options.php:104
128
  msgid "Active this option to see custom color settings."
129
  msgstr ""
130
 
131
- #: ../inc/wp-options.php:108
132
  msgid "Button style"
133
  msgstr ""
134
 
135
- #: ../inc/wp-options.php:113 ../inc/wp-options.php:130
136
  msgid "Background"
137
  msgstr ""
138
 
139
- #: ../inc/wp-options.php:117 ../inc/wp-options.php:134
140
  msgid "Border Color"
141
  msgstr ""
142
 
143
- #: ../inc/wp-options.php:121 ../inc/wp-options.php:138
144
  msgid "Text Color"
145
  msgstr ""
146
 
147
- #: ../inc/wp-options.php:125
148
  msgid "Counter Style"
149
  msgstr ""
150
 
151
- #: ../inc/wp-options.php:148
152
  msgid "Like this plugin?"
153
  msgstr "喜欢这个插件?"
154
 
155
- #: ../inc/wp-options.php:151
156
  msgid ""
157
  "Show your support by Rating 5 Star in <a href=\"http://wordpress.org/plugins/"
158
  "wp-ulike\"> Plugin Directory reviews</a>"
@@ -160,12 +163,12 @@ msgstr ""
160
  "支持本插件,请在 <a href=\"http://wordpress.org/plugins/wp-ulike\"> 插件目录"
161
  "评论 </a> 提交 5 星级投票"
162
 
163
- #: ../inc/wp-options.php:152
164
  msgid ""
165
  "Follow me on <a href=\"https://www.facebook.com/alimir.ir\"> Facebook</a>"
166
  msgstr "关注我的 <a href=\"https://www.facebook.com/alimir.ir\"> Facebook</a>"
167
 
168
- #: ../inc/wp-options.php:153
169
  msgid ""
170
  "Plugin Author Blog: <a href=\"http://alimir.ir\"> Wordpress & Programming "
171
  "World.</a>"
@@ -174,6 +177,31 @@ msgstr ""
174
  "a><br /> 感谢 <a href=\"http://www.wpdaxue.com\" target=\"_blank\">WordPress"
175
  "大学</a> 提供简体中文支持"
176
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
177
  #: ../inc/wp-widget.php:8
178
  msgid "WP Ulike - Most Liked Posts"
179
  msgstr ""
@@ -222,6 +250,9 @@ msgstr ""
222
  msgid "Activate user like count"
223
  msgstr ""
224
 
 
 
 
225
  #~ msgid "WP Ulike Widget"
226
  #~ msgstr "WP Ulike 小工具"
227
 
2
  msgstr ""
3
  "Project-Id-Version: WP ULike\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2014-10-25 01:52+0330\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: Alimir <info@alimir.ir>\n"
8
  "Language-Team: 倡萌@WordPress大学 <admin@cmhello.com>\n"
24
  #: ../wp-ulike.php:17
25
  msgid ""
26
  "WP ULike plugin allows to integrate Like Button into your WordPress website "
27
+ "to allow your visitors to like pages, posts AND comments. Its very simple to "
28
+ "use and support a widget to display the most liked posts."
29
  msgstr ""
30
  "WP ULike 插件允许集成喜欢按钮到你的WordPress站点,让你的访客可以喜欢页面和文"
31
  "章。它非常简单易用,还支持通过小工具显示最多人喜欢的文章。"
32
 
33
+ #: ../wp-ulike.php:80 ../inc/wp-widget.php:106
34
  msgid "Like"
35
  msgstr "喜欢"
36
 
37
+ #: ../wp-ulike.php:81
38
  msgid "You Like This"
39
  msgstr "你喜欢这个"
40
 
41
+ #: ../wp-ulike.php:82
42
  msgid "You Dislike This"
43
  msgstr "你不喜欢这个"
44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  #: ../inc/wp-options.php:4
46
  msgid "WP Ulike"
47
  msgstr "WP Ulike"
48
 
49
+ #: ../inc/wp-options.php:33
50
  msgid "Configuration"
51
  msgstr "配置"
52
 
53
+ #: ../inc/wp-options.php:39
54
  msgid "Image or text?"
55
  msgstr "图片或文本?"
56
 
57
+ #: ../inc/wp-options.php:54
58
  msgid "Like Text"
59
  msgstr "[喜欢]文本"
60
 
61
+ #: ../inc/wp-options.php:62
62
  msgid "Dislike Text?"
63
  msgstr "[不喜欢]文本"
64
 
65
+ #: ../inc/wp-options.php:70
66
  msgid "Automatic display"
67
  msgstr "自动显示"
68
 
69
+ #: ../inc/wp-options.php:74
70
  msgid ""
71
  "<strong>On all posts</strong> (home, archives, search) at the bottom of the "
72
  "post"
73
  msgstr "<strong>在所有文章</strong>(首页、存档、搜索)文章的底部"
74
 
75
+ #: ../inc/wp-options.php:76
76
  msgid "If you disable this option, you have to put manually the code"
77
  msgstr "如果你禁用这个选项,你必须手动添加代码 "
78
 
79
+ #: ../inc/wp-options.php:76
80
  msgid "wherever you want in your template."
81
  msgstr " 到模板中你想要添加的地方。"
82
 
83
+ #: ../inc/wp-options.php:80
84
+ msgid "Comment likes"
85
+ msgstr ""
86
+
87
+ #: ../inc/wp-options.php:84
88
+ msgid "<strong>On all comments</strong> at the bottom of the comment"
89
+ msgstr ""
90
+
91
+ #: ../inc/wp-options.php:86
92
+ msgid ""
93
+ "If you disable this option, you have to put manually this code on comments "
94
+ "text"
95
+ msgstr ""
96
+
97
+ #: ../inc/wp-options.php:90
98
  msgid "Only registered Users"
99
  msgstr "只有已注册的用户"
100
 
101
+ #: ../inc/wp-options.php:94 ../inc/wp-options.php:104
102
+ #: ../inc/wp-options.php:114 ../inc/wp-options.php:124
103
+ msgid "Activate"
104
+ msgstr "激活"
105
 
106
+ #: ../inc/wp-options.php:96
107
  msgid "<strong>Only</strong> registered users have permission to like posts."
108
  msgstr "<strong>只有</strong> 已注册的用户才有权限喜欢文章。"
109
 
110
+ #: ../inc/wp-options.php:100
111
  msgid "Show Users Like Box"
112
  msgstr "显示用户喜欢盒子"
113
 
114
+ #: ../inc/wp-options.php:106
 
 
 
 
115
  msgid "Active this option to show users avatar in like box."
116
  msgstr "激活这个选项可以在喜欢盒子里显示用户头像"
117
 
118
+ #: ../inc/wp-options.php:110
119
+ msgid "Format Number"
120
+ msgstr ""
121
+
122
+ #: ../inc/wp-options.php:116
123
+ msgid "Convert numbers of Likes with string (kilobyte) format."
124
+ msgstr ""
125
+
126
+ #: ../inc/wp-options.php:120
127
  msgid "Custom Style"
128
  msgstr ""
129
 
130
+ #: ../inc/wp-options.php:126
131
  msgid "Active this option to see custom color settings."
132
  msgstr ""
133
 
134
+ #: ../inc/wp-options.php:130
135
  msgid "Button style"
136
  msgstr ""
137
 
138
+ #: ../inc/wp-options.php:135 ../inc/wp-options.php:152
139
  msgid "Background"
140
  msgstr ""
141
 
142
+ #: ../inc/wp-options.php:139 ../inc/wp-options.php:156
143
  msgid "Border Color"
144
  msgstr ""
145
 
146
+ #: ../inc/wp-options.php:143 ../inc/wp-options.php:160
147
  msgid "Text Color"
148
  msgstr ""
149
 
150
+ #: ../inc/wp-options.php:147
151
  msgid "Counter Style"
152
  msgstr ""
153
 
154
+ #: ../inc/wp-options.php:170
155
  msgid "Like this plugin?"
156
  msgstr "喜欢这个插件?"
157
 
158
+ #: ../inc/wp-options.php:173
159
  msgid ""
160
  "Show your support by Rating 5 Star in <a href=\"http://wordpress.org/plugins/"
161
  "wp-ulike\"> Plugin Directory reviews</a>"
163
  "支持本插件,请在 <a href=\"http://wordpress.org/plugins/wp-ulike\"> 插件目录"
164
  "评论 </a> 提交 5 星级投票"
165
 
166
+ #: ../inc/wp-options.php:174
167
  msgid ""
168
  "Follow me on <a href=\"https://www.facebook.com/alimir.ir\"> Facebook</a>"
169
  msgstr "关注我的 <a href=\"https://www.facebook.com/alimir.ir\"> Facebook</a>"
170
 
171
+ #: ../inc/wp-options.php:175
172
  msgid ""
173
  "Plugin Author Blog: <a href=\"http://alimir.ir\"> Wordpress & Programming "
174
  "World.</a>"
177
  "a><br /> 感谢 <a href=\"http://www.wpdaxue.com\" target=\"_blank\">WordPress"
178
  "大学</a> 提供简体中文支持"
179
 
180
+ #: ../inc/wp-ulike-comments.php:34 ../inc/wp-ulike-comments.php:50
181
+ #: ../inc/wp-ulike-posts.php:35 ../inc/wp-ulike-posts.php:51
182
+ msgid "Already Voted"
183
+ msgstr "已经投票"
184
+
185
+ #: ../inc/wp-ulike-comments.php:61
186
+ msgid "Users who have LIKED this comment:"
187
+ msgstr "谁也喜欢这个评论用户:"
188
+
189
+ #: ../inc/wp-ulike-comments.php:73
190
+ msgid "You need to login in order to like this comment: "
191
+ msgstr "你需要为了喜欢这个评论登陆"
192
+
193
+ #: ../inc/wp-ulike-comments.php:73 ../inc/wp-ulike-posts.php:75
194
+ msgid "click here"
195
+ msgstr "点击这里"
196
+
197
+ #: ../inc/wp-ulike-posts.php:63
198
+ msgid "Users who have LIKED this post:"
199
+ msgstr "喜欢该文章的用户:"
200
+
201
+ #: ../inc/wp-ulike-posts.php:75
202
+ msgid "You need to login in order to like this post: "
203
+ msgstr "你需要登录后才能喜欢这篇文章:"
204
+
205
  #: ../inc/wp-widget.php:8
206
  msgid "WP Ulike - Most Liked Posts"
207
  msgstr ""
250
  msgid "Activate user like count"
251
  msgstr ""
252
 
253
+ #~ msgid "<strong>Active</strong> this option."
254
+ #~ msgstr "<strong>激活</strong>这个选项"
255
+
256
  #~ msgid "WP Ulike Widget"
257
  #~ msgstr "WP Ulike 小工具"
258
 
lang/alimir-zh_TW.mo CHANGED
Binary file
lang/alimir-zh_TW.po CHANGED
@@ -2,7 +2,7 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: WP ULike\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2014-10-02 18:47+0330\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: Alimir <info@alimir.ir>\n"
8
  "Language-Team: 超級efly <eflyjason@gmail.com>\n"
@@ -25,135 +25,138 @@ msgstr "WP ULike"
25
  #: ../wp-ulike.php:17
26
  msgid ""
27
  "WP ULike plugin allows to integrate Like Button into your WordPress website "
28
- "to allow your visitors to like pages and posts. Its very simple to use and "
29
- "support a widget to display the most liked posts."
30
  msgstr ""
31
  "WP ULike 外掛允許集成喜歡按鈕到你的WordPress站點,讓你的訪客可以喜歡頁面和文"
32
  "章。它非常簡單易用,還支持通過小工具顯示最多人喜歡的文章。"
33
 
34
- #: ../wp-ulike.php:56 ../inc/wp-widget.php:106
35
  msgid "Like"
36
  msgstr "喜歡"
37
 
38
- #: ../wp-ulike.php:57
39
  msgid "You Like This"
40
  msgstr "你喜歡這個"
41
 
42
- #: ../wp-ulike.php:58
43
  msgid "You Dislike This"
44
  msgstr "你不喜歡這個"
45
 
46
- #: ../wp-ulike.php:118 ../wp-ulike.php:134
47
- msgid "Already Voted"
48
- msgstr "已經投票"
49
-
50
- #: ../wp-ulike.php:146
51
- msgid "Users who have LIKED this post:"
52
- msgstr "喜歡該文章的用戶:"
53
-
54
- #: ../wp-ulike.php:158
55
- msgid "You need to login in order to like this post: "
56
- msgstr "你需要登錄後才能喜歡這篇文章:"
57
-
58
- #: ../wp-ulike.php:158
59
- msgid "click here"
60
- msgstr "點擊這裡"
61
-
62
  #: ../inc/wp-options.php:4
63
  msgid "WP Ulike"
64
  msgstr "WP Ulike"
65
 
66
- #: ../inc/wp-options.php:31
67
  msgid "Configuration"
68
  msgstr "配置"
69
 
70
- #: ../inc/wp-options.php:37
71
  msgid "Image or text?"
72
  msgstr "圖片或文本?"
73
 
74
- #: ../inc/wp-options.php:52
75
  msgid "Like Text"
76
  msgstr "[喜歡]文本"
77
 
78
- #: ../inc/wp-options.php:60
79
  msgid "Dislike Text?"
80
  msgstr "[不喜歡]文本"
81
 
82
- #: ../inc/wp-options.php:68
83
  msgid "Automatic display"
84
  msgstr "自動顯示"
85
 
86
- #: ../inc/wp-options.php:72
87
  msgid ""
88
  "<strong>On all posts</strong> (home, archives, search) at the bottom of the "
89
  "post"
90
  msgstr "<strong>在所有文章</strong>(首頁、存檔、搜索)文章的底部"
91
 
92
- #: ../inc/wp-options.php:74
93
  msgid "If you disable this option, you have to put manually the code"
94
  msgstr "如果你禁用這個選項,你必須手動添加代碼 "
95
 
96
- #: ../inc/wp-options.php:74
97
  msgid "wherever you want in your template."
98
  msgstr " 到模板中你想要添加的地方。"
99
 
100
- #: ../inc/wp-options.php:78
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  msgid "Only registered Users"
102
  msgstr "只有已注冊的用戶"
103
 
104
- #: ../inc/wp-options.php:82
105
- msgid "<strong>Active</strong> this option."
106
- msgstr "<strong>激活</strong>這個選項"
 
107
 
108
- #: ../inc/wp-options.php:84
109
  msgid "<strong>Only</strong> registered users have permission to like posts."
110
  msgstr "<strong>只有</strong> 已注冊的用戶才有權限喜歡文章。"
111
 
112
- #: ../inc/wp-options.php:88
113
  msgid "Show Users Like Box"
114
  msgstr "顯示用戶喜歡盒子"
115
 
116
- #: ../inc/wp-options.php:92 ../inc/wp-options.php:102
117
- msgid "Activate"
118
- msgstr "激活"
119
-
120
- #: ../inc/wp-options.php:94
121
  msgid "Active this option to show users avatar in like box."
122
  msgstr "激活這個選項可以在喜歡盒子裡顯示用戶大頭貼"
123
 
124
- #: ../inc/wp-options.php:98
 
 
 
 
 
 
 
 
125
  msgid "Custom Style"
126
  msgstr ""
127
 
128
- #: ../inc/wp-options.php:104
129
  msgid "Active this option to see custom color settings."
130
  msgstr ""
131
 
132
- #: ../inc/wp-options.php:108
133
  msgid "Button style"
134
  msgstr ""
135
 
136
- #: ../inc/wp-options.php:113 ../inc/wp-options.php:130
137
  msgid "Background"
138
  msgstr ""
139
 
140
- #: ../inc/wp-options.php:117 ../inc/wp-options.php:134
141
  msgid "Border Color"
142
  msgstr ""
143
 
144
- #: ../inc/wp-options.php:121 ../inc/wp-options.php:138
145
  msgid "Text Color"
146
  msgstr ""
147
 
148
- #: ../inc/wp-options.php:125
149
  msgid "Counter Style"
150
  msgstr ""
151
 
152
- #: ../inc/wp-options.php:148
153
  msgid "Like this plugin?"
154
  msgstr "喜歡這個外掛?"
155
 
156
- #: ../inc/wp-options.php:151
157
  msgid ""
158
  "Show your support by Rating 5 Star in <a href=\"http://wordpress.org/plugins/"
159
  "wp-ulike\"> Plugin Directory reviews</a>"
@@ -161,12 +164,12 @@ msgstr ""
161
  "支持本外掛,請在 <a href=\"http://wordpress.org/plugins/wp-ulike\"> 外掛目錄"
162
  "迴響 </a> 提交 5 星級投票"
163
 
164
- #: ../inc/wp-options.php:152
165
  msgid ""
166
  "Follow me on <a href=\"https://www.facebook.com/alimir.ir\"> Facebook</a>"
167
  msgstr "關注我的 <a href=\"https://www.facebook.com/alimir.ir\"> Facebook</a>"
168
 
169
- #: ../inc/wp-options.php:153
170
  msgid ""
171
  "Plugin Author Blog: <a href=\"http://alimir.ir\"> Wordpress & Programming "
172
  "World.</a>"
@@ -175,6 +178,31 @@ msgstr ""
175
  "a><br /> 感謝 <a href=\"http://www.arefly.com\" target=\"_blank\">暢想資源</"
176
  "a> 提供繁體中文支持"
177
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  #: ../inc/wp-widget.php:8
179
  msgid "WP Ulike - Most Liked Posts"
180
  msgstr "WP Ulike - 最多人喜歡的文章"
@@ -223,6 +251,9 @@ msgstr "用戶大頭貼尺寸"
223
  msgid "Activate user like count"
224
  msgstr "開啟「用戶喜歡」計數"
225
 
 
 
 
226
  #~ msgid "WP Ulike Widget"
227
  #~ msgstr "WP Ulike 小工具"
228
 
2
  msgstr ""
3
  "Project-Id-Version: WP ULike\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2014-10-25 01:54+0330\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: Alimir <info@alimir.ir>\n"
8
  "Language-Team: 超級efly <eflyjason@gmail.com>\n"
25
  #: ../wp-ulike.php:17
26
  msgid ""
27
  "WP ULike plugin allows to integrate Like Button into your WordPress website "
28
+ "to allow your visitors to like pages, posts AND comments. Its very simple to "
29
+ "use and support a widget to display the most liked posts."
30
  msgstr ""
31
  "WP ULike 外掛允許集成喜歡按鈕到你的WordPress站點,讓你的訪客可以喜歡頁面和文"
32
  "章。它非常簡單易用,還支持通過小工具顯示最多人喜歡的文章。"
33
 
34
+ #: ../wp-ulike.php:80 ../inc/wp-widget.php:106
35
  msgid "Like"
36
  msgstr "喜歡"
37
 
38
+ #: ../wp-ulike.php:81
39
  msgid "You Like This"
40
  msgstr "你喜歡這個"
41
 
42
+ #: ../wp-ulike.php:82
43
  msgid "You Dislike This"
44
  msgstr "你不喜歡這個"
45
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  #: ../inc/wp-options.php:4
47
  msgid "WP Ulike"
48
  msgstr "WP Ulike"
49
 
50
+ #: ../inc/wp-options.php:33
51
  msgid "Configuration"
52
  msgstr "配置"
53
 
54
+ #: ../inc/wp-options.php:39
55
  msgid "Image or text?"
56
  msgstr "圖片或文本?"
57
 
58
+ #: ../inc/wp-options.php:54
59
  msgid "Like Text"
60
  msgstr "[喜歡]文本"
61
 
62
+ #: ../inc/wp-options.php:62
63
  msgid "Dislike Text?"
64
  msgstr "[不喜歡]文本"
65
 
66
+ #: ../inc/wp-options.php:70
67
  msgid "Automatic display"
68
  msgstr "自動顯示"
69
 
70
+ #: ../inc/wp-options.php:74
71
  msgid ""
72
  "<strong>On all posts</strong> (home, archives, search) at the bottom of the "
73
  "post"
74
  msgstr "<strong>在所有文章</strong>(首頁、存檔、搜索)文章的底部"
75
 
76
+ #: ../inc/wp-options.php:76
77
  msgid "If you disable this option, you have to put manually the code"
78
  msgstr "如果你禁用這個選項,你必須手動添加代碼 "
79
 
80
+ #: ../inc/wp-options.php:76
81
  msgid "wherever you want in your template."
82
  msgstr " 到模板中你想要添加的地方。"
83
 
84
+ #: ../inc/wp-options.php:80
85
+ msgid "Comment likes"
86
+ msgstr ""
87
+
88
+ #: ../inc/wp-options.php:84
89
+ msgid "<strong>On all comments</strong> at the bottom of the comment"
90
+ msgstr "<strong>在所有文章</strong>(首頁、存檔、搜索)文章的底部"
91
+
92
+ #: ../inc/wp-options.php:86
93
+ msgid ""
94
+ "If you disable this option, you have to put manually this code on comments "
95
+ "text"
96
+ msgstr "如果你禁用這個選項,你必須手動添加代碼 "
97
+
98
+ #: ../inc/wp-options.php:90
99
  msgid "Only registered Users"
100
  msgstr "只有已注冊的用戶"
101
 
102
+ #: ../inc/wp-options.php:94 ../inc/wp-options.php:104
103
+ #: ../inc/wp-options.php:114 ../inc/wp-options.php:124
104
+ msgid "Activate"
105
+ msgstr "激活"
106
 
107
+ #: ../inc/wp-options.php:96
108
  msgid "<strong>Only</strong> registered users have permission to like posts."
109
  msgstr "<strong>只有</strong> 已注冊的用戶才有權限喜歡文章。"
110
 
111
+ #: ../inc/wp-options.php:100
112
  msgid "Show Users Like Box"
113
  msgstr "顯示用戶喜歡盒子"
114
 
115
+ #: ../inc/wp-options.php:106
 
 
 
 
116
  msgid "Active this option to show users avatar in like box."
117
  msgstr "激活這個選項可以在喜歡盒子裡顯示用戶大頭貼"
118
 
119
+ #: ../inc/wp-options.php:110
120
+ msgid "Format Number"
121
+ msgstr ""
122
+
123
+ #: ../inc/wp-options.php:116
124
+ msgid "Convert numbers of Likes with string (kilobyte) format."
125
+ msgstr ""
126
+
127
+ #: ../inc/wp-options.php:120
128
  msgid "Custom Style"
129
  msgstr ""
130
 
131
+ #: ../inc/wp-options.php:126
132
  msgid "Active this option to see custom color settings."
133
  msgstr ""
134
 
135
+ #: ../inc/wp-options.php:130
136
  msgid "Button style"
137
  msgstr ""
138
 
139
+ #: ../inc/wp-options.php:135 ../inc/wp-options.php:152
140
  msgid "Background"
141
  msgstr ""
142
 
143
+ #: ../inc/wp-options.php:139 ../inc/wp-options.php:156
144
  msgid "Border Color"
145
  msgstr ""
146
 
147
+ #: ../inc/wp-options.php:143 ../inc/wp-options.php:160
148
  msgid "Text Color"
149
  msgstr ""
150
 
151
+ #: ../inc/wp-options.php:147
152
  msgid "Counter Style"
153
  msgstr ""
154
 
155
+ #: ../inc/wp-options.php:170
156
  msgid "Like this plugin?"
157
  msgstr "喜歡這個外掛?"
158
 
159
+ #: ../inc/wp-options.php:173
160
  msgid ""
161
  "Show your support by Rating 5 Star in <a href=\"http://wordpress.org/plugins/"
162
  "wp-ulike\"> Plugin Directory reviews</a>"
164
  "支持本外掛,請在 <a href=\"http://wordpress.org/plugins/wp-ulike\"> 外掛目錄"
165
  "迴響 </a> 提交 5 星級投票"
166
 
167
+ #: ../inc/wp-options.php:174
168
  msgid ""
169
  "Follow me on <a href=\"https://www.facebook.com/alimir.ir\"> Facebook</a>"
170
  msgstr "關注我的 <a href=\"https://www.facebook.com/alimir.ir\"> Facebook</a>"
171
 
172
+ #: ../inc/wp-options.php:175
173
  msgid ""
174
  "Plugin Author Blog: <a href=\"http://alimir.ir\"> Wordpress & Programming "
175
  "World.</a>"
178
  "a><br /> 感謝 <a href=\"http://www.arefly.com\" target=\"_blank\">暢想資源</"
179
  "a> 提供繁體中文支持"
180
 
181
+ #: ../inc/wp-ulike-comments.php:34 ../inc/wp-ulike-comments.php:50
182
+ #: ../inc/wp-ulike-posts.php:35 ../inc/wp-ulike-posts.php:51
183
+ msgid "Already Voted"
184
+ msgstr "已經投票"
185
+
186
+ #: ../inc/wp-ulike-comments.php:61
187
+ msgid "Users who have LIKED this comment:"
188
+ msgstr "誰也喜歡這個評論用戶:"
189
+
190
+ #: ../inc/wp-ulike-comments.php:73
191
+ msgid "You need to login in order to like this comment: "
192
+ msgstr "你需要為了喜歡這個評論登陸:"
193
+
194
+ #: ../inc/wp-ulike-comments.php:73 ../inc/wp-ulike-posts.php:75
195
+ msgid "click here"
196
+ msgstr "點擊這裡"
197
+
198
+ #: ../inc/wp-ulike-posts.php:63
199
+ msgid "Users who have LIKED this post:"
200
+ msgstr "喜歡該文章的用戶:"
201
+
202
+ #: ../inc/wp-ulike-posts.php:75
203
+ msgid "You need to login in order to like this post: "
204
+ msgstr "你需要登錄後才能喜歡這篇文章:"
205
+
206
  #: ../inc/wp-widget.php:8
207
  msgid "WP Ulike - Most Liked Posts"
208
  msgstr "WP Ulike - 最多人喜歡的文章"
251
  msgid "Activate user like count"
252
  msgstr "開啟「用戶喜歡」計數"
253
 
254
+ #~ msgid "<strong>Active</strong> this option."
255
+ #~ msgstr "<strong>激活</strong>這個選項"
256
+
257
  #~ msgid "WP Ulike Widget"
258
  #~ msgstr "WP Ulike 小工具"
259
 
readme.txt CHANGED
@@ -5,15 +5,15 @@ Author: Ali Mirzaei
5
  Tags: wp ulike, wordpress youlike plugin, like button, rating, vote, voting, most liked posts, wordpress like page, wordpress like post, wordpress vote page, wordpress vote post, wp like page, wp like post, wp like plugin
6
  Requires at least: 3.0
7
  Tested up to: 4.0
8
- Stable tag: 1.5
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
12
- WP ULike plugin allows to integrate Ajax Like Button into your WordPress website to allow your visitors to like and dislike pages and posts.
13
 
14
  == Description ==
15
 
16
- WP ULike plugin allows to integrate a beautiful Ajax Like Button into your wordPress website to allow your visitors to like and dislike pages and posts. Its very simple to use and support a widget to display the most liked posts.
17
 
18
  = Demo =
19
 
@@ -27,6 +27,8 @@ WP ULike plugin allows to integrate a beautiful Ajax Like Button into your wordP
27
  * Compatible with WP version 3.0 & above.
28
  * Added automatically (no Code required).
29
  * Shortcode support.
 
 
30
  * Simple user like box with avatar support.
31
  * Custom Like-Dislike Texts.
32
  * Simple custom style with color picker settings.
@@ -64,6 +66,11 @@ Screenshots are available in <a href="http://preview.alimir.ir/wp-ulike-plugin"
64
 
65
  == Changelog ==
66
 
 
 
 
 
 
67
  = 1.5 =
68
  * Added: Number format option to convert numbers of Likes with string (kilobyte) format.
69
  * Updated: Persian language.
@@ -93,5 +100,8 @@ Screenshots are available in <a href="http://preview.alimir.ir/wp-ulike-plugin"
93
 
94
  == Upgrade Notice ==
95
 
 
 
 
96
  = 1.0 =
97
  The initial version
5
  Tags: wp ulike, wordpress youlike plugin, like button, rating, vote, voting, most liked posts, wordpress like page, wordpress like post, wordpress vote page, wordpress vote post, wp like page, wp like post, wp like plugin
6
  Requires at least: 3.0
7
  Tested up to: 4.0
8
+ Stable tag: 1.6
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
12
+ WP ULike plugin allows to integrate Ajax Like Button into your WordPress website to allow your visitors to like and dislike pages, posts and comments.
13
 
14
  == Description ==
15
 
16
+ WP ULike plugin allows to integrate a beautiful Ajax Like Button into your wordPress website to allow your visitors to like and dislike pages, posts and comments. Its very simple to use and support a widget to display the most liked posts.
17
 
18
  = Demo =
19
 
27
  * Compatible with WP version 3.0 & above.
28
  * Added automatically (no Code required).
29
  * Shortcode support.
30
+ * Comment likes support.
31
+ * BuddyPress activity support.
32
  * Simple user like box with avatar support.
33
  * Custom Like-Dislike Texts.
34
  * Simple custom style with color picker settings.
66
 
67
  == Changelog ==
68
 
69
+ = 1.6 =
70
+ * Added: Comment likes support.
71
+ * Added: BuddyPress activity support.
72
+ * Updated: language files.
73
+
74
  = 1.5 =
75
  * Added: Number format option to convert numbers of Likes with string (kilobyte) format.
76
  * Updated: Persian language.
100
 
101
  == Upgrade Notice ==
102
 
103
+ = 1.6 =
104
+ After plugin update: If the new database table won't fixed, try deactivating the plugin and reactivating that one at a time.
105
+
106
  = 1.0 =
107
  The initial version
wp-ulike.php CHANGED
@@ -2,8 +2,8 @@
2
  /*
3
  Plugin Name:WP ULike
4
  Plugin URI: http://wordpress.org/plugins/wp-ulike
5
- Description: WP ULike plugin allows to integrate Like Button into your WordPress website to allow your visitors to like pages and posts. Its very simple to use and support a widget to display the most liked posts.
6
- Version: 1.5
7
  Author: Ali Mirzaei
8
  Author URI: http://about.alimir.ir
9
  Text Domain: alimir
@@ -14,23 +14,15 @@ License: GPL2
14
  //Load Translations
15
  load_plugin_textdomain( 'alimir', false, dirname( plugin_basename( __FILE__ ) ) .'/lang/' );
16
  __('WP ULike', 'alimir');
17
- __('WP ULike plugin allows to integrate Like Button into your WordPress website to allow your visitors to like pages and posts. Its very simple to use and support a widget to display the most liked posts.', 'alimir');
18
-
19
- //Load Widget
20
- include( plugin_dir_path( __FILE__ ) . 'inc/wp-widget.php');
21
- //Load Options
22
- include( plugin_dir_path( __FILE__ ) . 'inc/wp-options.php');
23
- //Load Scripts
24
- include( plugin_dir_path( __FILE__ ) . 'inc/wp-script.php');
25
- //Load Functions
26
- include( plugin_dir_path( __FILE__ ) . 'inc/wp-functions.php');
27
 
28
  //Do not change this value
29
- define('WP_ULIKE_DB_VERSION', '1.0');
30
-
31
- function wp_ulike_options() {
32
 
 
 
33
  global $wpdb;
 
34
  $table_name = $wpdb->prefix . "ulike";
35
  if($wpdb->get_var("show tables like '$table_name'") != $table_name) {
36
  $sql = "CREATE TABLE " . $table_name . " (
@@ -49,8 +41,28 @@ License: GPL2
49
  add_option('wp_ulike_dbVersion', WP_ULIKE_DB_VERSION);
50
  }
51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  add_option('wp_ulike_onPage', '1', '', 'yes');
 
53
  add_option('wp_ulike_onlyRegistered', '0', '', 'yes');
 
54
  add_option('wp_ulike_user_like_box', '1', '', 'yes');
55
  add_option('wp_ulike_textOrImage', 'image', '', 'yes');
56
  add_option('wp_ulike_text', __('Like','alimir'), '', 'yes');
@@ -59,21 +71,22 @@ License: GPL2
59
  add_option('wp_ulike_format_number', '0', '', 'yes');
60
  add_option('wp_ulike_style', '0', '', 'yes');
61
  }
62
-
63
  register_activation_hook(__FILE__, 'wp_ulike_options');
64
-
65
- function wp_ulike_unset_options() {
66
 
67
- global $wpdb;
68
- $current_db_version = get_option('wp_ulike_dbVersion');
69
-
70
- if ($current_db_version != WP_ULIKE_DB_VERSION) {
71
- $wpdb->query("DROP TABLE IF EXISTS ".$wpdb->prefix."ulike");
72
- update_option('wp_ulike_dbVersion', $current_db_version);
73
  }
 
 
74
 
 
 
75
  delete_option('wp_ulike_onPage');
 
76
  delete_option('wp_ulike_onlyRegistered');
 
77
  delete_option('wp_ulike_user_like_box');
78
  delete_option('wp_ulike_textOrImage');
79
  delete_option('wp_ulike_text');
@@ -82,138 +95,17 @@ License: GPL2
82
  delete_option('wp_ulike_format_number');
83
  delete_option('wp_ulike_style');
84
  }
85
-
86
  register_uninstall_hook(__FILE__, 'wp_ulike_unset_options');
87
-
88
- //main function
89
- function wp_ulike($arg) {
90
 
91
- global $post,$wpdb,$user_ID;
92
- $post_ID = $post->ID;
93
- $counter = '';
94
- $get_like = get_post_meta($post_ID, '_liked', true) != '' ? get_post_meta($post_ID, '_liked', true) : '0';
95
- $liked = wp_ulike_format_number($get_like);
96
-
97
- if ( (get_option('wp_ulike_onlyRegistered') != '1') or (get_option('wp_ulike_onlyRegistered') == '1' && is_user_logged_in()) ){
98
-
99
-
100
- if(is_user_logged_in()){
101
- $user_status = $wpdb->get_var("SELECT COUNT(*) FROM ".$wpdb->prefix."ulike WHERE post_id = '$post_ID' AND user_id = '$user_ID'");
102
-
103
- if(!isset($_COOKIE['liked-'.$post_ID]) && $user_status == 0){
104
- if (get_option('wp_ulike_textOrImage') == 'image') {
105
- $counter = '<a onclick="likeThis('.$post_ID.', 1, 0);" class="image"></a><span class="count-box">'.$liked.'</span>';
106
- }
107
- else {
108
- $counter = '<a onclick="likeThis('.$post_ID.', 1, 0);" class="text">'.get_option('wp_ulike_text').'</a><span class="count-box">'.$liked.'</span>';
109
- }
110
- }
111
- else if($user_status != 0){
112
- if(get_user_status($post_ID,$user_ID) == "like"){
113
- $counter = '<a onclick="likeThis('.$post_ID.', 1, 1);" class="text">'.get_option('wp_ulike_btn_text').'</a><span class="count-box">'.$liked.'</span>';
114
- }
115
- else if(get_user_status($post_ID,$user_ID) == "dislike"){
116
- $counter = '<a onclick="likeThis('.$post_ID.', 1, 0);" class="text">'.get_option('wp_ulike_dislike_text').'</a><span class="count-box">'.$liked.'</span>';
117
- }
118
- }
119
-
120
- else if(isset($_COOKIE['liked-'.$post_ID]) && $user_status == 0){
121
- $counter = '<a class="text user-tooltip" title="'.__('Already Voted','alimir').'">'.get_option('wp_ulike_btn_text').'</a><span class="count-box">'.$liked.'</span>';
122
- }
123
- }
124
- else{
125
- if(!isset($_COOKIE['liked-'.$post_ID])){
126
-
127
- if (get_option('wp_ulike_textOrImage') == 'image') {
128
- $counter = '<a onclick="likeThis('.$post_ID.', 1, 2);" class="image"></a><span class="count-box">'.$liked.'</span>';
129
- }
130
- else {
131
- $counter = '<a onclick="likeThis('.$post_ID.', 1, 2);" class="text">'.get_option('wp_ulike_text').'</a><span class="count-box">'.$liked.'</span>';
132
- }
133
-
134
- }
135
- else{
136
-
137
- $counter = '<a class="text user-tooltip" title="'.__('Already Voted','alimir').'">'.get_option('wp_ulike_btn_text').'</a><span class="count-box">'.$liked.'</span>';
138
-
139
- }
140
- }
141
-
142
- $wp_ulike = '<div id="wp-ulike-'.$post_ID.'" class="wpulike">';
143
- $wp_ulike .= '<div class="counter">'.$counter.'</div>';
144
- $wp_ulike .= '</div>';
145
-
146
-
147
- $user_data = get_user_data($post_ID,$user_ID);
148
- if(get_option('wp_ulike_user_like_box') == '1' && $user_data != '')
149
- $wp_ulike .= '<br /><p style="margin-top:5px">'.__('Users who have LIKED this post:','alimir').'</p><ul id="tiles">' . $user_data . '</ul>';
150
-
151
- if ($arg == 'put') {
152
- return $wp_ulike;
153
- }
154
- else {
155
- echo $wp_ulike;
156
- }
157
-
158
- }
159
-
160
- else if (get_option('wp_ulike_onlyRegistered') == '1' && !is_user_logged_in()){
161
- return '<p class="alert alert-info fade in" role="alert"><button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>'.__('You need to login in order to like this post: ','alimir').'<a href="'.wp_login_url( get_permalink() ).'"> '.__('click here','alimir').' </a></p>';
162
- }
163
-
164
- }
165
-
166
- //Process function
167
- function wp_ulike_process(){
168
-
169
- global $wpdb,$user_ID;
170
- $post_ID = $_POST['id'];
171
- $like = get_post_meta($post_ID, '_liked', true);
172
- $user_status = $wpdb->get_var("SELECT COUNT(*) FROM ".$wpdb->prefix."ulike WHERE post_id = '$post_ID' AND user_id = '$user_ID'");
173
-
174
- if($post_ID != '') {
175
- if (!isset($_COOKIE['liked-'.$post_ID]) && $user_status == 0) {
176
- $newLike = $like + 1;
177
- update_post_meta($post_ID, '_liked', $newLike);
178
-
179
- setcookie('liked-'.$post_ID, time(), time()+3600*24*365, '/');
180
-
181
- if(is_user_logged_in()):
182
- $ip = wp_ulike_get_real_ip();
183
- $wpdb->query("INSERT INTO ".$wpdb->prefix."ulike VALUES ('', '$post_ID', NOW(), '$ip', '$user_ID', 'like')");
184
- endif;
185
-
186
- echo wp_ulike_format_number($newLike);
187
- }
188
- else if ($user_status != 0) {
189
- if(get_user_status($post_ID,$user_ID) == "like"){
190
- $newLike = $like - 1;
191
- update_post_meta($post_ID, '_liked', $newLike);
192
-
193
- $wpdb->query("
194
- UPDATE ".$wpdb->prefix."ulike
195
- SET status = 'dislike'
196
- WHERE post_id = '$post_ID' AND user_id = '$user_ID'
197
- ");
198
-
199
- echo wp_ulike_format_number($newLike);
200
- }
201
- else{
202
- $newLike = $like + 1;
203
- update_post_meta($post_ID, '_liked', $newLike);
204
-
205
- $wpdb->query("
206
- UPDATE ".$wpdb->prefix."ulike
207
- SET status = 'like'
208
- WHERE post_id = '$post_ID' AND user_id = '$user_ID'
209
- ");
210
-
211
- echo wp_ulike_format_number($newLike);
212
- }
213
- }
214
- else if (isset($_COOKIE['liked-'.$post_ID]) && $user_status == 0){
215
- echo wp_ulike_format_number($like);
216
- }
217
- }
218
- die();
219
- }
2
  /*
3
  Plugin Name:WP ULike
4
  Plugin URI: http://wordpress.org/plugins/wp-ulike
5
+ Description: WP ULike plugin allows to integrate Like Button into your WordPress website to allow your visitors to like pages, posts AND comments. Its very simple to use and support a widget to display the most liked posts.
6
+ Version: 1.6
7
  Author: Ali Mirzaei
8
  Author URI: http://about.alimir.ir
9
  Text Domain: alimir
14
  //Load Translations
15
  load_plugin_textdomain( 'alimir', false, dirname( plugin_basename( __FILE__ ) ) .'/lang/' );
16
  __('WP ULike', 'alimir');
17
+ __('WP ULike plugin allows to integrate Like Button into your WordPress website to allow your visitors to like pages, posts AND comments. Its very simple to use and support a widget to display the most liked posts.', 'alimir');
 
 
 
 
 
 
 
 
 
18
 
19
  //Do not change this value
20
+ define('WP_ULIKE_DB_VERSION', '1.1');
 
 
21
 
22
+ //register activation hook
23
+ function wp_ulike_options() {
24
  global $wpdb;
25
+
26
  $table_name = $wpdb->prefix . "ulike";
27
  if($wpdb->get_var("show tables like '$table_name'") != $table_name) {
28
  $sql = "CREATE TABLE " . $table_name . " (
41
  add_option('wp_ulike_dbVersion', WP_ULIKE_DB_VERSION);
42
  }
43
 
44
+ $table_name_2 = $wpdb->prefix . "ulike_comments";
45
+ if($wpdb->get_var("show tables like '$table_name_2'") != $table_name_2) {
46
+ $sql = "CREATE TABLE " . $table_name_2 . " (
47
+ `id` bigint(11) NOT NULL AUTO_INCREMENT,
48
+ `comment_id` int(11) NOT NULL,
49
+ `date_time` datetime NOT NULL,
50
+ `ip` varchar(30) NOT NULL,
51
+ `user_id` int(11) NOT NULL,
52
+ `status` varchar(15) NOT NULL,
53
+ PRIMARY KEY (`id`)
54
+ );";
55
+
56
+ require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
57
+ dbDelta($sql);
58
+
59
+ update_option('wp_ulike_dbVersion', WP_ULIKE_DB_VERSION);
60
+ }
61
+
62
  add_option('wp_ulike_onPage', '1', '', 'yes');
63
+ add_option('wp_ulike_onComments', '1', '', 'yes');
64
  add_option('wp_ulike_onlyRegistered', '0', '', 'yes');
65
+ add_option('wp_ulike_bp_activity_add', '0', '', 'yes');
66
  add_option('wp_ulike_user_like_box', '1', '', 'yes');
67
  add_option('wp_ulike_textOrImage', 'image', '', 'yes');
68
  add_option('wp_ulike_text', __('Like','alimir'), '', 'yes');
71
  add_option('wp_ulike_format_number', '0', '', 'yes');
72
  add_option('wp_ulike_style', '0', '', 'yes');
73
  }
 
74
  register_activation_hook(__FILE__, 'wp_ulike_options');
 
 
75
 
76
+ //plugin update check
77
+ function wp_ulike_update_db_check() {
78
+ if ( get_site_option( 'wp_ulike_dbVersion' ) != WP_ULIKE_DB_VERSION ) {
79
+ wp_ulike_options();
 
 
80
  }
81
+ }
82
+ add_action( 'plugins_loaded', 'wp_ulike_update_db_check' );
83
 
84
+ //register uninstall hook
85
+ function wp_ulike_unset_options() {
86
  delete_option('wp_ulike_onPage');
87
+ delete_option('wp_ulike_onComments');
88
  delete_option('wp_ulike_onlyRegistered');
89
+ delete_option('wp_ulike_bp_activity_add');
90
  delete_option('wp_ulike_user_like_box');
91
  delete_option('wp_ulike_textOrImage');
92
  delete_option('wp_ulike_text');
95
  delete_option('wp_ulike_format_number');
96
  delete_option('wp_ulike_style');
97
  }
 
98
  register_uninstall_hook(__FILE__, 'wp_ulike_unset_options');
 
 
 
99
 
100
+ //Load plugin widget
101
+ include( plugin_dir_path( __FILE__ ) . 'inc/wp-widget.php');
102
+ //Load plugin setting panel
103
+ include( plugin_dir_path( __FILE__ ) . 'inc/wp-options.php');
104
+ //Load plugin scripts
105
+ include( plugin_dir_path( __FILE__ ) . 'inc/wp-script.php');
106
+ //Load general functions
107
+ include( plugin_dir_path( __FILE__ ) . 'inc/wp-functions.php');
108
+ //Load WP ULike posts functions
109
+ include( plugin_dir_path( __FILE__ ) . 'inc/wp-ulike-posts.php');
110
+ //Load WP ULike comments functions
111
+ include( plugin_dir_path( __FILE__ ) . 'inc/wp-ulike-comments.php');