Like and deslike
3 posters
Page 1 of 1
Like and deslike
Good morning
I wonder if it is possible to add the effect of give like and appear people who have given like.
https://i.servimg.com/u/f38/18/45/41/65/captur25.png
Thank you
I wonder if it is possible to add the effect of give like and appear people who have given like.
https://i.servimg.com/u/f38/18/45/41/65/captur25.png
Thank you
Re: Like and deslike
there have been codes that have been developed by coders like lgforum on avacweb however since avacweb is down you can not get that code anymore
Last edited by skouliki on March 16th 2020, 1:59 pm; edited 1 time in total
Re: Like and deslike
Re: Like and deslike
Okay, but I found the code and tested it in phpbb3 and it worked perfectly.
My question here is to ask for your help to make the code work in punbb
My question here is to ask for your help to make the code work in punbb
- Code:
$(function(){
var pid = 270,
i = 0,
lang = {
like : 'Like',
loading : 'Loading...',
people : 'People like this post.',
person : 'Person likes this post.'
};
$('.post').each(function() {
var plus = $(this).find('.vote-button:first a'), id = $(this).attr('id').slice(1), clear = $(this).find('.clear'), votes = 0, text = lang.people;
if (plus.length) clear.after('<div class="fa_like_row"><a class="fa_like_button" href="'+plus.attr('href')+'">'+lang.like+'</a></div>');
else clear.after('<div class="fa_like_row"><span class="fa_liked">'+lang.like+'</span></div>');
if ($(this).find('.vote-bar').length) {
votes = Number($(this).find('.vote-bar').attr('title').replace(/.*?\((\d+)\s.*/,'$1'));
if (votes == 1) text = lang.person;
}
$(this).find('.fa_like_row').append('<div class="fa_like_text">'+votes+' '+text+'</div><div class="fa_like_list" id="fa_like_list'+id+'">Loading...</div>');
$(this).find('.vote').remove();
i++;
if (i==$('.post').length) {
$.get(_database.tid, function(data) {
$('.post').each(function() {
var id = $(this).attr('id').slice(1), dblikes;
$('#fa_like_list'+id).html('');
if ($('#fa_likes #likes'+id,data).length) {
dblikes = $('#fa_likes #likes'+id,data).text().replace(/likes=\{(.*?)\}/,'$1').split(',');
for (var i=0; i<dblikes.length; i++) {
var comma = ', ';
if (i==dblikes.length-1) comma = '';
$('#fa_like_list'+id).append(dblikes[i].replace(/^(.*?):(.*?)$/,'<a href="/u$1">$2</a>'+comma))
}
}
});
});
}
});
$('.fa_like_button').on('click', function() {
var id = $(this).attr('href').replace(/^.*?p\_vote=(\d+)$/,'$1');
$(this).after('<span class="fa_like_button">'+lang.loading+'</span>').hide();
$.get($(this).attr('href'), function() {
_database.post({
pid : pid,
tableid : 'likes'+id,
update : ['\\[td id="likes'+id+'"\\]likes=\\{(.*?)\\}\\[/td\\]','[td id="likes'+id+'"]likes={$1,'+_userdata.user_id+':'+_userdata.username+'}[/td]'],
newRow : '[tr][td]t'+window.location.pathname.replace(/\/t(\d+).*/,'$1')+'p'+id+'[/td][td id="likes'+id+'"]likes={'+_userdata.user_id+':'+_userdata.username+'}[/td][/tr]',
reload : true
});
});
return false;
});
});
Re: Like and deslike
If i remember right it was made for punbb forums before then it stopped working thanks to old codes and servers hosted outside of our system's that is why we stopped using the codes as we have NO power over the servers it was saved on.
maybe i can take a look at the thread you got this from and see if i can search for the other code for you.
Please link me to the thread your got the code from.
maybe i can take a look at the thread you got this from and see if i can search for the other code for you.
Please link me to the thread your got the code from.
Re: Like and deslike
this code is not working ...it counts the votes but has many conflicts with other codes
Re: Like and deslike
skouliki wrote:this code is not working ...it counts the votes but has many conflicts with other codes
From what I'm testing on my forum, there is no conflict, can you help me anyway? I take responsibility
Re: Like and deslike
Re: Like and deslike
Re: Like and deslike
Sadly there is nothing that can be done if there is old links that's why we stopped using it as it needed updating all the time thanks to servers outside of FM.
Re: Like and deslike
Sadly we are not coders and we never made the code it was done outside of our support forum and the makers is no longer with us
Re: Like and deslike
Please do not open same threads here and on Portuguese support
Since your forum is Portuguese and you already getting help from the staff there this topic will be closed
Since your forum is Portuguese and you already getting help from the staff there this topic will be closed
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum