Simple Machine Codes
October 23, 2018, 07:49:56 pm
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to SMC, the best place for your SMF For Free Codes
 
  Home Help Search Arcade Gallery Affiliates Code Index Staff List Calendar Members Login Register  

Activity Code

Pages: [1]   Go Down
  Print  
Author Topic: Activity Code  (Read 2963 times)
Agent Moose
Administrator

Offline Offline

Gender: Male
Posts: 2,671



View Profile WWW
« on: June 24, 2008, 10:30:58 am »

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 alittle comfusion for some of you, but you can try to get it Tongue

Enjoy Smiley
Report Spam   Logged

Social Buttons

legend 1234
100 Club Member

Offline Offline

Gender: Male
Posts: 461


Legend 1234


View Profile WWW
« Reply #1 on: June 30, 2008, 01:38:33 am »

woooooot thanks alot moosey ive been wanting this for ages

thanks alot although i only have 866 posts and with no commar

but when i add this it doesnt work any idea why ?

legend 1234
Report Spam   Logged

CodeLover
100 Club Member

Offline Offline

Gender: Male
Posts: 331


View Profile
« Reply #2 on: June 30, 2008, 06:24:17 am »

I don't get this, what exactly does it do?
Report Spam   Logged

Don't get mad at me if I'm acting immature - I'm only 10 Grin


legend 1234
100 Club Member

Offline Offline

Gender: Male
Posts: 461


Legend 1234


View Profile WWW
« Reply #3 on: July 01, 2008, 02:49:33 am »

go to the index of the forums

and ull see were it says 514 posts and 14 topics

it has a activity thing

like it may say 1% activity meaning 1% of the activities oon these forums have been in that board

u undertanad that ?

and moosey can u look  2 posts up and tell me y mine wont work ?

legend 1234
Report Spam   Logged

legend 1234
100 Club Member

Offline Offline

Gender: Male
Posts: 461


Legend 1234


View Profile WWW
« Reply #4 on: July 03, 2008, 04:44:56 am »

moosey Huh??

legend 1234
Report Spam   Logged

Agent Moose
Administrator

Offline Offline

Gender: Male
Posts: 2,671



View Profile WWW
« Reply #5 on: July 03, 2008, 12:52:23 pm »

Honestly legend, I don't know why it isn't working.

Can you post your forum URL?
Report Spam   Logged

legend 1234
100 Club Member

Offline Offline

Gender: Male
Posts: 461


Legend 1234


View Profile WWW
« Reply #6 on: July 04, 2008, 09:40:43 pm »

kk sure its:

http://havenworld.smfforfree4.com/index.php?action=forum

legend 1234
Report Spam   Logged

Agent Moose
Administrator

Offline Offline

Gender: Male
Posts: 2,671



View Profile WWW
« Reply #7 on: July 05, 2008, 10:52:32 am »

Well, I don't know why it isn't working, but  I did see that you had a lot of unnecessary codes in there,  Take out all this:

Code:
<script>
function name_across_board() {
//Created by Agent Moose (smcodes.smfforfree3.com)
$(function() {
var vfour = new Array()
vfour[vfour.length] = ["Roger","Roger","white","<img src=http://img442.imageshack.us/img442/4047/43260273ax3.gif <img>"]

for(f=0;f<vfour.length;f++){
$("a").each(function() {
if(this.innerHTML == vfour[f][0]){this.innerHTML = this.innerHTML.replace(vfour[f][0],"<font color='" + vfour[f][2] + "'>" + vfour[f][3] + vfour[f][(vfour[f][1] != "" ? 1 : 0)] + "</font>");};
});};});}
name_across_board();
</script>

<script>
function name_across_board() {
//Created by Agent Moose (smcodes.smfforfree3.com)
$(function() {
var vfour = new Array()
vfour[vfour.length] = ["Layton","Layton","white","<img src=http://img442.imageshack.us/img442/4047/43260273ax3.gif <img>"]

for(f=0;f<vfour.length;f++){
$("a").each(function() {
if(this.innerHTML == vfour[f][0]){this.innerHTML = this.innerHTML.replace(vfour[f][0],"<font color='" + vfour[f][2] + "'>" + vfour[f][3] + vfour[f][(vfour[f][1] != "" ? 1 : 0)] + "</font>");};
});};});}
name_across_board();
</script>

<script>
function name_across_board() {
//Created by Agent Moose (smcodes.smfforfree3.com)
$(function() {
var vfour = new Array()
vfour[vfour.length] = ["Predator","Predator","white","<img src=http://img442.imageshack.us/img442/4047/43260273ax3.gif <img>"]

for(f=0;f<vfour.length;f++){
$("a").each(function() {
if(this.innerHTML == vfour[f][0]){this.innerHTML = this.innerHTML.replace(vfour[f][0],"<font color='" + vfour[f][2] + "'>" + vfour[f][3] + vfour[f][(vfour[f][1] != "" ? 1 : 0)] + "</font>");};
});};});}
name_across_board();
</script>

<script>
function name_across_board() {
//Created by Agent Moose (smcodes.smfforfree3.com)
$(function() {
var vfour = new Array()
vfour[vfour.length] = ["anton","anton","white","<img src=http://img444.imageshack.us/img444/4125/modicons0xa5.gif <img>"]

for(f=0;f<vfour.length;f++){
$("a").each(function() {
if(this.innerHTML == vfour[f][0]){this.innerHTML = this.innerHTML.replace(vfour[f][0],"<font color='" + vfour[f][2] + "'>" + vfour[f][3] + vfour[f][(vfour[f][1] != "" ? 1 : 0)] + "</font>");};
});};});}
name_across_board();
</script>

<script>
function name_across_board() {
//Created by Agent Moose (smcodes.smfforfree3.com)
$(function() {
var vfour = new Array()
vfour[vfour.length] = ["legend1234","legend1234","white","<img src=http://img444.imageshack.us/img444/4125/modicons0xa5.gif <img>"]

for(f=0;f<vfour.length;f++){
$("a").each(function() {
if(this.innerHTML == vfour[f][0]){this.innerHTML = this.innerHTML.replace(vfour[f][0],"<font color='" + vfour[f][2] + "'>" + vfour[f][3] + vfour[f][(vfour[f][1] != "" ? 1 : 0)] + "</font>");};
});};});}
name_across_board();
</script>


For this:
Code:
[code]<script>
function name_across_board() {
//Created by Agent Moose (smcodes.smfforfree3.com)
$(function() {
var vfour = new Array()
vfour[vfour.length] = ["Roger","Roger","white","<img src=http://img442.imageshack.us/img442/4047/43260273ax3.gif <img>"]
vfour[vfour.length] = ["Layton","Layton","white","<img src=http://img442.imageshack.us/img442/4047/43260273ax3.gif <img>"]
vfour[vfour.length] = ["Predator","Predator","white","<img src=http://img442.imageshack.us/img442/4047/43260273ax3.gif <img>"]
vfour[vfour.length] = ["anton","anton","white","<img src=http://img444.imageshack.us/img444/4125/modicons0xa5.gif <img>"]
vfour[vfour.length] = ["legend1234","legend1234","white","<img src=http://img444.imageshack.us/img444/4125/modicons0xa5.gif <img>"]

for(f=0;f<vfour.length;f++){
$("a").each(function() {
if(this.innerHTML == vfour[f][0]){this.innerHTML = this.innerHTML.replace(vfour[f][0],"<font color='" + vfour[f][2] + "'>" + vfour[f][3] + vfour[f][(vfour[f][1] != "" ? 1 : 0)] + "</font>");};
});};});}
name_across_board();
</script>
[/code]
Report Spam   Logged

legend 1234
100 Club Member

Offline Offline

Gender: Male
Posts: 461


Legend 1234


View Profile WWW
« Reply #8 on: July 06, 2008, 08:46:24 am »

kk thanks and yea i know i was goina actually do that but never got around to it.

thanks moosey but dnno y code wont work

ps. Howd u get my headers and footers hahahhaha Tongue

pss. I know how to do it aswell lol but i would never take anything from smc if i wasnt aloud

psss. ok enough of these im out  Grin

legend 1234
Report Spam   Logged

Agent Moose
Administrator

Offline Offline

Gender: Male
Posts: 2,671



View Profile WWW
« Reply #9 on: July 07, 2008, 10:52:33 am »

I have no idea how to get the code working, it worked on SMC, I have no idea why it wont work on your forum.

And all I did was view the page source of your forum, it shows all the layout of your forum.
Report Spam   Logged

legend 1234
100 Club Member

Offline Offline

Gender: Male
Posts: 461


Legend 1234


View Profile WWW
« Reply #10 on: July 08, 2008, 03:02:36 am »

I have no idea how to get the code working, it worked on SMC, I have no idea why it wont work on your forum.

And all I did was view the page source of your forum, it shows all the layout of your forum.

mmk well thanks for trying i guess ill just have to live without it Tongue

haha yea thats wat i do aswell

thanks for trying mate
Report Spam   Logged

legend 1234
100 Club Member

Offline Offline

Gender: Male
Posts: 461


Legend 1234


View Profile WWW
« Reply #11 on: July 08, 2008, 03:04:15 am »

soz to double post

but i tried it on a different forum and still not working

has any 1 actually got this code working on there forum ?
Report Spam   Logged

Kalphiter
100 Club Member

Offline Offline

Gender: Male
Posts: 203


Never forget to drink coffee.


View Profile
« Reply #12 on: July 08, 2008, 10:11:29 am »

I have no idea how to get the code working, it worked on SMC, I have no idea why it wont work on your forum.

And all I did was view the page source of your forum, it shows all the layout of your forum.
Yes.

Front page of forum displays index.template.php
along with boardindex.template.php

Front page includes CSS link(depends on which theme you have)


I don't understand how the code couldn't work!
Report Spam   Logged

Java is your friend.
legend 1234
100 Club Member

Offline Offline

Gender: Male
Posts: 461


Legend 1234


View Profile WWW
« Reply #13 on: July 09, 2008, 06:49:40 am »

ermm well mine didnt work on 2 dif forums lol
Report Spam   Logged

Agent Moose
Administrator

Offline Offline

Gender: Male
Posts: 2,671



View Profile WWW
« Reply #14 on: July 09, 2008, 12:35:11 pm »

I made that code on one of my test forums, and it worked fine there Tongue
Report Spam   Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum | Buy traffic for your forum/website

Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy