There doesn't appear to be anything in this code to calibrate to the actual average donation rate. In fact it's not tied to any real amounts or rates at all. It's just a function of the current datetime.
UPDATE: They took the donation page down...
Forbidden
You don't have permission to access /stillneedhelp/
on this server.
Unless they've changed the code, there are some manually adjusted values that estimate the average donation rate based on some magic number they plugged in from their own projections (/propaganda if you think this was intentionally misleading).
If I had to guess, val1 was how many committed donations they had at 11am April 24th and val2 is how much they anticipated raising in the following 13 hours of April 24th. Note that Santorum suspended his campaign April 10th, so it looks like someone probably was updating this manually until the campaign was fully disbanded.
> There doesn't appear to be anything in this code to calibrate to the actual average donation rate. In fact it's not tied to any real amounts or rates at all. It's just a function of the current datetime.
I would assume that while the campaign was active they would periodically adjust the constants to reflect the current average.
My guess is the same barely-competent webmaster who wrote the JS noticed a huge traffic spike in that directory, and disabled the index but not the cause of the spike. But we'll see... (Ed: downvotes make me think you were right. :)
Yeah, I figured that was the real reason, the edit is tongue-in-cheek. But I don't think it's unfounded. Just look at all the comments criticizing the coding! (Particularly in Osiris' thread.) I don't consider myself a master programmer but at least I use 'var' by habit. Now one other objection I considered was the use of "barely-competent" as a term, which seems like a strange one since typically people are either competent or incompetent. But that's not really the whole picture in general and certainly not in coding. I don't just mean the levels of mastery[1], "barely-competent" here is the Just Good Enough (hey, it "works" for its purpose and most people won't know any better if they pay attention at all) and the Just Good Enough is often just fine in practice but it's not the actual goal. The goal is to do better, but if you never want to do better than the Just Good Enough, well, I for one don't want to work with you.
Well, theoretically they could just have a guy manually pushing new rate values to reflect reality.
But that's a big theoretically. This is almost certainly malice.
And it would almost certainly have gone unchecked if the developer had only hidden the BS generator script on the server side.
But as others have pointed out, that's probably asking too much given the state of this code and given that the main page 403's but they left the BS script serving.
UPDATE: They took the donation page down...