View Single Post
 01-23-2013, 01:46 AM PM User | #1 FrostWyrmWraith New Coder   Join Date: Jan 2013 Posts: 12 Thanks: 0 Thanked 0 Times in 0 Posts Coding a Forum Level Up System I'm working on modifying someone else's code for allowing forum posts to register towards a pool of experience towards leveling up. This is the original section which has been edited: Code: ```var plevel = Math.floor(EXP/xneeded+parseInt(1)); var xpup = (plevel*xneeded) var showxp= (xpup-xneeded) if(sPost.innerHTML.match('')) { NewCode = sPost.innerHTML.replace("", ""+name + ": " + sign + EXP + "
") } else { NewCode = topR + midR + name + ": " + sign +" "+ Math.floor(EXP/xneeded+parseInt(1)) + "
XP: "+ (EXP-showxp) +"
Experience needed: " + (xpup-EXP)+ "
Overall Experience:" + (xneeded * (EXP/xneeded)) +"

" } sPost.innerHTML = NewCode }} ``` What I've done is edited plevel to be determined by an "if," "else if," "else" string and altered the equations for xpup and showxp to work with the new system. However, whenever I try to use these sections the entire code fails to function. This is the same section, edited: Code: ``` if (EXP<600) { plevel = 1 } else if (600')) { NewCode = sPost.innerHTML.replace("", ""+name + ": " + sign + EXP + "
") } else { NewCode = topR + midR + name + ": " + sign +" "+ if (EXP<600) { plevel = 1 } else if (600 XP: "+ (EXP-showxp) +"
Experience needed: " + (xpup-EXP)+ "
Overall Experience:" + (xneeded * EXP / xneeded) +"

" } sPost.innerHTML = NewCode }} ``` I am at a loss as to what I screwed up. I've tried to resolve it myself, but I haven't been able to identify exactly what the problem is other than narrowing it down to this section. Can anyone shed some light on that?