Log in

View Full Version : User Points System


Reeve of shinra
04-23-2004, 10:00 PM
What does this script do?

This script is a very simple and easy to use system for giving or deducting arbitrary points from a given user. Its the vb3 edition of the popular vb2 hack found here (https://vborg.vbsupport.ru/showthread.php?t=32060)

It also easy to set this up to give users points through PM's, Journals (if you have one), or just about anything that can pull in custom profile fields.

Why is this in beta?

I really dont think anyone will have an issue with this hack as we've been using this for months already but we had to variabilize a few things so the possibility exists.

There is also one extra query per page for an uncached template. I just dont understand how thats done in vb3 and havent had time to really look into it. :(


What are the differences between this and the vb2 version?

The vb3 version doesnt have the mass user gil update feature but it has an easier interface to give or take points from the postbit.

Since points can be given very quickly from the postbit, our mods stopped using the mass updater and there just wasnt a need on our part to port it over.

Whats the difference between this and upoints hack?

User preferance mostly... I think this points hack offers a simpler way of manually giving or taking points which some people prefer. Others simply need a points hack without the complexity of having a store.

One thing I will note in advance is that this points hack does not give points automatically for people creating or replying to threads. Its just not something our site needed. However it can work with those options in the ustore.

Can this work with the ustore?

Thankfully Link coded the store to be able to take advantage of the different user points systems that would be released.

If you have this ustore / upoints hack installed, go to the UTT points settings and under the ucash settings use the following:

Points Table: userfield
Points Field: field x
(where x is the custom field you will be creating).

You will need to alter some of the template changes but from what I've seen, you should be able to get the added benifit of getting points for new threads, replies, etc.


Will this work with vbPetz?

I havent installed vbpetz yet so I have no clue how well this would intergrate with thier system.

And thats about all I can think of right now. Screen shots below:

The first shows the box you enter the points in, hit enter or click the coin to submit and you get a pop up box confirmation. If you reload the page, you'll see the second post which shows the users points (gil) updated and the points (gil) paid on that specific post. The logic is that reloading a page sux and its easier to click the okay button on a javascript box. Its not bad at all. ^^

ChrisBaktis
04-24-2004, 09:39 AM
Im not sure what chmod to '777' means.

MindTrix
04-24-2004, 11:38 AM
IT means right click on the folder or file in your FTP program, and choose CHMOD, then change it to 777

Vivi Ornitier
04-24-2004, 05:50 PM
so for this hack, do you get points from postin or do mods j ust give points.

The Quibbler
04-24-2004, 07:02 PM
Is it possible to see how many total points the members in a usergroup have?

Reeve of shinra
04-24-2004, 11:18 PM
At the moment, no - though it should be a simple query to find out.

The Quibbler
04-24-2004, 11:40 PM
Hmm… might me a nice feature to add to future versions. I’m pretty inexperienced with query stuff, any chance of more detailed instructions?

Anyway, nice hack.

/me clicks install

ChrisBaktis
04-25-2004, 07:41 PM
I have uploaded the gillog.txt file and right clicked on it and have no idea how im supposed to change something to 777. Is the 777 in the file or what. Im not expierenced at this and really have no clue.

ChrisBaktis
04-25-2004, 08:19 PM
Any chance in hiring you to install this?

Reeve of shinra
04-26-2004, 12:33 AM
What FTP program are you using? If your using WS-FTP or CuteFTP, you can right click in the file and under properties check off the boxes for read / write / execute under Owner, Group, World. If you still have a problem, let me know and I will help you through it.

(my aim is thetomblack... I'll be on for antoher hour or two)

NexVision
04-26-2004, 06:54 PM
installs anyway to change wut it says from gil's to something else like points or anything

ChrisBaktis
04-27-2004, 12:43 AM
I just wanted to say thanks to Reeve of shinra for all the help. Reeve really helped out this newbie and I now have a working points system! Thanks again!

:) ChrisBaktis clicks install

Reeve of shinra
04-27-2004, 01:26 AM
NexVision: when you create the new custom field, name it whatever you want.
When you do your template edits, simply put Points: $post[fieldx] where x is the new field # and points is the name you want.

The only thing at this point thats harded coded is the pop up box confirming the points you gave and the little box that shows how many points were paid on that post -- both of which are only viewable to admins or mods and can be changed in the template you need to add.

NexVision
04-27-2004, 02:30 AM
NexVision: when you create the new custom field, name it whatever you want.
When you do your template edits, simply put Points: $post[fieldx] where x is the new field # and points is the name you want.

The only thing at this point thats harded coded is the pop up box confirming the points you gave and the little box that shows how many points were paid on that post -- both of which are only viewable to admins or mods and can be changed in the template you need to add.
sweet im gonna poke around tom thanx for the quick response

Reeve of shinra
04-27-2004, 02:39 AM
If you really wanna be trick, you can add this on to Erwins warning and ban system.

https://vborg.vbsupport.ru/showthread.php?p=505875#post505875

You'll need to reverse Erwins code so that a user is banned on negative points rather than positive though ;)

Skyline_GT
04-27-2004, 07:59 AM
Good Stuff..
But I really want this to make it like a user must pay a certain number of points before they can download attachments?
Like buy the attachment using points.

Reeve of shinra
04-28-2004, 12:32 AM
Skyline: You want to post this as a request for a ushop intergration... otherwise you'll have to take a look at the existing attachment hacks to see if you can add a code in to deduct points upon download (should be simple enough I image)

Skyline_GT
04-30-2004, 01:55 AM
I suck at coding:(

daFish
04-30-2004, 09:00 AM
Do you plan to store the points each user has in the database as a new field in the table user?
Would be a good alternative to the textfile. ;)

Reeve of shinra
04-30-2004, 06:52 PM
No, the text file is just a record of what admin / mod gave points to a user.

The users points are stored in a custom profile field - which offers a lot of diversity and efficiency as to where its displayed.

ChrisBaktis
05-03-2004, 02:57 AM
Couple things I noticed that maybe you can help on:

1) The first time I go to give points it asks me to login (even if I am logged in already) - when I do it takes me to the gilupdate.php page which is blank - I then have to go back and back to the first page and re-add the points

2)When I add points I get the Gil Paid box but nothing shows until I refresh the page - is there a way for me to make it so the page refreshes when I hit 'Ok' on the Gils Paid box?

3) If I add poings in the PM section they do not save to the database - only when I do it from a post - can this be fixed?

4) Last how can I change the gil paid box to say 'Rusty Soaps Paid' instead of 'Gils Paid'?

Thanks for the support

Reeve of shinra
05-04-2004, 12:27 AM
1. I havent experienced that so I am not sure what it would be. Techincally speaking, I dont think the script alone would cause that but I will think on it.

2. Loading, or reloading, a page takes more server resources. The small pop up box was more effecient.

It may not techinically matter, but we were trying to keep this simple and efficent -- technically, you would know if you gave points to someone in that thread and if you opened the thread later on, you would see that you - or someone else - awarded points to that person for that post.

(I hope that makes sense, I am a bit tired). I guess if you REALLY wanted it, I could dig up the old code that refreshed the page upon giving points.

3. I should have an update for that soon. Not sure how soon yet but its something planned as we would like to use that feature as well.

4.

A) On step 4, find this and replace the words gil paid with your choice.


onClick="javascript:alert('Gil Paid!');


B) Then right below that in step 4 is this:

Gil paid: $post[gilpaid]

Again, change Gil Paid: to whatever you want (leave $post[gilpaid] alone)

ChrisBaktis
05-06-2004, 04:22 PM
Thank you....On step 3 I thought it was supposed to work - im glad that it is not something I did wrong...thanks for the help

zetetic
05-18-2004, 03:17 PM
This hack looks interesting... quick question:

Is the gil paid on individual posts stored somewhere, so the amount of gil given a user for a particular post would be reflected on the post itself?

I'm thinking that if so, I could use it to filter posts based on their gil value.

Thanks!

Reeve of shinra
05-18-2004, 04:07 PM
Yes, the points given for a particular post are stored in a new field in the post table.

If I gave you five points for your post, any mod or admin viewing the thread would see that five points were given. This is not your total points however, the total points you have are stored in a vb custom field.

Out of curosity, what kind of post filtering were you lookinig to do?

zetetic
05-18-2004, 11:44 PM
I'll PM my response so as not to derail your thread any more.

Arsenic33
06-12-2004, 01:24 AM
I'm looking for a point system that has a little more to it, as oppossed to just a few points awarded by mods, I'm looking for a full on point system with point store. Fully editable etc...

Reeve of shinra
06-12-2004, 02:38 PM
Check out the upoints / ustore hack. Its more robust in that it can award points based on posts, replies, etc, ... its just something I have need of.

Arsenic33
06-12-2004, 03:13 PM
thanks I'll look for/into it.

Reeve of shinra
07-08-2004, 12:30 AM
1) The first time I go to give points it asks me to login (even if I am logged in already) - when I do it takes me to the gilupdate.php page which is blank - I then have to go back and back to the first page and re-add the points


I finally ran into that error... and it kind of baffles me. I have it working as is on 3.0.1 and yet on 3.0.3 i was getting just what you described. I moved the gilupdate.php file to the /forums/ directory and simply changed the path to call it in the 'postbit_gilbox' template.

kall
07-08-2004, 01:13 AM
*confused*

Is this a Points System, or some form of addon for an existing Points System?

Reeve of shinra
07-08-2004, 02:36 AM
Kall. Its its own points system but you can use it as an add on for the ustore / upoint system and probably a few other hacks. We give out the points manually so this just made it simpler... its something we were using that we figured a few people might need or want.

ChrisBaktis
07-08-2004, 08:02 PM
Question for you.

I want to add 2 different kind of points to a members account - one for buying things in our shop and one for contest points. Is it possible install this twice so I can add 2 differnent points to members accounts?

Reeve of shinra
07-09-2004, 03:22 AM
Yeah. The simple way would be to install the hack a second time but change a the file name and template thats called.

Here's the start but I need to look over the php file itself to see what variables need to be changed.

* In step 2 change the name of gillog.txt to gillog2.txt

* In step 3 rename gilupdate.php to gilupdate2.php

* In step 5 add this instead:


// ##### UserPoints Mod Options #####
if ($bbuserinfo[usergroupid]==6 OR $bbuserinfo[usergroupid]==5 OR $bbuserinfo[usergroupid]==7)
{
eval('$gilBox2 .= "' . fetch_template('postbit_gilbox2') . '";');
}
else
{
$gilBox2 = "";
}
// #### End of UserPoints Mod Hack ####


* step 7 name the new template postbit_gilbox2 and insert this:


<br />
<form action="modcp/gilupdate2.php" method="post">
<input type="hidden" name="action" value="private204">
<input type="hidden" name="postid" value="$post[postid]">
<input type="hidden" name="userid" value="$post[userid]">
<input type="text" name="amount" size="3">&nbsp;
<input type="image" src="images/coin.gif" border="0" name="submit" alt="Give Points" onClick="javascript:alert('Points Paid!');">
</form>

<br />
<br />
Points Given: $post[gilpaid2]



step 9: use $gilBox2 instead of $gilBox

step 10:
ALTER TABLE `post` ADD `gilpaid2` TINYINT DEFAULT '0' NOT NULL ;

ChrisBaktis
07-10-2004, 12:08 PM
Thank you - works great!

EnriqueHavoc
08-26-2004, 01:44 AM
wait.. so is this working on 3.03?

Reeve of shinra
08-26-2004, 02:08 AM
works fine on vb3.0.3.

EnriqueHavoc
09-01-2004, 04:13 AM
awesome hack, thanks reeve :)

Crookedfoot
09-12-2004, 06:11 PM
A modification question.

Is there a way to place the update fields for this on another page such as the Profile page, or a custom drop box in each post?

Here is why I ask.
For our forum we used to have the similar hack by Palmer ofShinra when we ran vb2.3.5, we loved it.
We had adapted it to six different fields for keeping track of tournaments and special titles.
To make it accessable to Staff Members and Admins I didn't install the controls to the postbit, and gave the appropriate URLs to those that needed it so people wouldn't make unauthorized changes.

I like how this version logs and can be set to specific groups, but with six fields, that's six white boxes with coins in every post.

No offence, but that is ugly if your an admin and you see that many boxes.

So far I haven't had much luck getting a working control into the Profile page, and my associate is still trying to get a drop box to work as well.

The only other option that comes to mind is to place this on one skin not used by those that need the controls and then they switch to it when needed.

Reeve of shinra
09-13-2004, 12:29 AM
There is an addon for the upoints hack that lets you do mass updates for users in the same format as the old vb2 points hack which may suit you better. I will check on adding this to the profile page though.

Crookedfoot
09-13-2004, 01:45 AM
If you can't figure it out, is there at least some way to change the white background of the box to a selected color that would be complimentary to the skin?

ChrisBaktis
11-12-2004, 12:24 PM
There is an addon for the upoints hack that lets you do mass updates for users in the same format as the old vb2 points hack which may suit you better. I will check on adding this to the profile page though.

I know this is an old topic but were you ever able to get this to work on the User Profile page...I also use this for 2 different points and even with 2 it is not very pretty on the eyes seeing it in all the posts....

Thanks

Chris

Crookedfoot
11-19-2004, 12:05 AM
We personally never got it to work on the profile page, we set it up for 6 fields, but our needs are still up in the air so they aren't used as much as I'd like to see.

What we ended up doing was to offer the standard VB3 silver skin to those that like that style.
Which I am sorry to say is very few.
We added to that skin, but below the signature area.
Only my Staff Members have access to it, and they all prefer a different skin, so the edit boxes are hidden until needed.
Instead of the orange buttons that come standard, I made individual pics with text to help my staff in their editing choices.

If you figure out a way to add this to profiles, please let us know.

Reeve of shinra
11-19-2004, 02:17 AM
sorry, I kind of forgot about this for a while but its something I will need to work on as I plan to use the script in a few mods like vbarticles, the journals, and a gallery. I may also see about changing it to use the moderator logs.

In regards to using this in multiple instances, I think I could see a way of doing that with a check box or a drop down box.

IF only there were 98 hours in a day.

ChrisBaktis
12-07-2004, 01:21 AM
I have my site setup with 2 of the user points systems in place - is there a conditional I can use to only certain members or usergroups will see only one of the points systems? I waant only certain mods to have access to one or the other when it comes to the ability to hand out points.

Reeve of shinra
12-07-2004, 02:00 AM
in gilupdate.php make sure you change this to the groups that should have access to teh script.


if ($bbuserinfo[usergroupid]==5 OR $bbuserinfo[usergroupid]==6 OR $bbuserinfo[usergroupid]==7)


I believe people not listed wont see the box to enter but if i'm mistaken you can use vb3 template conditionals around $gilbox variable. I could probably dig some out if needed.

ChrisBaktis
12-07-2004, 12:28 PM
im not sure how i was able to do this before - I have 2 usergroups that have access to the gil boxes...however when I added the additional user groups they cannot see the boxes.

Im not sure why this is happening - i dont think I added any conditionals for the other groups to work so i dont know why I would need them for additional user groups.

am I missing something? Is there a place I can edit who can actually VIEW the gil boxes? Is that seperate from who can actually update? I tried locating a place that there is conditionals on viewing the boxes but couldnt locate it.

squawell
12-08-2004, 06:01 AM
quick question......

any possible show up the give point number on thread list page after thread title??

Reeve of shinra
12-08-2004, 06:55 AM
Chris, I'll poke and look

Squawell, it should be possible. The points for each post are recorded in the posts table so it should be a simple matter off adding it ot the right query. If I have time, I will check that too.

ChrisBaktis
12-09-2004, 01:46 AM
Thank you

ChrisBaktis
12-10-2004, 01:26 PM
I know your busy but just wondering if you were able to find anything.

ChrisBaktis
12-15-2004, 07:43 PM
Just checking back

tomshawk
12-24-2004, 06:00 AM
Question Reeve of shinra,

Can this be set up so the only person that can give points is the admins and the person that started the thread.

Basically, I want people to be able to ask support questions, then when a person answers the question correctly, the person that started the thread, can give that user some points. if the thread has multiple correct answers. then the thread starter can divy up points to the 2.

Then If possible, I'd like to have something in the boards stats, stating who has the highest points for the month, and total.

Bones_3DFC
10-26-2005, 01:09 PM
Any possibility of having this work for 3.5?
Maybe I just need to change a variable or two?

I would really, really like this to work. I don't need uCash. I simply want to hand out a point to any given user for particular actions common to my particular forum.

wolfyman
12-06-2005, 02:57 PM
I'm interested in something like this for 3.5 also

jemmy
12-17-2005, 07:20 AM
I really want this hack but I'm frightened of starting and messing it up, it took me a week to put spoiler codes in. I was wondering if I could pay you to do it. I know I'm being cheeky asking but I'm not sure I could manage something this big.

EDIT: I have bulletproof ftp how do I chmode 777 on this? I've managed to get this far.

chikkoo
12-19-2005, 03:32 AM
I too interested to see it in Ver. 3.5.2
All the best guys.