Skip to:
Content

BuddyPress.org

Opened 10 years ago

Last modified 3 years ago

#2084 assigned defect (bug)

Frontpage tabs - show if content is available

Reported by: Ezd Owned by: boonebgorges
Milestone: Awaiting Contributions Priority: minor
Severity: normal Version:
Component: Activity Keywords: needs-patch
Cc:

Description

On the frontpage we have all the tabs:

  • My Friends,
  • My Groups
  • My Favorites
  • @username Mentions

The first 3 only shows up if there's actual content inside them. Like if you don't have a friend the "My Friends" tab won't show up on the frontpage.

The last one "@username Mentions" always shows no matter if there's content or not. I think it should have same properties as as the other 3 meaning it should only show up if you have any mentions.

Attachments (1)

2084-1.diff (4.9 KB) - added by boonebgorges 9 years ago.

Download all attachments as: .zip

Change History (9)

#1 @boonebgorges
9 years ago

  • Component set to Core

I'd like some feedback on the attached 2084-1.patch. In order to get the mention count I had to write a new database method, and I wrote some other functions (similar to what exists for groups_total_groups_for_user() ) to make sure the count could be filtered and cached. The big change I want feedback on has to do with function names. bp_total_mention_count_for_user() was being used to get the *unread* mention count, not the total like the name suggests. So I renamed bp_total_mention_count_for_user() to bp_new_mention_count_for_user() and usurped the name. Is this a bad idea? (They're easy to switch back if so.)

@boonebgorges
9 years ago

#2 @boonebgorges
9 years ago

Ignore the fact that the phpdoc is wrong, I will fix that :)

#3 @cnorris23
9 years ago

  • Keywords has-patch added

#4 @DJPaul
9 years ago

  • Keywords dev-feedback added

Not tested, but approach looks okay to me. Like you say, phpdoc needs correcting (might be worth making a comment about the renamed function's legacy behaviour for anyone grepping the source).

#5 @boonebgorges
9 years ago

  • Keywords needs-patch added; has-patch dev-feedback removed
  • Milestone changed from 1.3 to 1.4

After some discussion, Paul and I decided it would be more efficient to store total mention count in usermeta (incremented on new mentions), to avoid the extra lookup. Patch should be rewritten accordingly.

#6 @DJPaul
8 years ago

  • Milestone changed from 1.6 to Future Release
  • Severity set to normal

Punting to a future release (1.7) so we can go through and audit all of these totals stored in meta for consistency.

#7 @boonebgorges
7 years ago

  • Owner set to boonebgorges
  • Status changed from new to assigned

#8 @DJPaul
3 years ago

  • Component changed from Core to Activity
Note: See TracTickets for help on using tickets.