|
|
|
|
![]() ![]() |
Jul 11 2005, 07:39 PM
Post
#1
|
|
|
Member [ Level 1 ] Group: Members Posts: 39 Joined: 12-June 05 From: Anywhere you can be on the web. Member No.: 6,112 |
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 |
|
|
|
Jul 11 2005, 09:56 PM
Post
#2
|
|
|
Newbie [ Level 2 ] Group: Members Posts: 11 Joined: 8-June 05 From: Bad English Member No.: 5,975 myCENTs:93.92 |
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: CODE <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: CODE // ... 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 |
|
|
|
Jul 12 2005, 04:14 PM
Post
#3
|
|
|
Member [ Level 1 ] Group: Members Posts: 39 Joined: 12-June 05 From: Anywhere you can be on the web. Member No.: 6,112 |
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 Astahost 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. |
|
|
|
Jul 12 2005, 04:20 PM
Post
#4
|
|
|
Member [ Level 1 ] Group: Members Posts: 39 Joined: 12-June 05 From: Anywhere you can be on the web. Member No.: 6,112 |
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...
|
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 5th December 2008 - 02:49 PM |