Page 1 of 2

[BETA] Post Points

Posted: Tue Jun 26, 2007 1:34 am
by SpilltheBeans
This mod allows people to vote on replies to a topic. Here are the features:
1. Each post has a point value. Users can vote positive or negative for a post.
2. The first post can't be voted on.
3. Can sort by points.
4. Voters can vote only once if logged in.
5. When users vote on a post, it does not increase the topic views.

Essentially, this was inspired by the Yahoo Q&A feature.
Demo can be seen here. Just click the thumbs up or thumbs down to vote on a reply. Note this demo is for phpBB modded with Categories Hierarchy, but the download is for regular phpBB.
Download of beta can be found here.

Potential to do
1. Right now, the authorization for voting is based on an existing auth. I may add it's own.
2. I may add an ACP panel to set the max voting points allowed - right now, capped at 1000.

I still need to package it to mod format, but I wanted to put it out there first to see if there is any demand. Also, I'd like to work on a phpBB3 version of this, so I may not do too much more for the phpBB2 version. Is anyone intersted in this type of mod?

Re: [DEV] Post Voting

Posted: Mon Jul 02, 2007 9:11 pm
by zaphs
I'd be interested in seeing a variant on this mod whereby users can give a thumbs up to a post but not a thumbs down.

Being able to negatively rate something sometimes creates the wrong sort of forum atmosphere.

Perhaps there could be a switch in your mod whereby I could turn off negative voting and only allow a thumbs up?

Re: [DEV] Post Voting

Posted: Thu Jul 05, 2007 11:25 pm
by SpilltheBeans
zaphs wrote:I'd be interested in seeing a variant on this mod whereby users can give a thumbs up to a post but not a thumbs down.

Being able to negatively rate something sometimes creates the wrong sort of forum atmosphere.

Perhaps there could be a switch in your mod whereby I could turn off negative voting and only allow a thumbs up?
If you want to remove the vote down, it's pretty easy.
1. Remove the reference to the thumbs down in the template. Delete {postrow.I_POSTVOTE_DOWN} in viewtopic_body.tpl of the mod.
2. Remove vote down code to ensure full removal. In viewtopics.php, find and delete

Code: Select all

	else if ($postvote == 'down')
	{
		$vote_points = (-1)*$abs_vote_points;
		$vote_crement = '-';
	}
The mod has been updated to Beta since I got a download working. See 1st post for download. It's in mod format and the changed files are included so that if you have a non-modded phpbb 2.0.22, you can just relace the files, run the sql statments and it should be working.

Re: [BETA] Post Points

Posted: Fri Jul 06, 2007 5:16 pm
by golddust
Nice little mod -

thank you!!

Re: [BETA] Post Points

Posted: Sat Jul 14, 2007 7:02 pm
by SpilltheBeans
Updated to Beta 0.2.0 with a couple of new features and bug fixes.
New
1. Posters get credit for points. This can be extended as sort of a reputation system.
2. ACP setting to modify the maximum points.
3. Handle deletion of posts.

Both the replacement files and the mod file is updated.

Re: [BETA] Post Points

Posted: Sun Jul 15, 2007 4:16 pm
by griera
Nice mod!
Congratulations

I have three questions for SpilltheBeans

1. Is there a way to allow users to vote also the first post, not just the replies?
2. Is there a way to get a list of the most voted posts of all the forums, to be published on the index page?
3. Is there a way to get a list of the most voted members, to be published on the index page?

Best regards

Re: [BETA] Post Points

Posted: Wed Jul 18, 2007 2:17 am
by SpilltheBeans
griera wrote:Nice mod!
Congratulations

I have three questions for SpilltheBeans

1. Is there a way to allow users to vote also the first post, not just the replies?
2. Is there a way to get a list of the most voted posts of all the forums, to be published on the index page?
3. Is there a way to get a list of the most voted members, to be published on the index page?

Best regards
1. The mod specifically prevents users to vote on the first post. It's suppose to be like the Yahoo Q&A. You can't vote on the question. Anyway, if you want to make it so users can vote on the first post, just remove some of the conditioinals around checking for the first post.
2. and 3. Both are possible. The database entries are have the info. It's just a matter of extracting it.

Re: [BETA] Post Points

Posted: Mon Jul 23, 2007 11:05 pm
by freejoe76
I like what you've started here, and have implemented it up at http://neighbors.denverpost.com/

My one suggestions: It would be useful to make multiple votes from the same user on the same post not count.

Also, in case you're interested, I modified the install to keep track of the user's ip address. I plan on building this out to allow non-members to vote (and to make those votes count for less than member votes).

Re: [BETA] Post Points

Posted: Mon Jul 23, 2007 11:13 pm
by freejoe76
Also, in the mod install script, I think POSTVOTE_RESULTS_TABLE ought to be POSTPOINTS_RESULTS_TABLE

Re: [BETA] Post Points

Posted: Thu Jul 26, 2007 2:21 am
by SpilltheBeans
freejoe76 wrote:Also, in the mod install script, I think POSTVOTE_RESULTS_TABLE ought to be POSTPOINTS_RESULTS_TABLE
You are right and that should fix the problem with users being able to vote multiple times in a post. The POSTPOINTS_RESULTS_TABLE is what keeps track of user votes per post. Package updated. Let me know if there are any more problems.

Re: [BETA] Post Points

Posted: Wed Aug 01, 2007 3:08 pm
by mericsson
I like it!

Any plans of a version for phpBB3?

Re: [BETA] Post Points

Posted: Thu Aug 09, 2007 7:42 pm
by freejoe76
No more problems, it's up and it's working. Got a question: Why did you build it so the points couldn't go below zero?

Re: [BETA] Post Points

Posted: Tue Aug 14, 2007 4:46 am
by SpilltheBeans
freejoe76 wrote:No more problems, it's up and it's working. Got a question: Why did you build it so the points couldn't go below zero?
No reason really. Just thoght it woudl be odd to have negative points. I'm glad you found the mod useful. It can be a good Digg style mod for topics that have a lot of posts. In fact, it's not hard to extend this mod to add points to topics themselves so people can digg up topics. Anyway, there are two things needed for this mod to be considered complete in my opinion.
1. Auth entry for the mod. Right now it uses reply as the auth to allow voting. It should have it's own.
2. It should be turned on and off per forum.
I'm not sure I'll do 1 but I might do 2. BTW, there is a Cateogories Hierarchy version of the mod that has both features above as well as all the other features. You can download it here.
As for phpBB 3, I probably won't do a conversion since I'm workiing on some other mods. We'll see.

Help... please

Posted: Wed Sep 19, 2007 12:30 pm
by wintersmith
I am really struggling with this. Does this mod require that you have the Category Hierarchy mod? I followed the installations instructions carefully (newbie here), but am getting fatal errors on the viewtopic.php file.

I'm puzzled by the following:

#-----[ FIND ]---------------------------------
#
//mod -- postpoints
$no_increase_views = _read('no_increase_views', TYPE_INT);
$postpoints = $post_id ? _read('postpoints', TYPE_NO_HTML, '', array_flip(array('', 'up', 'down'))) : '';

-------------
But the viewtopic file (fresh from phpBB 2.x installation) doesn't HAVE this set of code. Not only that, there's no instructions on what to do if you do find this code. The instructions simply move on to the next "FIND".

I really want this mod feature for the community, so any help you can provide would be much appreciated.

Re: [BETA] Post Points

Posted: Thu Sep 20, 2007 2:50 am
by SpilltheBeans
You must have downloaded the CH version. Get the regular phpBB version. The link I had may have been confusing so I updated it.
BTW, I'm planning to add an acp feature to let admins choose which forums the post points will be active. Can't say when though.
wintersmith wrote:I am really struggling with this. Does this mod require that you have the Category Hierarchy mod? I followed the installations instructions carefully (newbie here), but am getting fatal errors on the viewtopic.php file.

I'm puzzled by the following:

#-----[ FIND ]---------------------------------
#
//mod -- postpoints
$no_increase_views = _read('no_increase_views', TYPE_INT);
$postpoints = $post_id ? _read('postpoints', TYPE_NO_HTML, '', array_flip(array('', 'up', 'down'))) : '';

-------------
But the viewtopic file (fresh from phpBB 2.x installation) doesn't HAVE this set of code. Not only that, there's no instructions on what to do if you do find this code. The instructions simply move on to the next "FIND".

I really want this mod feature for the community, so any help you can provide would be much appreciated.