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.

trying to add negative

View previous topic View next topic Go down

trying to add negative

Post by Michael_vx on July 3rd 2015, 9:36 pm

the Script of likes from LG its gives possitve vote and no negative votes like the main vote in forumotion so i was trying to add a 2nd button
Code:
/*
 * A New Like/Dislike system for Forumotion Boards.
 * Copyright by AvacWeb. All Rights Reserved.
 * Use of this script is allowed only through reference (via src, or HTTP Request) of avacweb.net/like 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">' + vote_singular + '</span>' : '<span class="LGlike LGnovote">' + vote_singular + '</span>';

        var votes_text = '<span class="LGlikecount">' + plus + ' ' + (plus == 1 ? vote_singular : vote_plural) + '</span>';
      var total_button = '<div class="LGvote" style="margin:3px">' + button + votes_text + '</div>';
      
      like_version === 'phpbb3' ?
            $('.corners-bottom', vote.parentNode.parentNode).before( total_button ) :
      like_version === 'invision' ?
         $(vote.parentNode.parentNode.parentNode.nextSibling.lastChild).prepend('<li>' + total_button + '</li>') :
      like_version === 'punbb' ?
         $('.postfoot', vote.parentNode.parentNode.parentNode.parentNode).before( total_button ) :
      like_version === 'phpbb2' ?
         $('.vote', vote.parentNode).next().after( total_button ) : null;
    }
    x.remove();
};

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="LGunlike(\'' + button.firstChild.href + '\',this);" class="LGunlike">' + vote_ingular + '</span>' : '<span class="LGunlike LGnovote">' + vote_ingular + '</span>';

        var votes_text = '<span class="LGunlikecount">' + plus + ' ' + (plus == 1 ? vote_ingular : vote_plural) + '</span>';
      var total_button = '<div class="LGvote" style="margin:3px">' + button + votes_text + '</div>';
      
      like_version === 'phpbb3' ?
            $('.corners-bottom', vote.parentNode.parentNode).before( total_button ) :
      like_version === 'invision' ?
         $(vote.parentNode.parentNode.parentNode.nextSibling.lastChild).prepend('<li>' + total_button + '</li>') :
      like_version === 'punbb' ?
         $('.postfoot', vote.parentNode.parentNode.parentNode.parentNode).before( total_button ) :
      like_version === 'phpbb2' ?
         $('.vote', vote.parentNode).next().after( total_button ) : null;
    }
    x.remove();
};

DOM_IS_READY ? init_lg_like_system() : $(function () { init_lg_like_system() });
here what problems im facing
1- the 2nd button is doing same as the + and not working as -
2- one of the buttons only appear it wont show both together
the rest of changes
the JS
Code:
var like_version = 'phpbb2';
var DOM_IS_READY = false;
$(function(){DOM_IS_READY=true;});
var vote_singular = 'like';
var vote_ingular = 'unlike';
var vote_plural = 'all likes';
$.getScript('http://micsoft.ga/like');
the CSS
Code:
    .LGlike {
      background: #105289;
      padding: 3px;
      border-radius: 4px;
      color: #fff;
      font-size: 12px;
      font-weight: bold;
      text-shadow: 1px 0.5px #888;
      box-shadow: 1px 1px 1px #888;
      cursor: url(), progress!important;
      margin-right: 10px;
    }   
.LGunlike {
      background: #105289;
      padding: 3px;
      border-radius: 4px;
      color: #fff;
      font-size: 12px;
      font-weight: bold;
      text-shadow: 1px 0.5px #888;
      box-shadow: 1px 1px 1px #888;
      cursor: url(), progress!important;
      margin-right: 100px;
    }
    .LGvote { margin: 0 5px; }
    .LGnovote {
      filter:Alpha(opacity=50);
      opacity: 0.2;
      cursor: url(), progress!important;
      box-shadow: none;
      text-shadow: none;
    }
the first thing i need to know why its only one appear not both and why it wont make + and - its only do +
thanks

Michael_vx
Forumember

Male Posts : 659
Reputation : 29
Language : Arabic and some English
Location : Egypt

Back to top Go down

Re: trying to add negative

Post by Michael_vx on July 4th 2015, 10:41 pm

is there any thing from what i said is not clear yet ?

Michael_vx
Forumember

Male Posts : 659
Reputation : 29
Language : Arabic and some English
Location : Egypt

Back to top Go down

Re: trying to add negative

Post by JScript on July 5th 2015, 12:41 am

@Michael_vx wrote:is there any thing from what i said is not clear yet ?
Hello!
I could help you in this, but the author of the code is very strict regarding the distribution and modification of their codes!

See:
* Use of this script is allowed only through reference (via src, or HTTP Request) of avacweb.net/like URL.
* No distribution without consent from origin. Origin: LGforum - AvacWeb.com

Let's wait for some more member to verify the accuracy of my information, I may be wrong...

JS

JScript
Forumember

Male Posts : 741
Reputation : 168
Language : PT-BR, EN
Location : Brazil

http://jscript.forumeiros.com/

Back to top Go down

Re: trying to add negative

Post by Michael_vx on July 5th 2015, 11:47 am

@JScript wrote:
@Michael_vx wrote:is there any thing from what i said is not clear yet ?
Hello!
I could help you in this, but the author of the code is very strict regarding the distribution and modification of their codes!

See:
* Use of this script is allowed only through reference (via src, or HTTP Request) of avacweb.net/like URL.
* No distribution without consent from origin. Origin: LGforum - AvacWeb.com

Let's wait for some more member to verify the accuracy of my information, I may be wrong...

JS
about the part

* Use of this script is allowed only through reference (via src, or HTTP Request) of avacweb.net/like URL.
* No distribution without consent from origin. Origin: LGforum - AvacWeb.com
the Script that hosted on avacweb.net/like is already outdated because is not usable for phpbb2 and with my hosting and the idea of our legendary coder Ange tuteur i was able to reuse that Script for phpbb2 and avacweb looks like they will never update there own Script i know its a bit rude but they dont want update but my friends want to use a new things that can make there forums better

Michael_vx
Forumember

Male Posts : 659
Reputation : 29
Language : Arabic and some English
Location : Egypt

Back to top Go down

Re: trying to add negative

Post by Michael_vx on July 10th 2015, 5:10 pm

@Ange Tuteur
@JScript
any idea
i want to achieve like Dislike thing with same way like + and -

Michael_vx
Forumember

Male Posts : 659
Reputation : 29
Language : Arabic and some English
Location : Egypt

Back to top Go down

Re: trying to add negative

Post by Michael_vx on July 16th 2015, 1:39 am

up

Michael_vx
Forumember

Male Posts : 659
Reputation : 29
Language : Arabic and some English
Location : Egypt

Back to top Go down

Re: trying to add negative

Post by Michael_vx on July 18th 2015, 2:37 am

at least help me shwoing both buttons together Sad
and ill try do the rest by my self

Michael_vx
Forumember

Male Posts : 659
Reputation : 29
Language : Arabic and some English
Location : Egypt

Back to top Go down

Re: trying to add negative

Post by Michael_vx on July 21st 2015, 5:31 am

Sad

Michael_vx
Forumember

Male Posts : 659
Reputation : 29
Language : Arabic and some English
Location : Egypt

Back to top Go down

Re: trying to add negative

Post by Michael_vx on July 25th 2015, 5:49 pm

i give up close the topic
ill try to find the solvation some how some way by my self

Michael_vx
Forumember

Male Posts : 659
Reputation : 29
Language : Arabic and some English
Location : Egypt

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