[Bb-trac] Re: [bbPress] #784: function bb_profile_data should have
an action hook
bbPress
bb-trac at lists.bbpress.org
Fri May 29 15:20:37 GMT 2009
#784: function bb_profile_data should have an action hook
-------------------------+--------------------------------------------------
Reporter: _ck_ | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 1.0
Component: Back-end | Version:
Severity: normal | Resolution:
Keywords: |
-------------------------+--------------------------------------------------
Comment (by timskii):
To give an example of the current problem, as I see it:
1. I want to add a user setting, that display whatever on the forum when
that user is logged in.
2. $user->whatever is a really convenient place to store that data.
Remember this is a user setting, not a forum-wide setting.
3. I can add "whatever" via add_filter('get_profile_info_keys',
'function_that_adds_whatever').
4. Whatever will then appear on the profile and profile edit screen, in
with all the other data.
5. Unfortunately, I need to be able to:
(a) assign it as a checkbox, not a text field,
(b) add a text note to explain to the user what the whatever tickbox
does,
(c) assign it to a separate fieldset - perhaps called "Settings",
(d) stop the data displaying on the public profile view.
6. The current user data structure is not reliable enough (explained
below) to hold all that extra detail. So I create my own lookup data
structure.
7. Now since bb_profile_data is in the core, and more-or-less needs to be
re-written to support the extra data structure associated with whatever, I
cannot use it.
8. I write my own custom functions to re-create the profile screens, which
are called from my template.
9. This is unhealthy, since changes to core profile code will get
overlooked.
The extra_profile_info hooks seems to simply be a place to drop a heap of
entirely new code, that doesn't replace anything that would otherwise
appear in the profile. Further bb_profile_data-type action hooks would
help, but would not entirely solve the inflexibility of the current
"you're only really supposed to enter a name and email" user information.
I need to be able to specify the data type (tickboxes, textareas, selects
and radios with options), group sets of profile entries into blocks
(including groups of groups), alter the way data is displayed on the
public profile (including display to owner-member, all-members, public,
hide), help/explanation, class for formatting, and probably a few other
things that I don't even know I need yet (so an inherently flexible
method).
Perhaps this needs to be re-thought: For example, we're seeing slow
feature-creep in the existing user array, such as the addition of optional
vcard names... but the data structure is horrible: The vcards are are
referred to as label[2]. So I can hack my own data onto the end of the
array, but a reference to label[3] is clearly setting myself up for
disaster at a later date.
--
Ticket URL: <http://trac.bbpress.org/ticket/784#comment:5>
bbPress <http://bbpress.org/>
Innovative forum development
More information about the Bb-trac
mailing list