Search Results for 'code'
-
AuthorSearch Results
-
June 4, 2014 at 2:54 am #147385
Stephen Edgar
KeymasterHmmm… What you have outlined sounds like it should be working.
The one bit I am not sure about is you appear to only be describing WordPress roles and not also including bbPress’ roles in your description above.
Have you run the bbPress Repair Tool “Remap existing users to default forum roles”?(Tools->Forum)
This will set the users their bbPress role. The default role is
Participant(You can change the default role via bbPress settings)As outlined in the roles docs the bbPress role
Particpantrole includes the capabilityread_private_forumswhich in effect means anyprivateforums can be read by users who are logged in, this would include yourmembersandofficersWordPress roles if you assign these WordPress role users the bbPressParticipantrole. If you assign yourOfficersWordPress role the bbPressModeratorrole they will be able to readhiddenforums because they have theread_hidden_forumsbbPress capability.June 3, 2014 at 10:34 pm #147382In reply to: Pagination – changing arrows to Next/Previous
scottpoulin
Participantalso add:
add_filter( 'bbp_replies_pagination', 'my_pagination' );
add_filter( 'bbp_search_results_pagination', 'my_pagination' );Though I couldn’t get the search results piece to work – those don’t seem to paginate at all, could be a plugin conflict or something though.
June 3, 2014 at 10:17 pm #147381In reply to: Pagination – changing arrows to Next/Previous
scottpoulin
ParticipantI had a feeling there would be an easier way than a new plugin. Add this to your theme’s functions.php:
function my_pagination( $args ) { $args['prev_text'] = 'previous'; $args['next_text'] = 'next'; return $args; } add_filter( 'bbp_topic_pagination', 'my_pagination' );June 3, 2014 at 9:32 pm #147380jbroskos
ParticipantHey Everyone,
We migrated from Simple:Press today to bbPress and so far all is well after a little cleanup, but now I am noticing that we are experiencing issues with permissions within the roles and capabilities. We have 2 tiers of registered users which are our members and our officers. With this we have 2 seperate categories and forums within them with members only being able to see/edit the members forum and officers being able to see/edit the members forum and the officers forum.
According to here on bbPress, this should be possible as our “members” role would have the “read_private_forums” capability assigned to it and our “officers” role would have that capability as well as the “read_hidden_forums” capability assigned to it. Unfortunately…this is not working properly, our “members” role is not able to view there forum, so in the mean time, I’ve enabled the “read_hidden_forums” capability per and that seems to have “solved” the issue, however now there is no way to restrict access to the officers forum (Which I’ve temporarily deleted until this can be resolved).
Any help/input/ideas would be appreciated. This should work from what I am reading, so not sure why.
Thank you!
—–
Running:
WP v3.9.1
bbPress v2.5.3June 3, 2014 at 6:22 pm #147376In reply to: Moderators Disappearing
JosiahW
ParticipantI have no idea how to code or debug 🙁
June 3, 2014 at 6:17 pm #147375In reply to: This user has not created any topics
Stephen Edgar
KeymasterIt is not helpful, there have been vast changes to bbPress codebase since those posts and will only further confuse things.
June 3, 2014 at 5:34 pm #147371Stephen Edgar
KeymasterHere is Robin’s code updated to only show the website if it is not blank:
function user_profile_bbp_website_information() { //this function adds the website to the profile display menu $url=bbp_get_displayed_user_field( 'user_url' ) ; if ( ! empty($url) ) { $label1 = $rpi_options['item1_label'] ; echo "<p>" ; printf ( __( 'Website : ', 'bbpress' )); $url='<a href="'.$url.'">'.$url.'</a>'; echo $url; echo"</p>" ; } } add_action ('bbp_template_after_user_profile', 'user_profile_bbp_website_information') ;To add the location you want to add this, this will add the field to their profile so they can edit and update it, you then just duplicate the code from either Robin’s or mine and replace
$urlwith$locationanduser_urlwithlocation:function ntwb_user_contact_methods_location( $user_contact ){ /* Add user contact methods */ $user_contact['location'] = __('Location'); return $user_contact; } add_filter('user_contactmethods', 'ntwb_user_contact_methods_location');June 3, 2014 at 5:32 pm #147370In reply to: Moderators Disappearing
John James Jacoby
KeymasterAdd some debug logging to
bbp_set_current_user_default_role()to narrow down the cause,(likely with dumping out the call stack.)You should be able to cowboy code something if you’re able to reproduce the issue with a test user account. If you’re able to come up with explicit instructions on how to duplicate this on an installation that only has bbPress running, I’d love to fix anything that isn’t behaving correctly.
June 3, 2014 at 4:15 pm #147366In reply to: Moderators Disappearing
John James Jacoby
KeymasterI see two possible ways this *might* fail:
* Multisite & calls to
switch_to_blog
*bbp_get_user_role()is returning multiple bbPress roles (either because some third party role editor plugin was used to manipulate things, or there’s some crusty old role data somewhere in there.)June 3, 2014 at 4:12 pm #147365In reply to: Moderators Disappearing
John James Jacoby
Keymaster@josiahw That’s pretty odd. If you want to debug, check inside the
bbp_set_current_user_default_rolefunction, hooked tobbp_setup_current_user. There are several redundant checks to ensure what you’re seeing doesn’t happen, so I’m curious where it might be failing and how.June 3, 2014 at 3:42 pm #147363In reply to: MODIFY: Topic/Reply Author’s Profile Link
ryan360
ParticipantMy hack job solution was to just modify the plugin itself. Line 356 in template.php contains the permalink structure which you can modify to suit your needs.
// Pretty permalinks if ( $wp_rewrite->using_permalinks() ) { $url = $wp_rewrite->root . bbp_get_user_slug() . '/%' . bbp_get_user_rewrite_id() . '%';June 3, 2014 at 2:34 pm #147361yoosuke
ParticipantThanks for two of you!
That was familiar and interesting topic for me as a web designer!Well…
Thanks to you, Mr Robin W,
I could display ‘Website:’ part in User’s profile page!Now, Along with it, 2 new wishes came up to my mind.
Would you please grant my wishes again?(I really appreciate from Japan! that you always help me, Mr Robin W! )
1. When the ‘Website’ field is blank, I want it be invisible.
Now, When it’s blank, it’s displayed like
Website:_____.2. Is it possible to add ‘Where you live:’ part before the ‘Website:’ part?
Showing the living place is helpful for deepening relations between users, I think…
I wish I could add just<input>tag, neither<textarea> tag nor<select>tag.many thanks.
June 3, 2014 at 1:43 pm #147359ryan360
ParticipantI was able to accomplish this by writing a custom query. I was unable to find a solution ANYWHERE else on this forum despite numerous people asking the same question so I’m hoping this will help everyone out until the bbpress team fixes the bbp_get_template_part functions.
<?php $args = array( 'post_type' => 'reply', 'post_status' => 'publish', 'orderby' => 'title', 'order' => 'ASC', 'author' => $curauth->ID, ); $bbpressquery = new WP_Query($args); while ($bbpressquery->have_posts()) : $bbpressquery->the_post(); ?> <?php the_content(); ?> <?php endwhile; ?>Obviously you can modify the code above to show topics created, I was just trying to return all the forum posts created by a user.
June 3, 2014 at 7:20 am #147346In reply to: Show pagination in single topic
Stephen Edgar
KeymasterI should have said the ‘bbPress templates’ in your Twenty Eleven theme
<link rel="stylesheet" id="bbp-child-bbpress-css" href="http://www.assorpas.it/wp-content/themes/twentyeleven/css/bbpress.css?ver=2.3.2" type="text/css" media="screen">June 3, 2014 at 6:55 am #147342In reply to: Show pagination in single topic
aborruso
ParticipantOk, then I do not see the reply button, because I have an old version.
Where do you see in the code that I use a child theme?
Thank you
June 3, 2014 at 5:27 am #147338In reply to: Show pagination in single topic
Stephen Edgar
KeymasterNo, we use the same version, I think we may have our terminology crossed.
If you want the topic displayed at the top of every page like we do here so that you can still see the original topic when you are page 3 for example you want to use
bbp_show_lead_topicSee the following article and add that code to your themes
functions.phpfile.
(I think this is what you are after 🙂 )June 3, 2014 at 3:09 am #147327In reply to: Links not showing in Forum
Robin W
Moderatoryes the links are set as white in the display
try adding this to your style.css
#bbpress-forums .reply a { color : blue !important ; } #bbpress-forums .reply a:hover { color : green !important ; }I haven’t tested, but should work, come back if you need more help !
June 3, 2014 at 3:07 am #147326Stephen Edgar
KeymasterMine didn’t have “Website: ” now it does 😉 yours should also be ‘Website : ‘ (i.e. Capital W) 😉
It won’t be a link in a new window (i.e.
target="_blank"), a big pet peeve of my mine, see this for more background on when to and not to use it.June 3, 2014 at 2:56 am #147324In reply to: Hide role in the forum
Robin W
ModeratorTry this – it should work
Function hide_author_url () { $retval='' ; return $retval ; } add_filter( 'bbp_get_topic_author_url', 'hide_author_url' ); add_filter( 'bbp_get_reply_author_url', 'hide_author_url' );June 3, 2014 at 2:34 am #147321Robin W
ModeratorOk, this is what you wanted
function user_profile_bbp_website_information() //this function adds the website to the profile display menu { $label1 = $rpi_options['item1_label'] ; echo "<p>" ; printf ( __( 'website : ', 'bbpress' )); $url=bbp_get_displayed_user_field( 'user_url' ) ; $url='<a href="'.$url.'">'.$url.'</a>'; echo $url; echo"</p>" ; } add_action ('bbp_template_after_user_profile', 'user_profile_bbp_website_information') ;June 2, 2014 at 8:55 pm #147313In reply to: Using shortcode has created 2 forums
Stephen Edgar
KeymasterbbPress doesn’t actually create any WordPress pages.
You should be able to create a page titled ‘forums’ add the shortcode and bbPress will use that page.
If you can only create a page with the slug
forums-2then there is another page using theforumsslug or is in the trash.June 2, 2014 at 8:40 pm #147310In reply to: Forum images went crazy
Stephen Edgar
KeymasterThis is most likely an avatar plugin:
eg
<img src="http://www.passingrass.com/wp-content/uploads/avatars/460/5ed932eb9e1a5b11af2d1b9e7029b68e-bpthumb.jpg" class="avatar user-460-avatar avatar-20 photo" width="20" height="20" alt="Profile picture of PassinGrass">And or your themes CSS at Line #1044
http://www.passingrass.com/wp-content/themes/sweetdate/custom_buddypress/_inc/css/default.css?ver=20140430table.forum td img.avatar { float: none; margin: 0 5px -8px 0; }A quick change of that to the following fixes it:
table.forum td img.avatar { float: none; margin: 0 5px -8px 0; width: 20px; }You’ll want to find out if it is the plugin or theme and find a more permanent way to keep those changes such as creating a child theme.
June 2, 2014 at 5:52 pm #147304In reply to: Importing from Vanilla
Stephen Edgar
Keymaster@nippi9 I edited your post above just to remove a large code block for readability.
It looks like the issue above is that some of the user passwords include a quote
"string and that is causing the SQL error which is entirely valid.UPDATE wp_users SET user_pass = "62138e180a81452f40bf419b5a66c359"l$" WHERE ID = "96451" UPDATE wp_users SET user_pass = "27e42027c6eb6008426fbe96b5fdca08;"/" WHERE ID = "96468" UPDATE wp_users SET user_pass = "8cc902ac070d040e1a3231803d09a9411K"" WHERE ID = "96471" UPDATE wp_users SET user_pass = "da19b051d168e44b5833c703e1feb37dE"@" WHERE ID = "96502" UPDATE wp_users SET user_pass = "32f81a53cc20309e9c4d3553d3ba64cb1FA#N~A{J<"@TD:]]5o#vEXQ2v46ct" WHERE ID = "96511" UPDATE wp_users SET user_pass = "d1ea441db666ef80506a70bfcc890e10Ut"" WHERE ID = "96530" UPDATE wp_users SET user_pass = "97eefae85da1e2ea818556577c1dbb42"!m" WHERE ID = "96540" UPDATE wp_users SET user_pass = "edbb4ce3d20b74ca8ab9e141c46f25nW"" WHERE ID = "96572"I’ll take a look and see if there is something we can do to fix this.
That said, it appears only to be a password issue, if you continue you should get all the users imported and users who are affected by the password issue above would need to reset their password rather than using their existing password.
June 2, 2014 at 4:54 pm #147302Robin W
ModeratorThe following should do it – put this in your functions file
function bbp_website_information () //This function adds the website to the avatar display of topics/replies { echo '<li>' ; $user_id = bbp_get_reply_author_id( $reply_id ); global $wpdb; $url = get_userdata($user_id) ; $url=$url->user_url ; $url='<a href="'.$url.'">'.$url.'</a>'; echo $url ; echo '</li>' ; } add_action ('bbp_theme_after_reply_author_details', 'bbp_website_information') ;June 2, 2014 at 4:37 pm #147301In reply to: Hide role in the forum
yu
ParticipantThanks for this. Works just great. Just right now I found out that the author’s name in the forum is linked to his profile. How do I delete the link? Unfortunately my programming knowledge is not good enough to find it out by myself using the codex.
-
AuthorSearch Results