Like and deslike

Go down

In progress Like and deslike

Post by Rafa1804 on March 16th 2020, 1:29 pm

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
Rafa1804
Rafa1804
New Member

Posts : 18
Reputation : 1
Language : EN

View user profile https://punbb.forumotion.com/

Back to top Go down

In progress Re: Like and deslike

Post by skouliki on March 16th 2020, 1:56 pm


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
skouliki
skouliki
Manager
Manager

Female Posts : 8796
Reputation : 1148
Language : English,Greek
Location : Greece

View user profile http://iconskouliki.forumgreek.com

Back to top Go down

In progress Re: Like and deslike

Post by APE on March 16th 2020, 1:57 pm

Sadly that was a old code that no longer works without a host server it is not anything we use anymore.

The only one that works now is the following
 



PunBB - Like and deslike Left1212PunBB - Like and deslike Center11PunBB - Like and deslike Right112
PunBB - Like and deslike Ape_b110
PunBB - Like and deslike Ssshfm13
PunBB - Like and deslike Ape1010
APE
APE
Administrator
Administrator

Male Posts : 15526
Reputation : 1671
Language : fluent in dork / mumbojumbo & English haha

View user profile http://chatworld.forumotion.co.uk/

Back to top Go down

In progress Re: Like and deslike

Post by Rafa1804 on March 16th 2020, 2:16 pm

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

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;
  });
});
Rafa1804
Rafa1804
New Member

Posts : 18
Reputation : 1
Language : EN

View user profile https://punbb.forumotion.com/

Back to top Go down

In progress Re: Like and deslike

Post by APE on March 16th 2020, 2:28 pm

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.


PunBB - Like and deslike Left1212PunBB - Like and deslike Center11PunBB - Like and deslike Right112
PunBB - Like and deslike Ape_b110
PunBB - Like and deslike Ssshfm13
PunBB - Like and deslike Ape1010
APE
APE
Administrator
Administrator

Male Posts : 15526
Reputation : 1671
Language : fluent in dork / mumbojumbo & English haha

View user profile http://chatworld.forumotion.co.uk/

Back to top Go down

In progress Re: Like and deslike

Post by skouliki on March 16th 2020, 2:29 pm

this code is not working ...it counts the votes but has many conflicts with other codes
skouliki
skouliki
Manager
Manager

Female Posts : 8796
Reputation : 1148
Language : English,Greek
Location : Greece

View user profile http://iconskouliki.forumgreek.com

Back to top Go down

In progress Re: Like and deslike

Post by Rafa1804 on March 16th 2020, 2:32 pm

@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
Rafa1804
Rafa1804
New Member

Posts : 18
Reputation : 1
Language : EN

View user profile https://punbb.forumotion.com/

Back to top Go down

In progress Re: Like and deslike

Post by APE on March 16th 2020, 2:42 pm



PunBB - Like and deslike Left1212PunBB - Like and deslike Center11PunBB - Like and deslike Right112
PunBB - Like and deslike Ape_b110
PunBB - Like and deslike Ssshfm13
PunBB - Like and deslike Ape1010
APE
APE
Administrator
Administrator

Male Posts : 15526
Reputation : 1671
Language : fluent in dork / mumbojumbo & English haha

View user profile http://chatworld.forumotion.co.uk/

Back to top Go down

In progress Re: Like and deslike

Post by Rafa1804 on March 16th 2020, 2:48 pm


I actually used it, but as you can test, they don't work, the links are old.
Rafa1804
Rafa1804
New Member

Posts : 18
Reputation : 1
Language : EN

View user profile https://punbb.forumotion.com/

Back to top Go down

In progress Re: Like and deslike

Post by APE on March 16th 2020, 2:51 pm

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.


PunBB - Like and deslike Left1212PunBB - Like and deslike Center11PunBB - Like and deslike Right112
PunBB - Like and deslike Ape_b110
PunBB - Like and deslike Ssshfm13
PunBB - Like and deslike Ape1010
APE
APE
Administrator
Administrator

Male Posts : 15526
Reputation : 1671
Language : fluent in dork / mumbojumbo & English haha

View user profile http://chatworld.forumotion.co.uk/

Back to top Go down

In progress Re: Like and deslike

Post by Rafa1804 on March 16th 2020, 2:56 pm

Okay, so, is it possible to help me change the version of the code above?
Rafa1804
Rafa1804
New Member

Posts : 18
Reputation : 1
Language : EN

View user profile https://punbb.forumotion.com/

Back to top Go down

In progress Re: Like and deslike

Post by APE on March 16th 2020, 3:02 pm

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 Sad


PunBB - Like and deslike Left1212PunBB - Like and deslike Center11PunBB - Like and deslike Right112
PunBB - Like and deslike Ape_b110
PunBB - Like and deslike Ssshfm13
PunBB - Like and deslike Ape1010
APE
APE
Administrator
Administrator

Male Posts : 15526
Reputation : 1671
Language : fluent in dork / mumbojumbo & English haha

View user profile http://chatworld.forumotion.co.uk/

Back to top Go down

In progress Re: Like and deslike

Post by skouliki on March 16th 2020, 6:14 pm

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
skouliki
skouliki
Manager
Manager

Female Posts : 8796
Reputation : 1148
Language : English,Greek
Location : Greece

View user profile http://iconskouliki.forumgreek.com

Back to top Go down

In progress Re: Like and deslike

Post by skouliki on March 17th 2020, 8:47 am

Topic moved to the garbage.
Please read our forum rules: ESF General Rules
skouliki
skouliki
Manager
Manager

Female Posts : 8796
Reputation : 1148
Language : English,Greek
Location : Greece

View user profile http://iconskouliki.forumgreek.com

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum