[BETA] Post Points

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
User avatar
SpilltheBeans
Registered User
Posts: 53
Joined: Wed Dec 21, 2005 6:21 am
Contact:

[BETA] Post Points

Post by SpilltheBeans » Tue Jun 26, 2007 1:34 am

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?
Last edited by SpilltheBeans on Wed Dec 19, 2007 4:46 pm, edited 5 times in total.
A site for people interested in personal electronics - MP3 players, digital cameras, camcorders
All my mods found at TripStir.com/forum/

zaphs
Registered User
Posts: 18
Joined: Tue Apr 04, 2006 3:32 pm

Re: [DEV] Post Voting

Post by zaphs » Mon Jul 02, 2007 9:11 pm

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?

User avatar
SpilltheBeans
Registered User
Posts: 53
Joined: Wed Dec 21, 2005 6:21 am
Contact:

Re: [DEV] Post Voting

Post by SpilltheBeans » Thu Jul 05, 2007 11:25 pm

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.

User avatar
golddust
Registered User
Posts: 423
Joined: Tue Mar 09, 2004 4:41 am
Location: UK

Re: [BETA] Post Points

Post by golddust » Fri Jul 06, 2007 5:16 pm

Nice little mod -

thank you!!

User avatar
SpilltheBeans
Registered User
Posts: 53
Joined: Wed Dec 21, 2005 6:21 am
Contact:

Re: [BETA] Post Points

Post by SpilltheBeans » Sat Jul 14, 2007 7:02 pm

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.
A site for people interested in personal electronics - MP3 players, digital cameras, camcorders
All my mods found at TripStir.com/forum/

griera
Registered User
Posts: 1
Joined: Sat Jun 23, 2007 2:55 pm

Re: [BETA] Post Points

Post by griera » Sun Jul 15, 2007 4:16 pm

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

User avatar
SpilltheBeans
Registered User
Posts: 53
Joined: Wed Dec 21, 2005 6:21 am
Contact:

Re: [BETA] Post Points

Post by SpilltheBeans » Wed Jul 18, 2007 2:17 am

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.
A site for people interested in personal electronics - MP3 players, digital cameras, camcorders
All my mods found at TripStir.com/forum/

User avatar
freejoe76
Registered User
Posts: 34
Joined: Sat Feb 08, 2003 3:41 am
Location: Denver
Contact:

Re: [BETA] Post Points

Post by freejoe76 » Mon Jul 23, 2007 11:05 pm

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).

User avatar
freejoe76
Registered User
Posts: 34
Joined: Sat Feb 08, 2003 3:41 am
Location: Denver
Contact:

Re: [BETA] Post Points

Post by freejoe76 » Mon Jul 23, 2007 11:13 pm

Also, in the mod install script, I think POSTVOTE_RESULTS_TABLE ought to be POSTPOINTS_RESULTS_TABLE

User avatar
SpilltheBeans
Registered User
Posts: 53
Joined: Wed Dec 21, 2005 6:21 am
Contact:

Re: [BETA] Post Points

Post by SpilltheBeans » Thu Jul 26, 2007 2:21 am

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.
A site for people interested in personal electronics - MP3 players, digital cameras, camcorders
All my mods found at TripStir.com/forum/

User avatar
mericsson
Registered User
Posts: 40
Joined: Tue Jul 31, 2007 7:11 am
Location: Malmö, Sweden

Re: [BETA] Post Points

Post by mericsson » Wed Aug 01, 2007 3:08 pm

I like it!

Any plans of a version for phpBB3?

User avatar
freejoe76
Registered User
Posts: 34
Joined: Sat Feb 08, 2003 3:41 am
Location: Denver
Contact:

Re: [BETA] Post Points

Post by freejoe76 » Thu Aug 09, 2007 7:42 pm

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?

User avatar
SpilltheBeans
Registered User
Posts: 53
Joined: Wed Dec 21, 2005 6:21 am
Contact:

Re: [BETA] Post Points

Post by SpilltheBeans » Tue Aug 14, 2007 4:46 am

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.
A site for people interested in personal electronics - MP3 players, digital cameras, camcorders
All my mods found at TripStir.com/forum/

wintersmith
Registered User
Posts: 46
Joined: Wed Sep 19, 2007 12:22 pm

Help... please

Post by wintersmith » Wed Sep 19, 2007 12:30 pm

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.

User avatar
SpilltheBeans
Registered User
Posts: 53
Joined: Wed Dec 21, 2005 6:21 am
Contact:

Re: [BETA] Post Points

Post by SpilltheBeans » Thu Sep 20, 2007 2:50 am

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.

Post Reply

Return to “[2.0.x] MODs in Development”