prokops (@prokops)

Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • @prokops

    Participant

    For anyone looking for news on this topic, I have a simple css solution:

    /* FORUM */
    .logged-in #main .bbp-replies.forums,
    .logged-in #main .bbp-pagination-count{
    display: block;
    }
    #main .bbp-replies.forums,
    #main .bbp-pagination-count {
    display: none;
    }

    This does not hide replies programatically, just hides them from view, but this might be good enough for some, as it is for us. It is just a barrier made to make people signup / login.

    @prokops

    Participant

    Here is a functions / snippet code version for anyone else looking:

    function my_forums_dropdown_shortcode() {
        // Start buffering output
        ob_start();
    
        // Dropdown container
        echo '<select id="forums-dropdown" onchange="location = this.value;">';
        
        // Forum loop
        if ( bbp_has_forums() ) :
            while ( bbp_forums() ) : bbp_the_forum();
                $forum_permalink = bbp_get_forum_permalink();
                $forum_title = bbp_get_forum_title();
                echo "<option value='{$forum_permalink}'>{$forum_title}</option>";
            endwhile;
        else :
            // No forums found
            bbp_get_template_part( 'feedback', 'no-forums' );
        endif;
    
        // Close the dropdown
        echo '</select>';
    
        // Return the buffer contents
        return ob_get_clean();
    }
    add_shortcode('forums_dropdown', 'my_forums_dropdown_shortcode');
    

    Just paste in [forums_dropdown] where you want output.

    @prokops

    Participant

    It would do the trick but it is not the best solution :/
    I will try to develop an submission verification based on user custom field.

    @prokops

    Participant

    I can delete the email field in the file you specify. But the forum still tries to validate and thus gives me an “ERROR: Invalid email address.”

    How to define what to validate and disable email field validation?

    Cheers

Viewing 4 replies - 1 through 4 (of 4 total)