SMF For Free Support Forum
Signup For Free Forum
September 04, 2008, 11:22:36 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to SMF For Free. The best free SMF Host
 
   Home   Help Search Arcade Gallery Login Register  

Pages: [1]
  Print  
Author Topic: [Code] Activity Code  (Read 334 times)
0 Members and 1 Guest are viewing this topic.
Agent Moose
Moderator
*****
Offline Offline

Posts: 625


Do not PM me for Code Support or Request


View Profile WWW
« on: July 07, 2008, 05:02:33 pm »

Footers:
Code:
<script>
function Activity(){
$("td.titlebg:contains(Forum Stats)").parent().next().each(function(){
if(this.innerHTML.match(/(\d+) Posts/i)){
var bPosts = RegExp.$1 + RegExp.$2;
$("tr").each(function(){
if(this.innerHTML.match(/(\d+) Posts/i)){
var fPosts = RegExp.$1;
var Activity = Math.round(100 * fPosts / bPosts);
$(this).find("td.windowbg[valign='middle'] span.smalltext").append("<br>" + Activity + "% Activity");
};});};});};
Activity();
</script>

Here is the code alot of people wanted!  The Activity Code, straight from the SMCodes Footers!  There is one problem with it though.  If you look at your board stats, find (number) Posts.

If that number doesn't have a comma for you, it will work perfectly right when you put it on your forums, but, if you do have a comma, you will need to edit a part of the code.

You will need to add ,(\d+) to the code in this line:
Code:
if(this.innerHTML.match(/(\d+) Posts/i)){
Example, if you have 10,000 posts, that line of code would look like this:
Code:
if(this.innerHTML.match(/(\d+),(\d+) Posts/i)){

There ya go, might be a little confusion for some of you, but you can try to get it Tongue

Enjoy Smiley


Note*

Some of my members on my forum have tried this code on there forum and it didn't work, and I don't know why.  So if you have that problem, please don't keep on asking about it.  Thanks.
Logged

Eternal Flame Coming Soon

SMC Code Index - The best Code Index for all your Needs!  Includes a bunch of codes not on Support.
3lf-ครรครรเภ
SMF For Free Full Member
*
Offline Offline

Posts: 108



View Profile
« Reply #1 on: July 16, 2008, 05:47:20 pm »

thanks!!
Logged



Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC
ServerBeach Coupon
Page created in 0.67 seconds with 17 queries.