We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
  • Pages:
  • 1
  • 3
Simple Money/Points Script with Per-Post, Admit Edit
Topic Started: Nov 25 2010, 09:37 PM (11,067 Views)
Joe
Member Avatar


Code name: Simple Money Script [rewritten]
Date created: 5/6/2015
Author(s): Joe
Description: Admin-editable money system. You can define a currency name, starting amount, and a per-post amount. Money is displayed underneath the post count area.
Preview: Fiddle around on this board.

To get a members id, check their profile link like so:
[bbc_code]http://support.zathyus.com/profile/349609/[/bbc_code]`Board Template → Below the Board`
Code: HTML
 
<script type='text/javascript'>
/* Simple money script for Zetaboards (admin-edit)
Joe of http://outlineforum.com/ and http://support.zathyus.com/ */

// Options for currency, use "" for no currency sign
currencyName = "Money";
currencyPerPost = 1;
currencyStartAmt = 500;
currencySign = "$";

// Do not edit this line
currencyEdits = []; currencyID = 0;

// This where can add or subtract money using the member's id: [MEMBERID, AMOUNT]
currencyEdits[currencyID++] = [349609, 500];
currencyEdits[currencyID++] = [349609, -500];
</script>
<script type='text/javascript' src='http://z3.ifrm.com/53/36/0/p513624/simplemoneyscript.min.js'></script>
If anyone new to jQuery is interested how this script works (which is quite basic), a non-minified, commented version can be viewed here.

Older Version
Edited by Joe, May 6 2015, 01:15 PM.
Offline Profile Quote Post Goto Top
 
Replies:
Strangeness
Member
[ * ]
does this work for Invision board as well?
Offline Profile Quote Post Goto Top
 
Quozzo
Member Avatar
By the blood of Sanguinius!
[ *  *  *  *  * ]
Strangeness
Apr 23 2013, 06:18 PM
does this work for Invision board as well?
No
Offline Profile Quote Post Goto Top
 
another
Member
[ * ]
part207
Oct 24 2011, 08:46 AM
Is there a way i can add a seccond counter for this?

such as adding xp under the money code?
I would like to know the answer to this as well.
Offline Profile Quote Post Goto Top
 
FriendlyWarren
Member
[ * ]
I was wondering how do I attach a donation button where members could use their Forum Currencies to purchase deals and such that the forum offers please?

For example Say for $20 ZBIDS I will do 50 posts on your forum OR You can do 100 posts on my forum and I'll give you $100 ZBIDS (ZBIDS = Zetaboards and InvisionFree Dollars) for instance.
Offline Profile Quote Post Goto Top
 
StarsoftheSpiral
Member
[ * ]
I would like a forum gold shop that does not touch the posts' "points." I would like for my members to be able to earn badges AND gold at the same time without taking anything away from each other. They should earn gold anyway for posting and be able to donate it if they wish without destroying their post counts.

Is this even possible?
Edited by StarsoftheSpiral, Mar 6 2014, 01:26 AM.
Offline Profile Quote Post Goto Top
 
Joe
Member Avatar


Code rewritten, see original post. Nothing new in terms of features, however.

If anyone is just starting out with jQuery, this script covers a lot of basics and would be a good learning tool. For that reason, a non-minified, commented version can be found here.
Offline Profile Quote Post Goto Top
 
Quozzo
Member Avatar
By the blood of Sanguinius!
[ *  *  *  *  * ]
Joe
May 6 2015, 01:20 PM
Code rewritten, see original post. Nothing new in terms of features, however.

If anyone is just starting out with jQuery, this script covers a lot of basics and would be a good learning tool. For that reason, a non-minified, commented version can be found here.
It looks good but you might want to explain why you're multiplying the member ID and post count by 1.

You will want to cache `$(this)` if you use it multiple times within a handler too, as it's expensive converting the element into jQuery several times.

Also, instead of using `location.href.indexOf('/topic/') !== -1` if you don't need the index number, then you can use `location.href.indexOf('/topic/')+1` as that will return 0 if not found and >0 if it is. Not really necessary but saves milliseconds of my life typing out those extra characters :P
Offline Profile Quote Post Goto Top
 
Joe
Member Avatar


Quozzo
May 6 2015, 03:29 PM
Joe
May 6 2015, 01:20 PM
Code rewritten, see original post. Nothing new in terms of features, however.

If anyone is just starting out with jQuery, this script covers a lot of basics and would be a good learning tool. For that reason, a non-minified, commented version can be found here.
It looks good but you might want to explain why you're multiplying the member ID and post count by 1.

You will want to cache `$(this)` if you use it multiple times within a handler too, as it's expensive converting the element into jQuery several times.

Also, instead of using `location.href.indexOf('/topic/') !== -1` if you don't need the index number, then you can use `location.href.indexOf('/topic/')+1` as that will return 0 if not found and >0 if it is. Not really necessary but saves milliseconds of my life typing out those extra characters :P
Good points Quozzo! Thanks for that, I appreciate it.

I put in some extra comments for the `* 1`. Good point regarding `$(this)`, too.. didn't cross my mind despite using it three times per `$('td.c_username > a.member')` on the page, eeek!
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
Viral
[ *  *  *  *  *  * ]
You don't need my advice, but I'll also chime in with a small addition. Instead of `variable * 1` for type casting I usually use `+variable`. As far as I can remember there's no downsides to it, and it looks a lot neater in my opinion :P .
Offline Profile Quote Post Goto Top
 
Joe
Member Avatar


Viral
May 6 2015, 07:25 PM
You don't need my advice, but I'll also chime in with a small addition. Instead of `variable * 1` for type casting I usually use `+variable`. As far as I can remember there's no downsides to it, and it looks a lot neater in my opinion :P .
Feel free my friend! Little tid-bits like that are awesome, cool to share and to learn from each other. That's neat, hadn't seen that one before. :P
Offline Profile Quote Post Goto Top
 
Quozzo
Member Avatar
By the blood of Sanguinius!
[ *  *  *  *  * ]
Joe
May 6 2015, 08:30 PM
Viral
May 6 2015, 07:25 PM
You don't need my advice, but I'll also chime in with a small addition. Instead of `variable * 1` for type casting I usually use `+variable`. As far as I can remember there's no downsides to it, and it looks a lot neater in my opinion :P .
Feel free my friend! Little tid-bits like that are awesome, cool to share and to learn from each other. That's neat, hadn't seen that one before. :P
I've not seen that either. Good to know, thanks.
Offline Profile Quote Post Goto Top
 
Harvyy
Member Avatar
Member
[ *  *  * ]
thanks, i enjoy using this.
Edited by Harvyy, Nov 15 2016, 05:02 PM.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · ZetaBoards Codes & Modifications · Next Topic »
Add Reply
  • Pages:
  • 1
  • 3