Create A Forum - Support Forums

Support => Create a Forum Codes and Support => Topic started by: Agent Moose on August 02, 2010, 05:43:25 am

Title: [Code] Money Code (Simple)
Post by: Agent Moose on August 02, 2010, 05:43:25 am
Footers: (Admin > Style Manager > Headers and Footers > Footers)
Code: [Select]
<script type="text/javascript">
var Name = "NAME";
var Sign = "SIGN";
var Amount = AMOUNT PER POST;

var Aug_02_2010 = document.getElementsByTagName("li");
//Created by Agent Moose
for(x=0;x<Aug_02_2010.length;x++){
if(Aug_02_2010[x].className === "postcount" && Aug_02_2010[x].innerHTML.match(/posts: (.*)/i)){
var li = document.createElement("li");
li.className = "money";
li.innerHTML = Name + ": " + Sign + (RegExp.$1 * Amount);
Aug_02_2010[x].parentNode.insertBefore(li, Aug_02_2010[x].nextSibling);
};
};
</script>

That's right!  I'm back into the coding business (not really a business for me, since I do it on my free time :P )

It took me awhile to think of the first code to make for CreateAForum, so I went to my old forum (Simple Machine Codes) and looked at the most viewed codes, and boom, the Money Code was close to the top :)

This code could be better (coding wise), but I will just need to figure it out as I go, (after all, it has been a couple months since I have created a code).

NAME = The Name of the currency (EX: Money)
SIGN = The Sign of the currency (EX: $)
AMOUNT PER POST = How much the user will get for each post they make (EX: 2. Whatever number you set, will be multiplied by their post number)

If you have any questions, just ask.

Oh, and expect a lot more codes :)

Enjoy :)
Title: Re: [Code] Money Code (Simple)
Post by: Fate on August 02, 2010, 12:18:30 pm
Nice. The Master Coder has returned. :D
Title: Re: [Code] Money Code (Simple)
Post by: McLovin on August 02, 2010, 01:06:32 pm
Re we able to change the variable from amount per post to something else..?
Title: Re: [Code] Money Code (Simple)
Post by: Fate on August 02, 2010, 01:26:49 pm
Change AMOUNT PER POST to the amount you want users to be given for every post they make.
Quote
(EX: 2. Whatever number you set, will be multiplied by their post number)
Title: Re: [Code] Money Code (Simple)
Post by: McLovin on August 02, 2010, 05:05:07 pm
I know, but I want it to be a different variable. I can't really put what I want into words so nevermind, lol..
Title: Re: [Code] Money Code (Simple)
Post by: Jeenso on September 05, 2011, 12:44:53 pm
I think I know what you mean. I want so it isn't affected by the posts they make. Could I change it so I can AWARD/DOCK points from them myself?
Title: Re: [Code] Money Code (Simple)
Post by: Alex on September 05, 2011, 04:49:21 pm
Well that depends Jeenso. If you want it so that they don't gain money simply by posing-- so that you or another administrator would have to give them points for their posts, then you could always set it up with the karma system.
Title: Re: [Code] Money Code (Simple)
Post by: aIURbliS on September 05, 2011, 05:16:09 pm
I doubt you would want to do it with the karma system because you can only give 1 karma at a time and when you want to give 20, you have to click applaud 20 times. Should just make it so that only mods and above can edit custom titles which will be easier
Title: Re: [Code] Money Code (Simple)
Post by: Jeenso on September 05, 2011, 08:20:51 pm
I've found a way to do that without having to click applaud until your finger bleeds. =] I guess I have to stick with that after all. Thank you for your help anyways!
Title: Re: [Code] Money Code (Simple)
Post by: starlit night on December 12, 2012, 05:00:37 am
I've added this to my forum, but only problem is that it has already awarded cash to everyone based on how many posts they've made. Is there any way I can change it so that as of today everyone is at zero, and they can start earning today?

Title: Re: [Code] Money Code (Simple)
Post by: aIURbliS on December 12, 2012, 09:57:18 pm
No
Title: Re: [Code] Money Code (Simple)
Post by: starlit night on December 13, 2012, 12:19:24 am
Okay, thank you.
Title: Re: [Code] Money Code (Simple)
Post by: CyanProductions on December 02, 2014, 06:57:57 pm
@Alex
Just change "postcount" to "karma"
and "posts" to the custom name you gave karma