Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 4,751 through 4,775 (of 32,481 total)
  • Author
    Search Results
  • #188141
    #188136
    Robin W
    Moderator

    not tested but try adding this to your functions file

    add_filter( 'bbp_get_reply_author_display_name', 'rew_display_first_name' 10, 2);
    
    function rew_display_first_name ($author_name, $reply_id ) {
    	$reply_id = bbp_get_reply_id( $reply_id );
    
    		// User is not a guest
    		if ( !bbp_is_reply_anonymous( $reply_id ) ) {
    
    			// Get the author ID
    			$author_id = bbp_get_reply_author_id( $reply_id );
    
    			// Try to get a display name
    			$author_name = get_the_author_meta( 'first_name', $author_id );
    
    			// Fall back to user login
    			if ( empty( $author_name ) ) {
    				$author_name = get_the_author_meta( 'user_login', $author_id );
    			}
    
    		// User does not have an account
    		} else {
    			$author_name = get_post_meta( $reply_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 apply_filters( 'rew_display_first_name', $author_name, $reply_id );
    }
    #188127
    andrey90
    Participant

    is it possible to create two forums? because I have a forum on my site for free users and the second forum with other topics should be for the pay users, the two forums are separated by two different pages on the site, so i need two forums with one database. I would block the pay forum with a “paid membership” addon for free users.

    but as i can see i can just create one forum with one shortcode in bbpress?

    #188123
    leeproc
    Participant

    Hello all,

    I somehow broke the page layout of my topic index and topic pages. The sidebar should be on the right, but it looks like WordPress is drawing the gray line separator on the left of the page, and pushing all the sidebar content to the bottom. Example: https://www.parentifact.org/forums/forum/questions/

    I thought this was due to some code I put in the style.css and functions.php to style my archive pages, but I removed that code and it’s still messed up. Has anyone experienced this before, or could someone more knowledgeable look at the source and developer tools to figure out what’s going wrong here?

    Thanks!

    #188117
    Wilfrank
    Participant

    I made a small change so that the user can choose the sort order, but can anyone tell me why it does not work?

    function custom_bbp_has_topics($order) {
    
      switch ($order) {
        case 1:
            $args['order'] = 'ASC';
            break;
        case 2:
            $args['order'] = 'DESC';
            break;
        default:
            $args['order'] = 'DESC';
      }
      
      return $args;
    }
    add_filter('bbp_before_has_topics_parse_args', 'custom_bbp_has_topics' );
    #188116
    morpheus978
    Participant

    Hello,
    I created a page on the site with the shortcode [bbp-forum-index] and a custom title.
    I have a problem with the breadcumbs (which I yet have on my site, implemented with the SEO YOAST plugin).

    When I navigate through categories and forums, starting from the index page, breadcumbs works properly. When I open a topic, the root path of the forum disappears.

    I’ll explain better:

    the root page is http://www.apesca.it/forum
    Breadcumb: Home »Forum

    Within the category “Benvenuto – Presentazioni”…
    Breadcumb: Home » Forum » Benvenuto – Presentazioni

    I’m in the forum “Mi Presento”…
    Breadcumb: Home » Forum » Benvenuto – Presentazioni » Mi presento

    I’m in the topic “Ciao a Tutti” …
    Breadcumb: Home » Benvenuto – Presentazioni » Mi presento » Ciao a Tutti

    What i want to get is:
    Home » Forum » Benvenuto – Presentazioni » Mi presento » Ciao a Tutti

    I hope you can help me.

    #188112
    richard.miller
    Participant

    Just installed BBPress, and see that the editor is barebones html.

    I’ve learned from this codex page that the visual editor is disabled by default – so I added the code snippet to my functions file, but no effect at all. Added TinyMCE Advance plugin, no effect at all.

    What could be wrong?

    (note: I see all sorts of references to “enable fancy WP editor” in older posts here, but can’t find that setting)

    WP 4.8.3
    BBpress: 2.5.14

    Robin W
    Moderator

    these sortcodes are theme(or other plugin) related, not bbpress.

    what theme are you using?

    #188106
    Eric Malalel
    Participant

    Now it’s fine. I made an error when copy paste the code.
    It works perfectly, thanks a lot!

    #188092
    dominikb
    Participant

    in form-reply.php i find this line:

    <input name="bbp_log_reply_edit" id="bbp_log_reply_edit" type="checkbox" value="1" <?php bbp_form_reply_log_edit(); ?> tabindex="<?php bbp_tab_index(); ?>" />

    it does not seem like, i can uncheck the box here.

    I have my subscription boxes auto-checked via:

    function pw_bbp_auto_checK_subscribe( $checked, $topic_subscribed  ) {
    
        if( $topic_subscribed == 0 )
            $topic_subscribed = true;
    
        return checked( $topic_subscribed, true, false );
    }

    is there maybe a way, to turn this around and use it on the log checkbox?

    #188091
    coreymcollins
    Participant

    I’ve been fighting with how to enable the Topics CPT for all users in the dashboard and not having a great time. I thought I could, perhaps, filter the CPT registration to change the CPT caps and show_ui settings, but no luck.

    Even when I am able to get the Topics CPT to display for all users by commenting out the lines noted below as a test:

    
    // Register Topic content type
    register_post_type(
    	bbp_get_topic_post_type(),
    	apply_filters( 'bbp_register_topic_post_type', array(
    		'labels'              => bbp_get_topic_post_type_labels(),
    		'rewrite'             => bbp_get_topic_post_type_rewrite(),
    		'supports'            => bbp_get_topic_post_type_supports(),
    		'description'         => __( 'bbPress Topics', 'bbpress' ),
    		// 'capabilities'        => bbp_get_topic_caps(),
    		// 'capability_type'     => array( 'topic', 'topics' ),
    		'menu_position'       => 999999999999,
    		'has_archive'         => ( 'forums' === bbp_show_on_root() ) ? bbp_get_topic_archive_slug() : false,
    		'exclude_from_search' => true,
    		'show_in_nav_menus'   => false,
    		'public'              => true,
    		// 'show_ui'             => current_user_can( 'bbp_topics_admin' ),
    		'can_export'          => true,
    		'hierarchical'        => false,
    		'query_var'           => true,
    		'menu_icon'           => ''
    	)
    ) );
    

    Things still don’t completely work. Users can technically create a post, but can’t save the Forum in which the post is created.

    The short of it is: I want users with the Participant Forum Role to be able to see the Topics CPT in the dashboard so they can create their posts here, mainly because it would be helpful for them to be able to Preview a topic before posting it. Out of the box, the front-end bbPress form does not allow for post previews.

    Has anyone achieved this?

    Using:
    WP 4.8.3
    bbPress 2.5.14

    #188058
    uzosky
    Participant

    Hello, please how do I retrieve the user id of the last active user in a forum? To get the last active name requires the following code:
    bbp_author_link( array( 'post_id' => bbp_get_forum_last_active_id(), 'type' => 'name' ) );
    But how do I get the ID instead of the name?

    #188057
    docaj
    Participant

    Solved! Found an earlier post about a similar problem. I manually edited spam-prevention.php under Mojo Marketplace Plugin to remove all blocked words including breast. Then problem is gone. Strangely, I had uninstalled Mojo Marketplace long time ago and it does not even show up on my Dashboard. Apparently its codes are still there and working.

    #187996
    manm0untain
    Participant

    Hi

    I happened to check a mail account we are not using yet, when we moved servers. It turns out there are quite a few emails in that account. They are all forum activity alerts coming from BBPress on the site. These are the kind of mails being received:

    UserX wrote:
    
    Hello to all in the group!
    
    Post Link: https://www.juicy.io/groups/venezuela/forum/topic/presentacion/#post-33662
    
    -----------
    
    You are receiving this email because you subscribed to a forum topic.
    
    Login and visit the topic to unsubscribe from these emails.

    It seems to be sending these alerts to a user. But there is no ‘to’ username on the emails. I have done several searches on our user database and there are no users with that email address.

    I have done a full database search for that email address and come up with nothing.

    I have looked absolutely everywhere I can think of within WP admin, for any instance of that address, and can find none. Unless it’s buried away in some obscure corner of a plugin, I am pretty sure I have looked everywhere relevant that I could think of.

    I am downloading the entire site, to do a search on that string within the site files, as a last resort. I’m not optimistic.

    Can anyone point me in the right direction about this?

    Many thanks for your time.

    #187977
    mikedean
    Participant

    A year later but here it is.

    This assumes a drop down select menu has been added to the form-topic.php template. wp_dropdown_categories() is used to make a <select> element for all the terms in the categories taxonomy so users can assign the topic to a term.
    https://codex.wordpress.org/Function_Reference/wp_dropdown_categories

    Then, the topic is assigned to the term they selected by hooking into the new topic process.

    /**
     * Assign a taxonomy term to a topic after it has been selected in the front end (using a <select> element).
     *
     * @param Int           $topic_id               The id for the current topic being created.
     * @param Int           $forum_id               The id for the current forum the topic is being created in.
     * @param Int           $anonymous_data         ??
     * @param Int           $topic_author           The id of the user who created the topic.
     *
     * @see https://codex.wordpress.org/Function_Reference/wp_dropdown_categories
     */
    
    //Update the taxonomy terms when a new topic is created or edited.
    add_action( 'bbp_new_topic', 'myprefix_assign_category_to_post', 20, 4 );
    
    function myprefix_assign_category_to_post( $topic_id, $forum_id, $anonymous_data, $topic_author ) {
            
            //Get the category submitted by the user
            $taxonomy_name = 'category';                    //the slug, or machine name, or the taxonomy
            $term_id = intval( $_POST['cat'] );             //Get value from the <select> element as an interger
    
            //@TODO error checking if term or taxonomy does not exists (returns false if so)
            $term_object = get_term_by( 'id', $term_id, $taxonomy_name );
    
            //Replace the existing subject with the selected one
            wp_set_post_terms( $topic_id, array( $term_id ), $taxonomy_name, false );
    }     
    #187965
    uddin33
    Participant

    I am using WordPress Version 4.7 And have installed bbpress version 2.5.12.Every thing is working fine but in edit profile page no edits are updating.I have checked it for both admin and participant role.After edit profile button submit it redirects to following url
    http://mysite.com/forums/user/pro2/edit/?updated=true but nothing is changed actually.How can i solve this problem?pls help

    Robin W
    Moderator

    It is shocking how bad this forum aspect of WordPress is Amazing that consumers put up with it, really.

    oh how I agree that something that has taken a lot of people a lot of time to write for free, is maintained for free, and supported for free, and has cost you nothing doesn’t do what you want. Absolutely disgusting and shouldn’t be allowed. Of course you could always crack the code open and help improve it, or perhaps it is easier to just easier to expect someone else to do that for you and just complain when it doesn’t.

    #187945
    amitrwt
    Participant

    What I want to do eventually is check whether a topic has a specific tag. Like we check with has tag.

    
    if ( has_tag( $tag, $topic_id)) {
    	echo "exists";
    }else{
    	echo "does not exists";
    }
    
    #187933
    Robin W
    Moderator

    you can always us this in your function file

    //This function changes the text wherever it is quoted
    function change_translate_text( $translated_text ) {
    	if ( $translated_text == 'old text' ) {
    	$translated_text = 'new text';
    	}
    	return $translated_text;
    }
    add_filter( 'gettext', 'change_translate_text', 20 );

    so you would have

    //This function changes the text wherever it is quoted
    function change_translate_text( $translated_text ) {
    	if ( $translated_text == 'by' ) {
    	$translated_text = 'par';
    	}
    	return $translated_text;
    }
    add_filter( 'gettext', 'change_translate_text', 20 );
    #187913
    Eric Malalel
    Participant

    I use bbPress 2.5.14 on latest WP.
    I have enabled TinyMCE with this code:

    add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );
    function bbp_enable_visual_editor( $args = array() ) {
    	$args['tinymce'] = true;
    	$args['quicktags'] = false;
        return $args;
    }

    It works well when a user posts a new topic.
    But when a user wants to reply to a topic, the tinyMCE editor is displayed but is not editable.
    I can’t see any error in the browser console.
    Please advise.

    #187911

    Try this:

    #bbpress-forums div.odd blockquote, #bbpress-forums ul.odd blockquote {
    background-color: #fff; }

    Also, you should always try to only use !important as an absolute last resort.

    Hope that helps

    #187902
    Robin W
    Moderator
    aravoth
    Participant

    So, I can style an .odd and .even forum differently, in this case to give forums on the the forums front page alternating colors, This also works for topics in the same way. And it carries over into replies, were the lead reply will have background-color: #fff;, and the next reply will have background-color: #000;, for example. What I am trying to do now is change the color of the blockqoute within the forum reply, to be the opposite of what the reply background is.

    so if….

    #bbpress-forums div.odd, #bbpress-forums ul.odd {
    background-color: #000 !important;

    }

    then I would want something like…

    #bbpress-forums div.odd, #bbpress-forums ul.odd, blockquote {
    background-color: #fff !important;

    }

    For some reason I can not get the blockqoute background to change, at least the way I want it too. For some reason it changes the blockquote background globally. I feel like I am missing a CSS class here somewhere. Can anyone give me a hint at what I’m missing?

    #187868

    In reply to: Search by user

    sbmar
    Participant

    I think I almost have this working on my site but I cannot get the form value for some reason:

    $username = $_GET['bbp_search_by_user'];

    If I type the value into the URL (/?bbp_search_by_user=someuser), then it works 100%… should be something silly, right?

    I also added a member drop-down so when someone is searching they can choose from a listing of members that have already created at least one reply:

    global $wpdb;
    
    $sql = "SELECT DISTINCT
    $wpdb->posts.post_author as id,
    $wpdb->users.display_name as name
    FROM
    $wpdb->posts
    INNER JOIN $wpdb->users ON $wpdb->posts.post_author = $wpdb->users.ID
    WHERE
    $wpdb->posts.post_type = 'reply' AND $wpdb->users.display_name <> ''
    ORDER BY
    $wpdb->users.display_name ASC";
    
    $result = $wpdb->get_results($sql, OBJECT);
    			
    echo "<select name=\"bbp_search_by_user\">";
    echo "<option value='ALL'>All Users</option>";
    echo "<option value='ALL'></option>";
    foreach ($result as $key => $value) {			  
       echo "<option value='" . $value->id . "'>" . $value->name . "</option>";
    }
    echo "</select>";

    Anyone know how to get the $_GET[‘bbp_search_by_user’]; to work?

    Here’s the code in my functions.php:

    /* ADD SEARCH BY USER FUNCTION */
    
    add_filter ( 'bbp_before_has_search_results_parse_args', 'ha_custom_search_by_username' );
     
    function ha_custom_search_by_username() {
    	//Get username from input on search page
    	$username = $_GET['bbp_search_by_user'];
    
    	$default_post_type = array( bbp_get_forum_post_type(), bbp_get_topic_post_type(), bbp_get_reply_post_type() );
    	//check if empty
    	if(!empty($username) && $username != "ALL"){
    		//Make ID from username
    		$user = get_user_by('slug', $username);
    		$user_id = $user->ID;
    	$args['author'] = $user_id;	
    	}
    	$args['post_type'] = $default_post_type;
    	$args['orderby'] = 'date';
    	$args['posts_per_page'] = '5';
    	$args['ignore_sticky_posts'] = 'true';
    	$args['order'] = 'DESC';
    
    	return $args;
    }
Viewing 25 results - 4,751 through 4,775 (of 32,481 total)
Skip to toolbar