April 20, 2024, 09:42:37 am
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to Revolution X, where Coding meets Graphics.
 
  Home Help Search Arcade Affiliates Staff List Calendar Members Login Register  

Shop

Pages: [1]   Go Down
  Print  
Author Topic: Shop  (Read 407 times)
0 Members and 1 Guest are viewing this topic.
Agent Moose
Administrator
Adminitrator
Offline Offline

Gender: Male
Posts: 1,470



View Profile WWW
Badges: (View All)
Tenth year Anniversary Nineth year Anniversary Search
« on: November 07, 2008, 07:02:31 pm »

Yep, that is right, I am back to from my break of coding, and I decided to give y'all a suprise Smiley

Here is the Very first shop on SMF For Free Smiley
The Shop comes with a new Money Code that you can now Subtract money from people, without you lowering there Post count Smiley

Preview: http://shoppreview.smfforfree4.com/index.php

Before you accually add the shop, you need to create a new Profile Feild.  So,
1. Go to: Admin >> Features and Options >> Custom Profile Fields.
2. Press Add Field.
3. Now Click on the [Settings] Link.
4. Now Put this information as the Settings:
      Name: Subtract
      Field Description: The Ammount of money that will be subtracted from this user.
      Show in profile?:  Check
      Show in posts?: Under Post Count
      Parse BBC?: UnCheck
      Text to display before field (BBC is ok if enabled above): Leave Blank
      Text to display After field (BBC is ok if enabled above): Leave Blank
      Field ID:  SubtractMoney
      Add a horizontal rule before field?:  Don't Show
      Show field on registration?:  Don't Show
      Only allow admins to edit field?:  Check
      Only allow admins to view field?:  UnCheck
5. Press Save.

Now that's done, you can add the following code to your Footers:
Code:
<script>
var Name = "NAME";
var Sign = "SIGN";
var PerPost = "PERPOST";
var UserID = "ID";

var Item = new Array();
Item[Item.length] = ["ITEM","DESCRIPTION","COST"];

document.write("<script src='http://smcodes0" + Math.floor(Math.random() * 9) + ".googlepages.com/shop1.js'><\/script>");
</script>

NAME = The Name of the Money. (Ex: Money)
SIGN = The Sign for the Money (Ex: $)
PERPOST = The Amount the user will be getting Per Post.  (Ex: If 2, and you have 10 Posts, you will have $20)
ID = The ID of the Admin. (This is because they will get a PM with what the User will want.)

Now for the Item Part:
ITEM = The Item Name
DESCRIPTION - The description of that item.
COST = How much the Item will cost.

To add more items, add more of these lines:
Code:
Item[Item.length] = ["ITEM","DESCRIPTION","COST"];

Just save your Headers and Footers.  Now, one more step.

How do I subtract money?
All you have to do it go to the profile of a user that had bought something, then go to "Forum Profile Information" and find the Subtract Feild.  You will now have to add the price of the item they bought, and Save there profile Smiley
That easy.

Enjoy Smiley

Remember, this is only V1 of the Shop, there will be greater things added Smiley
Report Spam   Logged


Share on Facebook Share on Twitter

Mojobojo82
MVP
MVP
Offline Offline

Gender: Male
Posts: 838


View Profile
Badges: (View All)
« Reply #1 on: June 22, 2009, 04:28:49 am »

Nice Code.

On the preview I like that spam!  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

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