PDA

View Full Version : Post Quality Points System! [megahack]


N9ne
02-15-2003, 10:00 PM
<--------------------------------------------------------------------------------------------------------->
Quality/Length of Post Points System
A hack by N9ne, copyright 2003, created on Feb 16 2003.
<--------------------------------------------------------------------------------------------------------->
Description:
This hack is packed full of features. It will introduce a point system
to your forum. This is not like previous released points systems though.
The points are allocated to users based on the length of their post, in
characters. There are 3 levels to the amount of points allocated. You
can choose to use up to level 1, level 2, or level 3. This is also done on a
per forum basis. You can have the whole feature disabled in a forum, and
you can have level 1 enabled on one forum, and level 3 enabled on another.
You can set separate values of # of chars in post, and how many points are
received when that figure is exceeded. This is also on a per forum, per level
basis.

No points are given if the post has less characters than specified in level 1.

Quality point count is shown on the profile page of the user, in the postbit
under post count, and in the user's profile in the adminCP. Admins can edit
a user's amount of quality points in the adminCP.

Options are also added to the vBulletin Options page in the adminCP. You
can enable quality points - custom avatars, where you may specify the
number of points a user must have, and if he has that amount, he can
use a custom avatar, regardless of his post count. There is the same option
for custom titles. You can set a value for minimum required quality points
and if the user has that amount or more, they can specify a custom title,
regardless of their post count or days registered.

Options to specify levels, # of characters, # of points given, are in the
add forum and edit forum pages in the adminCP.

In newthread and newreply, above the options part, it will specify how
many characters are to be in the post, to achieve specified levels, and
how many points are awarded. If the quality point system is disabled in
the forum, it will say so.
<--------------------------------------------------------------------------------------------------------->
For: 2.2.x and 2.3.x (hack created in 2.2.9 - should work on 2.2.x - 2.3.x though)
<--------------------------------------------------------------------------------------------------------->
Files to modify:
admin/forum.php
admin/user.php
newreply.php
newthread.php
member.php
<--------------------------------------------------------------------------------------------------------->
Templates to modify:
newreply
newthread
getinfo
postbit
<--------------------------------------------------------------------------------------------------------->
Queries to run: 15
<--------------------------------------------------------------------------------------------------------->
Please backup your database and the templates and files we're going to
modify in this hack, before proceeding to install it. I will not take any
responsibility and am not liable for any damage done to your forum.
You should have a backup.
<--------------------------------------------------------------------------------------------------------->
Addons
Top Quality Posters Page (https://vborg.vbsupport.ru/showthread.php?s=&threadid=50221)



Download the attached .php file and open it in a text editor which can handle long strings of text and large files.

Support will just be given in this thread. I will try my hardest to answer most questions!

Screenshots can be found in next post.

N9ne
02-16-2003, 06:07 PM
Loads of screenshots! - 8 screenshots.

Erwin
02-16-2003, 06:16 PM
Good idea for a points system. :) I may make my own version of your scoring system for my forums. I like how you base it on post length. :)

N9ne
02-16-2003, 06:18 PM
Originally posted by Erwin
Good idea for a points system. :) I may make my own version of your scoring system for my forums. I like how you base it on post length. :)

Feel free to take my code and modify it, to save time. PM me with how you change it, i'm interested :).

Chris M
02-16-2003, 06:38 PM
Nice:)

Satan

Automated
02-16-2003, 08:47 PM
Looks good, might have a look tommorow :p

Hwulex
02-16-2003, 10:00 PM
Hmm. Not bad, might encourage needlessly long posts though.
Still, nice idea, just not for me :)

007
02-16-2003, 11:24 PM
Hey this looks good. What's the best way to backup/restore a dB? I know the backup function is in the admin cp, but how do I restore if need be? 15 queries seems like it would definately be good to know how to do this before trying to install this. :)

N9ne
02-16-2003, 11:28 PM
If you have SSH or telnet access to your server, run this:

mysqldump --opt -u DBUSERNAME -p DBNAME > /path/to/backup/directory/backup.sql

It will then ask for your db's password. enter it.

To restore:

mysql -u DBUSERNAME -p DBNAME < /path/to/backup/backup.sql

it will then ask you for your db's password.

You shouldn't need to restore, but i'm just keeping on the safe side, you know? The queries to run have no potential danger really, they're just adding fields.

squawell
02-17-2003, 05:45 AM
nice hack...

but i have a problem....

if quote someone's post and the post text over the setting

it will count the point...how to make it only count own post even

u quote someone's post......

any idea?Thankz

007
02-17-2003, 06:36 AM
Great thanks! I will install this tomorrow morning :) Is there a max number of points you can get or does it keep going?

I plan to use this with THIS (https://vborg.vbsupport.ru/showthread.php?s=&threadid=48699&) :)

Should be pretty sweet.

:banana:

N9ne
02-17-2003, 07:50 AM
Originally posted by squawell
nice hack...

but i have a problem....

if quote someone's post and the post text over the setting

it will count the point...how to make it only count own post even

u quote someone's post......

any idea?Thankz

I'm aware of this, i'm looking for a way to fix it.

Dean C
02-17-2003, 03:58 PM
Sounds good n9ne :)

- miSt

N9ne
02-17-2003, 08:09 PM
Would people be interested in an addon for this hack to, alongside the posts column in the memberlist, be a quality points column?

ethics
02-18-2003, 02:28 AM
N9ne,

Can this be integrated in to Lesane's Store point system? Don't mean to be an ass and rain on your great system, but just curious. :)

Great job btw. :)

N9ne
02-18-2003, 09:34 AM
I'm sure it can, so you'd like it so there isn't separate points for quality, but just they get added on to their store points? If so, no problemo...

ethics
02-18-2003, 01:43 PM
Originally posted by N9ne
I'm sure it can, so you'd like it so there isn't separate points for quality, but just they get added on to their store points? If so, no problemo...

Yes yes. :)

I love the concept of quality posts. I run political forum, so quality is much more important than quantity. But to have the quality rules for the store would be awesome.

Thanks again!

N9ne
02-18-2003, 03:08 PM
Unfortunately, I don't have enough time to create the integration with the store hack today, as i'm leaving tomorrow early morning, on a one week trip to Germany. It's quite simple to integrate it though, I will be able to release the integration once I get back in one week.

If you can't wait that long and know your way around some of the files and you have already installed this hack,

Replace every instance of qualitypoints to storep.
- Delete the qualitypoints field created in the database.

Really, all you should need to do is re-do the steps in newreply and newthread.php but with storep written instead of qualitypoints.

This is not tested as I don't have the store installed, and I'm just going off the top of my head with this, but it should work.

Dan_UPC
02-25-2003, 05:04 AM
If you dont want quoted text to be counted towards the post length when awarding points then do the following...

In the install file replace all occurences of

$message

with

preg_replace("/(\[quote])(.*)(\[\/quote])/siU", "", $message)

That should do the trick.

MartynJ
02-25-2003, 06:04 PM
Um, I have a problem. If I load up member.php, I get "Unexpected T_ELSE at line 499." and the script dies.

Here's the code it's talking about:


// Allow titles if Posts are ok OR JoinDate is ok
if ( ($bbuserinfo[posts] >= $ctPosts) or ( ($bbuserinfo[joindate] <= (time()-($ctDays*86400))) or ($ctDays==0)) )
{
$ctShowTitle = 1;
}
}
} else {
// Allow titles if Posts AND Joindate is ok
if ( ($bbuserinfo[posts] >= $ctPosts) and ( ($bbuserinfo[joindate] <= (time()-($ctDays*86400))) or ($ctDays==0)) ) {
$ctShowTitle = 1;
}
}
}


It's that } else { in the middle that's doing it. I wouldn't be surprised if I've made an error somewhere, this hack has an awful lot of manual file changes to be made. Though I really want this to work, it seems great.


EDIT: I'm an ass, I haven't even modified any templates yet. I'll let you know if I'm still having this problem after that.

2nd EDIT: Now all the templates are in place I'm still getting that error. I get the feeling maybe that the if/elseif above it was closed, and this leaves an else on it's own with no if to support it?

MartynJ
02-25-2003, 06:27 PM
If it helps, this is the part of the instruction file that I am having probs with (been trhough it twice now and no change)


<--------------------------------------------------------------------------------------------------------->
Find:
<--------------------------------------------------------------------------------------------------------->

if ($ctEnable == 1 and $customtext) {// Custom Titles are ON, Make sure user can actually use them and isn't trying to manipulate them through forms
$ctShowTitle = 0;
if (ismoderator() and $ctAdmin == 1) {// Allow mods to use titles no matter what
$ctShowTitle = 1;
} else {
if ($ctEitherOr==0) {// Allow titles if Posts are ok OR JoinDate is ok
if ( ($bbuserinfo[posts] >= $ctPosts) or ( ($bbuserinfo[joindate] <= (time()-($ctDays*86400))) or ($ctDays==0)) ) {
$ctShowTitle = 1;
}
<--------------------------------------------------------------------------------------------------------->
Replace it with:
<--------------------------------------------------------------------------------------------------------->

if ($ctEnable == 1 and $customtext) {// Custom Titles are ON, Make sure user can actually use them and isn't trying to manipulate them through forms
$ctShowTitle = 0;
if ($qpct == 1 and $ctEnable == 1 and ($bbuserinfo[qualitypoints] >= $minqpct) ) {
$ctShowTitle = 1;
} elseif (ismoderator() and $ctAdmin == 1) {// Allow mods to use titles no matter what
$ctShowTitle = 1;
} else {
if ($ctEitherOr==0) {// Allow titles if Posts are ok OR JoinDate is ok
if ( ($bbuserinfo[posts] >= $ctPosts) or ( ($bbuserinfo[joindate] <= (time()-($ctDays*86400))) or ($ctDays==0)) ) {
$ctShowTitle = 1;
}

MartynJ
02-25-2003, 06:33 PM
Found out what it was, sorry, my fault, I had copied and pasted wrong.

Vivi Ornitier
02-26-2003, 04:33 PM
nice

Sun Boy
03-01-2003, 04:14 PM
Nice work

But, waht's about the quick reply box ? :)

N9ne
03-01-2003, 04:44 PM
I think it works with that automatically as QRB uses newreply.php...

Lord Man
03-01-2003, 04:45 PM
ERORR! :(

You have an error in your SQL syntax near 'INSERT INTO setting (settingid,settinggroupid,title,varname,value,desc ription,op' at line 2

N9ne
03-01-2003, 05:22 PM
Which file is that? forum.php in the admin folder? Make sure you followed the instructions very carefully and make sure that you entered the code in the right places.

Lord Man
03-02-2003, 10:56 AM
in phpmyadmin

when i insert the sql queries :(

N9ne
03-02-2003, 12:01 PM
Insert each one separately.

007
03-07-2003, 07:30 PM
That store integration idea didn't work... I would think it would but I don't know why it didn't. :(

squawell
03-15-2003, 09:14 AM
N9ne can u tell me if i want to do top 5 quality points how should i do??

thankz...:D:D:D

N9ne
03-15-2003, 08:22 PM
Addon released:
Top Quality Posters Page (https://vborg.vbsupport.ru/showthread.php?s=&threadid=50221)

Mephisteus
03-16-2003, 08:25 AM
I think I'll be modifying this hack so it will add both points to lesane's store AND to the quality points. I think that this is an better concept.

Great hack!

Koopa
03-16-2003, 09:30 AM
Nice hack, I might install it :)

N9ne
03-16-2003, 11:44 AM
Today at 10:25 AM DarkSSJ3 said this in Post #33 (https://vborg.vbsupport.ru/showthread.php?postid=367234#post367234)
I think I'll be modifying this hack so it will add both points to lesane's store AND to the quality points. I think that this is an better concept.

Great hack!


Not a bad idea :). It's quite simple to integrate it with the store hack, I just haven't had the time to do it though.

cirisme
03-19-2003, 07:51 PM
I like this hack. I installed it on my forum, with the spam point system, to reward people.

The funny thing is, we're using it to reward people for spam, and good posts. :D

yxboom
03-19-2003, 08:48 PM
Ironic isn't it!

N9ne
03-19-2003, 08:53 PM
LOL cirisme :p tut tut, rewarding people for spamming ;)...

Mathiau
04-03-2003, 07:35 AM
i know some peopel who post will love his one! as they go on and on and on!

Mathiau
04-03-2003, 07:35 AM
Have you considered a way to work this in with the store hack that the points u get u can get things with them?

007
05-05-2003, 04:34 PM
Anyone got this working with the store hack yet??

ChrisLM2001
05-12-2003, 10:40 PM
OMG! Thank you, thank you, thank you!

Finally a way to reward members who type quality posts. :)

Going to install it now. :)

Chris

squawell
06-11-2003, 06:08 PM
N9ne i have a question about this

if i want the new register member have basic points how should i

do?thankz....

N9ne
06-11-2003, 06:27 PM
You want each member to start with a given amount? That defeats the object of the hack where people earn the points from posting, going by the length of their post...

squawell
06-12-2003, 12:51 PM
Today at 03:27 AM N9ne said this in Post #44 (https://vborg.vbsupport.ru/showthread.php?postid=407642#post407642)
You want each member to start with a given amount? That defeats the object of the hack where people earn the points from posting, going by the length of their post...
can i just use the simple quary to update the points table let

already register member have basic points?if they zero point....

bigwest
07-25-2003, 03:02 AM
Looks like a great hack, I wish there was an easier install for us dummies! :D

N9ne
07-25-2003, 01:21 PM
It's fairly simple to install, if you have any questions, please feel free to ask.

VirtualHogwarts
11-30-2003, 01:37 AM
This would be perfect for the House Points idea for my Hogwarts Board. The only problem is how would I get it to have a page where I could show an added up spot for 4 usergroups.

So if you it would show user groups A points all added up

B's C's and D's (the 4 houses)

any ideas?

Kruppa
12-03-2003, 03:10 PM
If I install this will it be retroactive to all posts made so far on my board? What I like about this hack is that you can come up with a scheme to compare post count versus quality count but if a user already has 2000 posts and we start giving that user a quality score after every post subsequent to his 2000 posts the result will be tainted.

Does anyone know about this?

Kruppa
12-03-2003, 09:42 PM
Ok I've installed and everything seems fine except for one very uncool side effect. Where is the radio button to enable post count or not in a given forum?!