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:

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:`var plevel = Math.floor(EXP/xneeded+parseInt(1));`

var xpup = (plevel*xneeded)

var showxp= (xpup-xneeded)

if(sPost.innerHTML.match('<!-- placeholder -->')) {

NewCode = sPost.innerHTML.replace("<!-- placeholder -->", ""+name + ": " + sign + EXP + "<br><!-- placeholder -->")

}

else {

NewCode = topR + midR + name + ": " + sign +" "+ Math.floor(EXP/xneeded+parseInt(1)) + "<BR> XP: "+ (EXP-showxp) +"<BR> Experience needed: " + (xpup-EXP)+ "<BR>Overall Experience:" + (xneeded * (EXP/xneeded)) +"<br><!-- placeholder --><br><br>"

}

sPost.innerHTML = NewCode

}}

</script>

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?Code:`if (EXP<600)`

{

plevel = 1

}

else if (600<EXP<700)

{

plevel = 2

}

else if (650<EXP<750)

{

plevel = 3

}

else if (800<EXP<900)

{

plevel = 4

}

else if (900<EXP<1000)

{

plevel = 5

}

else if (1050<EXP<1200)

{

plevel = 6

}

else if (1200<EXP<1350)

{

plevel = 7

}

else if (1350<EXP<1550)

{

plevel = 8

}

else if (1550<EXP<1800)

{

plevel = 9

}

else if (1800<EXP<2050)

{

plevel = 10

}

else if (2050<EXP<2350)

{

plevel = 11

}

else if (2350<EXP<2700)

{

plevel = 12

}

else if (2700<EXP<3100)

{

plevel = 13

}

else if (3100<EXP<3550)

{

plevel = 14

}

else if (3550<EXP<4100)

{

plevel = 15

}

else if (4100<EXP<4700)

{

plevel = 16

}

else if (4700<EXP<5400)

{

plevel = 17

}

else if (5400<EXP<6200)

{

plevel = 18

}

else if (6200<EXP<7150)

{

plevel = 19

}

else if (7150<EXP<8200)

{

plevel = 20

}

else if (8200<EXP<9450)

{

plevel = 21

}

else if (9450<EXP<10850)

{

plevel = 22

}

else if (10850<EXP<12450)

{

plevel = 23

}

else if (12450<EXP<14350)

{

plevel = 24

}

else if (14350<EXP<16500)

{

plevel = 25

}

else if (16500<EXP<18950)

{

plevel = 26

}

else if (18950<EXP<21800)

{

plevel = 27

}

else if (21800<EXP<25050)

{

plevel = 28

}

else if (25050<EXP<28800)

{

plevel = 29

}

else

{

plevel = 30

}

var xpup = (xneeded * Math.ceiling(Math.pow(1.15, plevel)))

var showxp= (xpup - (xneeded * Math.ceiling(Math.pow(1.15, plevel-1)))

if(sPost.innerHTML.match('<!-- placeholder -->')) {

NewCode = sPost.innerHTML.replace("<!-- placeholder -->", ""+name + ": " + sign + EXP + "<br><!-- placeholder -->")

}

else {

NewCode = topR + midR + name + ": " + sign +" "+ if (EXP<600)

{

plevel = 1

}

else if (600<EXP<700)

{

plevel = 2

}

else if (650<EXP<750)

{

plevel = 3

}

else if (800<EXP<900)

{

plevel = 4

}

else if (900<EXP<1000)

{

plevel = 5

}

else if (1050<EXP<1200)

{

plevel = 6

}

else if (1200<EXP<1350)

{

plevel = 7

}

else if (1350<EXP<1550)

{

plevel = 8

}

else if (1550<EXP<1800)

{

plevel = 9

}

else if (1800<EXP<2050)

{

plevel = 10

}

else if (2050<EXP<2350)

{

plevel = 11

}

else (2350<EXP<2700)

{

plevel = 12

}

else if (2700<EXP<3100)

{

plevel = 13

}

else if (3100<EXP<3550)

{

plevel = 14

}

else if (3550<EXP<4100)

{

plevel = 15

}

else if (4100<EXP<4700)

{

plevel = 16

}

else if (4700<EXP<5400)

{

plevel = 17

}

else if (5400<EXP<6200)

{

plevel = 18

}

else if (6200<EXP<7150)

{

plevel = 19

}

else if (7150<EXP<8200)

{

plevel = 20

}

else if (8200<EXP<9450)

{

plevel = 21

}

else if (9450<EXP<10850)

{

plevel = 22

}

else if (10850<EXP<12450)

{

plevel = 23

}

else if (12450<EXP<14350)

{

plevel = 24

}

else if (14350<EXP<16500)

{

plevel = 25

}

else if (16500<EXP<18950)

{

plevel = 26

}

else if (18950<EXP<21800)

{

plevel = 27

}

else if (21800<EXP<25050)

{

plevel = 28

}

else if (25050<EXP<28800)

{

plevel = 29

}

else

{

plevel = 30

} + "<BR> XP: "+ (EXP-showxp) +"<BR> Experience needed: " + (xpup-EXP)+ "<BR>Overall Experience:" + (xneeded * EXP / xneeded) +"<br><!-- placeholder --><br><br>"

}

sPost.innerHTML = NewCode

}}

</script>