Thanks for post

General discussion of development ideas and the approaches taken in the 3.x branch of phpBB. The next feature release of phpBB 3 will be 3.3/Proteus.
Forum rules
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.2.x. If you need support for phpBB 3.2.x please visit the 3.2.x Support Forum on phpbb.com.

If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
User avatar
bantu
3.0 Release Manager
3.0 Release Manager
Posts: 557
Joined: Thu Sep 07, 2006 11:22 am
Location: Karlsruhe, Germany
Contact:

Re: Thanks for post

Post by bantu »

naderman wrote:I'm not sure I would call it "Thanks" but a general "Like" "+1" "upvote" whatever feature seems to be rather common on the web these days. So I would appreciate a feature like that be included in phpBB by default.
I agree.

User avatar
imkingdavid
Registered User
Posts: 1050
Joined: Thu Jul 30, 2009 12:06 pm

Re: Thanks for post

Post by imkingdavid »

I could agree with something like this being implemented. From what I can tell, what would be needed is a new referential table that holds the post_id, topic_id, user_id (for the user liking the post/topic), and the poster_id (for the user who made the post that is being liked), and add a new column on the topics and posts tables to hold the total number of likes for that topic/post (would topic likes simply be the sum of all likes of the posts in that topic, or should users be able to like a topic itself, separately from the individual posts?), so that we can just grab the number from there instead of having to count rows on the other table. We would then be able to restrict users to only one like per post/topic and can display the likes a user has given, the likes a user has received, the number of likes a post/topic has received (and maybe even display who liked it), etc.

But I agree that this should be kept as barebones as possible. If we just implement what is required for a system like this and display the minimum, extensions can take the information that is stored and display more if needed.
I do custom MODs. PM for a quote!
View My: MODs | Portfolio
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.

User avatar
tbackoff
Registered User
Posts: 180
Joined: Sat Jun 12, 2010 3:25 am

Re: Thanks for post

Post by tbackoff »

I support this (imagine that :P ) under this implementation:
Arty wrote:there is only "Like" link below posts and amount of "likes" user has received on user's profile
David, your first paragrah steers away from this concept. If a new table is implemented (with the number likes per topic/post being added to their respective tables), it only needs two frields: the user_id and the number of likes. That takes care of listing the nuber of likes a user has in the user's profile. No need for user_id, poster_id, topic_id, post_id, tabithas_age_id, other_useless_nonsense_id, etc.

User avatar
MichaelC
Development Team
Development Team
Posts: 889
Joined: Thu Jan 28, 2010 6:29 pm

Re: Thanks for post

Post by MichaelC »

t_backoff wrote:I support this (imagine that :P ) under this implementation:
Arty wrote:there is only "Like" link below posts and amount of "likes" user has received on user's profile
David, your first paragrah steers away from this concept. If a new table is implemented (with the number likes per topic/post being added to their respective tables), it only needs two frields: the user_id and the number of likes. That takes care of listing the nuber of likes a user has in the user's profile. No need for user_id, poster_id, topic_id, post_id, tabithas_age_id, other_useless_nonsense_id, etc.
Well, it should probably display on the post the number of likes and who liked it. That is considered basic I'd say?

Would an unlike (removing your like of a post) be basic?
Formerly known as Unknown Bliss
psoTFX wrote: I went with Olympus because as I said to the teams ... "It's been one hell of a hill to climb"
No unsolicited PMs please except for quotes.

User avatar
tbackoff
Registered User
Posts: 180
Joined: Sat Jun 12, 2010 3:25 am

Re: Thanks for post

Post by tbackoff »

Unknown Bliss wrote:Well, it should probably display on the post the number of likes and who liked it. That is considered basic I'd say?
Which I why I posted this part ;) :
t_backoff wrote:with the number likes per topic/post being added to their respective tables
Unknown Bliss wrote:Would an unlike (removing your like of a post) be basic?
I don't see why not.

Code: Select all

$sql = 'SELECT likes
    FROM ' . POSTS_TABLE . '
    WHERE post_id = ' . (int) $post_id;
$result = $db->sql_query($sql);
$post_likes = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// stuff
// more stuff

// Are we disliking a post? If so, do that here.
$post_likes = $post_likes--;
$data = array(
    'likes' => $post_likes,
);
$sql = 'UPDATE ' . POSTS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $data) . ' WHERE post_id = ' . (int) $post_id;
$db->sql_query($sql); 

User avatar
MichaelC
Development Team
Development Team
Posts: 889
Joined: Thu Jan 28, 2010 6:29 pm

Re: Thanks for post

Post by MichaelC »

This should probably be made into an RFC.
Formerly known as Unknown Bliss
psoTFX wrote: I went with Olympus because as I said to the teams ... "It's been one hell of a hill to climb"
No unsolicited PMs please except for quotes.

User avatar
imkingdavid
Registered User
Posts: 1050
Joined: Thu Jul 30, 2009 12:06 pm

Re: Thanks for post

Post by imkingdavid »

t_backoff wrote:I support this (imagine that :P ) under this implementation:
Arty wrote:there is only "Like" link below posts and amount of "likes" user has received on user's profile
David, your first paragrah steers away from this concept. If a new table is implemented (with the number likes per topic/post being added to their respective tables), it only needs two frields: the user_id and the number of likes. That takes care of listing the nuber of likes a user has in the user's profile. No need for user_id, poster_id, topic_id, post_id, tabithas_age_id, other_useless_nonsense_id, etc.
A table with user ID and the number of likes that user has would be completely pointless. How is that any different than adding a new column on the users' table to contain that user's number of likes.

The reason we need a new table to contain (at the very least) the user_id (of the user liking the post) and the post_id is that we can prevent a user from liking a post an unlimited number of times (with your suggestion, this is not possible, unless I am misunderstanding you). Also having the poster_id on the table allows you to see how many times an individual user has been liked in total from all of his or her posts. Of course that could and should be stored on the users table for easy access, but if that gets out of sync, having it on this relational table will allow for correcting the numbers.
Unknown Bliss wrote:This should probably be made into an RFC.
Please do.
I do custom MODs. PM for a quote!
View My: MODs | Portfolio
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.

User avatar
tbackoff
Registered User
Posts: 180
Joined: Sat Jun 12, 2010 3:25 am

Re: Thanks for post

Post by tbackoff »

Wasn't a new table your idea? :?
imkingdavid wrote:what would be needed is a new referential table
imkingdavid wrote:The reason we need a new table to contain (at the very least) the user_id (of the user liking the post) and the post_id is that we can prevent a user from liking a post an unlimited number of times (with your suggestion, this is not possible, unless I am misunderstanding you)
Uh, yup. Sorry about that. I didn't take that into consideration. :oops:

User avatar
imkingdavid
Registered User
Posts: 1050
Joined: Thu Jul 30, 2009 12:06 pm

Re: Thanks for post

Post by imkingdavid »

t_backoff wrote:Wasn't a new table your idea? :?
imkingdavid wrote:what would be needed is a new referential table
Yes...? When did I say otherwise?
I do custom MODs. PM for a quote!
View My: MODs | Portfolio
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.

User avatar
Erik Frèrejean
Registered User
Posts: 207
Joined: Thu Oct 25, 2007 2:25 pm
Location: surfnet
Contact:

Re: Thanks for post

Post by Erik Frèrejean »

Arty wrote:It would be nice, but only if its a simple elegant system, not bloated like most mods are.

I think XenForo has perfect implementation of this feature: there is only "Like" link below posts, amount of "likes" user has received on user's profile and list of users who liked certain post. That's it. Nothing else. No useless stuff like ability to select +-X rating, no option to dislike post, no thread rankings, no medals/ranks/stars/whatever, no huge options panels. Such bloat should be left to addons.
This is pretty much the implementation I'd like to see as well. If designed properly with event locations at the proper places it is rather trivial to create extensions that add the other things to the system but phpBB itself should ship a "simple elegant system"
Available on .com
Support Toolkit developer

Post Reply