Jump to content

point system


doddsey_65

Recommended Posts

im working on a point system for my forum where points are awarded based on actions taken.

 

$scores = array(
                'login' => 1,
                'editor' => 10
                );

 

so if a user logs in then they will be awarded 1 point, if they edit their post then they get 10 points etc.

 

So in my login process page i process the login then award the points that it is worth with $score['login'].

Everything works fine.

 

My problem is that this is a forum package like phpbb and mybb where people download the package and can install their own forum. So i want them to be able to add to the points list. For example the admin chooses to award 10 points for every post that is made.

how would i go about implementing this? the points categories would be in the database but what happens in the post processing page when i add the post to the database? how would i know that the admin wants some points awarded? the database would look like so:

 

id    title    points

1    post    10

 

but the title can change based on the admins choosing of words.

 

I hope i explained this ok.

Link to comment
Share on other sites

I can't really think of a way to do this the way you want.

 

The best bet would to have preset ways to award points, such as logging in, posting threads, replies etc.

Have the database set-up so it already has the possible options in it, then have the value set to 0 like this:

-----------------------------------
| ID  |     TYPE      |   POINTS  |
|  1  |   newTopic    |     0     |
|  2  |    newPost    |     0     |
|  3  |    login      |     0     |
|  4  |    another    |     0     |
|  5  |    another    |     0     |
-----------------------------------

Then allow for the admin to change these in the Admin Area, other than that I wouldn't know.

 

Then when doing any of the actions, check the table to see if they are awarded points, if so then award them that amount of points.

 

Regards, PaulRyan.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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.