Published on November 1st, 2013 by MissPiplup
I want to allow users to edit their address via the user profile edit page and I’ve been loosely following ardentfrost’s suggestion in this thread: https://bbpress.org/forums/topic/profile-user-specified-fields/#post-2670. My problem is that the fields are rendered on the edit page, but aren’t getting saved.
My code to add the address fields is in a file I’ve called custom-profile-fields which I’ve uploaded to the plugins page:
function get_address_keys() {
return array(
'user_address_line1' => array(0, __('Address Line 1')),
'user_address_line2' => array(0, __('Address Line 2')),
'user_address_suburb' => array(0, __('Suburb')),
'user_address_state' => array(0, __('State')),
'user_address_postcode' => array(0, __('Postcode/ZIP')),
'user_address_country' => array(0, __('Country'))
);
}
add_filter('get_profile_info_keys', 'get_address_keys');
To display the fields I’ve inserted the following code into form-user-edit.php above the website field since it makes sense to keep the address fields in the contact info area.
<div>
<label for="user_address_line1"><?php _e( 'Address Line 1', 'bbpress' ) ?></label>
<input type="text" name="user_address_line1" id="user_address_line1" value="<?php bbp_displayed_user_field( 'user_address_line1', 'edit' ); ?>" class="regular-text code" tabindex="<?php bbp_tab_index(); ?>" />
</div>
<div>
<label for="user_address_line2"><?php _e( 'Address Line 2', 'bbpress' ) ?></label>
<input type="text" name="user_address_line2" id="user_address_line2" value="<?php bbp_displayed_user_field( 'user_address_line2', 'edit' ); ?>" class="regular-text code" tabindex="<?php bbp_tab_index(); ?>" />
</div>
<div>
<label for="user_address_suburb"><?php _e( 'Suburb', 'bbpress' ) ?></label>
<input type="text" name="user_address_suburb" id="user_address_suburb" value="<?php bbp_displayed_user_field( 'user_address_suburb', 'edit' ); ?>" class="regular-text code" tabindex="<?php bbp_tab_index(); ?>" />
</div>
<div>
<label for="user_address_state"><?php _e( 'State', 'bbpress' ) ?></label>
<input type="text" name="user_address_state" id="user_address_state" value="<?php bbp_displayed_user_field( 'user_address_state', 'edit' ); ?>" class="regular-text code" tabindex="<?php bbp_tab_index(); ?>" />
</div>
<div>
<label for="user_address_postcode"><?php _e( 'Postcode/ZIP', 'bbpress' ) ?></label>
<input type="text" name="user_address_postcode" id="user_address_postcode" value="<?php bbp_displayed_user_field( 'user_address_postcode', 'edit' ); ?>" class="regular-text code" tabindex="<?php bbp_tab_index(); ?>" />
</div>
<div>
<label for="user_address_country"><?php _e( 'Country', 'bbpress' ) ?></label>
<input type="text" name="user_address_country" id="user_address_country" value="<?php bbp_displayed_user_field( 'user_address_country', 'edit' ); ?>" class="regular-text code" tabindex="<?php bbp_tab_index(); ?>" />
</div>
Published on November 1st, 2013 by fatpat76
Hello there, I just went through some problems where the bbPress capabilities were not registered in the wp_user_roles option_name row entry. I don’t know what caused it but I was trying to see if I uninstalled/reinstalled bbPress it might reset the capabilities. It didn’t.
So I got hunting through the code and I found this function:
/**
* Adds capabilities to WordPress user roles.
*
* @since bbPress (r2608)
*/
function bbp_add_caps() {
// Loop through available roles and add caps
foreach ( bbp_get_wp_roles()->role_objects as $role ) {
foreach ( bbp_get_caps_for_role( $role->name ) as $cap => $value ) {
$role->add_cap( $cap, $value );
}
}
do_action( 'bbp_add_caps' );
}
But nothing seem to ever call this function. I did a search through all of the plugin code and there aren’t any references to this function. What gives?
In the end I was able to force the capabilities to be rebuilt by adding this function call inside another function that I knew was being called and it worked (I’ve since removed this).
BTW, this is on WP 3.7.1, bbPress 2.4.1.
Thanks!
Patrick
Published on November 1st, 2013 by rscrouse
Hi. I understood that I could post HTML formatted content into bbPress. But when I do, the formatting is ignored. Does someone know what I’m likely doing wrong?
Published on November 1st, 2013 by dotdatdot
Hello everyone.
Is there a proper codex site anywhere with all the functions/hooks and all the good stuff properly documented anywhere? For example I found a function called bb_is_home(), and I wanted to know what EXACTLY that checked for, but after researching it, I couldn’t find a single real reference or documentation of it.
Am I missing something? Because the https://codex.bbpress.org/type/functions/ has only about 5 functions. Surely there is a list of functions somewhere?
Thanks
Published on October 31st, 2013 by jazinsa
Is it possible to show a user’s forum topic count(or post count) in the buddypress profile page? It feels like it should be simple enough but hours of googling and reading topics here has left me more confused than when I started.
I can see its possible on a bbpress profile page, where it’s using:
<p class="bbp-user-topic-count"><?php printf( __( 'Topics Started: %s', 'bbpress' ), bbp_get_user_topic_count_raw() ); ?></p>
<p class="bbp-user-reply-count"><?php printf( __( 'Replies Created: %s', 'bbpress' ), bbp_get_user_reply_count_raw() ); ?></p>
Should I be calling a different function altogether, or is there a specific way to put bbPress functions inside a BuddyPress template page?
A good example of what I mean is at Tamriel Foundry, where the various counts are listed under the heading Post Details. (The design of that site in general is amazing)
Any help would be greatly, greatly appreciated! And apologies if you are reading this for a second time, I wasn’t sure whether to post my query at the Buddypress or bbPress forums.
Published on October 31st, 2013 by mmichael1991
Hi!
First of all, if I’m double posting this, I’m really sorry!
I want to create a menu item (or text link) to let users quickly go to their bbpress profile.
(http://raven.michaelravenstein.nl/forums/users/userid/)
So how do i get the right link?
Any help is welcome!
– Michael
Published on October 31st, 2013 by Donta
I like bbpress but I am desperately trying to make it work for moving a large forum from vbulletin.
I tried to move my forum several times and everytime I move users, topics and some replies, I notice that users and some of their true replies are out of sync. In other words, some user are assigned to topics they didn’t start or reply to and other topics are assigned to admin. No, I didn’t wait for 1 million replies to be downloaded. I checked the first 350,000K replies and everything seems to be a mess.
1. Users are not in sync with their topics and replies. Some topics with no replies downloaded yet are in ok, but many are not. Some topics are assigned to users who never posted anything, some are assigned to admin and the rest are assigned to their owners.
2. At somewhere at 350,000 posts, the whole process slows down (10 posts per 20 seconds or worse) to turtle speed.
3. I repaired whatever I downloaded using the bbpress repair page and I don’t see anything fixed.
I am not sure what is causing this. Is this normal?
I need help. I can give links and login info to bbpress staff if required.
Published on October 30th, 2013 by Unit9
WordPress: 3.7.1
Buddypress: 1.8.1
BBPress: 2.4.1
Hi guys,
I realised I posted this in the wrong forum so I’m adding it here. 🙂
Is there any way for me to adjust the current BBPress and get back profile activity posting, so whenever someone posts in the forum, it shows on their BuddyPress profile activity feed?
This works in previous versions of BBPress but is broken in the current version.
Thanks!
Published on October 30th, 2013 by Marcosbcn
Hello
I installed bbpress but the forum comes close by the presence of the sidebar, how can eliminate the sidebar to the full width of the page is for the forum?
http://www.adelgazarrapidoweb.com/forums/forum/foro-para-adelgazar/
wordpress 3.7.0
bgpress 2.4.1
Regards
Mark
Published on October 30th, 2013 by Mailhilfe
I am looking for hack that allow a reader to switch from one question to the previous question and to next question (not the page number).
Also for the forum…
I can´t find it in the template.
I hope someone here has a tipp