Simple Machine Codes
March 28, 2024, 04:35:50 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  

Money Code

Pages: [1] 2   Go Down
  Print  
Author Topic: Money Code  (Read 4987 times)
0 Members and 1 Guest are viewing this topic.
Agent Moose
Administrator

Offline Offline

Gender: Male
Posts: 2,672



View Profile WWW
« on: May 30, 2007, 12:05:34 pm »

Finnally, a code that eveyone wants.  The Money Code!!!  It took me forever to finish, but I got it done.  It isn't the the place I want it, but it works for now.  It showes up under the AIM and MSN icons...

Code:
<script>
function smc_money_code(name,sign,amount){
//Created by Agent Moose at smcodes.smfforfree3.com
c = document.getElementsByTagName("div");
for(v=0;v<c.length;v++){
if(c[v].className=="smalltext" && c[v].innerHTML.match(/Posts: (\d+)/)){
var total = amount * RegExp.$1;
c[v].innerHTML+="<br />" + name+": " + sign + total;
};};}
smc_money_code("MONEY NAME","SIGN","AMOUNT PER POST")
</script>

This is simple
MONEY NAME is the name of the money...(eg: Money)
SIGN is the sign of the money(eg: $)
AMOUNT PER POST is how much you get per post(eg: 5[The number you put will be multiplied the posts.])

EDIT:  I forgot to tell you people something.  If you want to decrease someones money, decrese there post count by going to there profile.
« Last Edit: May 02, 2008, 09:02:37 pm by Agent Moose » Report Spam   Logged

Share on Facebook Share on Twitter

deathwilldie
100 Club Member

Offline Offline

Posts: 214


View Profile WWW
« Reply #1 on: May 30, 2007, 08:07:58 pm »

This is a great code.  Is it the only one that SMF has?
Report Spam   Logged

Agent Moose
Administrator

Offline Offline

Gender: Male
Posts: 2,672



View Profile WWW
« Reply #2 on: June 01, 2007, 02:00:39 pm »

Well, it is the only one that SMF for Free Has.
Report Spam   Logged

deathwilldie
100 Club Member

Offline Offline

Posts: 214


View Profile WWW
« Reply #3 on: June 01, 2007, 02:11:58 pm »

Im sure that alot of people will use this then.
Report Spam   Logged

LaundryLady
Geriatric Goddess
Global Moderator

Offline Offline

Gender: Female
Posts: 290


I'm watching, I have a sense of humor: Guess Who


View Profile
« Reply #4 on: June 15, 2007, 04:58:32 am »

I am using it and my members love it.  They are always making suggestions as to what they think they can buy with it, heh heh.  Someday I will tell them it's not real money. 
Report Spam   Logged

Agent Moose
Administrator

Offline Offline

Gender: Male
Posts: 2,672



View Profile WWW
« Reply #5 on: June 15, 2007, 11:30:07 am »

lol, you might wanna do that soon...lol
Report Spam   Logged

deathwilldie
100 Club Member

Offline Offline

Posts: 214


View Profile WWW
« Reply #6 on: June 17, 2007, 02:50:29 pm »

You need to somehow make it have a donate thing.
Report Spam   Logged

NOOB MUFFIN
Newcomers!

Offline Offline

Posts: 1


View Profile
« Reply #7 on: June 27, 2007, 03:02:15 pm »

where is the headers section?
Report Spam   Logged
Celebrus
Artificially Conscious
Administrator

Offline Offline

Gender: Male
Posts: 1,337


aka Omikron


View Profile WWW
« Reply #8 on: June 29, 2007, 11:27:47 am »

Your Forums|Admin|Manage Styles|Edit Headers/Footers.
Hey could you have it show up somewhere near the the place where it shows the amount of time logged in. It would be nice if the member didn't have to go see his posts to find out how much 'money' he has.
« Last Edit: July 05, 2007, 03:22:53 am by vikhyat » Report Spam   Logged

Agent Moose
Administrator

Offline Offline

Gender: Male
Posts: 2,672



View Profile WWW
« Reply #9 on: June 29, 2007, 02:17:06 pm »

I have tried to do that.  But I only got it to show when your veiwing the topic.  Which wouldn't be much help...I will work more on it.
Report Spam   Logged

Celebrus
Artificially Conscious
Administrator

Offline Offline

Gender: Male
Posts: 1,337


aka Omikron


View Profile WWW
« Reply #10 on: July 19, 2007, 06:01:05 am »

I got it to show up in the user's area correctly when viewing a post. Otherwise, it shows null as the money so I got it off. To use it, you need this cookie library. So ensure you have this in your headers:
Code:
<script src="http://vikhyatk.googlepages.com/vikhyatscookielibrary.js">//Vikhyat's cookie library</script>

And this is the code:
Code:
<script>
function smc_money_code(name,sign,amount){
//Created by Agent Moose at smcodes.smfforfree3.com
//Edited by Vikhyat at smcodes.smfforfree3.com
$(function() {
c = $("div")
for (v=0;v<c.length;v++)
if((c[v].className=="smalltext")&&(c[v].innerHTML.match(/Posts: (\d+)/))){
total = amount*RegExp.$1
setcookie("money"+name+amount+sign,total);
c[v].innerHTML+="<br />"+name+": "+sign+total+""
}
var moneyobtainedfromcookie=getcookie("money"+name+amount+sign);
if(moneyobtainedfromcookie) {
texttoshowinusersarea=name+": "+sign+moneyobtainedfromcookie;
$("#upshrinkHeader td table tr td.windowbg2").append(texttoshowinusersarea);
};});}
smc_money_code("MONEY NAME","SIGN","AMOUNT PER POST")
</script>

Let me give you a little advice to check if all the codes you are using are compatible with each other. Get a test forum and put in all the codes you are using in the order you are using them. And have some posts there to check if they all work fine together.
You might also want to mention in your TOS that there are actually 2 cookies your site is using. Oh, and by the way, this is a preview: vikhyatstestforum3.smfforfree3.com.
Report Spam   Logged

LaundryLady
Geriatric Goddess
Global Moderator

Offline Offline

Gender: Female
Posts: 290


I'm watching, I have a sense of humor: Guess Who


View Profile
« Reply #11 on: July 19, 2007, 09:45:49 am »

Quote
Let me give you a little advice to check if all the codes you are using are compatible with each other. Get a test forum and put in all the codes you are using in the order you are using them. And have some posts there to check if they all work fine together
.


This is a good thing to do.  It will keep you from destroying your main forum while you see if a particular code will work for you.
Report Spam   Logged

Agent Moose
Administrator

Offline Offline

Gender: Male
Posts: 2,672



View Profile WWW
« Reply #12 on: July 19, 2007, 10:13:20 am »

One thing to do, don't test codes on your main forum, made that mistake about a day or two ago.
Report Spam   Logged

Frost
Members

Offline Offline

Posts: 30


View Profile
« Reply #13 on: July 21, 2007, 02:23:41 am »

One thing to do, don't test codes on your main forum, made that mistake about a day or two ago.

Ah luckily mine was a success. I makin a test forum now  Cheesy
Report Spam   Logged
Agent Moose
Administrator

Offline Offline

Gender: Male
Posts: 2,672



View Profile WWW
« Reply #14 on: July 22, 2007, 07:16:48 pm »

Be smart and make a test forum before making new codes.
Report Spam   Logged

Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum

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