Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for ' . default . '

Viewing 25 results - 3,501 through 3,525 (of 6,759 total)
  • Author
    Search Results
  • #139761
    mistercyril
    Participant

    Hello again Stephen,

    so here is what happens…

    SHORTCODE SOLUTION
    I inserted the [bbp-forum-form] shortcode and can see a forum creation form while logged is as KeyMaster. However, once logged in as “Moderator” I only get the following message

    You cannot create new forums.

    PLUGIN APPROACH
    I installed the suggested plugin (which is very straight forward and easy to use BTW) Advanced user capability editing for bbPress.

    Even though options are all set appropriately, the “Forum” menu will not display as long as the user is a “moderator”.

    In order to be as thorough as possible, here are the tests I ran :

    • Changed moderator’s WP user role to each available option (subscriber -> admin) and tested every time
    • Used plugin’s reset to defaults button (essentially disabled everything)
    • Added options to enable creating and editing forums

    What i noticed is that the “Topics” and “Replies” menus react to BBpress user-role settings whereas the “Forum” menu does not. This might seem logical, but in my mind it validates the fact that BBpress roles are not entirely overridden or broken.

    #139751
    mistercyril
    Participant

    Hello,

    I am experiencing BBPress role issues with a WP + BP + BBPress setup.

    I need a “moderator” role to be able to create new forums and edit his own, as per the standard permissions defined here : http://codex.bbpress.org/bbpress-user-roles-and-capabilities/

    Moderator

    Forum Capabilities

    • publish_forums
    • edit_forums
    • read_private_forums
    • read_hidden_forums

    Unfortunately, the “moderator” role doesn’t see the “Forum” menu in the WordPress back-end, and even if its pages are accessed directly, there is a message stating the user does not have permission to accès the content.

    So I understand that this may be a permissions issue, but i’ve taken a number of steps to circumvent this, and still no solution in sight :

    • Disable all other plugins and use standard WP theme
    • Upgrade BBpress to V 2.5
    • Tried every single “repair forum” tool in plugin preferences
    • Tried activating-deactivating and reactivating “default user role” setting
    • Tried editing role with Capability Manager Enhanced
    • Tried with a fresh install of WordPress

    From what i’ve gathered on-line, the BBpress team has introduced a new way of storing user roles but there isn’t very much information on how it REALLY works and how to make it compatible with an existing site that upgrades to a new version of BBpress.

    Anyway, has anyone else experienced this? Does anyone know how to solve this issue?

    I would appreciate any input,

    C.

    #139705

    In reply to: Avatar

    Jgonl
    Participant

    Apparently the problem is with the theme
    I use buddydefault theme 1.8.1 if it works.

    #139650

    Topic: CSS bug?

    in forum Troubleshooting
    jeepdon
    Participant

    Re: http://powershell.org/wp/forums/users/dlwyatt/replies/

    You’ll notice that the container for the page content is getting a 0px width and massive height calculated. The CSS style #bbp-forums has an “overflow: hidden;” style. Removing that style element fixes the display – but I’d like some confirmation that this is indeed a bug? The content in this specific case has a lot of PRE/CODE styling, so I’m not sure if there’s some weird interaction going on that I just can’t figure out.

    The container in question is a ul#topic-0-replies, classed with .forums and .bbp-replies. The overflow attribute I’m referring to is coming right from the top of bbpress.css.

    Note that I’m using the default styling/theming for BBP.

    #139631
    justsayno1
    Participant

    How did you get from there to “I just followed…”?

    Unfortunately there is not an easy way to explain this as I am not that familair with wordpress/bbpress core myself. BUT what I mean is that function is obviously somewhere in the bbpress core files. All I did was start going in there. They are quite well documented and have comments that explain the different functions that get used. You are mainly looking for the template tags function files. Also most plugins/php apps use an includes folder to put all the main crux of the things in. While the main file is just simply a link to all those areas an common functions. If you really can’t find it then just use a program with a “search in files” option and just try and find it that way. I think that is what I did to start with.

    For example when I wanted to find the function yo mention above:
    bbp_reply_author_link( array( 'sep' => '<br />', 'show_role' => false ) );

    I thought about what the function is saying and where in the folder directories of includes it may be. Since it was “reply” related I figured it would be in the reply section. I just used some common sense to figure out the template-tags.php probably containted template specific functions. Then I just did a search on those files until I found the bbp_reply_author_link. Which then calls bbp_get_reply_author_link which in tern as a return value of:

    return apply_filters( 'bbp_get_reply_author_link', $author_link, $r );

    Meaning that you can basically sub in your own functino for this function by using:

    add_filter( 'bbp_get_reply_author_display_name', 'replace_bbpress_replies_username_filter', 10, 2);

    Where replace_bbpress_replies_username_filter is your replacement filter. Then what I mean by following the functions is that i realised that this function was fine. It was the bpp_get_author_display_name that I was unhappy with. And this would be called in many places (presumably). So I overwrote that function. EG:

    
    function replace_bbpress_replies_username_filter($author_name,$reply_id ){
    $author_id = bbp_get_reply_author_id($reply_id);
    $author_object = get_userdata( $author_id );
    $author_name  = ucfirst($author_object->user_login);
    return $author_name;
    }
    add_filter( 'bbp_get_reply_author_display_name', 'replace_bbpress_replies_username_filter', 10, 2);
    

    Does that help? I know it seems daunting but getting into the core files and seeing what they are doing is I have found the best way when you are thinking “what the fuck!”. Also bear in mind I spend about 4 hours yesterday figuring this stuff out (but I didn’t understand filters really until now). Just to help you out futher. The three filters I added were as follows:

    
    add_filter( 'bbp_get_reply_author_display_name', 'replace_bbpress_replies_username_filter', 10, 2);
    add_filter( 'bbp_get_topic_author_display_name', 'replace_bbpress_topic_author_display_name', 10, 2);
    add_filter( 'bbp_get_user_profile_link', 'replace_bbpress_profile_link_text_filter', 10, 2 );
    

    The display name function I have shown you. The topic display name function:

    
    function replace_bbpress_topic_author_display_name( $topic_id = 0 ) {
    		$topic_id = bbp_get_topic_id( $topic_id );
    
    		// Check for anonymous user
    		if ( !bbp_is_topic_anonymous( $topic_id ) ) {
    
    			// Get the author ID
    			$author_id = bbp_get_topic_author_id( $topic_id );
    			$author_name = get_the_author_meta( 'user_login', $author_id );
    
    		// User does not have an account
    		} else {
    			$author_name = get_post_meta( $topic_id, '_bbp_anonymous_name', true);
    		}
    
    		// If nothing could be found anywhere, use Anonymous
    		if ( empty( $author_name ) )
    			$author_name = __( 'Anonymous', 'bbpress' );
    
    		// Encode possible UTF8 display names
    		if ( seems_utf8( $author_name ) === false )
    			$author_name = utf8_encode( $author_name );
    
    		return $author_name;
    }

    And for the profile link:

    
    function replace_bbpress_profile_link_text_filter($user_link, $user_id){
    		// Validate user id
    		$user_id = bbp_get_user_id( $user_id );
    		$user_object = get_userdata( $author_id );
    		$user_name  = ucfirst($author_object->user_login);
    		if ( empty( $user_id ) )
    			return false;
    
    		$user      = get_userdata( $user_id );
    		$name      = esc_attr( $user_name );
    		$user_link = '<a href="' . bbp_get_user_profile_url( $user_id ) . '" title="' . $name . '">' . $name . '</a>';
    }

    I also changed the default wordpress “get_avatar” function because it returns the gravatar users real name as the alt attr. All you really have to do it replace the function with the same function but get the users login name and replace the alt text name with that. the function is big and I don’t wanna make this post any more ridiculous.

    It’s cool to be the one giving the answers on a WordPress forum! I only really have learned this stuff in the last few months myself. I am more of a Drupal guy. Shock Horror.

    Cheers!

    #139623

    In reply to: Lost Formatting

    FreeWPress
    Participant

    Hi, if you have update to 2.5 versions you can find other topics with this issue.. There is a patch.. problem is this:

    <link rel='stylesheet' id='bbp-default-css' href='http://qtippoker.com/wp-content/D:Hosting4710742htmlwp-contentpluginsbbpress/templates/default/css/bbpress.css?ver=2.5-5199' type='text/css' media='screen' />

    Your theme can’t find bbpress css…

    #139582
    Matoca
    Participant

    Thank you for you extreme patience with me.

    So am I not supposed to be seeing the Visual Tab inside the forum Topic and Replies now that this recommended plugin is installed? This is from the read me file for bbPress Enable Tinymce-visual-tab:
    “Enabling the full default TinyMCE editor mode will display all the buttons, similar to the editor inside the WordPress admin.” I guess I expected to see this.

    Ok, this gets more complex doesn’t it… Another plug in, I will have to look and see what could be doing this. This function of editing user’s image dimensions in topics right in the forum pages was super for the moderators. They are leery of always using the dashboard to do everything and this made it a simple task. Isn’t it always hard to go backwards…

    The Add Media button information came from the Read Me file for bbPress Enable Tinymce-visual-tab:
    “Enabling the media upload button, “Add Media”, will only enable this button for users who have the ability to upload files. By default this is authors and greater. This means this button will _not_ show for normal forum users. This is simply to give administrators the ability to easily upload and insert images into bbPress.”

    I am giving 4 moderators admin and keymaster privileges to add images to posts, delete spam etc. The forum is being run with no registration required, my choice. The topic and reply traffic has been considerable and this is only a hidden test site by invitation only at this point. I had many choices to pick from for forums, and we definitely agreed we did not want to be using FB or yahoo. So far bbPress has been perfect for this. But the plugin problems have been greater than normal this week.
    Thank you for your help,
    Patrice

    #139572
    justsayno1
    Participant

    Hi,

    I am in the same situation and I have found a solution. You can apply filters to almost every function in bbpress it seems. I just followed the functions until I found these three filters:

    apply_filters( 'bbp_get_user_profile_link', $user_link, $user_id );
    apply_filters( 'bbp_get_reply_author_display_name', $author_name, $reply_id )
    apply_filters( 'bbp_get_topic_author_link', $author_link, $args );
    

    Using these you can change basically everything. I found it easier to change the avatar ALT text vie the normal wordpress get_avatar filter since I wanted that to happen site wide anyway. Here is an example of the reply filter:

    
    function replace_bbpress_replies_username_filter($author_name,$reply_id ){
    $author_id = bbp_get_reply_author_id($reply_id);
    $author_object = get_userdata( $author_id );
    $author_name  = ucfirst($author_object->user_login);
    return $author_name;
    }
    add_filter( 'bbp_get_reply_author_display_name','replace_bbpress_replies_username_filter',10, 2);
    

    Hope that helps. You can do it through templating but this way you don’t have to worry about doing it in a million different templates and then also dealing the layout of the markup you use to replace the current markup. And if filters confuse you and you don’t understand go read this:

    http://dev.themeblvd.com/tutorial/filters/

    I had zero knowledge of how to do filters when I read this thread 16 hours ago and decided to not go the route the above person mentioned.

    EDIT: I thought I’d add that they really could make this a lot easier with very little effort and make it so that you could configure what to use as a display name…. If anyone reads this from bbPress I’d be happy to get involved and do it for them. Seems so dumb to default to make it peoples full names when 90% people don’t want that. That is what facebook, G+ etc is for.

    #139559

    In reply to: Stylesheet Issues

    focallocal
    Participant

    i’m making all changes live to my site as i havent launched yet (hopefully in 2 days) and my hosting companies servers are running Litespeed.

    <link rel=’stylesheet’ id=’bbp-default-css’ href=’http://focallocal.org/wp-content/plugins/bbpress/templates/default/css/bbpress.css?ver=2.5-5199&#8242; type=’text/css’ media=’screen’ />

    #139557

    In reply to: Stylesheet Issues

    Stephen Edgar
    Keymaster

    It looks like you have patched the file correctly.

    Can you view the source and get the stylesheet path and paste it here:

    eg.
    A ‘failed’ example
    <link rel="stylesheet" id="bbp-default-css" href="http://localhost/wordpress37/wp-content/C:devhtdocswordpress37wp-contentpluginsbbpress/templates/default/css/bbpress.css?ver=2.5-5199" type="text/css" media="screen">

    A ‘working’ example:
    <link rel='stylesheet' id='bbp-default-css' href='http://127.0.0.1/wp-content/plugins/bbpress/templates/default/css/bbpress.css?ver=2.5-5199' type='text/css' media='screen' />

    #139551

    In reply to: Stylesheet Issues

    focallocal
    Participant
    function bbp_enqueue_style( $handle = '', $file = '', $dependencies = array(), $version = false, $media = 'all' ) {
    
    	// No file found yet
    	$located = false;
    
    	// Trim off any slashes from the template name
    	$file = ltrim( $file, '/' );
    
    	// Make sure there is always a version
    	if ( empty( $version ) ) {
    		$version = bbp_get_version();
    	}
    
    	// Loop through template stack
    	foreach ( (array) bbp_get_template_stack() as $template_location ) {
    
    		// Continue if $template_location is empty
    		if ( empty( $template_location ) ) {
    			continue;
    		}
    
    		// Check child theme first
    		if ( file_exists( trailingslashit( $template_location ) . $file ) ) {
    			$located = trailingslashit( $template_location ) . $file;
    			break;
    		}
    	}
    
    	// Enqueue if located
    	if ( !empty( $located ) ) {
    
                    $content_dir = constant( 'WP_CONTENT_DIR' );
    
                    // IIS (Windows) here
                    // Replace back slashes with forward slash
                    if ( strpos( $located, '\\' ) !== false ) {
                            $located     = str_replace( '\\', '/', $located );
                            $content_dir = str_replace( '\\', '/', $content_dir );
                    }
    
    		// Make path to file relative to site URL
    		$located = str_replace( $content_dir, WP_CONTENT_URL, $located );
    
    		// Enqueue the style
    		wp_enqueue_style( $handle, $located, $dependencies, $version, $media );
    	}
    
    	return $located;
    }
    
    /**
     * Enqueue a script from the highest priority location in the template stack.
     *
     * Registers the style if file provided (does NOT overwrite) and enqueues.
     *
     * @since bbPress (r5180)
     *
     * @param string      $handle    Name of the script.
     * @param string|bool $file      Relative path to the script. Example: '/js/myscript.js'.
     * @param array       $deps      An array of registered handles this script depends on. Default empty array.
     * @param string|bool $ver       Optional. String specifying the script version number, if it has one. This parameter
     *                               is used to ensure that the correct version is sent to the client regardless of caching,
     *                               and so should be included if a version number is available and makes sense for the script.
     * @param bool        $in_footer Optional. Whether to enqueue the script before </head> or before </body>.
     *                               Default 'false'. Accepts 'false' or 'true'.
     *
     * @return string The script filename if one is located.
     */
    function bbp_enqueue_script( $handle = '', $file = '', $dependencies = array(), $version = false, $in_footer = 'all' ) {
    
    	// No file found yet
    	$located = false;
    
    	// Trim off any slashes from the template name
    	$file = ltrim( $file, '/' );
    
    	// Make sure there is always a version
    	if ( empty( $version ) ) {
    		$version = bbp_get_version();
    	}
    
    	// Loop through template stack
    	foreach ( (array) bbp_get_template_stack() as $template_location ) {
    
    		// Continue if $template_location is empty
    		if ( empty( $template_location ) ) {
    			continue;
    		}
    
    		// Check child theme first
    		if ( file_exists( trailingslashit( $template_location ) . $file ) ) {
    			$located = trailingslashit( $template_location ) . $file;
    			break;
    		}
    	}
    
    	// Enqueue if located
    	if ( !empty( $located ) ) {
    
    				$content_dir = constant( 'WP_CONTENT_DIR' ); 	 
    		                // IIS (Windows) here 
     		                // Replace back slashes with forward slash 
     		                if ( strpos( $located, '\\' ) !== false ) { 
     		                        $located     = str_replace( '\\', '/', $located ); 
     		                        $content_dir = str_replace( '\\', '/', $content_dir ); 
     		                } 
    
    		// Make path to file relative to site URL
    		$located = str_replace( $content_dir, WP_CONTENT_URL, $located );
    
    		// Enqueue the style
    		wp_enqueue_script( $handle, $located, $dependencies, $version, $in_footer );
    	}
    
    	return $located;
    }
    
    /**
     * This is really cool. This function
    #139533

    hi Stephen, I am using Window Xampp Apache (3.1.0.3.1.0). I guess that I am not using Window IIS.
    more information as the following base on the research.

    I installed bbpress & buddypress on my site which has pitch theme. I suspect this could be from my theme formatting the bbpress forums this way.the pitch theme is working perfectly. I created a page which is called “Forums”(forum index page). I chose the default template. My forum index page is just a bunch of bullet points listing each text for the topics

    example:
    —-
    Forum
    Topics
    Posts
    Freshness

    Group Forums
    group one (2, 0)
    2
    2
    41 minutes ago
    Avatar of admin admin

    not group forum
    cool
    0
    0
    No Topics
    ———–

    I also asked that Pitch theme is compatibly with bbpress and buddypress or not.

    Thank you

    #139532

    In reply to: Stylesheet Issues

    Tadas Krivickas
    Participant

    Hi,

    This is definitely a bug in bbp 2.5 on Windows. 2.4.1 does not have this issue. You can reproduce it by reverting to 2.4.1 (works again) -> update to 2.5 (doesn’t work again).

    <link rel="stylesheet" id="bbp-default-css" href="http://localhost/wordpress37/wp-content/C:devhtdocswordpress37wp-contentpluginsbbpress/templates/default/css/bbpress.css?ver=2.5-5199" type="text/css" media="screen">

    Windows 7 x64, httpd+php+mysqld, latest stable WP, BP, BBP

    #139492
    Bright Thought, LLC
    Participant

    After I updated bbpress to version 2.5 the stylesheet for the default theme is not being linked correctly.

    <link rel=’stylesheet’ id=’bbp-default-css’ href=’http://localhost/wordpress/almostaveragegamers/wp-content/C:xampphtdocswordpresswp-contentpluginsbbpress/templates/default/css/bbpress.css?ver=2.5-5199&#8242; type=’text/css’ media=’screen’ />

    This is the way that the link is showing up when I look at the source code for the site which I am designing on a local host server. When I click on the link to see what is displayed this is what it is showing me below.

    https://www.dropbox.com/s/3as5djr6w0m2b0a/error-message.jpg

    #139482

    Hello,
    I just installed bbpress on my site. I created a page which is called “Forums”. I chose the default template. Every thing is working except the display is not organized as the plan.
    —-
    Forum
    Topics
    Posts
    Freshness

    Group Forums
    group one (2, 0)
    2
    2
    41 minutes ago
    Avatar of admin admin

    not group forum
    cool
    0
    0
    No Topics
    ———–

    how to organize the display as following or better? ( not display in vertically orders)
    Forum Topics posts Freshness/minutes

    thank you

    #139451
    PureLoneWolf
    Participant

    Hi there

    I upgraded to 2.5 this morning and, after noticing that some of my users were not assigned the participant role, ran the tool to remap users to default roles.

    This had the unfortunate side-effect of setting both of my administrator accounts to Participant, and removed all Dashboard related links to bbpress.

    In users, when I choose “Change Forum Role to” at the top of the user list, the highest level is moderator. Keymaster is no longer there.

    Am I missing something?

    I tried, in PHPMyAdmin, to change the wp_capabilities table from a:3:{s:13:"administrator";b:1;s:14:"backwpup_admin";b:1;s:15:"bbp_participant";b:1;} to a:3:{s:13:"administrator";b:1;s:14:"backwpup_admin";b:1;s:15:"bbp_keymaster";b:1;} after looking at a few posts on here. But that actually stopped access to the site until I changed it back.

    Can anyone help?

    Thanks

    roeller
    Participant

    After the upgrade to 2.5 there are CSS errors because the include is broken! The cause is that the programmers didn’t thought about people hosting WordPresss (and bbpress) on Windows platforms. (Windows uses a different slash and different directory root/paths).

    I’m hoping for a 2.5.1 fix 😉

    ERRORS:
    =======

    Failed to load resource: the server responded with a status of 404 (Not Found) http://www.XXXXXXX.com/wordpress/wp-content/E:inetpubwwwrootXXXXXXX…esswp-contentpluginsbbpress/templates/default/css/bbpress.css?ver=2.5-5199

    AND

    Failed to load resource: the server responded with a status of 404 (Not Found) http://www.XXXXXXX.com/wordpress/wp-content/E:inetpubwwwrootXXXXXXX…dpresswp-contentpluginsbbpress/templates/default/js/editor.js?ver=2.5-5199

    Note that the slashes are missing from the ‘plugin_dir’ part.

    I think the problem is within the “private function setup_globals” of the bbpress.php file or the “public function __construct” of the bbpress-functions.php file.

    (masked my directory and sitename with XXXXXXX)

    #139409

    In reply to: bbPress 2.5 is out!

    roeller
    Participant

    After the upgrade to 2.5 there are CSS errors because the include is broken! The cause is that the programmers didn’t thought about people hosting WordPresss (and bbpress) on Windows platforms. (Windows uses a different slash and different directory root/paths).

    See my other topic about this. I’m hoping for a 2.5.1 fix 😉

    ERRORS:
    =======

    Failed to load resource: the server responded with a status of 404 (Not Found) http://www.XXXXXXX.com/wordpress/wp-content/E:inetpubwwwrootXXXXXXX…esswp-contentpluginsbbpress/templates/default/css/bbpress.css?ver=2.5-5199

    AND

    Failed to load resource: the server responded with a status of 404 (Not Found) http://www.XXXXXXX.com/wordpress/wp-content/E:inetpubwwwrootXXXXXXX…dpresswp-contentpluginsbbpress/templates/default/js/editor.js?ver=2.5-5199

    Note that the slashes are missing from the ‘plugin_dir’ part.

    I think the problem is within the “private function setup_globals” of the bbpress.php file or the “public function __construct” of the bbpress-functions.php file.

    (masked my directory and sitename with XXXXXXX)

    #139360
    Robin W
    Moderator

    This may look a bit messy but without spending a lot of time

    In loop-single-reply.php (wp-content/plugins/bbpress/templates/default/bbpress)

    change line 45 which uses bbp_reply_author_link

    and use

    bbp_get_reply_author_avatarto display the avatar and

    bbp_get_reply_author_id
    to get the id – you’ll then need to play with maybe

    bbp_get_reply_author()
    putting the id in the brackets

    eg bbp_get_reply_author(bbp_get_reply_author_id )

    should give you the username rather than display name

    you’d then need to play with

    content-single-topic.php for the forum lists (wp-content/plugins/bbpress/templates/default/bbpress)

    #139337
    bigjakk
    Participant

    I have created two categories with forums beneath the categories. However the forum root does not display any of this. I am only able to go to each category by the direct link. Forum link is
    https://birdseyeminecraft.us/wordpress/wordpress

    This is still in development so excuse the sloppiness of it. Are categories in a different root the then the default one? if so where can i find it?

    #139302

    In reply to: SMF Import to bbPress

    Stephen Edgar
    Keymaster

    You should see Starting conversion in seconds.
    Next Converting users in another second if your converting your users.
    Next ‘Converting forums` in seconds if not converting users.

    By default everything is done in chunks of 100 records and this should never really take much longer than 5 seconds per chunk at which point you will see the converter message progress to Converting topics 300 - 399 then Converting topics 400 - 499 etc, you should never be far away from a new message informing you of the status of the import.

    I’ll try to get some more docs into the ‘import screen’ for bbPress 2.5 to give people a heads up on what they should expect to see.

    As you are on a dedicated server this topic might be worth checking out on ‘speeding it up’

    phpBB Import speed

    Firstly though lets get it started…

    Via FTP grab a copy of your SMF Settings.php file and open it up in a text editor.
    /public_html/mywebsite/smf/Settings.php

    In that file something that looks like this:

    ########## Database Info ##########
    $db_type = 'mysql';
    $db_server = 'localhost';
    $db_name = 'mydb_name';
    $db_user = 'mydb_usernam';
    $db_passwd = '123456789';
    $ssi_db_user = '';
    $ssi_db_passwd = '';
    $db_prefix = 'smf_';

    These are the settings you need to use on the bbPress importer.

    ps. Thanks @manuxel for helping others out here with the SMF importer 🙂

    #139292
    mizzinc
    Participant

    Hello,

    I would like to know the correct method to add a filter in a child theme for a template function.

    For this example lets use ‘bbp_get_user_subscribe_link()’

    I would like to insert

    <icon class="icon-user"></i>

    into the following before the %s

    <span id="subscribe-%d"  %s>%s
    $html = sprintf( '%s<span id="subscribe-%d"  %s>%s</span>%s', $r['before'], $topic_id, $sub, $url, $topic_id, $text, $r['after'] );
    

    of this function bbp_get_user_subscribe_link()

    	function bbp_get_user_subscribe_link( $args = '', $user_id = 0, $wrap = true ) {
    		if ( !bbp_is_subscriptions_active() )
    			return;
    
    		// Parse arguments against default values
    		$r = bbp_parse_args( $args, array(
    			'subscribe'   => __( 'Subscribe',   'bbpress' ),
    			'unsubscribe' => __( 'Unsubscribe', 'bbpress' ),
    			'user_id'     => 0,
    			'topic_id'    => 0,
    			'before'      => ' | ',
    			'after'       => ''
    		), 'get_user_subscribe_link' );
    
    		// Validate user and topic ID's
    		$user_id  = bbp_get_user_id( $r['user_id'], true, true );
    		$topic_id = bbp_get_topic_id( $r['topic_id'] );
    		if ( empty( $user_id ) || empty( $topic_id ) ) {
    			return false;
    		}
    
    		// No link if you can't edit yourself
    		if ( !current_user_can( 'edit_user', (int) $user_id ) ) {
    			return false;
    		}
    
    		// Decide which link to show
    		$is_subscribed = bbp_is_user_subscribed( $user_id, $topic_id );
    		if ( !empty( $is_subscribed ) ) {
    			$text       = $r['unsubscribe'];
    			$query_args = array( 'action' => 'bbp_unsubscribe', 'topic_id' => $topic_id );
    		} else {
    			$text       = $r['subscribe'];
    			$query_args = array( 'action' => 'bbp_subscribe', 'topic_id' => $topic_id );
    		}
    
    		// Create the link based where the user is and if the user is
    		// subscribed already
    		if ( bbp_is_subscriptions() ) {
    			$permalink = bbp_get_subscriptions_permalink( $user_id );
    		} elseif ( bbp_is_single_topic() || bbp_is_single_reply() ) {
    			$permalink = bbp_get_topic_permalink( $topic_id );
    		} else {
    			$permalink = get_permalink();
    		}
    
    		$url  = esc_url( wp_nonce_url( add_query_arg( $query_args, $permalink ), 'toggle-subscription_' . $topic_id ) );
    		$sub  = $is_subscribed ? ' class="is-subscribed"' : '';
    		$html = sprintf( '%s<span id="subscribe-%d"  %s>%s</span>%s', $r['before'], $topic_id, $sub, $url, $topic_id, $text, $r['after'] );
    
    		// Initial output is wrapped in a span, ajax output is hooked to this
    		if ( !empty( $wrap ) ) {
    			$html = '<span id="subscription-toggle">' . $html . '</span>';
    		}
    
    		// Return the link
    		return apply_filters( 'bbp_get_user_subscribe_link', $html, $r, $user_id, $topic_id );
    	}
    

    So how would I construct my_custom_bbp_get_user_subscribe_link() function to add_filter( ‘bbp_get_user_subscribe_link’, ‘my_custom_bbp_get_user_subscribe_link’ ); ?

    I hope the answer will serve as a general example to correctly add filters to many other template functions.

    Thanks for your assistance.

    #139276
    Anonymous User 8097816
    Inactive

    Hello,

    As part of a project for a forum in French which will be online soon, I completed the translation in French of bbPress and I improved (at least I hope) many strings already translated so that they are more true to the original english meaning and context.

    I’m entering the translations one by one on translate.wordpress.org/projects/bbpress/2.4.x/fr/default and I would like to discuss with the french translation team about a number of aspects of the project, eg nomenclature, accents, etc.

    Thank you and good day.

    #139252
    cjcampbell121
    Participant

    When looking at the settings, I see that I can “customize” the forum index with shortcodes. I did that, and when its just its own page, then it works. When I try and change the settings to display that page as the forum index, it overwrites it with a weird looking search result instead of the index.

    All I want it to do is to display the forums that I have, and to be the forum link that is displayed when you go into a topic.

    Here is the default root:

    Here is the page with the shortcode (and not yet assigned to the forum root):

    Here is the forum root changed (with the same page):

    #139240
    shearamariz
    Participant

    nice. Thanks @ozgurpolat for that. I actually inserted it in my child theme and no core was changed even I update it. Hope it helps you too. 🙂

Viewing 25 results - 3,501 through 3,525 (of 6,759 total)
Skip to toolbar