MyBB Community Forums

Full Version: [1.4.x/1.6.x] Thank You/Like System v1.5 (Updated: 10/26/2011)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
better to set a limit to every group (max likes per day)
(2014-11-08, 09:57 AM)Eldenroot Wrote: [ -> ]better to set a limit to every group (max likes per day)

I would have done that, but that option is not available in my ACP Settings for the plugin.

So how can I add it?^^ I wouldnt know the php code for it to add to the pluginfile. Do you have a solution?
unfortunately I dont
there is no file like " thankyoulike_button_del "

(2014-09-07, 06:09 PM)My-BB.Ir Wrote: [ -> ]If you want use it for 1.8 see this:

in "inc/plugins/thankyoulike.php" find:

"compatibility" => "14*,16*"
replace with:

"compatibility" => "14*,16*,18*"

and change "jscript/thankyoulike.js"  to this code:

var thankyoulike = {
 init: function()
 {
 },
 
 tgl: function(pid)
 {
 if(tylCollapsible == 1)
 {
 if($('#tyl_data_'+pid).is(':visible'))
 {
 $('#tyl_data_'+pid).hide();
 $('#tyl_title_'+pid).hide();
 $('#tyl_title_collapsed_'+pid).show();
 $('#tyl_i_expcol_'+pid).attr('src', $('#tyl_i_expcol_'+pid).attr('src').replace("collapse", "collapse_collapsed"));
 $('#tyl_i_expcol_'+pid).attr('alt', "[+]");
 $('#tyl_a_expcol_'+pid).attr('title', "[+]");
 }
 else
 {
 $('#tyl_data_'+pid).show();
 $('#tyl_title_collapsed_'+pid).hide();
 $('#tyl_title_'+pid).show();
 $('#tyl_i_expcol_'+pid).attr('src', $('#tyl_i_expcol_'+pid).attr('src').replace("collapse_collapsed", "collapse"));
 $('#tyl_i_expcol_'+pid).attr('alt', "[-]");
 $('#tyl_a_expcol_'+pid).attr('title', "[-]");
 }
 }
 },
 
 add: function(pid)
 {
 if(use_xmlhttprequest == 1 && tylEnabled == 1)
 {
 if(tylUser == 0)
 {
 return true;
 }
 //this.spinner = new ActivityIndicator("body", {image: imagepath + "/spinner_big.gif"});
 $.ajax('thankyoulike.php?ajax=1&action=add&pid='+pid+'&my_post_key='+my_post_key,
 {
 type: 'POST'
 }).done(function(data)
 {
 thankyoulike.addDone(data, pid);
 });
 document.body.style.cursor = 'wait';
 return false;
 }
 else
 {
 return true;
 }
 },
 
 addDone: function(data, pid)
 {
 if(typeof data == 'string' && data.match(/<error>([^<]*)<\/error>/))
 {
 message = data.match(/<error>([^<]*)<\/error>/);

 if(!message[1])
 {
 message[1] = "An unknown error occurred.";
 }

 /*if(this.spinner)
 {
 this.spinner.destroy();
 this.spinner = '';
 }*/
 document.body.style.cursor = 'default';
 alert(message[1]);
 }
 else
 {
 tylVisible = 2;
 if(tylCollapsible == 1 && $("#tyl_"+pid).css('display') != "none")
 { 
 if($('datatyl_data_'+pid).is(':visible'))
 {
 tylVisible = 1;
 }
 else
 {
 tylVisible = 0;
 }
 }
 $("#tyl_"+pid).html(data.tylData);
 $("#tyl_"+pid).show();
 $("#tyl_btn_"+pid).html(data.tylButton);
 if(tylCollapsible == 1)
 {
 if(tylVisible != 2)
 {
 if(tylVisible == 1)
 {
 $('#tyl_data_'+pid).show();
 $('#tyl_title_collapsed_'+pid).hide();
 $('#tyl_title_'+pid).show();
 $('#tyl_i_expcol_'+pid).attr('src', $('#tyl_i_expcol_'+pid).attr('src').replace("collapse_collapsed", "collapse"));
 $('#tyl_i_expcol_'+pid).attr('alt', "[-]");
 $('#tyl_a_expcol_'+pid).attr('title', "[-]");
 }
 else
 {
 $('#tyl_data_'+pid).hide();
 $('#tyl_title_'+pid).hide();
 $('#tyl_title_collapsed_'+pid).show();
 $('#tyl_i_expcol_'+pid).attr('src', $('#tyl_i_expcol_'+pid).attr('src').replace("collapse", "collapse_collapsed"));
 $('#tyl_i_expcol_'+pid).attr('alt', "[+]");
 $('#tyl_a_expcol_'+pid).attr('title', "[+]");
 }
 }
 }
 }
 
/* if(this.spinner)
 {
 this.spinner.destroy();
 this.spinner = '';
 }*/
 document.body.style.cursor = 'default';
 },
 
 del: function(pid)
 {
 if(use_xmlhttprequest == 1 && tylEnabled == 1)
 {
 if(tylUser == 0)
 {
 return true;
 }
 //this.spinner = new ActivityIndicator("body", {image: imagepath + "/spinner_big.gif"});
 $.ajax('thankyoulike.php?ajax=1&action=del&pid='+pid+'&my_post_key='+my_post_key,
 {
 type: 'POST'
 }).done(function(data)
 {
 thankyoulike.delDone(data, pid);
 });
 //new Ajax.Request('thankyoulike.php?ajax=1&action=del&pid='+pid+'&my_post_key='+my_post_key, {method: 'post', onComplete: function(request) { thankyoulike.delDone(request, pid); }});
 document.body.style.cursor = 'wait';
 return false;
 }
 else
 {
 return true;
 }
 },
 
 delDone: function(data, pid)
 {
 if(typeof data == 'string' && data.match(/<error>([^<]*)<\/error>/))
 {
 message = data.match(/<error>([^<]*)<\/error>/);

 if(!message[1])
 {
 message[1] = "An unknown error occurred.";
 }

 /*if(this.spinner)
 {
 this.spinner.destroy();
 this.spinner = '';
 }*/
 document.body.style.cursor = 'default';
 alert(message[1]);
 }
 else
 {
 tylVisible = 2;
 if(tylCollapsible == 1 && $("#tyl_"+pid).css('display') != "none")
 { 
 if($('datatyl_data_'+pid).is(':visible'))
 {
 tylVisible = 1;
 }
 else
 {
 tylVisible = 0;
 }
 }
 $("#tyl_"+pid).html(data.tylData);
 $("#tyl_"+pid).show();
 $("#tyl_btn_"+pid).html(data.tylButton);
 if(tylCollapsible == 1)
 {
 if(tylVisible != 2)
 {
 if(tylVisible == 1)
 {
 $('#tyl_data_'+pid).show();
 $('#tyl_title_collapsed_'+pid).hide();
 $('#tyl_title_'+pid).show();
 $('#tyl_i_expcol_'+pid).attr('src', $('#tyl_i_expcol_'+pid).attr('src').replace("collapse_collapsed", "collapse"));
 $('#tyl_i_expcol_'+pid).attr('alt', "[-]");
 $('#tyl_a_expcol_'+pid).attr('title', "[-]");
 }
 else
 {
 $('#tyl_data_'+pid).hide();
 $('#tyl_title_'+pid).hide();
 $('#tyl_title_collapsed_'+pid).show();
 $('#tyl_i_expcol_'+pid).attr('src', $('#tyl_i_expcol_'+pid).attr('src').replace("collapse", "collapse_collapsed"));
 $('#tyl_i_expcol_'+pid).attr('alt', "[+]");
 $('#tyl_a_expcol_'+pid).attr('title', "[+]");
 }
 }
 }
 }
 
/* if(this.spinner)
 {
 this.spinner.destroy();
 this.spinner = '';
 }*/
 document.body.style.cursor = 'default';
 }
}; 
$(document).ready(thankyoulike.init);

change "thankyoulike_button_add" template to this code:

<div id="tyl_btn_{$post['pid']}" class="postbit_buttons inline"><a href="thankyoulike.php?action=add&amp;pid={$post['pid']}&amp;my_post_key={$mybb->post_code}" onclick="return thankyoulike.add({$post['pid']}, {$post['tid']});" class="postbit_thank_add"><span>+ Thanks</span></a></div>

and change "thankyoulike_button_del" template to this code:

<div id="tyl_btn_{$post['pid']}" class="postbit_buttons inline"><a href="thankyoulike.php?action=del&amp;pid={$post['pid']}&amp;my_post_key={$mybb->post_code}" onclick="return thankyoulike.del({$post['pid']}, {$post['tid']});" class="postbit_thank_del" title="{$lang->del_tyl}"><span>- Remove thanks </span></a></div>
Is there a way (e.g. jquery) to see what's the POST with the most likes/thanks?

Please help. Thanks Smile
Gobe, you may see a few pages back.
(2014-12-11, 08:33 AM)cafeína Wrote: [ -> ]Gobe, you may see a few pages back.

If you refer to the "top 100 likes script", then my answer to that hasnt changed ever since: http://community.mybb.com/thread-59652-p...pid1091503

Does it work for you?
Anyone know how configure that users can also like/thank those closed threads? Only administrators/moderators can like/thank.

I've tried this one solution (at ..60 page) - it shows thank/like button but it wont work.


if(($tyled && $mybb->settings[$prefix.'removing'] != "1") || (!is_moderator($post['fid'], "caneditposts") && $mybb->user['uid'] == 0) || $post['uid'] == $mybb->user['uid'])
Hi there,

I've made a Toplist addon for this nice TYL plugin.

Currently it is in status "Pending approval" but here are some screenshots:

[attachment=33261] [attachment=33262]

Link to plugin: http://community.mybb.com/mods.php?action=view&pid=334
(2014-10-14, 06:37 PM)Eldenroot Wrote: [ -> ]I just need these two changes:
- add "<br><br><hr>" before the list of users in classic postbin if the post is liked
- change image in thnk you/ike button (now I see a heart, I would like to see thumb up or anything else, I just need to know where to change it)

Anyone can help?