News:

Create A Forum Installed

Author Topic: [Code] Money Code (Simple)  (Read 4478 times)

0 Members and 1 Guest are viewing this topic.

Offline Agent Moose

  • Newbie
  • *
  • Posts: 37
  • Karma: 12
  • Gender: Male
  • Miss me?
  • Location: South Carolina, United States
    • View Profile

Badges: (View All)
Linux User Mobile User Level 5
[Code] Money Code (Simple)
« 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 :)
« Last Edit: August 03, 2010, 04:26:14 pm by Agent Moose »
Code: [Select]
//Hint hint :)
if(/action=profile;u=(.*);sa=UserPage/i.test(location.href)){
var number = RegExp.$1;
var username = (smf_id_member !== "0") ? document.getElementById("upper_section").getElementsByTagName("li")[0].getElementsByTagName("span")[0].innerHTML : void(0);

Share on Facebook Share on Twitter


Offline Fate

  • Newbie
  • *
  • Posts: 36
  • Karma: -1
  • Gender: Male
  • US Navy Seal - Commander Fate
    • View Profile
    • CIA

Badges: (View All)
Level 3 Topic Starter Combination
Re: [Code] Money Code (Simple)
« Reply #1 on: August 02, 2010, 12:18:30 pm »
Nice. The Master Coder has returned. :D

Offline McLovin

  • Newbie
  • *
  • Posts: 30
  • Karma: -4
    • View Profile

Badges: (View All)
Topic Starter Combination Level 2
Re: [Code] Money Code (Simple)
« Reply #2 on: August 02, 2010, 01:06:32 pm »
Re we able to change the variable from amount per post to something else..?

Offline Fate

  • Newbie
  • *
  • Posts: 36
  • Karma: -1
  • Gender: Male
  • US Navy Seal - Commander Fate
    • View Profile
    • CIA

Badges: (View All)
Level 3 Topic Starter Combination
Re: [Code] Money Code (Simple)
« Reply #3 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)

Offline McLovin

  • Newbie
  • *
  • Posts: 30
  • Karma: -4
    • View Profile

Badges: (View All)
Topic Starter Combination Level 2
Re: [Code] Money Code (Simple)
« Reply #4 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..

guest879

  • Guest
Re: [Code] Money Code (Simple)
« Reply #5 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?

Offline Alex

  • CAF Support Team
  • Full Member
  • ***
  • Posts: 235
  • Karma: 13
  • Gender: Male
  • Location: Greenville, North Carolina
    • View Profile

Badges: (View All)
Eighth year Anniversary Seventh year Anniversary Sixth year Anniversary
Re: [Code] Money Code (Simple)
« Reply #6 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.
Terms Of Service

Please don't PM me with support questions

Offline aIURbliS

  • Hero Member
  • *****
  • Posts: 1215
  • Karma: 45
  • Gender: Male
  • Location: U.S.
    • View Profile

Badges: (View All)
Level 6 Sixth year Anniversary Fifth year Anniversary
Re: [Code] Money Code (Simple)
« Reply #7 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
All codes I make are tested on the latest version of Google Chrome and upon request of other browsers.

guest879

  • Guest
Re: [Code] Money Code (Simple)
« Reply #8 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!

Offline starlit night

  • Jr. Member
  • **
  • Posts: 54
  • Karma: 1
  • Gender: Female
    • View Profile
    • Starlit Night Falls Ageplay Community

Badges: (View All)
50 Posts Level 4 Karma Bad
Re: [Code] Money Code (Simple)
« Reply #9 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?

« Last Edit: December 12, 2012, 05:02:30 am by mikeyrocks »

Offline aIURbliS

  • Hero Member
  • *****
  • Posts: 1215
  • Karma: 45
  • Gender: Male
  • Location: U.S.
    • View Profile

Badges: (View All)
Level 6 Sixth year Anniversary Fifth year Anniversary
Re: [Code] Money Code (Simple)
« Reply #10 on: December 12, 2012, 09:57:18 pm »
No
All codes I make are tested on the latest version of Google Chrome and upon request of other browsers.

Offline starlit night

  • Jr. Member
  • **
  • Posts: 54
  • Karma: 1
  • Gender: Female
    • View Profile
    • Starlit Night Falls Ageplay Community

Badges: (View All)
50 Posts Level 4 Karma Bad
Re: [Code] Money Code (Simple)
« Reply #11 on: December 13, 2012, 12:19:24 am »
Okay, thank you.

Offline CyanProductions

  • Newbie
  • *
  • Posts: 39
  • Karma: -1
    • View Profile

Badges: (View All)
Level 3 10 Posts Karma Good
Re: [Code] Money Code (Simple)
« Reply #12 on: December 02, 2014, 06:57:57 pm »
@Alex
Just change "postcount" to "karma"
and "posts" to the custom name you gave karma

 

Related Topics

  Subject / Started by Replies Last post
1 Replies
1339 Views
Last post March 14, 2012, 04:53:55 pm
by aIURbliS
3 Replies
1307 Views
Last post March 14, 2012, 02:03:17 pm
by Agent Moose
4 Replies
585 Views
Last post May 27, 2017, 07:25:09 pm
by Egbune
2 Replies
1264 Views
Last post January 05, 2020, 06:37:45 pm
by Matthew
2 Replies
472 Views
Last post February 02, 2020, 03:34:38 pm
by mickjav