The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Topics Likes (avacweb) show only number on count

View previous topic View next topic 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() });

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.

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

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');

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 : '',

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

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..


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');






Luffy
Manager
Manager

Male Posts : 4258
Reputation : 424
Language : Greek, English
Location : Greece

http://helpgr.forumgreek.com/forum

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 ..


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) +

_Twisted_Mods_
Helper
Helper

Male Posts : 2032
Reputation : 302
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

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.

Ramdaman
Active Poster

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

http://ndihme.forumotion.com/forum

Back to top Go down

View previous topic View next topic Back to top


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