Forum Replies Created

Viewing 15 replies - 226 through 240 (of 407 total)
  • It’s about the same amount of work either way. You basically just save one conditional check (if not logged in). The rest of the code would be the same. It would have to be done with a hook and find/replace function like I described in order for it to have backward compatibility with all past and future quotes, which also gives you the flexibility of being able to change what users see without changing the actual saved content.

    I see the value in this option, and that many others may use it besides just you, so tell you what…. I’m releasing an update within the next few days. I will add an option for this. You will be able to choose:

    1.) Display profile links within quotes for everyone.

    2.) Display profile links within quotes only for logged-in users.

    3.) Disable profile links within quotes for everyone.

    I was the last one to make changes to the quotes so it’s still fresh in my mind, and hopefully I can answer your question.

    Simple answer – No, there is no way to accomplish that.

    Simple explanation – The quotes are included within the reply content as if it were part of the reply content.

    This is default bbPress behavior. Style Pack just expands upon that default behavior to provide more quote options, better styling, and integration of quotes within both editors.

    How those user profile links are handled is based upon your profile settings. If user profiles are public, guest users will be allowed to access the user profiles from that link. If user profiles are private, guest users will be prompted to login to access any user profile.

    If guest users can access user profiles, but you don’t want them to, just change your user profile settings to private.

    It sounds like you’re asking how to hide/disable those links completely for guest users, overriding the default bbPress behavior.

    That is possible by using a hook for the content, and doing str_replace() or preg_replace() for every URL that matches a pattern for your user profiles, and only doing so for guest users. A bit beyond any current plans for Style Pack at the moment, but if that is what you want, I can give you a code snippet to get you started that you could alter for your purposes. Let me know.

    I considered it a “must have” due to the super long tabs, and especially the long tabs with numbered descriptive pictures at the top.

    Marking as resolved…..but I will add more descriptive wording next release, and keep that in mind for other new features in future releases as well 😉

    @ajtruckle – I will add additional details for it in the next release.

    It is pretty standardized.

    When you scroll away from the top of the settings page, a button appears in the bottom right. Click that to automatically scroll back to the top.

    It applies to the admin page, since some of the tabs are super long.

    There is no “scroll to top” functionality added to bbPress on the front-end, but that could be added if people request it and will use it.

    • This reply was modified 3 years, 1 month ago by codejp3.
    Thread Starter codejp3

    (@codejp3)

    @robin-w – Got it at ALL of the email addresses…. but there was an extreme delay. The one sent to [email protected] and auto-forwarded to my server arrived yesterday. The other addresses received the duplicate email today.

    Thread Starter codejp3

    (@codejp3)

    @cj74 – finally got a chance to check it out. Looks 100% good-to-go as far as I can tell. I wish there was a built-in bbPress option for this, but it’s not common enough to justify it I guess.

    I’ve considered writing custom code that asks you for the desired slug for the new “fake forum root index” and then automatically does all of the other steps….but it’s a lot of work for something only a handful of people would ever use. Maybe one day….but sticking to things that MOST people would put to use for now.

    @robin-w – email sent with multiple emails. Worst case, you should always be able to send emails to [email protected]. It should never bounce/reject any emails. It only filters spammy emails before forwarding on to my email server.

    • This reply was modified 3 years, 2 months ago by codejp3. Reason: fixed typos
    Thread Starter codejp3

    (@codejp3)

    One issue I see.

    The nav menu item points to /forum (singular) , not /forums (plural).

    It should be /forums , which is the slug decided on in Step 1, the slug of the page with bbp shortcode, and what all of the other instructions are setup to use.

    Having a page with the slug /forum WILL CONFLICT with the bbPress slug for single forum which is also “forum” (singular).

    Checking the url for https://yoursite.com/forums still shows the auto-embedded bbPress forum root index above the bbp shortcode. Again, this indicates that the slug for forum root index is still set to “forums” when it should be “bbpress-forums”.

    What you have is functional, but not correct. the slug “forum” (singular) should only be used for a forum single slug (Step #5), not a page.

    The instructions specifically setup “forums” (plural) as the base slug for all things related to forums, and the page with the “forums” (plural) slug and bbp shortcode is intended to be used as the new “fake forum root index”. The page you link to in the nav menu should also use that plural slug (Step #3), and the bbPress forum root slug should NO LONGER use that plural slug. (Step #4).

    I have to step away from the computer for a few hours and won’t be able to help. I hope I explained the issue well enough for you to resolve it.

    • This reply was modified 3 years, 2 months ago by codejp3.
    Thread Starter codejp3

    (@codejp3)

    Alright, I was trying to keep the instructions generic that anyone could apply to their site, but it seems to be a little too generic for you to be successful with them. Here’s step-by-step, with your site as it is right now:

    Step 1.) Your new “fake forum root index” slug:
    forums

    Step 2.) You already have a page setup with the slug “forums” and the bbp shortcode, so you’re good-to-go. Nothing to do for this step.

    Step 3.) You need to make sure the “Forum” menu item in the nav menu points to the page from step #2. Link directly to that page. Do not use a generic custom URL.

    Step 4.) In /wp-admin/options-general.php?page=bbpress scroll to the “Forum Root Slug” options, and make sure “Prefix all forum content with the Forum Root slug (Recommended)” is NOT checked. 

    Also change the slug for “Forum Root” to something different like: “bbpress-forums”. It will no longer be used, but we still want to change it to something distinctly unique to prevent conflicts of any kind and to make it stand out if it ever accidentally shows up in breadcrumbs/URL strings for easy future debugging reasons.

    Step 5.) In the “Forum Single Slugs” section just below that, setup the following permalink slugs:

    Forum - 	forum
    Topic - 	forums/topic
    Topic Tag - 	forums/topic-tag
    Topic View - 	forums/view
    Reply - 	forums/reply
    Edit - 		forums/edit
    Search - 	forums/search

    We’re just adding “forums/” in-front of each slug to override the default bbPress behavior. ONE EXCEPTION – “Forum” is intentionally unmodified and the slug remains “forum” so that we can handle it specifically for breadcrumb/URL reasons (taken care of below in step #8).

    Step 6.) Do the same thing in the “Forum User Slugs” section below that. New values:

    User Base - 		forums/users
    Topics Started - 	forums/topics
    Replies Created -	forums/replies
    Favorite Topics - 	forums/favorites
    Subscriptions - 	forums/engagements

    Just add “forums/” in-front of the existing slugs.

    Step 7.) Now customize the breadcrumbs using Style Pack. Go to /wp-
    admin/options-general.php?page=bbp-style-pack&tab=breadcrumb and scroll down to #2 “Breadcrumb Root” and make sure “Disable Root breadcrumbs” IS CHECKED. We don’t want the default bbPress forum root index within the URL structure anymore, and this will remove it from the breadcrumbs.

    Step 8.) Add this (pre-modified for YOUR SITE @cj74 ) code snippet to your site with either the Code Snippets plugin (preferred), or to your proper child theme functions.php file.

    // function to handle custom redirection for single forum permalinks
    // needed to remove default bbPress forum root index and use custom "fake" forum root index
    function custom_single_forum_redirect() {
    	
    	
    		/*
    		 * Setup Variables. Should be the only part of this code you need to modify
    		 */
    		$original_forum_index_slug = 'forums';
    		$original_single_forum_slug = 'main-forum';
    		$new_slug = 'forums';
    		$single_forum_slug_base = bbp_get_forum_slug();
    		$redirect_old_forum_root_index = false;
    	
    	
    		/* DO NOT MODIFY ANYTHING BELOW THIS LINE UNLESS YOU HAVE A REASON AND KNOW WHAT YOU'RE DOING! */
    	
    		// only do this code if on the frontend of the site
    		if ( ! is_admin() ) {
    
    				// let's dissect and check the requested URL
    				if ( isset( $_SERVER['HTTP_HOST'] ) && isset( $_SERVER['REQUEST_URI'] ) ) {
    					
    						// does the URL request start with the single forum permalink slug and the only single forum slug? 
    						// we want to redirect /forum/slug-for-the-one-and-only-single-forum to /forums
    						if ( strpos( $_SERVER['REQUEST_URI'], '/' . $single_forum_slug_base . '/' . $original_single_forum_slug ) === 0 ) {
    								// set redirect flag to true so we do a redirect
    								$redirect = true;
    								// build out new URL to redirect to
    								$redirect_url = is_ssl() ? 'https://' : 'http://';
    								$redirect_url .= $_SERVER['HTTP_HOST'];
    								$redirect_url .= str_replace( '/' . $single_forum_slug_base . '/' . $original_single_forum_slug, '/' . $new_slug, $_SERVER['REQUEST_URI'] );
    								wp_redirect( $redirect_url, 301 );
    								exit();
    						}
    					
    						// does the URL request start with the old forum index slug and single forum permalink slug and the only single forum slug? 
    						// we want to redirect old /forums/forum/slug-for-the-one-and-only-single-forum to /forums
    						if ( strpos( $_SERVER['REQUEST_URI'], '/' . $original_forum_index_slug . '/' . $single_forum_slug_base . '/' . $original_single_forum_slug ) === 0 ) {
    								// set redirect flag to true so we do a redirect
    								$redirect = true;
    								// build out new URL to redirect to
    								$redirect_url = is_ssl() ? 'https://' : 'http://';
    								$redirect_url .= $_SERVER['HTTP_HOST'];
    								$redirect_url .= str_replace( '/' . $original_forum_index_slug . '/' . $single_forum_slug_base . '/' . $original_single_forum_slug, '/' . $new_slug, $_SERVER['REQUEST_URI'] );
    								wp_redirect( $redirect_url, 301 );
    								exit();
    						}
    					
    						// handle redirects for the old forum root index, but only if flag set to true and the original/new slugs do not match
    						if ( ( $redirect_old_forum_root_index === true ) && ( $original_forum_index_slug !== $new_slug ) ) {
    								// does the URL request start with the old forum root index slug? 
    								// we want to redirect /old-forum-root-index-slug to /forums
    								if ( strpos( $_SERVER['REQUEST_URI'], '/' . $original_forum_index_slug ) === 0 ) {
    										// set redirect flag to true so we do a redirect
    										$redirect = true;
    										// build out new URL to redirect to
    										$redirect_url = is_ssl() ? 'https://' : 'http://';
    										$redirect_url .= $_SERVER['HTTP_HOST'];
    										$redirect_url .= str_replace( '/' . $original_forum_index_slug, '/' . $new_slug, $_SERVER['REQUEST_URI'] );
    										wp_redirect( $redirect_url, 301 );
    										exit();
    								}
    						}
    					
    				}
    			
    		}
    }
    
    // hook into init to process redirection before header
    add_action( 'init', 'custom_single_forum_redirect' );

    Step 9.) For good measure, navigate to /wp-admin/options-permalink.php and click “save” to force a regeneration of permalinks.

    DONE!

    Thread Starter codejp3

    (@codejp3)

    Just viewed your site. The URL https://yoursite.com/forums/ is CLEARLY pointing to a custom PAGE that uses the slug “forums” and has the [bbp-single-forum id=XX] shortcode. THAT’S WHAT YOU WANT! THAT’S THE PAGE YOU LINK TO IN STEP #3 IN YOUR MENU NAV.

    DELETE ANY OTHER PAGES YOU HAVE SETUP RELATED TO FORUMS SINCE THEY ARE IRRELEVANT, UNUSED, AND JUST CAUSE CONFUSION!

    Since the default bbPress forum root index is still being auto-embeded into that page, it indicates that you did not change the bbPress forum root slug as instructed in Step 4.

    Step 4.) Change default bbPress forum root index slug options

    Then in /wp-admin/options-general.php?page=bbpress scroll to the “Forum Root Slug” options, and make sure “Prefix all forum content with the Forum Root slug (Recommended)” is NOT checked. 

    Also change the slug for “Forum Root” to something different like: “bbpress-forums”. It will no longer be used, but we still want to change it to something distinctly unique to prevent conflicts of any kind and to make it stand out if it ever accidentally shows up in breadcrumbs/URL strings for easy future debugging reasons.

    If are absolutely certain that the forum root slug has been changed from “forums” to “bbpress-forums”, then navigate to /wp-admin/options-permalink.php and click “save” to force a regeneration of permalinks.

    Thread Starter codejp3

    (@codejp3)

    I am having problems locating the slug. Is it under “settings” of the admin dashboard?

    Edit : The only slug being used at this point is “forums” as you have suggested. Should i match that?

    No. This is the slug to the actual one-and-only forum you have setup in bbPress.

    When I last viewed your site, it had the title “General Forum” and the slug “main-forum”.

    If that is still the case, you want to change ‘slug-for-the-one-and-only-single-forum’ to ‘main-forum’.

    You can verify this by going to /wp-admin/edit.php?post_type=forum, clicking on the one-and-only forum you have as if you were going to edit it, and view the slug value it shows on that edit page.

    Thread Starter codejp3

    (@codejp3)

    except it is adding ‘forums-3/’ after the

    https://yoursite.com/forums/ in step 3)

    That means you have 3 other pages using the slug “forums” that need to be removed/deleted/changed. The ONLY page using the slug “forums” should be the one you created/altered for use in Step 2.

    Slugs have to be unique and used only once! When slugs are duplicated, the # is automatically appended to the end for each new duplicate.

    No way to fix that except make sure that only ONE page (the one you created in Step 2) is using the slug “forums”. All others need to be deleted or changed so that they use a different slug.

    Once you remove all of the other ones, edit the slug for the page you created in Step 2 and remove the “-3” part for the slug so that it’s just “forums”.

    Thread Starter codejp3

    (@codejp3)

    The code snippet in that link remains the same.

    I included a list of changes to apply, but they don’t seem to be in that post….hmm. Strange.

    Here’s the changes to make to that code snippet:

    1.) Change that value for “$original_forum_index_slug”to match the actual original slug of the bbPress forum root ( the original slug before it was changed in Step 4 – default value is: forums ).

    2.) Change the value for “$original_single_forum_slug” to match the actual slug of the one-and-only single forum you’re setting up to act as the new fake forum root. If you don’t know what that slug is, you can find it at /wp-admin/edit.php?post_type=forum

    3.) Change the value for “$new_slug” to match the slug you decided on in step #1 above and have been using throughout all of these steps.

    4.) Do not change the value for “$single_forum_slug_base”. It is auto-poluated using a bbPress function.

    5.) Leave “$redirect_old_forum_root_index” as false if your forum is private (requires logging in) and is not accessible to search engines. Change “$redirect_old_forum_root_index” to true if your forum is publicly accessible (no login required) and has been indexed by search engines.

    Thread Starter codejp3

    (@codejp3)

    Sorry, i couldn’t edit the code in that post.

    Use the follow-up update code directly in the post below. It fixed that typo and one other issue:

    https://ww.wp.xz.cn/support/topic/interesting-dilemma-single-forum-as-forum-root-index/#post-16590467

    Thread Starter codejp3

    (@codejp3)

    Baby steps is the wrong approach. It’s kinda “all or nothing”.

    Set it to maintenance mode.

    Make a backup of your site as it is.

    Apply all of these changes.

    Test it thoroughly to make sure it works as expected.

    If it works as expected, keep the changes, make another backup with the new changes applied, and take it out of maint. mode to go live with the new changes applied.

    If it doesn’t work as expected, take detailed notes about the issue, start a support topic, and then reapply the saved backup prior to the changes so your users don’t experience unnecessary downtime/issues.

    Thread Starter codejp3

    (@codejp3)

    Yes and no.

    Yes, these instructions would not work as they are because they assume you only have 1 forum, and that you want to replace the default bbPress forum root index with that single forum.

    No, because you could essentially just add a [bbp-single-forum id=XX] shortcode to the page you create in Step #2 for the user forum category to also show the user-created forums below the General Forum on the same page. Or, you could use steps 1, 2, 3, 8 & 9 to create a separate page for that, and have “two fake forum root indexes” – one for the main forum and one for the user forums.

Viewing 15 replies - 226 through 240 (of 407 total)