Jump to content
xisto Community
Trojan

Website And Forum "points" System Is there a way to make a Point system?

Recommended Posts

Hi.

 

I know there's a lot of forums that use things such as Credits, Points etc. that people gain in different ways and can be used for rewards such as hosting, Additional Permissions, etc.

 

Well, I want to know if there is a simple way to make a Point System similar to this, but works on Websites as well as forums and can be gained or lost by visiting certain pages, making posts, or (maybe) playing games. What is more, while you are on the website youcan always see the points you have at a certan place on the page.

 

Is there a way of doing this? A thing like this would really boost my website!

 

Thanks in advance,

-Trojan

Share this post


Link to post
Share on other sites

There is a way to do what you want with a bit of scripting, assuming you don't need too great security features.

I'll assume some points before starting explanation:

- You should already have a system on your site to track user identification: that is, you need a working 'login' box.

- Even it can also be done using database technologies, i'll give you the easiest way to implement it.

- I'll supose that your site has a server-side scripting technologie such as PHP, ASP or so. I'll also supose that you know the basics about each of them.

Most server side scripting technologies feature file-in/out methods. We may use this methods and some handmade data files to avoid use of databases in simple aplications. The simplest way to implement a points system is to create a folder, named something like 'users' and put a ***.dat or ***.points (or something like that) file for each user do you have, where *** is the user-name/login-name/id or even the email address. Once done that, you'll need to do the following:

- Write a function new_user(username) that creates a username.dat file with '0' as it's only content.

- Write a function get_points(username) that reads the file username.dat and returns its content.

- Write a function set_points(username, points) that sets the content of username.dat to 'points'.

Once you have these functions, you have a 'kernel' for your point system. Then you need a interface, that depends mainly on the use and administration you'll gona apply to this system. For example, you may create a form called 'grant points' that, in adition to login data (to ensure that user is allowed to grant points) gets a username and an amount of points.

Let's assume this example:

<form name='addpointfrm' action='grantpoints.php'>Admin log: <input id='admin_log' type='textbox'><br>Admin password: <input id='admin_pwd' type='password'><br>Target user log:<input id='user' type='textbox'><br>Amount of points:<input id='points' type='textbox'><br><input id='send' type='submit'></form>
Then your grantpoints.php should have a fragment like this:

// ...set_points($username, get_points($username)+addpointfrm.points);// ...
Please note that these are generic examples. Exact codification varies upon technology and even version used on a site. If you post some more details about in wich environment do you run your site and what do you pretend to do, then I'll be able to give you more 'final' code.

 

Hoping be useful,

Herenvardo, Freakiest among the freaks :P

Share this post


Link to post
Share on other sites

That's just the thing, I have three problems there-1. I don't have Server Side Includes (yes, I do know what they are)2. All my logging in features (except on my forum) are done using JavaScript, so I don't know if they'd be compatible,3. I know very little about SSI or their scripting techniques....But then again, moving to Xisto should solve the first two problems...And when I say I know very little about SSI, the only thing I really do understand is how to make a .htaccess file, and how to make custom error pages using it.

Share this post


Link to post
Share on other sites

Right now I'm predicting on the next post being something like "Well you're stuck there, Trojan". I just hope that's not the case...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.