Topics Likes (avacweb) show only number on count

Go down

Solved Topics Likes (avacweb) show only number on count

Post by J0k3R^ on December 4th 2014, 7:38 pm

Hi. im currently using the codes by avacweb for the topics likes but i want to show only the number of likes on count and not + the "likes" word.
Now its saying Like - [0 Likes]
and i want Like - [0]



js using:

Code:
/*
 * A New Like/Dislike system for Forumotion Boards.
 * Copyright 2013 © by AvacWeb. All Rights Reserved.
 * Use of this script is allowed only through reference (via src, or HTTP Request) of avacweb.net/likesystem URL.
 * No distribution without consent from origin. Origin: LGforum - AvacWeb.com
 */
function lglike(b,a){var d=a.innerHTML;a.innerHTML="Loading...";a.onclick="#";$.get(b,function(){a.className+=" LGnovote";a.innerHTML=d;var c=a.nextSibling,b=parseInt(/\d+/.exec(c.innerHTML)[0])+1;c.innerHTML=c.innerHTML.replace(/\d+/,b)})};

function init_lg_like_system() {
   for(var x = $('.vote'), i = 0, vote; (vote = x[i++]); ) {
      var count = 0, plus = 0, bar = $('.vote-bar', vote)[0], button = $('.vote-button', vote)[0];         
      if (bar) {
         var info = bar.title.match(/\d+/g);
         plus = Math.round(parseInt( info[1] ) * parseInt( info[0] )) / 100;
      }
      
      button = button ? '<span onclick="lglike(\'' + button.firstChild.href + '\',this);" class="LGlike">' + avacweb_like_system.vote_singular + '</span>' : '<span class="LGlike LGnovote">' + avacweb_like_system.vote_singular + '</span>';
      var votes_text = '<span class="LGlikecount">' + plus + ' ' + (plus == 1 ? avacweb_like_system.vote_singular : avacweb_like_system.vote_plural) + '</span>';
      var total_button = '<div class="LGvote" style="margin:3px">' + button + votes_text + '</div>';
      
      if(avacweb_like_system.callback) avacweb_like_system.callback(vote, total_button);
   }
   x.remove();
   
};

avacweb_like_system.dom_ready ? init_lg_like_system() : $(function () { init_lg_like_system() });
avatar
J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: Topics Likes (avacweb) show only number on count

Post by Ange Tuteur on December 4th 2014, 9:50 pm

Hello,

You'll have to edit the external JavaScript file which contains the lang data. Looking over it I don't see the language mentioned or a reference to an external script.
avatar
Ange Tuteur
Forumaster

Male Posts : 13201
Reputation : 2917
Language : EN10, FR5, JA5
Location : Macungie, PA

https://github.com/SethClydesdale

Back to top Go down

Solved Re: Topics Likes (avacweb) show only number on count

Post by J0k3R^ on December 4th 2014, 10:08 pm

the other code is this one:

Code:
var avacweb_like_system = {
dom_ready : false,
vote_singular : 'Μου Αρέσει',
vote_plural : 'Μου Αρέσει',
callback : function(vote, new_button) {
$('.entry-content', vote.parentNode.parentNode.parentNode.parentNode).prepend( new_button )
}
};
$(function() { avacweb_like_system.dom_ready = true; });
$.getScript('/36283.js');
avatar
J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: Topics Likes (avacweb) show only number on count

Post by Ange Tuteur on December 5th 2014, 9:06 am

Have you tried removing Μου Αρέσει and leaving an empty string ?

e.g.
vote_singular : '',
vote_plural : '',
avatar
Ange Tuteur
Forumaster

Male Posts : 13201
Reputation : 2917
Language : EN10, FR5, JA5
Location : Macungie, PA

https://github.com/SethClydesdale

Back to top Go down

Solved Re: Topics Likes (avacweb) show only number on count

Post by J0k3R^ on December 5th 2014, 1:30 pm

worked, but the button disappeared..

avatar
J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: Topics Likes (avacweb) show only number on count

Post by Luffy on December 5th 2014, 1:46 pm

I believe by only removing the plural it will work. Try this:
Code:
var avacweb_like_system = {
dom_ready : false,
vote_singular : 'Μου Αρέσει',
vote_plural : '',
callback : function(vote, new_button) {
$('.entry-content', vote.parentNode.parentNode.parentNode.parentNode).prepend( new_button )
}
};
$(function() { avacweb_like_system.dom_ready = true; });
$.getScript('/36283.js');
avatar
Luffy
Manager
Manager

Male Posts : 5510
Reputation : 607
Language : Greek, English
Location : Greece

https://www.crossroadz.net

Back to top Go down

Solved Re: Topics Likes (avacweb) show only number on count

Post by J0k3R^ on December 5th 2014, 1:51 pm

hm not exactly @MrMind ..

avatar
J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: Topics Likes (avacweb) show only number on count

Post by _Twisted_Mods_ on December 5th 2014, 1:53 pm

replace the words you removed and
try removing this from the first code instead


Code:
 ' ' + (plus == 1 ? avacweb_like_system.vote_singular : avacweb_like_system.vote_plural) +
avatar
_Twisted_Mods_
Helper
Helper

Male Posts : 2064
Reputation : 314
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Solved Re: Topics Likes (avacweb) show only number on count

Post by J0k3R^ on December 5th 2014, 2:00 pm

here we go. thanks a lot buddy Smile
problem solved
avatar
J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: Topics Likes (avacweb) show only number on count

Post by Ramdaman on December 5th 2014, 2:17 pm

Topic solved and archived.
avatar
Ramdaman
Active Poster

Male Posts : 1614
Reputation : 99
Language : English, Albanian, Macedonian, Russian | HTML, CSS
Location : New York City

http://ndihme.forumotion.com/forum

Back to top Go down

Back to top


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