vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Database of Codes/Hacks/Mods :: Average Posts Per Member in Info Center - View Topic
Topic Rating: *****
Printable View
Danny
Full Member
***

[Avatar]

Posts: 180
Status: Offline
Gender: Male
Location: Durham
Age: 33
Joined:  
Reputation: 1%  


pmmsnxfire
Average Posts Per Member in Info Center (31st Dec 07 at 2:12am UTC)
Main Footer

Preview:

Image

This adds the average posts per member into the info center

Code:
 
  1. <script type="text/javascript">
  2. <!--
  3. /*Average Posts Per Member in Info Center by Danny*/
  4.  
  5. var getID = document.getElementById("info_center_stats");
  6. var posts = getID.innerHTML.match(/Posts:s(.+?)<br ?/?>/i) ? RegExp.$1.replace(/,/,''): ''1
  7. var members = getID.innerHTML.match(/Members:s(.+?)<br ?/?>/i) ? RegExp.$1.replace(/,/,''): ''
  8.  
  9. getID.innerHTML += 'Posts Per Member: ' + (posts/members);
  10.  
  11. //-->
  12. </script>
 

Myspace | deviantART

"Suffer For Your Art"
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Average Posts Per Member in Info Center (31st Dec 07 at 2:13am UTC)
I would suggest you do the following:

replace the commas (,) in the numbers, and parse the number (result) {Wink}

once you have done those, your code will be added! {Smile}
Danny
Full Member
***

[Avatar]

Posts: 180
Status: Offline
Gender: Male
Location: Durham
Age: 33
Joined:  
Reputation: 1%  


pmmsnxfire
Re: Average Posts Per Member in Info Center (31st Dec 07 at 3:10am UTC)
I think ive done what you want {Tongue Out}

Myspace | deviantART

"Suffer For Your Art"
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Average Posts Per Member in Info Center (31st Dec 07 at 9:41am UTC)
no...

var members = getID.innerHTML.match(/Members:\s(.+?)<br ?\/?>/i) ? RegExp.$1.replace(/,/,''): ''

that's it! {Wink}

now alter the other one {Tongue Out}
Danny
Full Member
***

[Avatar]

Posts: 180
Status: Offline
Gender: Male
Location: Durham
Age: 33
Joined:  
Reputation: 1%  


pmmsnxfire
Re: Average Posts Per Member in Info Center (31st Dec 07 at 11:34am UTC)
{Tongue Out}
cr0w told me to put that {Tongue Out} and that the second one was unneeded

Myspace | deviantART

"Suffer For Your Art"
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Average Posts Per Member in Info Center (31st Dec 07 at 11:46am UTC)
did he? I wouldn't have put it... oh well! {Tongue Out}

Danny
Full Member
***

[Avatar]

Posts: 180
Status: Offline
Gender: Male
Location: Durham
Age: 33
Joined:  
Reputation: 1%  


pmmsnxfire
Re: Average Posts Per Member in Info Center (31st Dec 07 at 11:47am UTC)
{Tongue Out} either way it still works so meh {Unsure} {Tongue Out}

Myspace | deviantART

"Suffer For Your Art"
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Average Posts Per Member in Info Center (31st Dec 07 at 11:52am UTC)
ok I'll add this later if cr0w hasn't already! {Smile}
Marc
vChat Developer
*****
I <3 Rossy

Posts: 3,388
Status: Offline
Gender: Male
Location: Ontario, Canada
Age: 32
Joined:  

Additional Groups:
Coding Team
***


Reputation: 40%  


pmwww
Re: Average Posts Per Member in Info Center (31st Dec 07 at 3:55pm UTC)
 
ok I'll add this later if cr0w hasn't already! {Smile}


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. {Wink}

rroll.to— Shorten a link, rickroll your friends.
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Average Posts Per Member in Info Center (31st Dec 07 at 3:57pm UTC)
ya, I forgot he was dividing! {Tongue Out}

So yeah, it can be ignored !;)
Marc
vChat Developer
*****
I <3 Rossy

Posts: 3,388
Status: Offline
Gender: Male
Location: Ontario, Canada
Age: 32
Joined:  

Additional Groups:
Coding Team
***


Reputation: 40%  


pmwww
Re: Average Posts Per Member in Info Center (31st Dec 07 at 4:01pm UTC)
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. {Tongue Out}

rroll.to— Shorten a link, rickroll your friends.
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Average Posts Per Member in Info Center (31st Dec 07 at 4:02pm UTC)
+1 to Wrighty! {Tongue Out}

(but Cr0w is still winning! {Sad} )
Marc
vChat Developer
*****
I <3 Rossy

Posts: 3,388
Status: Offline
Gender: Male
Location: Ontario, Canada
Age: 32
Joined:  

Additional Groups:
Coding Team
***


Reputation: 40%  


pmwww
Re: Average Posts Per Member in Info Center (31st Dec 07 at 4:12pm UTC)
 
+1 to Wrighty! {Tongue Out}

(but Cr0w is still winning! {Sad} )


{Tongue Out}

rroll.to— Shorten a link, rickroll your friends.
 Printable View

All times are GMT+0 :: The current time is 1:28am
Page generated in 1.1289 seconds
This Forum is Powered By vForums (v2.4)
Create a Forum for Free | Find Forums