Skip to:
Content

Opened 3 years ago

Closed 14 months ago

Last modified 14 months ago

#3177 closed enhancement (invalid)

Member favorite topics

Reported by: DJPaul Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Theme 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 3 years ago.

Download all attachments as: .zip

Change History (17)

comment:1 boonebgorges3 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.

comment:2 DJPaul3 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.

comment:3 boonebgorges3 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.

boonebgorges3 years ago

comment:4 boonebgorges3 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?

comment:5 boonebgorges3 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.

comment:6 boonebgorges3 years ago

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

comment:7 follow-up: boonebgorges3 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?

comment:8 in reply to: ↑ 7 johnjamesjacoby3 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.

comment:9 boonebgorges3 years ago

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

comment:10 boonebgorges3 years ago

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

comment:11 boonebgorges3 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.

comment:12 DJPaul3 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?

comment:13 boonebgorges3 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.

comment:14 boonebgorges2 years ago

  • Milestone changed from 1.6 to Future Release

comment:15 r-a-y14 months 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!

comment:16 DJPaul14 months ago

  • Milestone Future Release deleted
Note: See TracTickets for help on using tickets.