Main Footer
Preview:
![]()
This adds the average posts per member into the info center
Code:
- <script type="text/javascript">
- <!--
- /*Average Posts Per Member in Info Center by Danny*/
- var getID = document.getElementById("info_center_stats");
- var posts = getID.innerHTML.match(/Posts:s(.+?)<br ?/?>/i) ? RegExp.$1.replace(/,/,''): ''1
- var members = getID.innerHTML.match(/Members:s(.+?)<br ?/?>/i) ? RegExp.$1.replace(/,/,''): ''
- getID.innerHTML += 'Posts Per Member: ' + (posts/members);
- //-->
- </script>
I would suggest you do the following:
replace the commas (,) in the numbers, and parse the number (result)![]()
once you have done those, your code will be added!![]()
I think ive done what you want![]()
no...
var members = getID.innerHTML.match(/Members:\s(.+?)<br ?\/?>/i) ? RegExp.$1.replace(/,/,''): ''
that's it!![]()
now alter the other one![]()
![]()
cr0w told me to put thatand that the second one was unneeded
did he? I wouldn't have put it... oh well!![]()
either way it still works so meh
![]()
![]()
ok I'll add this later if cr0w hasn't already!![]()
ok I'll add this later if cr0w hasn't already!![]()
parseInt() is rarely needed. The only real time it's needed is if you're adding, as older browsers may think you're trying to combine two strings.![]()
ya, I forgot he was dividing!![]()
So yeah, it can be ignored !;)
Hmm, actually Danny, the RegExp.$1 isn't needed; you should leave it as this:
var members = getID.innerHTML.match(/Members:\s(.+?)<br ?\/?>/i) ? RegExp.$1.replace(/,/,''): ''
That's why it's not smart to ask me these things at 1am.![]()
+1 to Wrighty!![]()
(but Cr0w is still winning!)
+1 to Wrighty!![]()
(but Cr0w is still winning!)
![]()