Skip to:
Content

BuddyPress.org

Opened 14 years ago

Closed 12 years ago

Last modified 8 years ago

#3177 closed enhancement (no action required)

Member favorite topics

Reported by: djpaul's profile DJPaul Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Templates Keywords: needs-patch
Cc: johnjamesjacoby, djpaul

Description

The member profile forum screens (tabs: started, replied to, favourites) all need to be implemented. This involves adding new bbPress queries into bp_forums_get_forum_topics(), as well as making changes to the templates to let users favourite a thread.

Attachments (1)

3177-1.patch (4.3 KB) - added by boonebgorges 14 years ago.

Download all attachments as: .zip

Change History (18)

#1 @boonebgorges
14 years ago

I've started poking around with "replied to". It is going to be tricky. bbPress does not appear to have any native method for getting topics replied to, perhaps because it would necessarily involve a join and thus be ugly. It seems to me that there are two strategies we might consider.

1) Write our own query. Or, rather, filter bbPress's query and manipulate it manually, like BP already does to ensure that group privacy settings apply in the forum directory. The SQL would have to look something like (this is totally pseudocode off the top of my head, probably won't work!)

SELECT DISTINCT p.topic_id, t.* FROM $bbdb->posts p LEFT JOIN $bbdb->topics t ON (t.topic_id = p.topic_id) WHERE p.poster_id = {$user_id}

This only involves a single join, which shouldn't be terrible given that the topics table is necessarily smaller than the posts table, but if we structure it as a filter on the BB_Query object, then we may be adding it to an already-existing join. I don't know.

2) Store topics-replied-to as a piece of usermeta (kinda how bbPress currently deals with favorites), so that the Replied To panel will involve querying bbPress for specific topics. This seems better than (1) in part because it avoids messing with the bbPress query. On the other hand, there are a few things to consider: (a) it won't apply to existing posts unless we write an installation routine that loops through existing members and gets their posts (this would be for 1.2-1.3 upgrades only), and (b) the usermeta itself could get quite large if someone is extremely active on forums. That means that the usermeta value itself could get very, very large (especially as topic_ids have more digits). Also, it could mean some inefficiency in BB_Query if the numbers are big - I have no idea how efficient IN(x) queries are when x is a very long string.

#2 @DJPaul
14 years ago

I'd lean toward your first option, customising the query, for the reasons you put down. Also not sure this would be a very forwards-thinking thing to do with regards to bbPress plugin.

#3 @boonebgorges
14 years ago

  • Cc johnjamesjacoby added

Nearly all of our bbPress customizations are going to break when we move to the bbPress plugin anyway. But it's worth getting jjj's feedback, because if there is an approach that will work best for the move to bbPress plugin, then we should take that into consideration.

#4 @boonebgorges
14 years ago

3177-1.patch is a first pass at the Replied To filters (option 1 described above).

I think it's mostly pretty good - it was more straightforward than I thought it would be.

The one remaining puzzle is the issue of group privacy. At the moment, the Replied To query (or the Started query for that matter) does *not* respect group privacy settings. That means that if I reply to a post in a private/hidden group, and then leave the group, I'll still be able to see those items on my Forums pages. (So will others, for that matter.) Of course, when you click through to the topics, group privacy settings are enforced.

I'm not sure what the best way is to deal with this. (a) We could just do what we do on the main Forums directory: show only topics from public groups. Or, (b) we could show only public groups when !bp_is_my_profile(), and show all topics to the profile owner. Or, (c) we could do it the "right" way, and only show a given topic if the viewing user has access to the group. The last way seems best, but it's probably too big a job for 1.3, because there are some performance questions (it'll require at least one more join against the group members table). So maybe (b) is a fair compromise for now?

#5 @boonebgorges
14 years ago

After some discussion with DJPaul, I'm going to go ahead and commit the changes so far. We can iterate as necessary.

To be clear: this changeset will reference Replied To only. As of now, Started and Replied To will be working correctly. Favorites must still be implemented.

#6 @boonebgorges
14 years ago

(In [4301]) Creates queries for member Replied To tab. References #3177

#7 follow-up: @boonebgorges
14 years ago

  • Cc djpaul added
  • Keywords close dev-feedback added

I've just spent a bit of time messing with Favorites. It's going to mean adding quite a bit of code. Seeing as we are getting closer to release, and I don't want to spend a ton of time writing all the necessary stuff, can I suggest that the Favorites tab is just removed for now, and postponed until a future release?

#8 in reply to: ↑ 7 @johnjamesjacoby
14 years ago

Replying to boonebgorges:

I've just spent a bit of time messing with Favorites. It's going to mean adding quite a bit of code. Seeing as we are getting closer to release, and I don't want to spend a ton of time writing all the necessary stuff, can I suggest that the Favorites tab is just removed for now, and postponed until a future release?

Fine by me.

#9 @boonebgorges
14 years ago

(In [4303]) Disables Forum Favorites tab until future release. References #3177

#10 @boonebgorges
14 years ago

  • Milestone changed from 1.3 to 1.4
  • Priority changed from critical to normal

#11 @boonebgorges
14 years ago

  • Summary changed from member profile forum screens to Member favorite topics

Thanks, jjj. I've bumped it to 1.4; this ticket will now refer to filling out the Favorites functionality. For fixes to the other parts of the member forums tab, please open a new ticket for the 1.3 milestone.

#12 @DJPaul
13 years ago

  • Keywords needs-patch added; close dev-feedback removed
  • Severity set to normal

Did you ever keep a copy of whatever patch you made for Favourites, or does it need someone to start from scratch?

#13 @boonebgorges
13 years ago

I might have a patch somewhere, but I think it will become moot anyway after converting to bbPress 2.0, as it would all have to be rewritten anyway. If the bbPress integration (or a reasonably close patch) comes early in the dev cycle, I think we can handle this; otherwise we'll have to punt.

#14 @boonebgorges
13 years ago

  • Milestone changed from 1.6 to Future Release

#15 @r-a-y
12 years ago

  • Resolution set to invalid
  • Status changed from new to closed

I think it will become moot anyway after converting to bbPress 2.0

Ticket is indeed moot now! Go bbPress 2!

#16 @DJPaul
12 years ago

  • Milestone Future Release deleted

#17 @DJPaul
8 years ago

  • Component changed from Appearance - Template Parts to Templates
Note: See TracTickets for help on using tickets.