Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 11,676 through 11,700 (of 32,504 total)
  • Author
    Search Results
  • Stephen Edgar
    Keymaster

    Hmmm… 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 Particpant role includes the capability read_private_forums which in effect means any private forums can be read by users who are logged in, this would include your members and officers WordPress roles if you assign these WordPress role users the bbPress Participant role. If you assign your Officers WordPress role the bbPress Moderator role they will be able to read hidden forums because they have the read_hidden_forums bbPress capability.

    #147382
    scottpoulin
    Participant

    also 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.

    #147381
    scottpoulin
    Participant

    I 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' );
    jbroskos
    Participant

    Hey 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.3

    #147376
    JosiahW
    Participant

    I have no idea how to code or debug 🙁

    #147375
    Stephen Edgar
    Keymaster

    It is not helpful, there have been vast changes to bbPress codebase since those posts and will only further confuse things.

    Stephen Edgar
    Keymaster

    Here 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 $url with $location and user_url with location:

    
    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');
    
    #147370

    Add 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.

    #147366

    I 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.)

    #147365

    @josiahw That’s pretty odd. If you want to debug, check inside the bbp_set_current_user_default_role function, hooked to bbp_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.

    #147363
    ryan360
    Participant

    My 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() . '%';
    yoosuke
    Participant

    Thanks 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.

    ryan360
    Participant

    I 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.

    #147346
    Stephen Edgar
    Keymaster

    I 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">

    #147342
    aborruso
    Participant

    Ok, 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

    #147338
    Stephen Edgar
    Keymaster

    No, 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_topic

    See the following article and add that code to your themes functions.php file.
    (I think this is what you are after 🙂 )

    bbp_show_lead_topic

    #147327
    Robin W
    Moderator

    yes 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 !

    Stephen Edgar
    Keymaster

    Mine 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.

    #147324

    In reply to: Hide role in the forum

    Robin W
    Moderator

    Try 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' );
    Robin W
    Moderator

    Ok, 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') ;
    #147313
    Stephen Edgar
    Keymaster

    bbPress 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-2 then there is another page using the forums slug or is in the trash.

    #147310
    Stephen Edgar
    Keymaster

    This 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=20140430

    table.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.

    #147304

    In 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.

    Robin W
    Moderator

    The 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') ;
    #147301

    In reply to: Hide role in the forum

    yu
    Participant

    Thanks 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.

Viewing 25 results - 11,676 through 11,700 (of 32,504 total)
Skip to toolbar