[Project_owners] Suggestion to correct downloadsNoFmt()

Jesper Staun Hansen jesper at heroes-addon.dk
Mon Mar 24 06:52:35 PDT 2008


Hello

Was looking at the downloadsNoFmt() once again, and as its written, then 
downloads No Format shouldn't have any formating code assigned to it.
But it instead it outputs this:

<span class="download_count">16</span>
While the expected result would be:
16

Resulting in a longer "Total downloads" script:
<script>
var f01 = '<span class="download_count">16</span>';
n01 = f01.match(/<span class=\"download_count\">(.*?)<\/span>/)[1];
var f02 = '<span class="download_count">19</span>';
n02 = f02.match(/<span class=\"download_count\">(.*?)<\/span>/)[1];
var f03 = '<span class="download_count">14</span>';
n03 = f03.match(/<span class=\"download_count\">(.*?)<\/span>/)[1];
var f04 = '<span class="download_count">17</span>';
n04 = f04.match(/<span class=\"download_count\">(.*?)<\/span>/)[1];
var f051 = '<span class="download_count">113</span>';
n051 = f051.match(/<span class=\"download_count\">(.*?)<\/span>/)[1];
var f052 = '<span class="download_count">38</span>';
n052 = f052.match(/<span class=\"download_count\">(.*?)<\/span>/)[1];
var f053 = '<span class="download_count">10</span>';
n053 = f053.match(/<span class=\"download_count\">(.*?)<\/span>/)[1];
var f054 = '<span class="download_count">17</span>';
n054 = f054.match(/<span class=\"download_count\">(.*?)<\/span>/)[1];
var f055 = '<span class="download_count">37</span>';
n055 = f055.match(/<span class=\"download_count\">(.*?)<\/span>/)[1];
var f0551 = '<span class="download_count">43</span>';
n0551 = f0551.match(/<span class=\"download_count\">(.*?)<\/span>/)[1];
var f0552 = '<span class="download_count">19</span>';
n0552 = f0552.match(/<span class=\"download_count\">(.*?)<\/span>/)[1];
var f05521 = '<span class="download_count">139</span>';
n05521 = f05521.match(/<span class=\"download_count\">(.*?)<\/span>/)[1];

counting = Math.abs(0-n01-n02-n03-n04-n051-n052-n053-n054-n055-n0551-n0552-n05521);

document.write(counting);
</script>

For which it would be easier to just add them together.

What do you fellas and girls think?


More information about the Project_owners mailing list