Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 4,351 through 4,375 (of 32,518 total)
  • Author
    Search Results
  • #191787

    In reply to: Private Forum issue

    Pascal Casier
    Moderator

    Hi @brmbk,

    You would need to add the following function into your functions.php:

    add_filter('private_title_format', 'brmbk_remove_private_title');
    function brmbk_remove_private_title($title) {
    	return '%s';
    }

    If you don’t know how or where to add it, you can also install my bbp-toolkit plugin and you will find the option in there.

    #191786
    dheerajsharma14
    Participant

    The above code does not work. It is not part of overall_header.html BUT should be part of viewtopic.php. I was able to search all the code files and place the code in right place to make my migration successful.

    However, all user replies were not mapped to users rather imported as anonymous 🙁 … On the other hand, Topics were successfully mapped to right users. Is there any help I can get in mapping those anonymous users back to right users in bbPress?

    #191764
    makingcircuits
    Participant

    @Pippin Williamson

    Your code works like charm.

    Thank you very much!!

    #191762
    cpo1wh
    Participant

    Hello, I’m a newby and having trouble getting bbpress sidebar to show on forum page. I’ve tried the various combinations with sidebar widget populated with a couple of other widgets, but still can’t see the bbpress sidebar. I have the wp tweaks installed as well. The forum page has the bbpress shortcode on it.
    Thanks for your help. The website is oandp.link.

    #191730
    Indrekkor
    Participant

    No idea if this was the most optimal way to do it, but did it like this :

    <?php 
    
    $val2=bbp_get_user_id();
    $val3=get_current_user_id( );
    if ( current_user_can( 'moderate' ) OR $val2 == $val3 ) :
        ?>
    
    Anything you want the moderator or logged in user to see.
    <?php endif; ?>
    

    Modified all the user-*****.php files like this.

    Also in other template files I modified the code so usernames are not linkable to their profile.

    #191727
    zcoin
    Participant

    The whole logic is on how to get the notifications from your own table synch with the posts table:

    global $wpdb;
    		$results = $wpdb->get_results( "SELECT notif.*, p2.post_title, p2.post_name
    								FROM YOUR_NOTIF_TABLE notif 
    		            INNER JOIN wp_posts p on p.id = (CASE WHEN notif.parent_id > 0 THEN notif.parent_id ELSE notif.topic_id END) 
    								INNER JOIN wp_posts p2 on notif.topic_id = p2.id     
    								WHERE p.post_author = $current_user->ID
    								AND notif.user_source != $current_user->ID
    								AND notif.unread = 1");
    								
    		$reply_notifications = array(); 
    #191680
    crista007
    Participant

    So basically found that there is a syntax error be created with youtube links

    <iframe width="560" height="315" src="https://www.youtube.com/embed/pt8VYOfr8To?rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen><="" ifram=""></iframe>

    
    <iframe src="https://www.youtube.com/embed/pt8VYOfr8To?rel=0" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen"></iframe>

    the allofulscreen and ifram

    Does anyone now where in the plug this is generated.
    wp autoembed seem to do the youtube but not sure where the iframe parameters are being generated.

    this is an issue mainly seen in mobile view only as other views seem to ignore the error.

    Pascal Casier
    Moderator

    In my plugin bbp-toolkit I have used a filter on bbp_get_title_max_length.
    Feel free to install the plugin or look at the code on the use of the filter.

    #191647
    James Revillini
    Participant

    I coded something you can add to your functions.php file which will do this.

    // ---------------------------------------- REDIRECT REPLY POSTS TO TOPIC WITH REPLY ANCHOR
    function jrevillini_reply_redirect( $wp_query ) {
      if ( !function_exists('bbp_get_reply_url') ) return;
      if ( !isset($wp_query->query['reply']) ) return;
      wp_safe_redirect( bbp_get_reply_url( $wp_query->query['reply'] ) );
    }
    add_action('pre_get_posts', 'jrevillini_reply_redirect');
    
    0be1
    Participant

    Robin;

    I have attempted to add the code you provided to my child themes functions.php file and change the length value to 120. It does not reflect that in either the text on the screen or the actual field length itself. Is there something else I can try?

    Thank you…

    Shawn

    #191614
    p1s4
    Participant

    I know this topic is very old, but is the most recent i found about this argument.

    I need different colors for authors link ( topic and replys) .

    I solved using the filters bbp_get_reply_author_link and bbp_get_topic_author_link in function.php of my child theme.

    I changed the class $link_class in $author_link, you can found the original code in bbpress/includes/topics/template.php and bbpress/includes/reply/template.php.

    This is the complete code in my function.php child’s theme:

    //custom color LINK AUTHOR roles
    add_filter( 'bbp_get_reply_author_link', 'addrole_reply_author_links', 10, 2);
    add_filter( 'bbp_get_topic_author_link', 'addrole_topic_author_links', 10, 2);
    function addrole_topic_author_links($author_link, $args) {
    // Parse arguments against default values
    		$r = bbp_parse_args( $args, array(
    			'post_id'    => 0,
    			'link_title' => '',
    			'type'       => 'both',
    			'size'       => 80,
    			'sep'        => '&nbsp;',
    			'show_role'  => false
    		), 'get_topic_author_link' );
    
    		// Used as topic_id
    		if ( is_numeric( $args ) ) {
    			$topic_id = bbp_get_topic_id( $args );
    		} else {
    			$topic_id = bbp_get_topic_id( $r['post_id'] );
    		}
    
    		// Topic ID is good
    		if ( !empty( $topic_id ) ) {
    
    			// Get some useful topic information
    			$author_url = bbp_get_topic_author_url( $topic_id );
    			$anonymous  = bbp_is_topic_anonymous( $topic_id );
    
    			// Tweak link title if empty
    			if ( empty( $r['link_title'] ) ) {
    				$link_title = sprintf( empty( $anonymous ) ? __( 'View %s\'s profile', 'bbpress' ) : __( 'Visit %s\'s website', 'bbpress' ), bbp_get_topic_author_display_name( $topic_id ) );
    
    			// Use what was passed if not
    			} else {
    				$link_title = $r['link_title'];
    			}
    
    			// Setup title and author_links array
    			$link_title   = !empty( $link_title ) ? ' title="' . esc_attr( $link_title ) . '"' : '';
    			$author_links = array();
    
    			// Get avatar
    			if ( 'avatar' === $r['type'] || 'both' === $r['type'] ) {
    				$author_links['avatar'] = bbp_get_topic_author_avatar( $topic_id, $r['size'] );
    			}
    
    			// Get display name
    			if ( 'name' === $r['type'] || 'both' === $r['type'] ) {
    				$author_links['name'] = bbp_get_topic_author_display_name( $topic_id );
    			}
    
    			// Link class
    			//ADD ROLE CLASS TO LINK 
    			$role        = str_replace(' ', '-', strtolower(bbp_get_user_display_role( bbp_get_topic_author_id( $topic_id )) ));
    			$link_class = ' class="'.$role.' bbp-author-' . esc_attr( $r['type'] ) . '"';
    
    			// Add links if not anonymous
    			if ( empty( $anonymous ) && bbp_user_has_profile( bbp_get_topic_author_id( $topic_id ) ) ) {
    
    				$author_link = array();
    
    				// Assemble the links
    				foreach ( $author_links as $link => $link_text ) {
    					//ADD ROLE CLASS TO LINK 
    					$role        =  str_replace(' ', '-', strtolower(bbp_get_user_display_role( bbp_get_topic_author_id( $topic_id )) ));
    					$link_class = ' class="'.$role.'  bbp-author-' . esc_attr( $link ) . '"';
    					$author_link[] = sprintf( '<a href="%1$s"%2$s%3$s>%4$s</a>', esc_url( $author_url ), $link_title, $link_class, $link_text );
    				}
    
    				if ( true === $r['show_role'] ) {
    					$author_link[] = bbp_get_topic_author_role( array( 'topic_id' => $topic_id ) );
    				}
    
    				$author_link = implode( $r['sep'], $author_link );
    
    			// No links if anonymous
    			} else {
    				$author_link = implode( $r['sep'], $author_links );
    			}
    
    		} else {
    			$author_link = '';
    		}
    
    return $author_link;
    }
    
    function addrole_reply_author_links($author_link, $args) {
    
    		// Parse arguments against default values
    		$r = bbp_parse_args( $args, array(
    			'post_id'    => 0,
    			'link_title' => '',
    			'type'       => 'both',
    			'size'       => 80,
    			'sep'        => '&nbsp;',
    			'show_role'  => false
    		), 'get_reply_author_link' );
    
    		// Used as reply_id
    		if ( is_numeric( $args ) ) {
    			$reply_id = bbp_get_reply_id( $args );
    		} else {
    			$reply_id = bbp_get_reply_id( $r['post_id'] );
    		}
    
    		// Reply ID is good
    		if ( !empty( $reply_id ) ) {
    
    			// Get some useful reply information
    			$author_url = bbp_get_reply_author_url( $reply_id );
    			$anonymous  = bbp_is_reply_anonymous( $reply_id );
    
    			// Tweak link title if empty
    			if ( empty( $r['link_title'] ) ) {
    				$link_title = sprintf( empty( $anonymous ) ? __( 'View %s\'s profile', 'bbpress' ) : __( 'Visit %s\'s website', 'bbpress' ), bbp_get_reply_author_display_name( $reply_id ) );
    
    			// Use what was passed if not
    			} else {
    				$link_title = $r['link_title'];
    			}
    
    			// Setup title and author_links array
    			$link_title   = !empty( $link_title ) ? ' title="' . esc_attr( $link_title ) . '"' : '';
    			$author_links = array();
    
    			// Get avatar
    			if ( 'avatar' === $r['type'] || 'both' === $r['type'] ) {
    				$author_links['avatar'] = bbp_get_reply_author_avatar( $reply_id, $r['size'] );
    			}
    
    			// Get display name
    			if ( 'name' === $r['type']   || 'both' === $r['type'] ) {
    				$author_links['name'] = bbp_get_reply_author_display_name( $reply_id );
    			}
    
    			// Link class
    			//ADD ROLE CLASS TO LINK  
    			$role        =  str_replace(' ', '-', strtolower(bbp_get_user_display_role( bbp_get_reply_author_id( $reply_id ) )));
    			$link_class = ' class="'.$role.' bbp-author-' . esc_attr( $r['type'] ) . '"';
    
    			// Add links if not anonymous and existing user
    			if ( empty( $anonymous ) && bbp_user_has_profile( bbp_get_reply_author_id( $reply_id ) ) ) {
    
    				$author_link = array();
    
    				// Assemble the links
    				foreach ( $author_links as $link => $link_text ) {
    					//ADD ROLE CLASS TO LINK 
    					$role        =  str_replace(' ', '-', strtolower(bbp_get_user_display_role( bbp_get_reply_author_id( $reply_id ) )));
    					$link_class = ' class="'.$role.'  bbp-author-' . $link . '"';
    					$author_link[] = sprintf( '<a href="%1$s"%2$s%3$s>%4$s</a>', esc_url( $author_url ), $link_title, $link_class, $link_text );
    				}
    
    				if ( true === $r['show_role'] ) {
    					$author_link[] = bbp_get_reply_author_role( array( 'reply_id' => $reply_id ) );
    				}
    
    				$author_link = implode( $r['sep'], $author_link );
    
    			// No links if anonymous
    			} else {
    				$author_link = implode( $r['sep'], $author_links );
    			}
    
    		// No replies so link is empty
    		} else {
    			$author_link = '';
    		}
    
    		return $author_link;
    	}

    Then you have to add the CSS to the new class added to author’s link.

    Hope will be useful,
    bye,
    Marco.

    #191611
    zcoin
    Participant

    Yes, I would like to , I am checking how to port my code to a standalone plugin

    #191606
    yusareba
    Participant

    I’m able to embed external sources into my forum with direct urls, which is nice.
    But they are HUGE. How can I change the size so that they don’t take up so much space?

    View post on imgur.com

    I’ve attempted to use:
    if ( ! isset( $content_width ) ) $content_width = 500;

    in child theme functions.php but it didn’t change anything.

    #191567

    In reply to: Single Forums

    Robin W
    Moderator

    you can create an index with particular forums using a shortcode in my style pack

    [bsp-display-forum-index forum= ‘2932,2921’ title=’main forums’] Displays the selected forum indexes

    bbp style pack

    Robin W
    Moderator

    my style pack has a shortcode

    [bsp-display-topic-indexforum =’101′ ] Displays the latest topics, optionally from a forum or forums

    bbp style pack

    #191562
    yanjuadmin
    Participant

    I would like my site to be completely user driven. I don’t want to create all the possible forums and only have users create topics, can I do this?

    Right now when I include the new forum shortcode, it forces users to select a “parent forum” which is not what I want

    luice
    Participant

    Now we have using a latest version of your plugin with buddy press.

    How to get latest 10 discussion based on forum id which on assign on buddy-press group.

    We need to custom code or suggestion for this. Please replay as soon as.

    Thanks

    #191546

    Topic: Single Forums

    in forum Installation
    Andrew Leonard
    Participant

    I can create a page with a single forum using the shortcode [bbp-single-forum id=19743] but I also want it this particular forum not to be seen in the main forum index where I use the shortcode [bbp-forum-index]
    Is this possible?
    Is there another way of achieving the same effect?

    I have:
    Wordpress version 4.9.5
    BBPress Version 1.4.1
    main Forum page
    specific forum page

    #191543
    mtclmbr
    Participant

    Wondering if there are any suggestions on where to start looking or what to do. Not sure if this is at all related to the below issue or not. But I have not looked once yet at the bbpress code to see if I can figure anything out myself so if there is any suggestions or pointers that would be great. This is currently the biggest pet peeve out there with our forums that our users always mention.

    Topics with +1000 replies do not add page numbers to reply permalinks

    #191535
    jishua
    Participant

    Hello,

    Sometimes when some of my bbpress pages render, they render with bbpress code above everything else in the source (even the doctype!). It breaks the page and a user needs to refresh to see the page correctly.

    For example:

    <div id="bbpress-forums">
    
    	
    	<div id="bbp-user-wrapper">
    		
    	
    	<div id="bbp-single-user-details">
    		<div id="bbp-user-avatar">
    
    			<span class='vcard'>
    				<a class="url fn n" href="http://example.com/forums/users/firstname-lastname/" title="firstname-lastname" rel="me">
    					<!DOCTYPE html>
    <!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en-US" xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml"> <![endif]-->

    This doesn’t happen consistently. Does anyone have idea what might be causing this?

    #191530
    tylertervooren
    Participant

    Huh… looks like my link got stripped. Here it is: https://wordpress.org/plugins/bbp-profile-link-shortcode/

    #191528
    Stephen Edgar
    Keymaster

    I’ve just created the user testtest on the site

    I can login successfully using the following 3 methods:
    • Using Chrome on my desktop
    • Using Chrome emulating an iPhone 7+
    • Using my iPhone 7+ directly

    Using the above 3 methods worked successfully logging in at *both* these URLs:
    http://www.getswing.co.uk/wp-login.php
    http://www.getswing.co.uk/forums/

    The only other things I can suggest is checking with your webhosting if you have any firewall applications or rules that might be the cause of this.

    p.s Feel free to the delete the testtest account I created

    #191516
    Pascal Casier
    Moderator

    I have no solution unfortunately. And reminding is not chasing 🙂

    You don’t have any code snippets added in a function.php that you forgot to deactivate when deactivating all plugins?

    #191515
    michaellanfield
    Participant

    Hi. I would like to edit the search bar height and remove the grey border but not to cut off the text. What code do I add to custom css? Thanks.

    #191511
    Robin W
    Moderator
    $post_id = bbp_get_forum_last_active_id($forum_id)) ;
    $last_author  = get_post_field ('post_author', $post_id);
Viewing 25 results - 4,351 through 4,375 (of 32,518 total)
Skip to toolbar