Buying Convert JavaScript To jQuery

Discussion in 'Programming' started by GetWebHost, Mar 31, 2010.

  1. #1
    Overview:
    I'm currently working on a Pligg CMS. Pligg has two methods of voting:
    1 - standard method, add 1 vote
    2 - star rating method
    and the effects of those voting methods are controlled by a JavaScript file: xmlhttp.php

    I have tried to rewrite the JavaScript vote function in xmlhttp.php to jQuery but I have only success on the standard 1 Voting Method.

    Want To Hire:
    I need someone who can finish and/or fix the conversion/rewrite I have started. Currently, this is what I have so far: http://demo.oxythemes.com/Pligg/templates/wistiestar/vote.tpl - it's in jQuery now converted from the JavaScript of xmlhttp.php

    What you need to do is to fix my vote.tpl so that the Star Voting Method will work. I have already commented on this file what needs to be fix. This is only a quick job and I think can be done in minutes by jQuery experts.

    Technical Info:
    Site Demo:
    http://demo.oxythemes.com/Pligg/
    Original Vote Script: http://demo.oxythemes.com/Pligg/templates/xmlhttp.php (there are other functions here, just see the function vote() )
    My jQuery Vote Script: http://demo.oxythemes.com/Pligg/templates/wistiestar/vote.tpl
    HTML Vote Code: http://demo.oxythemes.com/Pligg/templates/wistiestar/link_summary.tpl (also see below the specific code)
    PHP Vote Script: http://demo.oxythemes.com/Pligg/vote.php - you need to download Pligg to view this one.

    Code Specifics:
    HTML Vote Code (in link_summary.tpl):
        {if $Voting_Method eq 2}
        <div class="headline">
            <h4 id="ls_title-{$link_shakebox_index}">
                <ul class='star-rating{$star_class}' id="xvotes-{$link_id}">
                    <li class="current-rating" style="width: {$link_rating_width}px;" id="xvote-{$link_id}"></li>
                    <span id="mnmc-{$link_id}" {if $link_shakebox_currentuser_votes ne 0}style="display: none;"{/if}>
                            <li><a href="#{$link_shakebox_javascript_vote_1star}" class='vb_vote one-star'>1</a></li>
                            <li><a href="#{$link_shakebox_javascript_vote_2star}" class='vb_vote two-stars'>2</a></li>
                            <li><a href="#{$link_shakebox_javascript_vote_3star}" class='vb_vote three-stars'>3</a></li>
                            <li><a href="#{$link_shakebox_javascript_vote_4star}" class='vb_vote four-stars'>4</a></li>
                            <li><a href="#{$link_shakebox_javascript_vote_5star}" class='vb_vote five-stars'>5</a></li>
                    </span>
                    <span id="mnmd-{$link_id}" {if $link_shakebox_currentuser_votes eq 0}style="display: none;"{/if}>
                            <li class='one-star-noh'>1</li>
                            <li class='two-stars-noh'>2</li>
                            <li class='three-stars-noh'>3</li>
                            <li class='four-stars-noh'>4</li>
                            <li class='five-stars-noh'>5</li>
                    </span>
                </ul>
            </h4>
        {/if}
    
    PHP:
    Old JavaScript Vote (from xmlhttp.php, under function vote() )
                       if (mnmxmlhttp[htmlid].readyState == 4) {
                            xvotesString[htmlid] = mnmxmlhttp[htmlid].responseText;
                            if (xvotesString[htmlid].match (errormatch)) {
                                xvotesString[htmlid] = xvotesString[htmlid].substring (6, xvotesString[htmlid].length);
                                <?php if(Voting_Method == 1){
                                    echo "changemnmvalues (htmlid, value, true);";
                                }?>
                            } else {
                                <?php if(Voting_Method == 2){
                                    echo "var mySplitResult = xvotesString[htmlid].split('~');\n";
                                    echo "target3 = document.getElementById ('xvote-' + htmlid);\n";
                                    echo "target3.style.width = mySplitResult[0] + 'px';\n";
                                    echo "if (target4 = document.getElementById ('mnma-' + htmlid))";
                                    echo "    target4.innerHTML = mySplitResult[1];\n";
                                    echo "if (target5 = document.getElementById ('mnmb-' + htmlid))";
                                    echo "    target5.innerHTML = mySplitResult[2];\n";
                                    echo "if (target6 = document.getElementById ('mnmc-' + htmlid))";
                                    echo "    target6.style.display='none'; \n";
                                    echo "if (target6 = document.getElementById ('mnmd-' + htmlid))";
                                    echo "    target6.style.display='block'; \n";
                                    echo "target7 = document.getElementById ('xvotes-' + htmlid);\n";
                                    echo "target7.className = 'star-rating-noh';\n";
                                }?>
                                <?php if(Voting_Method == 1){
                                    echo 'if (xvotesString[htmlid].substring (1, 6) == "ERROR") { ';
                                    echo "alert(xvotesString[htmlid]);  } else {";
                                    echo "changemnmvalues (htmlid, value, false); } ";
                                }?>
                            }
                        }
    PHP:
    Please post your offers.
     
    GetWebHost, Mar 31, 2010 IP
  2. gapz101

    gapz101 Well-Known Member

    Messages:
    524
    Likes Received:
    8
    Best Answers:
    2
    Trophy Points:
    150
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    good for $25 best price
     
    gapz101, Mar 31, 2010 IP
  3. GetWebHost

    GetWebHost Active Member

    Messages:
    735
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    78
    As Seller:
    100% - 1
    As Buyer:
    100% - 0
    #3
    ^ can you do it?
     
    GetWebHost, Mar 31, 2010 IP
  4. BinaryShadow

    BinaryShadow Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #4
    i can do you job
     
    BinaryShadow, Mar 31, 2010 IP
  5. GetWebHost

    GetWebHost Active Member

    Messages:
    735
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    78
    As Seller:
    100% - 1
    As Buyer:
    100% - 0
    #5
    @BinaryShadow
    For how much and what timeframe?
     
    GetWebHost, Mar 31, 2010 IP
  6. BinaryShadow

    BinaryShadow Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #6
    50$ in a week with 100% satisfaction
     
    BinaryShadow, Apr 5, 2010 IP
  7. GetWebHost

    GetWebHost Active Member

    Messages:
    735
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    78
    As Seller:
    100% - 1
    As Buyer:
    100% - 0
    #7
    Sorry, the fix has been done by me.

    Mods may close this thread.
     
    GetWebHost, Apr 5, 2010 IP