following is the myjavascriptajax.js.Upload it to js folder
Code:
// User vote
function rateuser(voter,candate,rate){
try{
cp.call('ajax/myajaxphp.php','process_uservote',return_uservote,voter,candate,rate);
}
catch(Err){
alert('Connection failed');
}
}
function return_uservote(result){
try{
myMsg=result.getElementsByTagName('myMsg').item(0).firstChild.data;
cnt=result.getElementsByTagName('cnt').item(0).firstChild.data;
showMe('himr');
if(cnt>5){cnt=5;}
else if (cnt<0) {cnt=0;}
blank_star=5-cnt;
var x=document.getElementById('tblViewUserVote').rows[0].cells;
for (i=0;i<cnt;i++ )
{
x[i].innerHTML='[img]+imgurl+[/img]';
}
for (j=cnt;j<=4;j++ )
{
x[j].innerHTML='[img] + imgurl+[/img]';
}
if(myMsg=='f'){
var x=document.getElementById('tblViewUserTate').rows[0].cells;
x[0].innerHTML='Sorry! You already rated him.';
}else{
var x=document.getElementById('tblViewUserTate').rows[0].cells;
x[0].innerHTML='Thanks!';
}
}
catch(Err){
alert('Server problem');
}
}
// End user vote
Bookmarks