ZomgStuff
05-09-2008, 07:31 PM
Well before I had a rating mod installed in which after you clicked on an icon besides a user's name, you would get a CSS pop-up with an AJAX request for the ratings that they received. It seems as though the AJAX system has been changed in 3.7 and I need a little help.
Before after clicking on the button it would open up a little box besides the button and display the information, now, it does not display anything but yet it is still responding with the correct information.
The link leads to ajax.php?do=ratebox&uid=XXXX (with the securitytoken as a parameter), which then gets the response of
<div style="width: 130px; float: left;">Was Rated<br /><br /><div class="rate_it_display_box" style="background-image
: url('images/rate/agree.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 1 , 0 );">140 x Agree</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/funny.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 7 , 0 );">114 x Funny</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/goldstar.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 2 , 0 );">67 x Gold Star</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/zing.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 5 , 0 );">63 x ZING</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/artistic.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 9 , 0 );">21 x Artistic</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/thanks.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 4 , 0 );">21 x Thanks</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/informative.png');"
>
<a href="#" onclick="return showWhoVoted( 5428 , 3 , 0 );">17 x Informative</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/goodidea.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 8 , 0 );">15 x Good Idea</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/goodfind.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 10 , 0 );">13 x Good Find</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/useful.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 6 , 0 );">7 x Useful</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/disagree.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 11 , 0 );">1 x Disagree</a>
</div></div><div style="width: 130px; float: left;">Ratings Given<br /><br /><div class="rate_it_display_box"
style="background-image: url('images/rate/agree.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 1 , 1 );">100 x Agree</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/goldstar.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 2 , 1 );">43 x Gold Star</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/funny.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 7 , 1 );">35 x Funny</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/zing.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 5 , 1 );">35 x ZING</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/thanks.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 4 , 1 );">34 x Thanks</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/goodidea.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 8 , 1 );">25 x Good Idea</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/artistic.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 9 , 1 );">16 x Artistic</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/informative.png');"
>
<a href="#" onclick="return showWhoVoted( 5428 , 3 , 1 );">14 x Informative</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/goodfind.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 10 , 1 );">13 x Good Find</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/useful.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 6 , 1 );">6 x Useful</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/wtf.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 12 , 1 );">1 x WTF</a>
</div></div>
Only problem is that it does not create the box pop-up anymore, how can I get the response to actually output the information into a div container.
Here is the js function that is responsible for requesting the AJAX request.
function showRateBox( $userid, $securitytoken, $clicked, e )
{
;
if (ajRB)
{
alert( 'One at a time you dork' );
return;
}
if ( RateWindow )
{
document.body.removeChild( RateWindow );
delete RateWindow;
RateWindow = false;
}
ClickX = MouseX + 10;
ClickY = MouseY;
YAHOO.util.Connect.asyncRequest('POST', 'ajax.php?do=erategetbox&uid=' + $userid , {
success: this.handle_ajax_response,
failure: this.handle_ajax_error,
timeout: vB_Default_Timeout,
scope: this
}, SESSIONURL + 'securitytoken=' + SECURITYTOKEN);
return false;
}
Thanks in advance.
Before after clicking on the button it would open up a little box besides the button and display the information, now, it does not display anything but yet it is still responding with the correct information.
The link leads to ajax.php?do=ratebox&uid=XXXX (with the securitytoken as a parameter), which then gets the response of
<div style="width: 130px; float: left;">Was Rated<br /><br /><div class="rate_it_display_box" style="background-image
: url('images/rate/agree.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 1 , 0 );">140 x Agree</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/funny.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 7 , 0 );">114 x Funny</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/goldstar.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 2 , 0 );">67 x Gold Star</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/zing.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 5 , 0 );">63 x ZING</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/artistic.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 9 , 0 );">21 x Artistic</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/thanks.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 4 , 0 );">21 x Thanks</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/informative.png');"
>
<a href="#" onclick="return showWhoVoted( 5428 , 3 , 0 );">17 x Informative</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/goodidea.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 8 , 0 );">15 x Good Idea</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/goodfind.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 10 , 0 );">13 x Good Find</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/useful.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 6 , 0 );">7 x Useful</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/disagree.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 11 , 0 );">1 x Disagree</a>
</div></div><div style="width: 130px; float: left;">Ratings Given<br /><br /><div class="rate_it_display_box"
style="background-image: url('images/rate/agree.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 1 , 1 );">100 x Agree</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/goldstar.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 2 , 1 );">43 x Gold Star</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/funny.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 7 , 1 );">35 x Funny</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/zing.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 5 , 1 );">35 x ZING</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/thanks.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 4 , 1 );">34 x Thanks</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/goodidea.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 8 , 1 );">25 x Good Idea</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/artistic.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 9 , 1 );">16 x Artistic</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/informative.png');"
>
<a href="#" onclick="return showWhoVoted( 5428 , 3 , 1 );">14 x Informative</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/goodfind.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 10 , 1 );">13 x Good Find</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/useful.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 6 , 1 );">6 x Useful</a>
</div><div class="rate_it_display_box" style="background-image: url('images/rate/wtf.png');">
<a href="#" onclick="return showWhoVoted( 5428 , 12 , 1 );">1 x WTF</a>
</div></div>
Only problem is that it does not create the box pop-up anymore, how can I get the response to actually output the information into a div container.
Here is the js function that is responsible for requesting the AJAX request.
function showRateBox( $userid, $securitytoken, $clicked, e )
{
;
if (ajRB)
{
alert( 'One at a time you dork' );
return;
}
if ( RateWindow )
{
document.body.removeChild( RateWindow );
delete RateWindow;
RateWindow = false;
}
ClickX = MouseX + 10;
ClickY = MouseY;
YAHOO.util.Connect.asyncRequest('POST', 'ajax.php?do=erategetbox&uid=' + $userid , {
success: this.handle_ajax_response,
failure: this.handle_ajax_error,
timeout: vB_Default_Timeout,
scope: this
}, SESSIONURL + 'securitytoken=' + SECURITYTOKEN);
return false;
}
Thanks in advance.