Forum Replies Created
-
In reply to: Favorites and subscription count
Thank you for the quick, helpful reply. Sorry I didn’t get back to you sooner.
I would like to count each subscribed forum and subscribed/favorite topic but not every topic within a subscribed forum, though with a few technical exceptions.
In my case,
WP__bbp_subscriptions
andWP__bbp_favorites
only output topics, not forums or the topics of a subscribed forum.Fortunately, I found three functions that provide either subscribed forum ids or subscribed/favorite topic ids separately, based on a user id:
bbp_get_user_subscribed_topic_ids()
bbp_get_user_subscribed_forum_ids()
bbp_get_user_favorites_topic_ids()
Here is my solution in the form of two custom functions. The above functions obviously made it all very simple:
// display bbPress subscription count function user_subscriptions_count( $user_id = null ) { $topic_count = count(bbp_get_user_subscribed_topic_ids($user_id)); $forum_count = count(bbp_get_user_subscribed_forum_ids($user_id)); echo $forum_count + $topic_count ; }
// display bbpress favorites count function user_favorites_count( $user_id = null ) { echo count(bbp_get_user_favorites_topic_ids($user_id)); }
I do realize that a user’s subscribed forums and topics are usually private, but I prefer to check for permissions outside functions.
Thanks for the help, I hope this might be useful for someone in the future.
In reply to: Moving bbPress Edit profile formsI will if I find an acceptable solution. It would be better if one of the developers could drop by and share their wisdom though.
There is also a small chance that BuddyPress Trac ticket #5619 will materialize and effectively solve my problem before I do.
Anyway, thanks for the help!
In reply to: Moving bbPress Edit profile formsRight, I guess I’m moving on to the Stack Exchange. Worst case, I’ll have to figure out how PHP forms are done in general, figure out some MySQL in relation to WordPress and sprinkle with security precautions.
Do you have a donation link? I don’t think anybody else is going to drop by and help me out before I figure it out elsewhere π
In reply to: Moving bbPress Edit profile formsGotcha, glad we’re on the same page now. π
What happens when I rename the form-user-edit.php to settings.php and drop it in the right directory is that I get the right markup, but the forms don’t work when submitted. They also don’t display any pre-submitted values like they would if they did work.
In fact, they don’t work anywhere except at their original location at example.com/forums/profile/%username%/edit so it doesn’t really matter whether I’m trying to make them work in BuddyPress or any other page.
I’m sure it’s just a matter of understanding how WordPress or specifically BuddyPress implement PHP forms and the rest should be a cakewalk.
In reply to: Moving bbPress Edit profile formsis this what you are describing as the template file? and which file is that and is it a php file?
Let’s start with this. The file is a BuddyPress template file called settings.php. It’s wiped clear of any code though. You can find it in buddypress/bp-templates/bp-legacy/buddypress/members/single if you have downloaded BuddyPress.
This template file controls the BuddyPress user Settings page and I am trying to turn it into a working copy of the bbPress user Edit page.
ok, so if I understand you correctly, you are trying to have the links that are … and place them on a buddypress page?
I can’t figure out why you’re listing the URLs you mentioned in above quote again. I’m really sorry if I’m missing something, but I feel like I need to reaffirm that this is not what I’m doing.
In reply to: Moving bbPress Edit profile formsThanks for the reply.
I can’t actually access the BuddyPress Settings page in the backend. Are you suggesting I use the shortcode inside the template file?
I’m making a theme, so I would really prefer not to rely on plugins. Besides, I would love to know how the form-user-edit.php actually works. π
Can you say what I need to edit or add to the content of form-user-edit.php get to get it to work somewhere else?
I’m not sure what you mean by calling each by their url. Can you elaborate?
In reply to: Moving bbPress Edit profile formsThe site is hosted locally so I can’t give you an actual live URL if that’s what you mean?
The page is a ‘customized’ version of the BuddyPress Settings page located at DOMAIN/members/USER/settings/.
Just think of it as a blank WordPress page with that URL.
By “the content” I mean the
<form id="bbp-your-profile>
element, and everything within it, on the Edit page at DOMAIN/forums/profile/USER/edit/.The template file that contains the form is called form-user-edit.php.
In reply to: Moving bbPress Edit profile formsmy wife would be delighted if I had a six pack, but suspect thatβs not what you are talking about !
I hear you can get crafty six pack-making belts on the shop***g channel that work wonders at the same price though! π
Is that correct?
Not exactly, I’m trying to move the content of the edit page from bbPress over to the settings page on BuddyPress, or any other page for that matter.
Maybe I should add that I’m making a custom WP/BBP/BP theme, so if it’s something that can easily be done by working with the template files as opposed to drawing up plugins then I’m happy to do it that way.
I started reading up on how PHP forms work, but I figure it’s safer to ask someone who knows what they’re doing when it comes to things like user inputs.
In reply to: Moving bbPress Edit profile formsOkay, let’s raise the stakes.
I will donate a six pack to whoever successfully helps me get this to work within a reasonable time frame.
I hope it’s okay to do that here?
In reply to: Moving bbPress Edit profile formsBump
Okay, please post the solution here if you figure it out. π
If you can’t get a filter to work, you can always look at customizing a template file or two if you don’t need it to work across different themes.
In reply to: Display latest post excerpt under FreshnessThanks for the tip, I’ll keep that in mind.
Actually, there is a link to the topic by default, in which case it’s the number in the top right corner of the reply.
Here on the bbPress support forum, it’s the time stamp to the left of the reply, underneath the user’s profile information.
Linking to replies, posts, etc. like it’s done here is fairly common practice throughout the web, although not at all intuitive in my opinion.
In reply to: Display latest post excerpt under FreshnessWill do. Thanks for the help anyway! π
In reply to: Display latest post excerpt under FreshnessNo, I mean words from the content.
Don’t worry about it though, it’s a low priority, even for me.
I’m also starting to have second thoughts about it now that I’ve only been able to find one example of it being used in production.
I’ll keep looking at the material you posted along with the bbp and wp codices though.
In reply to: Display latest post excerpt under FreshnessThank you for the reply.
I just realized that the Steam Forums I linked to don’t actually do what I’m talking about. I’m gonna see what I can do with
wdgets.php
the plugin you linked to, but just to clarify:I’m looking for the first couple of words from the most recent post of each forum to be displayed under “Freshness” on the front page and on forum lists, etc.
I’ll figure out the PHP I need to, so don’t worry about that π
In reply to: Per Forum Permissions by GroupIt would be great to have an alternative to the Groups feature in BuddyPress so you’re not forced to use their extensive override of the bbPress profiles, which is not that well designed if you’re not interested in the rest of the package.
I can’t contribute much in the form of PHP development, but please ask if you think I could help out some other way.