Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 626 through 650 (of 32,295 total)
  • Author
    Search Results
  • #234498
    DeepBlue
    Participant

    Hi
    Another solution
    add to your css :

    form.bbp-login-form {
        display: none!important;
    }
    #234490
    valarcher
    Participant

    Wow that seems like a complex solution to something that the codex says is a simple checkmark next to Settings > Forums > Forum Features

    #234489
    Robin W
    Moderator

    please post the code you are using

    #234487
    wpturk
    Participant

    Hi, you can put this in your functions.php to fix the problem:

    if( !function_exists( 'bbpress_browser_supports_js' ) ){
            function bbpress_browser_supports_js() {
                    echo '<script>document.body.classList.remove("no-js");</script>';
            }
            add_action( 'wp_footer', 'bbpress_browser_supports_js' );
    }
    wpturk
    Participant

    This is the good part of bbpress. You don’t have hundreds of features you don’t need. As you mentioned, everything you need can be added via plugins or code customizations. (functions.php)

    Maybe, you can tell us which features you are missing? For example you can check the plugin “GD bbPress Toolbox” which adds many features to your bbpress forum.

    #234457

    In reply to: subsciption problem

    nobody
    Participant

    the problem is resolved, the problem is because code activates forum descriptions…but thank u for Replied

    #234456
    crsikes01
    Participant

    Certainly. This is the code to generate the new shortcode in functions.php or wherever your custom code is located:

    add_shortcode( 'custom_bbp-search', 'custom_bbp_search_shortcode' );
    function custom_bbp_search_shortcode( $atts ) {
    	$search_string = str_replace("-", " ", sanitize_title($_GET['bbp_search']));
            return do_shortcode( '[bbp-search search="'. $search_string .'"]' );
    }

    For the new page, just set up a new page (I called mine Forum Search with a url of /forum-search/) with the shortcode [custom_bbp-search] added.

    Finally, for the search form template, just copy wp-content/plugins/bbpress/templates/default/bbpress/form-search.php into wp-content/themes/[mythemename]/bbpress/form-search.php and replace the opening <form> line with the following:

    <form role="search" method="get" id="bbp-search-form" action="/forum-search/">

    #234454
    erich199
    Participant

    Re-posting this. For some reason my original post got marked as spam. So, this time I took out the screenshot link.

    I wanted to share some code I cooked up for one of my sites. I want to disclaimer that I’m not a professional coder but through lots of trail, error, and zero hair left I’ve found this code works very well for my website.

    There are two functions. The first one creates a “New Topic” button and uses a template hook to display it above the forum list. The second function does the same thing, but just uses a hook to display the button over the single topic display to create a “New Reply” button. The second function is basically the first function but renamed and uses a different template hook.

    These buttons, when clicked, open a modal that has the shortcode for a new topic/new reply. The code also passes the current forum id into the shortcode, so there is no need for the user to select a forum from the drop down menu. In my screenshot, I’ve enabled the WYSWYG TinyMCE editor and all buttons on it work properly. In addition, I’ve fixed it so that the user can’t accidentally close the modal. They have to physically click on the “Close” button in order to close it. I decided to do this for simplicity sake and so my users won’t accidentally click off the screen and close the modal.

    I made it because I was tired of users getting confused about the new topic/new reply topic area of bbpress. So, in order to bring it more in line with other forum software I made this code (through many trial and errors). I hope that it can help anyone in the community who’s using bbpress for their forums. Oh, I also made sure it displays nicely in mobile size screens. I added a screenshot to show people what it looks like.

    Modal Example

    
    /*
    This function adds the New Topic button to bbpress above the forum list template
    */
    
    function add_new_topic_button() {
        $forum_id = bbp_get_forum_id();
        ?>
        <button id="new-topic-button">New Topic</button>
        <div id="new-topic-modal">
            <button id="close-modal-button">Close</button>
            <div class="modal-content">
                <?php echo do_shortcode('[bbp-topic-form forum_id=' . $forum_id . ']'); ?>
            </div>
        </div>
        <script>
        jQuery(document).ready(function($) {
            var newTopicButton = $('#new-topic-button');
            var modal = $('#new-topic-modal');
            var close = $('#close-modal-button');
            newTopicButton.click(function() {
                modal.show();
                setTimeout(function() {
                    if (typeof bp !== 'undefined' && typeof bp.mentions !== 'undefined') {
                        bp.mentions.tinyMCEinit();
                    }
                }, 1000);
            });
            close.click(function() {
                modal.hide();
            });
            $('textarea#bbp_topic_content').addClass('bbp_topic_content');
        });
        </script>
        <style>
        #new-topic-modal {
            display: none;
            position: fixed;
            z-index: 999;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            overflow: auto;
            background-color: rgba(0,0,0,0.6);
        }
        .modal-content {
            background-color: #fefefe;
            margin: auto;
            padding: 20px;
            border: 1px solid #888;
            width: 50%;
            max-width: 600px;
            border-radius: 5px;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
        }
        #close-modal-button {
            color: #aaaaaa;
            float: right;
            font-size: 28px;
            font-weight: bold;
            margin-right: 10px;
            margin-top: 40px;
        }
        #close-modal-button:hover,
        #close-modal-button:focus {
            color: #000;
            text-decoration: none;
            cursor: pointer;
        }
        @media only screen and (max-width: 600px) {
            .modal-content {
                width: 90%;
                max-width: 90%;
            }
        }
        </style>
        <?php
    }
    add_action('bbp_template_before_single_forum', 'add_new_topic_button');
    
    
    /*
    This function adds the New Reply button to bbpress above the single topic template
    */
    
    function add_new_reply_button() {
        $forum_id = bbp_get_forum_id();
        ?>
        <button id="new-topic-button">New Topic</button>
        <div id="new-topic-modal">
            <button id="close-modal-button">Close</button>
            <div class="modal-content">
                <?php echo do_shortcode('[bbp-reply-form forum_id=' . $forum_id . ']'); ?>
            </div>
        </div>
        <script>
        jQuery(document).ready(function($) {
            var newTopicButton = $('#new-topic-button');
            var modal = $('#new-topic-modal');
            var close = $('#close-modal-button');
            newTopicButton.click(function() {
                modal.show();
                setTimeout(function() {
                    if (typeof bp !== 'undefined' && typeof bp.mentions !== 'undefined') {
                        bp.mentions.tinyMCEinit();
                    }
                }, 1000);
            });
            close.click(function() {
                modal.hide();
            });
            $('textarea#bbp_topic_content').addClass('bbp_topic_content');
        });
        </script>
        <style>
        #new-topic-modal {
            display: none;
            position: fixed;
            z-index: 999;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            overflow: auto;
            background-color: rgba(0,0,0,0.6);
        }
        .modal-content {
            background-color: #fefefe;
            margin: auto;
            padding: 20px;
            border: 1px solid #888;
            width: 50%;
            max-width: 600px;
            border-radius: 5px;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
        }
        #close-modal-button {
            color: #aaaaaa;
            float: right;
            font-size: 28px;
            font-weight: bold;
            margin-right: 10px;
            margin-top: 40px;
        }
        #close-modal-button:hover,
        #close-modal-button:focus {
            color: #000;
            text-decoration: none;
            cursor: pointer;
        }
        @media only screen and (max-width: 600px) {
            .modal-content {
                width: 90%;
                max-width: 90%;
            }
        }
        </style>
        <?php
    }
    add_action('bbp_template_before_single_topic', 'add_new_reply_button');
    
    
    /*
    This function calls the Buddypress js file to bbpress pages only so that @mentions can work in the modal
    */
    
    function enqueue_buddypress_js() {
        if ( function_exists( 'bp_is_active' ) && bp_is_active( 'mentions' ) ) {
            wp_enqueue_script( 'bp-mentions-js' );
        }
    }
    add_action( 'wp_enqueue_scripts', 'enqueue_buddypress_js' );
    
    
    /* Additional Custom Forum Modal CSS This will hide the default new topic/reply form boxes but shouldn't hide the ones inside of the modal */ 
    
    .modal-content .bbp-topic-form, .modal-content .bbp-reply-form {
    	padding-top: 5px;
    	padding-bottom: 5px;
    	margin-top: 5px;
    	margin-bottom: 5px;
    }
    
    .bbpress-wrapper > .bbp-topic-form {
      display: none;
    }
    
    .modal-content .bbp-topic-form legend {
    	display: none;
    }
    
    #new-topic-button {
      float: right;
      margin-right: 10px;
    }
    
    #bbpress-forums > .bbp-reply-form {
    	display: none;
    }
    
    #234453
    webcreations907
    Participant

    You could use the below which should add your registration link to that form.

    Add to your functions.php file in your theme.

    
    if(!function_exists('dnk_add_registration_link')){
    	function dnk_add_registration_link(){
    		if( function_exists('is_bbpress') && is_bbpress() ){
    			echo '<p>Don\'t have an account? <a href="'.esc_attr( wp_registration_url() ).'">Register</a></p>';
    		}
    	}
    }
    add_action( 'login_form','dnk_add_registration_link' ,10 );
    
    
    #234451
    wpturk
    Participant

    Unfortunately, register link ist not something you can activate via settings for this part of forum.

    You need to modify this file: form-user-login.php

    Best way would be to create a bbpress direcrory in your child theme and copy this file there and modify.

    You can also make use of the [bbp-register] shortcode.

    I hope this helps.

    #234450
    dnashif
    Participant

    I think you are right. It is showing as a default wp template.

    I wish BBpress had a shortcode to add to a page for the search results. Seems logical since they have other shortcodes that it would be a no brainer for them to create one.

    Or even function code to put in my child theme functions file. I am not a developer so nothing I can do.

    Seen other people commenting about the search results page. Don’t think BBpress cares though!

    Appreciate your looking at this for me wpturk.

    You are a super hero!

    Diana

    #234444
    erich199
    Participant

    I wanted to share some code I cooked up for one of my sites. I want to disclaimer that I’m not a professional coder but through lots of trail, error, and zero hair left I’ve found this code works very well for my website.

    There are two functions. The first one creates a “New Topic” button and uses a template hook to display it above the forum list. The second function does the same thing, but just uses a hook to display the button over the single topic display to create a “New Reply” button. The second function is basically the first function but renamed and uses a different template hook.

    These buttons, when clicked, open a modal that has the shortcode for a new topic/new reply. The code also passes the current forum id into the shortcode, so there is no need for the user to select a forum from the drop down menu. In my screenshot, I’ve enabled the WYSWYG TinyMCE editor and all buttons on it work properly. In addition, I’ve fixed it so that the user can’t accidentally close the modal. They have to physically click on the “Close” button in order to close it. I decided to do this for simplicity sake and so my users won’t accidentally click off the screen and close the modal.

    I made it because I was tired of users getting confused about the new topic/new reply topic area of bbpress. So, in order to bring it more in line with other forum software I made this code (through many trial and errors). I hope that it can help anyone in the community who’s using bbpress for their forums. Oh, I also made sure it displays nicely in mobile size screens. I added a screenshot to show people what it looks like.

    https://img.iwebnow.net/screenshots/popup.jpg

     
    /*
    This function adds the New Topic button to bbpress above the forum list template
    */
    
    function add_new_topic_button() {
        $forum_id = bbp_get_forum_id();
        ?>
        <button id="new-topic-button">New Topic</button>
        <div id="new-topic-modal">
            <button id="close-modal-button">Close</button>
            <div class="modal-content">
                <?php echo do_shortcode('[bbp-topic-form forum_id=' . $forum_id . ']'); ?>
            </div>
        </div>
        <script>
        jQuery(document).ready(function($) {
            var newTopicButton = $('#new-topic-button');
            var modal = $('#new-topic-modal');
            var close = $('#close-modal-button');
            newTopicButton.click(function() {
                modal.show();
                setTimeout(function() {
                    if (typeof bp !== 'undefined' && typeof bp.mentions !== 'undefined') {
                        bp.mentions.tinyMCEinit();
                    }
                }, 1000);
            });
            close.click(function() {
                modal.hide();
            });
            $('textarea#bbp_topic_content').addClass('bbp_topic_content');
        });
        </script>
        <style>
        #new-topic-modal {
            display: none;
            position: fixed;
            z-index: 999;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            overflow: auto;
            background-color: rgba(0,0,0,0.6);
        }
        .modal-content {
            background-color: #fefefe;
            margin: auto;
            padding: 20px;
            border: 1px solid #888;
            width: 50%;
            max-width: 600px;
            border-radius: 5px;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
        }
        #close-modal-button {
            color: #aaaaaa;
            float: right;
            font-size: 28px;
            font-weight: bold;
            margin-right: 10px;
            margin-top: 40px;
        }
        #close-modal-button:hover,
        #close-modal-button:focus {
            color: #000;
            text-decoration: none;
            cursor: pointer;
        }
        @media only screen and (max-width: 600px) {
            .modal-content {
                width: 90%;
                max-width: 90%;
            }
        }
        </style>
        <?php
    }
    add_action('bbp_template_before_single_forum', 'add_new_topic_button');
    
    
    
    /*
    This function adds the New Reply button to bbpress above the single topic template
    */
    
    function add_new_reply_button() {
        $forum_id = bbp_get_forum_id();
        ?>
        <button id="new-topic-button">New Topic</button>
        <div id="new-topic-modal">
            <button id="close-modal-button">Close</button>
            <div class="modal-content">
                <?php echo do_shortcode('[bbp-reply-form forum_id=' . $forum_id . ']'); ?>
            </div>
        </div>
        <script>
        jQuery(document).ready(function($) {
            var newTopicButton = $('#new-topic-button');
            var modal = $('#new-topic-modal');
            var close = $('#close-modal-button');
            newTopicButton.click(function() {
                modal.show();
                setTimeout(function() {
                    if (typeof bp !== 'undefined' && typeof bp.mentions !== 'undefined') {
                        bp.mentions.tinyMCEinit();
                    }
                }, 1000);
            });
            close.click(function() {
                modal.hide();
            });
            $('textarea#bbp_topic_content').addClass('bbp_topic_content');
        });
        </script>
        <style>
        #new-topic-modal {
            display: none;
            position: fixed;
            z-index: 999;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            overflow: auto;
            background-color: rgba(0,0,0,0.6);
        }
        .modal-content {
            background-color: #fefefe;
            margin: auto;
            padding: 20px;
            border: 1px solid #888;
            width: 50%;
            max-width: 600px;
            border-radius: 5px;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
        }
        #close-modal-button {
            color: #aaaaaa;
            float: right;
            font-size: 28px;
            font-weight: bold;
            margin-right: 10px;
            margin-top: 40px;
        }
        #close-modal-button:hover,
        #close-modal-button:focus {
            color: #000;
            text-decoration: none;
            cursor: pointer;
        }
        @media only screen and (max-width: 600px) {
            .modal-content {
                width: 90%;
                max-width: 90%;
            }
        }
        </style>
        <?php
    }
    add_action('bbp_template_before_single_topic', 'add_new_reply_button');
    
    
    
    /*
    This function calls the Buddypress js file to bbpress pages only so that @mentions can work in the modal
    */
    
    function enqueue_buddypress_js() {
        if ( function_exists( 'bp_is_active' ) && bp_is_active( 'mentions' ) ) {
            wp_enqueue_script( 'bp-mentions-js' );
        }
    }
    add_action( 'wp_enqueue_scripts', 'enqueue_buddypress_js' );
    
    
    /* Additional Custom Forum Modal CSS This will hide the default new topic/reply form boxes but shouldn't hide the ones inside of the modal */ 
    
    .modal-content .bbp-topic-form, .modal-content .bbp-reply-form {
    	padding-top: 5px;
    	padding-bottom: 5px;
    	margin-top: 5px;
    	margin-bottom: 5px;
    }
    
    .bbpress-wrapper > .bbp-topic-form {
      display: none;
    }
    
    .modal-content .bbp-topic-form legend {
    	display: none;
    }
    
    #new-topic-button {
      float: right;
      margin-right: 10px;
    }
    
    #bbpress-forums > .bbp-reply-form {
    	display: none;
    }
    
    #234436
    wpturk
    Participant

    Sidebar is related to your wordpress theme (template file). Select a full-width theme template file in your forum settings. If you are displaying your forums via shortcode, the shorcode can be placed on full-with pages.

    #234429
    Robin W
    Moderator

    any chance that you could post the code you developed?

    #234428
    crsikes01
    Participant

    I have a site that was experiencing the same exact issue. I wasn’t able to determine the root cause, but I did manage to develop a workaround.

    1. Create a new custom shortcode that captures url search term parameters and sends them to the default bbp-search shortcode’s search parameter.

    2. Create a new page that includes the new shortcode from step 1.

    3. Modify the search form from the template forum-search.php such that the action is now the page created in step 2.

    It is a bit wonky but it seems to work fine, including the search result pagination. It doesn’t address the root cause of the 500 error but at least site users can use the forum search now.

    #234424
    wpturk
    Participant

    Hi Diana,

    you can get this info from mysql DB in case you have access: (ex. via phpmyadmin)

    SELECT user_login FROM wp_users WHERE id not in (SELECT DISTINCT post_author FROM wp_posts) AND id not in (SELECT DISTINCT user_id FROM wp_comments) ORDER BY user_registered ASC;

    You need to change wp_ if you have another prefix for your mysql tables.

    After you’ve checked the list, you can change the sql statement and DELETE.

    I hope this helps.

    #234379
    enkoes
    Participant

    This is the bbpress.php from my theme:

    <?php
    /**
     * Template Name: Magbook Template
     *
     * Displays Magazine template.
     *
     * @package Theme Freesia
     * @subpackage Magbook
     * @since Magbook 1.0
     */
    get_header(); ?>
    <div class="wrap">
    	<?php 	if( is_active_sidebar( 'magbook_primary_fullwidth' ) && class_exists('Magbook_Plus_Features') ){
    		echo '<div class="primary-full-width clearfix">';
    			dynamic_sidebar ('magbook_primary_fullwidth');
    		echo '</div>';
    	} ?>
    	<div id="primary" class="content-area">
    		<main id="main" class="site-main" role="main">
    			<?php 
    			if( is_active_sidebar( 'magbook_template_section' )){
    				dynamic_sidebar( 'magbook_template_section' );
    			}
    
    		the_content(); ?>
    		</main><!-- end #main -->
    	</div> <!-- end #primary -->
    	
    		<?php if( is_active_sidebar( 'magbook_template_sidebar_section' )){ ?>
    		<aside id="secondary" class="widget-area" role="complementary" aria-label="<?php esc_attr_e('Side Sidebar','magbook');?>">
    			<?php dynamic_sidebar( 'magbook_template_sidebar_section' ); ?>
    		</aside> <!-- end #secondary -->
    	<?php	}
    	if( is_active_sidebar( 'magbook_seondary_fullwidth' ) && class_exists('Magbook_Plus_Features') ){
    		echo '<div class="secondary-full-width clearfix">';
    			dynamic_sidebar ('magbook_seondary_fullwidth');
    		echo '</div>';
    	} ?>
    	
    </div><!-- end .wrap -->
    
    <?php get_footer();
    #234376
    enkoes
    Participant

    Hi, after struggling some time trying to make profile page full width, I give up.

    The theme I’m using is Magbook. I found that there is only one theme template page that has no sidebar, ie, magbook-template.php. I copied this file to my child theme root directory, and rename it as bbpress.php. However it doesn’t make any changes to the profile page.

    I have read some other similar topics, I guess we need to “inject” custom php codes into the bbpress.php. If this is correct, can you provide me the relevant php codes for bbpress.php that make it works?

    One more thing I have doubt is that, let say bbpress finally adopted bbpress.php as default template, all other forum & topic pages will turn out no sidebar altogether, I presumed, which is against my wish. What I want is profile page FULL WIDTH, forum/topic page WITH SIDEBAR.

    Pls guide me.
    Regards

    #234345
    webcreations907
    Participant

    Have you tried setting WP_DEBUG to true in wp-config.php to see if there are any errors?

    #234333
    Robin W
    Moderator

    so can you post the entire code you are using please

    #234324
    lesd1315
    Participant

    I get the following error using the code in my functions.php file

    PHP Warning: strtotime() expects parameter 1 to be string, object given

    the line cited in the above warning is
    $topic_date = strtotime( get_post( $topic_id, 'post_date', true ) );

    #234266
    Robin W
    Moderator
    #234265
    Robin W
    Moderator
    #234252
    Robin W
    Moderator

    I am getting

    Your access to this site has been limited by the site owner
    Your access to this service has been limited. (HTTP response code 503)

    #234196
    Robin W
    Moderator

    simply asking the same question twice will not get you any further, as I have said :

    looks like you are using the cloux theme which claims to be bbpress integrated.

    I suggest you reach out to the theme authors for support

    Step by step guide to setting up a bbPress forum – Part 1

Viewing 25 results - 626 through 650 (of 32,295 total)
Skip to toolbar