/    Sign up×
Community /Pin to ProfileBookmark

Can someone interpret this long JQuery script for me?

Note: This script is quite long, please don’t spend your time on this unless you have plenty of free time ?

File: [url]http://linksku.com/wp-content/plugins/gd-star-rating/js/gdsr.js[/url]
File content:

[QUOTE]

eval(function(p,a,c,k,e,r){e=function(c){return(c<a?”:e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!”.replace(/^/,String)){while(c–)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return’w+’};c=1};while(c–)if(k[c])p=p.replace(new RegExp(‘b’+e(c)+’b’,’g’),k[c]);return p}(‘p K(a,b){9(“#”+a).B(“1z”,”26″);9(“#”+b).B(“1z”,”F”)}p 1i(a){G’#’+a.1H(/:/g,”:”).1H(/./g,”.”)}p v(){}p 1q(a){q(9(a).2c(“1v”)){F=9(a).1L().s(“y”).P(12);1m(F)}}p 1t(a){n b=9(a).s(“y”).E(“X”);n c=b[4];n d=b[5];n e=c*d;n f=’#2g’+b[1]+’o’+b[2]+’o’+b[3];n g=’#1D’+b[1]+’o’+b[2];9(f).B(“R”,e+”1k”);n h=9(g).z().E(“X”);h[b[3]]=c;n j=1w;W(n i=0;i<h.A;i++){q(h[i]==0){j=19;1B}}9(g).z(h.1O(“X”));n k=b[1]+’o’+b[2]+’o’+b[6]+’o’+d;q(28==1){n l=’#2e’+k;q(j){9(l).10(‘1J’);9(l).D(‘1F’);9(l+” a”).D(‘1v’)}13{9(l).10(‘1F’);9(l).D(‘1J’);9(l+” a”).10(‘1v’)}}13{q(j)1m(k)}}p 1b(b){n c=9(b).s(“y”).E(“X”);K(c[5],c[6]);9.16(15,{17:18,1o:c[1],1x:c[2],14:c[4],1u:c[7],1y:c[8]},p(a){K(c[6],c[5]);q(a.1P==’1T’){9(“#2i”+c[4]+c[1]).T(“”);9(“#2k”+c[4]+c[1]).B(“R”,1R(a.27));9(“#1A”+c[4]+c[1]).D(“1j”);9(“#1A”+c[4]+c[1]).T(a.1s)}})}p 1a(b){n c=9(b).s(‘1r’);n d=9(b).s(“y”).E(“X”);q(d[6]==’Y’)K(“Q”+d[1]+”o”+d[3]+”o”+d[2],”Q”+d[1]+”o”+d[3]+”o”+”1Z”+d[2]);9(“#Q”+d[1]+”o”+d[3]+”o”+”2l a”).1f(‘<U 1r=”‘+c+'”></U>’);9(“#Q”+d[1]+”o”+d[3]+”o”+”2d a”).1f(‘<U 1r=”‘+c+'”></U>’);9.16(15,{17:18,1o:d[1],1x:d[2],14:’r’+d[3],1u:d[4],1y:d[5]},p(a){q(d[6]==’Y’)K(“Q”+d[1]+”o”+d[3]+”o”+”1Z”+d[2],”Q”+d[1]+”o”+d[3]+”o”+d[2]);q(a.1P==’1T’){9(“#1I”+d[1]+”o”+d[3]).D(“1j”);9(“#1I”+d[1]+”o”+d[3]).T(a.1s)}})}p 1m(c){n d=c.E(“o”);n e=d[0];n f=d[1];n g=d[2];n h=d[3];n j=9(“#1D”+e+”o”+f).z();K(“1n”+e+”o”+f,”1V”+e+”o”+f);9.16(15,{17:18,1o:e,2p:f,1x:j,1u:g,14:’m’,1y:h},p(a){9(“#1h”+e+”o”+f+” .S”).1d();9(“#1h”+e+”o”+f+” .2a”).1d();9(“#1h”+e+”o”+f+” 2r”).1d();9(“#1h”+e+”o”+f+” .2x”).1d();n b=9(“#1E”+e+”o”+f+” U”).B(“2n”);q(b>0)9(“#1E”+e+”o”+f+” U”).B(“R”,a.2u*b.P(0,2));W(n i=0;i<a.1S.A;i++)9(“#2z”+e+”o”+f+”o”+i).B(“R”,1R(a.1S[i]));9(“#1n”+e+”o”+f).T(a.1s).D(“1j”);K(“1V”+e+”o”+f,”1n”+e+”o”+f)})}n 1g=19;p 1M(){n a=9(“#2h”).z();q(a==0){9(“#C-L-V-F-1X”).10(“Z”);9(“#C-L-V-F-21”).10(“Z”);9(“#C-L-V-F-23”).10(“Z”)}13{9(“#C-L-V-F-1X”).D(“Z”);9(“#C-L-V-F-21”).D(“Z”);9(“#C-L-V-F-23”).D(“Z”)}q(!1g){9(“#25-1C-1W-1Q”).t(p(){1M()});1g=1w}13{9(“#25-1C-1W-1Q”).M(“t”);1g=19}}p 29(){n a=20();n b=1w;W(n i=0;i<a.A;i++){q(a[i]==0)b=19}G b}p 2m(){G 24()>0}p 2t(){G 1K()>0}p 20(){n a=9(“.C-2f-1l-1p”).z();G a.E(“X”)}p 24(){G 9(“.C-2w-1l-1p”).z()}p 1K(){G 9(“.C-L-1l-1p”).z()}p N(){G 9.H.O&&9.H.2q<‘8.0′}9(2A).2b(p(){q(2v==1){n h=””;n j=””;9(“.2o”).2B(p(i){1c=9(u).s(“y”).P(6);q(1c.P(0,1)==”a”)h+=1c+”:”;13 j+=1c+”:”});q(h.A>0){h=h.P(0,h.A-1);9.16(15,{17:18,14:’1G’,1U:’a’,22:h},p(a){W(n i=0;i<a.1e.A;i++){n b=a.1e[i];9(1i(b.y)).1f(b.T)}q(9.H.O)9(“.I > a”).s(“w”,”x:v()”);q(9.H.O)9(“.J > a”).s(“w”,”x:v()”);q(9.H.O)9(“.11 > a”).s(“w”,”x:v()”);q(9.H.O)9(“.S > a”).s(“w”,”x:v()”);9(“.I > a”).M(“t”);9(“.I > a”).t(p(){1b(u)});9(“.J > a”).M(“t”);9(“.J > a”).t(p(){1a(u)});9(“.11 > a”).M(“t”);9(“.11 > a”).t(p(){1q(u)});9(“.S > a”).M(“t”);9(“.S > a”).t(p(){1t(u)})})}q(j.A>0){j=j.P(0,j.A-1);9.16(15,{17:18,14:’1G’,1U:’c’,22:j},p(a){W(n i=0;i<a.1e.A;i++){n b=a.1e[i];9(1i(b.y)).1f(b.T)}q(9.H.O)9(“.I > a”).s(“w”,”x:v()”);q(9.H.O)9(“.J > a”).s(“w”,”x:v()”);9(“.I > a”).M(“t”);9(“.I > a”).t(p(){1b(u)});9(“.J > a”).M(“t”);9(“.J > a”).t(p(){1a(u)})})}}q(N())9(“.I > a”).s(“w”,”x:v()”);9(“.I > a”).t(p(){1b(u)});q(N())9(“.J > a”).s(“w”,”x:v()”);9(“.J > a”).t(p(){1a(u)});q(N())9(“.1N > a”).s(“w”,”x:v()”);9(“.1N > a”).t(p(){n a=9(u).s(“y”).E(“X”);n b=”#”+9(u).1L().s(“y”);n c=a[1]*a[2];9(b+”2j”).B(“R”,c+”1k”);9(b+”2y”).z(a[1])});q(N())9(“.11 > a”).s(“w”,”x:v()”);9(“.11 > a”).t(p(){1q(u)});q(N())9(“.S > a”).s(“w”,”x:v()”);9(“.S > a”).t(p(){1t(u)});q(N())9(“.1Y > a”).s(“w”,”x:v()”);9(“.1Y > a”).t(p(){n a=9(u).s(“y”).E(“X”);n b=a[4];n c=a[5];n d=b*c;n e=’#2s’+a[1]+’o’+a[2]+’o’+a[3];n f=’.2C’+a[1]+’o’+a[2];9(e).B(“R”,d+”1k”);n g=9(f).z().E(“X”);g[a[3]]=b;W(n i=0;i<g.A;i++){q(g[i]==0){1B}}9(f).z(g.1O(“X”))})});’,62,163,’|||||||||jQuery||||||||||||||var|_|function|if||attr|click|this|gdsrEmpty|href|javascript|id|val|length|css|gdsr|addClass|split|block|return|browser|gdsr_rating_as|gdthumb|gdsrWait|cmm|unbind|gdsr_ie|msie|substring|gdsr_thumb_|width|gdsr_multis_as|html|div|integration|for|||cmminthide|removeClass|gdsr_multisbutton_as||else|vote_type|gdsr_cnst_ajax|getJSON|_ajax_nonce|gdsr_cnst_nonce|false|gdsr_rating_thumb|gdsr_rating_standard|el|remove|items|replaceWith|gdsrCanceled|gdsr_mur_block_|jquery_escape_id|voted|px|cls|multi_rating_vote|gdsr_mur_text_|vote_id|rt|gdsr_rating_multi_button|class|rater|gdsr_rating_multi_stars|vote_tpl|active|true|vote_value|vote_size|display|gdr_text_|break|comment|gdsr_multi_|gdsr_mur_avgstars_|gdactive|cache|replace|gdsr_thumb_text_|gdinactive|value_cmm_rated_review|parent|hideshowCmmInt|gdsr_integration|join|status|link|parseInt|values|ok|vote_domain|gdsr_mur_loader_|reply|review|gdsr_mur_static|loader_|value_cmm_rated_multis|standard|votes|multis|value_cmm_rated_standard|cancel|none|value|gdsr_cnst_button|is_cmm_rated_multis|gdcurrent|ready|hasClass|dw|gdsr_button_|mur|gdsr_mur_stars_current_|comment_parent|gdr_stars_|_stars_rated|gdr_vote_|up|is_cmm_rated_standard|height|gdsrcacheloader|vote_set|version|input|gdsr_murvw_stars_current_|is_cmm_rated_review|average|gdsr_cnst_cache|int|ratingbutton|_value|gdsr_mur_stars_rated_|document|each|gdsr_int_multi_‘.split(‘|’),0,{}))

[/QUOTE]

What this script does is it initiates [url]http://linksku.com/wp-content/plugins/gd-star-rating/ajax.php[/url] when a star (in a rating system) is clicked. After appending a few $_GET variables, it becomes:

[CODE]http://linksku.com/wp-content/plugins/gd-star-rating/ajax.php?vote_id=vote_id&vote_tpl=vote_tpl&vote_size=vote_size&vote_value=vote_value[/CODE]

.
However, I want to dynamically generate the value for [I]vote_id[/I] using PHP (I have another dynamically generated external Javascript file that contains everything in [url]http://linksku.com/wp-content/plugins/gd-star-rating/js/gdsr.js[/url]).

Thank you in advance! ?

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@JonaSep 13.2010 — [font=arial]Hi,

The script you posted has been run through an obfuscation program, which means that it's highly compressed in order to download faster (and highly, nigh impossible to interpret). You should find the original, non-obfuscated version of the script and work to modify that, and then recompress/obfuscate again afterward. No one's going to be able to take the time to resolve the packer function, as it's really a nuisance and the substance of the script can take a lot more time to decipher than it ought to.[/font]
Copy linkTweet thisAlerts:
@narutodude000authorSep 13.2010 — Hi Jona. I've been trying searching for a software that can make this human-readable. Do you know of such a software?

I will try contacting the author for the original code, I'll post it here if I receive it (I only know the very basics of JQuery).

I Googled "JQuery packer" and I understand what you mean. I never knew about it earlier. Thanks!
Copy linkTweet thisAlerts:
@narutodude000authorSep 13.2010 — I got it!

[CODE]function gdsrWait(a, b) {
jQuery("#" + a).css("display", "none");
jQuery("#" + b).css("display", "block")
}
function jquery_escape_id(a) {
return '#' + a.replace(/:/g, "\:").replace(/./g, "\.")
}
function gdsrEmpty() {}
function gdsr_rating_multi_button(a) {
if (jQuery(a).hasClass("active")) {
block = jQuery(a).parent().attr("id").substring(12);
multi_rating_vote(block)
}
}
function gdsr_rating_multi_stars(a) {
var b = jQuery(a).attr("id").split("X");
var c = b[4];
var d = b[5];
var e = c * d;
var f = '#gdsr_mur_stars_current_' + b[1] + '_' + b[2] + '_' + b[3];
var g = '#gdsr_multi_' + b[1] + '_' + b[2];
jQuery(f).css("width", e + "px");
var h = jQuery(g).val().split("X");
h[b[3]] = c;
var j = true;
for (var i = 0; i < h.length; i++) {
if (h[i] == 0) {
j = false;
break
}
}
jQuery(g).val(h.join("X"));
var k = b[1] + '_' + b[2] + '_' + b[6] + '_' + d;
if (gdsr_cnst_button == 1) {
var l = '#gdsr_button_' + k;
if (j) {
jQuery(l).removeClass('gdinactive');
jQuery(l).addClass('gdactive');
jQuery(l + " a").addClass('active')
} else {
jQuery(l).removeClass('gdactive');
jQuery(l).addClass('gdinactive');
jQuery(l + " a").removeClass('active')
}
} else {
if (j) multi_rating_vote(k)
}
}
function gdsr_rating_standard(b) {
var c = jQuery(b).attr("id").split("X");
gdsrWait(c[5], c[6]);
jQuery.getJSON(gdsr_cnst_ajax, {
_ ajax_nonce: gdsr_cnst_nonce,
vote_id: c[1],
vote_value: c[2],
vote_type: c[4],
vote_tpl: c[7],
vote _size: c[8]
}, function (a) {
gdsrWait(c[6], c[5]);
if (a.status == 'ok') {
jQuery("#gdr_sta rs_" + c[4] + c[1]).html("");
jQuery("#gdr_vote_" + c[4] + c[1]).css("width", p arseInt(a.value));
jQuery("#gdr_text_" + c[4] + c[1]).addClass("voted");
jQuery("#gdr_text_" + c[4] + c[1]).html(a.rater)
}
})
}
function gdsr_rating_thumb(b) {
var c = jQuery(b).attr('class');
var d = jQuery(b).attr("id").split("X");
if (d[6] == 'Y') gdsrWait("gdsr_thumb_" + d[1] + "_" + d[3] + "_" + d[2], "gdsr_thumb_" + d[1] + "_" + d[3] + "_" + "loader_" + d[2]);
jQuery("#gdsr_thumb_" + d[1] + "_" + d[3] + "_" + "up a").replaceWith('<div class="' + c + '"></div>');
jQuery("#gdsr_thumb_" + d[1] + "_" + d[3] + "_" + "dw a").replaceWith('<div class="' + c + '"></div>');
jQuery.getJSON(gdsr_cnst_ajax, {
_ ajax_nonce: gdsr_cnst_nonce,
vote_id: d[1],
vote_value: d[2],
vote_type: 'r' + d[3],
vote_tpl: d[4],
vote _size: d[5]
}, function (a) {
if (d[6] == 'Y') gdsrWait("gdsr_thumb_" + d[1] + "_" + d[3] + "_" + "loader_" + d[2], "gdsr_thumb_" + d[1] + "_" + d[3] + "_" + d[2]);
if (a.status == 'ok') {
jQuery("#gdsr_thu mb_text_" + d[1] + "_" + d[3]).addClass("voted");
jQuery("#gdsr_thu mb_text_" + d[1] + "_" + d[3]).html(a.rater)
}
})
}
function multi_rating_vote(c) {
var d = c.split("_");
var e = d[0];
var f = d[1];
var g = d[2];
var h = d[3];
var j = jQuery("#gdsr_multi_" + e + "_" + f).val();
gdsrWait("gdsr_mur_text_" + e + "_" + f, "gdsr_mur_loader_" + e + "_" + f);
jQuery.getJSON(gdsr_cnst_ajax, {
_ ajax_nonce: gdsr_cnst_nonce,
vote_id: e,
vote_set: f,
vote_value: j,
vote_tpl: g,
vote_type: 'm',
vote _size: h
}, function (a) {
jQuery("#gdsr_mur_block_" + e + "_" + f + " .gdsr_multis_as").remove();
jQuery("#gdsr_mur_block_" + e + "_" + f + " .gdcurrent").remove();
jQuery("#gdsr_mur_block_" + e + "_" + f + " input").remove();
jQuery("#gdsr_mur_block_" + e + "_" + f + " .ratingbutton").remove();
var b = jQuery("#gdsr_mur_avgstars_" + e + "_" + f + " div").css("height");
if (b > 0) jQuery("#gdsr_mur_avgstars_" + e + "_" + f + " div").css("width", a.average * b.substring(0, 2));
for (var i = 0; i < a.values.length; i++) jQuery("#gdsr_mur _stars_rated_" + e + "_" + f + "_" + i).css("width", p arseInt(a.values[i]));
jQuery("#gdsr_mur_text_" + e + "_" + f).html(a.rater).addClass("voted");
gdsrWait("gdsr_mur_loader_" + e + "_" + f, "gdsr_mur_text_" + e + "_" + f)
})
}
var gdsrCanceled = false;

function hideshowCmmInt() {
var a = jQuery("#comment_parent").val();
if (a == 0) {
jQuery("#gdsr-cmm-in tegration-block-review").removeClass("cmminthide");
jQuery("#gdsr-cmm-in tegration-block-standard").removeClass("cmminthide");
jQuery("#gdsr-cmm-in tegration-block-multis").removeClass("cmminthide")
} else {
jQuery("#gdsr-cmm-in tegration-block-review").addClass("cmminthide");
jQuery("#gdsr-cmm-in tegration-block-standard").addClass("cmminthide");
jQuery("#gdsr-cmm-in tegration-block-multis").addClass("cmminthide")
}
if (!gdsrCanceled) {
jQuery("#cancel-comment-reply-link").click(function () {
hideshowCmmInt()
});
gdsrCanceled = true
} else {
jQuery("#cancel-comment-reply-link").unbind("click");
gdsrCanceled = false
}
}
function is_cmm_rate d_multis() {
var a = value_cmm_rated_ multis();
var b = true;
for (var i = 0; i < a.length; i++) {
if (a[i] == 0) b = false
}
return b
}
function is_cmm_rated_standard() {
return value_cmm_rated_standard() > 0
}
function is_cmm_rated_review() {
return value_cmm_rated_review() > 0
}
function value_cmm_rated_ multis() {
var a = jQuery(".gdsr-mur-cls- rt").val();
return a.split("X")
}
function value_cmm_rated_standard() {
return jQuery(".gdsr-int-cls- rt").val()
}
function value_cmm_rated_review() {
return jQuery(".gdsr-cmm-cls- rt").val()
}
function gdsr_ie() {
return jQuery.browser.msie && jQuery.browser.version < '8.0'
}
[/CODE]

WebDeveloper only allows 10000 characters per post. The rest are on the next post.
Copy linkTweet thisAlerts:
@narutodude000authorSep 13.2010 — [CODE]jQuery(document).ready(function () {
if (gdsr_cnst_cache == 1) {
var h = "";
var j = "";
jQuery(".gdsrcacheloader").each(function (i) {
el = jQuery(this).attr("id").substring(6);
if (el.substring(0, 1) == "a") h += el + ":";
else j += el + ":"
});
if (h.length > 0) {
h = h.substring(0, h.length - 1);
jQuery.getJSON(gdsr_cnst_ajax, {
_ ajax_nonce: gdsr_cnst_nonce,
vote_type: 'cache',
vote_domain: 'a',
votes: h
}, function (a) {
for (var i = 0; i < a.items.length; i++) {
var b = a.items[i];
jQuery(jquery_escape_id(b.id)).replaceWith(b.html)
}
if (jQuery.browser.msie) jQuery(".gdsr_ratin g_as > a").attr("href", "javascript:gdsrEmpty()");
if (jQuery.browser.msie) jQuery(".gdthumb > a").attr("href", "javascript:gdsrEmpty()");
if (jQuery.browser.msie) jQuery(".gdsr_multisbutton_as > a").attr("href", "javascript:gdsrEmpty()");
if (jQuery.browser.msie) jQuery(".gdsr_multis_as > a").attr("href", "javascript:gdsrEmpty()");
jQuery(".gdsr_ratin g_as > a").unbind("click");
jQuery(".gdsr_ratin g_as > a").click(function () {
gdsr_rating_standard(this)
});
jQuery(".gdthumb > a").unbind("click");
jQuery(".gdthumb > a").click(function () {
gdsr_rating_thumb(this)
});
jQuery(".gdsr_multisbutton_as > a").unbind("click");
jQuery(".gdsr_multisbutton_as > a").click(function () {
gdsr_rating_multi_button(this)
});
jQuery(".gdsr_multis_as > a").unbind("click");
jQuery(".gdsr_multis_as > a").click(function () {
gdsr_rating_multi_stars(this)
})
})
}
if (j.length > 0) {
j = j.substring(0, j.length - 1);
jQuery.getJSON(gdsr_cnst_ajax, {
_ ajax_nonce: gdsr_cnst_nonce,
vote_type: 'cache',
vote_domain: 'c',
votes: j
}, function (a) {
for (var i = 0; i < a.items.length; i++) {
var b = a.items[i];
jQuery(jquery_escape_id(b.id)).replaceWith(b.html)
}
if (jQuery.browser.msie) jQuery(".gdsr_ratin g_as > a").attr("href", "javascript:gdsrEmpty()");
if (jQuery.browser.msie) jQuery(".gdthumb > a").attr("href", "javascript:gdsrEmpty()");
jQuery(".gdsr_ratin g_as > a").unbind("click");
jQuery(".gdsr_ratin g_as > a").click(function () {
gdsr_rating_standard(this)
});
jQuery(".gdthumb > a").unbind("click");
jQuery(".gdthumb > a").click(function () {
gdsr_rating_thumb(this)
})
})
}
}
if (gdsr_ie()) jQuery(".gdsr_ratin g_as > a").attr("href", "javascript:gdsrEmpty()");
jQuery(".gdsr_ratin g_as > a").click(function () {
gdsr_rating_standard(this)
});
if (gdsr_ie()) jQuery(".gdthumb > a").attr("href", "javascript:gdsrEmpty()");
jQuery(".gdthumb > a").click(function () {
gdsr_rating_thumb(this)
});
if (gdsr_ie()) jQuery(".gdsr_integration > a").attr("href", "javascript:gdsrEmpty()");
jQuery(".gdsr_integration > a").click(function () {
var a = jQuery(this).attr("id").split("X");
var b = "#" + jQuery(this).parent().attr("id");
var c = a[1] * a[2];
jQuery(b + "_stars_rated").css("width", c + "px");
jQuery(b + "_value").val(a[1])
});
if (gdsr_ie()) jQuery(".gdsr_multisbutton_as > a").attr("href", "javascript:gdsrEmpty()");
jQuery(".gdsr_multisbutton_as > a").click(function () {
gdsr_rating_multi_button(this)
});
if (gdsr_ie()) jQuery(".gdsr_multis_as > a").attr("href", "javascript:gdsrEmpty()");
jQuery(".gdsr_multis_as > a").click(function () {
gdsr_rating_multi_stars(this)
});
if (gdsr_ie()) jQuery(".gdsr_mur_static > a").attr("href", "javascript:gdsrEmpty()");
jQuery(".gdsr_mur_static > a").click(function () {
var a = jQuery(this).attr("id").split("X");
var b = a[4];
var c = a[5];
var d = b * c;
var e = '#gd sr_murvw_stars_current_' + a[1] + '_' + a[2] + '_' + a[3];
var f = '.gdsr_int_multi_' + a[1] + '_' + a[2];
jQuery(e).css("width", d + "px");
var g = jQuery(f).val().split("X");
g[a[3]] = b;
for (var i = 0; i < g.length; i++) {
if (g[i] == 0) {
break
}
}
jQuery(f).val(g.join("X"))
})
});[/CODE]

I want to dynamically generate "vote_id." There should be a line that gets the value for "vote_id" from a dynamically generated piece of code.

A page where the stars are used is this: http://linksku.com/05/guppy-fish-best-aquarium-pet. When a star is pressed, the above JQuery code loads ajax.php?vote_id=96&... I want to change the 96 to something else.

Thanks in advance!
Copy linkTweet thisAlerts:
@JonaSep 13.2010 — [font=arial]Create a function that returns the value for the [/font][font=monaco]vote_id[/font][font=arial] variable.[/font]

<i>
</i>function my_vote_id(){
return 'your vote id value';
}


[font=arial]Then, replace the appropriate parts of the code to insert that value instead of what was generated by the existing code. There are 3 functions that send this value: [/font][font=monaco]gdsr_rating_standard[/font][font=arial], [/font][font=monaco]gdsr_rating_thumb[/font][font=arial], and [/font][font=monaco]multi_rating_vote[/font][font=arial].

Consider the bold lines.[/font]

<i>
</i>function gdsr_rating_standard(b) {
var c = jQuery(b).attr("id").split("X");
gdsrWait(c[5], c[6]);
jQuery.getJSON(gdsr_cnst_ajax, {
_ ajax_nonce: gdsr_cnst_nonce,
[b]vote_id: [i]my_vote_id()[/i],[/b]
vote_value: c[2],
vote_type: c[4],
vote_tpl: c[7],
vote _size: c[8]
}, function (a) {
gdsrWait(c[6], c[5]);
if (a.status == 'ok') {
jQuery("#gdr_sta rs_" + c[4] + c[1]).html("");
jQuery("#gdr_vote_" + c[4] + c[1]).css("width", p arseInt(a.value));
jQuery("#gdr_text_" + c[4] + c[1]).addClass("voted");
jQuery("#gdr_text_" + c[4] + c[1]).html(a.rater)
}
})
}


<i>
</i>function gdsr_rating_thumb(b) {
var c = jQuery(b).attr('class');
var d = jQuery(b).attr("id").split("X");
if (d[6] == 'Y') gdsrWait("gdsr_thumb_" + d[1] + "_" + d[3] + "_" + d[2], "gdsr_thumb_" + d[1] + "_" + d[3] + "_" + "loader_" + d[2]);
jQuery("#gdsr_thumb_" + d[1] + "_" + d[3] + "_" + "up a").replaceWith('&lt;div class="' + c + '"&gt;&lt;/div&gt;');
jQuery("#gdsr_thumb_" + d[1] + "_" + d[3] + "_" + "dw a").replaceWith('&lt;div class="' + c + '"&gt;&lt;/div&gt;');
jQuery.getJSON(gdsr_cnst_ajax, {
_ ajax_nonce: gdsr_cnst_nonce,
[b]vote_id: [i]my_vote_id()[/i],[/b]
vote_value: d[2],
vote_type: 'r' + d[3],
vote_tpl: d[4],
vote _size: d[5]
}, function (a) {
if (d[6] == 'Y') gdsrWait("gdsr_thumb_" + d[1] + "_" + d[3] + "_" + "loader_" + d[2], "gdsr_thumb_" + d[1] + "_" + d[3] + "_" + d[2]);
if (a.status == 'ok') {
jQuery("#gdsr_thu mb_text_" + d[1] + "_" + d[3]).addClass("voted");
jQuery("#gdsr_thu mb_text_" + d[1] + "_" + d[3]).html(a.rater)
}
})
}


<i>
</i>function multi_rating_vote(c) {
var d = c.split("_");
var e = d[0];
var f = d[1];
var g = d[2];
var h = d[3];
var j = jQuery("#gdsr_multi_" + e + "_" + f).val();
gdsrWait("gdsr_mur_text_" + e + "_" + f, "gdsr_mur_loader_" + e + "_" + f);
jQuery.getJSON(gdsr_cnst_ajax, {
_ ajax_nonce: gdsr_cnst_nonce,
[b]vote_id: [i]my_vote_id()[/i],[/b]
vote_set: f,
vote_value: j,
vote_tpl: g,
vote_type: 'm',
vote _size: h
}, function (a) {
jQuery("#gdsr_mur_block_" + e + "_" + f + " .gdsr_multis_as").remove();
jQuery("#gdsr_mur_block_" + e + "_" + f + " .gdcurrent").remove();
jQuery("#gdsr_mur_block_" + e + "_" + f + " input").remove();
jQuery("#gdsr_mur_block_" + e + "_" + f + " .ratingbutton").remove();
var b = jQuery("#gdsr_mur_avgstars_" + e + "_" + f + " div").css("height");
if (b &gt; 0) jQuery("#gdsr_mur_avgstars_" + e + "_" + f + " div").css("width", a.average * b.substring(0, 2));
for (var i = 0; i &lt; a.values.length; i++) jQuery("#gdsr_mur _stars_rated_" + e + "_" + f + "_" + i).css("width", p arseInt(a.values[i]));
jQuery("#gdsr_mur_text_" + e + "_" + f).html(a.rater).addClass("voted");
gdsrWait("gdsr_mur_loader_" + e + "_" + f, "gdsr_mur_text_" + e + "_" + f)
})
}
×

Success!

Help @narutodude000 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.24,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...