Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 6,351 through 6,375 (of 32,505 total)
  • Author
    Search Results
  • #175202
    kachan64
    Participant

    There is a code I implemented a while ago on my site by doing something like this

    <?php 
    		$displayed_user = bbp_get_reply_author_id() ;
    		$role = bbp_get_user_role( $displayed_user);
    		if ( bbp_is_user_keymaster($displayed_user) ||$role == 'bbp_keymaster') : ?>
    		<div class="bbp-author-role">Administrator</div>
    <?php endif; ?>

    Where is says $role == ‘bbp_keymaster’ you can change that. If I get your question correctly.

    Robkk
    Moderator

    There is something in the codex about a bbPress forums page, but specifically it is for the forum index only not bbPress forums entirely. So it will not embed bbPress in an iframe like other forum solutions that host the forum content on their own servers.

    Look into creating a bbpress.php file for your site so that all your bbPress pages will use the same template, which is what you are looking for, for this to work.

    https://codex.bbpress.org/themes/theme-compatibility/getting-started-in-modifying-the-main-bbpress-template/

    #175195
    giobby
    Participant

    Just realised I didn’t post the right error.
    Here it is…

    Error Code: 1054. Unknown column ‘profile_fields_data.pf_phpbb_website’ in ‘field list’.

    That column doesn’t exist in my profile_fields_data table.
    Also, I was not getting that error with the previous version of the converter so i am wondering if the converter expects a specific/recent phpBB version to convert from

    andrew55
    Participant

    I have a custom wp role that I have displaying under each user author link in all replies. There are different custom roles depending on the user. I was able to use it by implementing this snippet (inserted on loop-single-reply.php):

    <?php
    $user = new WP_User( bbp_get_reply_author_id() );
    echo $user->roles[0];
    ?>

    My question is how to get some text (with link) to show if a user has a specific custom role. For example, is user has “Graduate” role, I need a link with text to show under the role, in all the replies for all users.

    I’m not coder by any means, but I realize it will probably take a php “if” statement. Any suggestions on how I might accomplish this? Thanks for any help.

    #175186
    giobby
    Participant

    After further investigation, It looks to be something related to the character – see error below.

    Error Code: 1115. Unknown character set: ‘“utf8mb4”’

    Not sure why it’s trying to make this conversion :-\

    #175181
    kachan64
    Participant

    I’m trying to add a forum description. I used
    <?php bbp_forum_content(); ?>

    in loop-single-forum and didn’t work! Any other way I can do this? I have not modified any theme fifle, I simply copied loop-forums & loop-single-forums into my bbpress folder in my them folder

    #175166
    akira010203
    Participant

    I found out where is the problem.

    It is due to the language translation file, If I put the default language back in english there is no problems.

    To the french users if you get this issue try :

    #bbpress-forums .administrateur .bbp-author-role {
      background-color: blue;

    It will wrk but when it comes to the french translation of moderator : modérateur it will be harder due to the special character on it.

    You will have to rename it before being able to change color.

    #175155
    alzaran
    Participant

    I’ve found a function that enables autocomplete on any element of my choice. I’m reproducing it below:

    function buddydev_enable_mention_autosuggestions_on_compose( $load, $mentions_enabled ) {
    	if ( ! $mentions_enabled ) {
    		return $load; //activity mention is  not enabled, so no need to bother
    	}
    	//modify this condition to suit yours
    	if( is_user_logged_in() ) {
    		$load = true;
    	}
     
    	return $load;
    }
    add_filter( 'bp_activity_maybe_load_mentions_scripts', 'buddydev_enable_mention_autosuggestions_on_compose', 10, 2 );

    However, this only works with a textarea or input, I believe. TinyMCE, on the other hand, is an iframe with HTML elements generated on the fly. As such, when I try to initialize the function using the below:

    if ( jQuery( '#bbp_reply_content_ifr').get( 0 ) ) {
    		console.log('success');
    		jQuery('#bbp_reply_content_ifr').bp_mentions( bp.mentions.users );
    	}

    Nothing happens. What am I doing wrong? Buddypress supports the @mentions on TinyMCE instances (see here: https://buddypress.trac.wordpress.org/ticket/6972) and bbpress supports it in the plaintext editor. How can I enable it for the TinyMCE editor?

    #175146
    JijOnline
    Participant

    this does work like this: <?php bbp_topic_excerpt(); ?>

    #175143
    akira010203
    Participant

    Hello,

    I got an issue while trying to put a background color under the role name on my forum.

    I added this to my function file :

    function rk_show_role_classes($classes) {
        $replyid = bbp_get_reply_author_id();
        $bbp_get_role = bbp_get_user_display_role($replyid);
        $bbp_display_role = strtolower($bbp_get_role);
    	  
      
    	$classes[] = $bbp_display_role;
    	return $classes;
    }
    add_filter( 'bbp_get_topic_class','rk_show_role_classes' );
    add_filter( 'bbp_get_reply_class','rk_show_role_classes' );

    and this into my css file :

    #bbpress-forums .participant .bbp-author-role {
      background-color: blue;
    #bbpress-forums .keymaster .bbp-author-role {
      background-color: red;
    #bbpress-forums .moderator .bbp-author-role {
      background-color: green;

    But it only works with the participant role. Maybe I’m not using the correct keymaster and moderator role name. Is someone already did that and can help me to sold it out ?

    Thanks!

    Robin W
    Moderator

    ok, that opened up a whole new area, and I think I’ve worked out what is happening !

    When a new topic/reply is created, bbpress sends a email

    to : noreply@vpinball.com
    bcc : all the subscribers of that topic

    Bbpress changed how this works in a recent version. It used to send an email per user, but many mail servers saw say 200 emails going at once as spam, and blocked them.

    So now bbpress sends to an address and blind copies all the users, so that in most cases a single email is sent. This still creates a risk, as some mail servers block multiple bcc’s over a certain number, but is probably better for most sites.

    Now the problem with this is that some mailservers will return invalid email addresses, and as your noreply email doesn’t exist, you get a failed.

    so you could

    1. create the noreply email address on your system, so that a mailbox gets them, and every so often just clear it out.
    2. change that noreply email address to a valid email – I can give you code to make it anything you want, but as with 1 above a mailbox will get them so it will fill up.
    3. change the code to send emails individually – the old code is somewhere.

    Let me know your thoughts

    Kineta
    Participant

    Here you go. I have this in my theme’s functions.php file. I posted this code a while ago, but there was a small mistake which is fixed here.

    function jpr_buddypress_add_notification( $reply_id = 0, $topic_id = 0, $forum_id = 0, $anonymous_data = false, $author_id = 0, $is_edit = false, $reply_to = 0 ) {
    	
    		
    		// this is who the notification goes to. whose post is replied to
    		$topic_author_id = bbp_get_topic_author_id( $reply_to );
    
    		// Bail if somehow this is hooked to an edit action
    		if ( !empty( $is_edit ) ) {
    			return;
    		}
    
    		// Get author information
    		// $topic_author_id   = bp_loggedin_user_id();
    		$secondary_item_id = $author_id;
    
    		// Hierarchical replies
    		if ( !empty( $reply_to ) ) {			
    			$reply_to_item_id = bbp_get_topic_author_id( $reply_to );
    			// if not replying to OP:
    			$topic_id = $reply_to;
    		}		
    
    		
    		// Get some reply information
    		$args = array(
    			'user_id'          => $topic_author_id,
    			'item_id'          => $topic_id,
    			'component_name'   => bbp_get_component_name(),
    			'component_action' => 'bbp_new_reply',
    			'date_notified'    => get_post( $reply_id )->post_date_gmt,
    		);
    	 	
    		// Notify the topic author if not the current reply author
    	 	if ( $author_id !== $topic_author_id ) {
    			$args['secondary_item_id'] = $secondary_item_id ;
    
    			bp_notifications_add_notification( $args );
    	 	}
    	 	// Notify the immediate reply author if not the current reply author
    	 	if ( !empty( $reply_to ) && ( $author_id !== $reply_to_item_id ) ) {
    			$args['secondary_item_id'] = $secondary_item_id;
    			
    			bp_notifications_add_notification( $args );
    	 }
    }
    // remove the bbpress notification function so we don't get dupicate notifications
    remove_action( 'bbp_new_reply', 'bbp_buddypress_add_notification', 10, 7 );
    add_action( 'bbp_new_reply', 'jpr_buddypress_add_notification', 10, 7 );
    
    // remove the bbpress format notification function before using our custom function
    remove_filter( 'bp_notifications_get_notifications_for_user', 'bbp_format_buddypress_notifications', 10, 5 );
    
    function jpr_format_buddypress_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) {
    
    	// New reply notifications
    	if ( 'bbp_new_reply' === $action ) {
    		$topic_id    = bbp_get_reply_id( $item_id );
    		$topic_title = bbp_get_reply_title( $item_id );
    		$topic_link  = wp_nonce_url( add_query_arg( array( 'action' => 'bbp_mark_read', 'topic_id' => $topic_id ), bbp_get_reply_url( $item_id ) ), 'bbp_mark_topic_' . $topic_id );
    		$title_attr  = __( 'Topic Replies', 'bbpress' );
    
    		if ( (int) $total_items > 1 ) {
    			$text   = sprintf( __( 'You have %d new replies', 'bbpress' ), (int) $total_items );
    			$filter = 'bbp_multiple_new_subscription_notification';
    		} else {
    			if ( !empty( $secondary_item_id ) ) {
    				$text = sprintf( __( 'You have %d new reply to %2$s from %3$s', 'bbpress' ), (int) $total_items, $topic_title, bp_core_get_user_displayname( $secondary_item_id ) );
    			} else {
    				$text = sprintf( __( 'You have %d new reply to %s',             'bbpress' ), (int) $total_items, $topic_title );
    			}
    			$filter = 'bbp_single_new_subscription_notification';
    		}
    
    		// WordPress Toolbar
    		if ( 'string' === $format ) {
    			$return = apply_filters( $filter, '<a href="' . esc_url( $topic_link ) . '" title="' . esc_attr( $title_attr ) . '">' . esc_html( $text ) . '</a>', (int) $total_items, $text, $topic_link );
    			
    		// Deprecated BuddyBar
    		} else {
    			$return = apply_filters( $filter, array(
    				'text' => $text,
    				'link' => $topic_link
    			), $topic_link, (int) $total_items, $text, $topic_title );
    		}
    
    		do_action( 'jpr_format_buddypress_notifications', $action, $item_id, $secondary_item_id, $total_items );
    
    		return $return;
    	}
    }
    add_filter( 'bp_notifications_get_notifications_for_user', 'jpr_format_buddypress_notifications', 10, 5 );
    
    
    #175125
    alzaran
    Participant

    So Buddypress, by default, has a nifty @function that allows you to look up users by username. As I understand it, bbpress works with this out of the box, in the reply boxes. However, when I enable TinyMCE using the tutorial above (https://codex.bbpress.org/enable-visual-editor/), Buddypress autocomplete goes away completely. We’d rather not have to choose between these two features, is there a way to restore autocomplete even with TinyMCE enabled?

    #175120
    Digital Arm
    Participant

    After upgrading to PHP 5.5 and running a compatibility test on a site, it has flagged the use of a deprecated modifier being used in preg_replace functions.
    These occur on lines 1149 and 1150 in file /includes/admin/parser.php

    1149 | ERROR | preg_replace() – /e modifier is deprecated in PHP 5.5
    1150 | ERROR | preg_replace() – /e modifier is deprecated in PHP 5.5

    Could you please let me know the best way to replace the code with the preg_replace_callback function and let me know if this is likely to be updated in a future patch as this can be seen as a security concern.

    Thank you

    #175115
    dawidadach
    Participant

    Hi guys,

    for some reason , in our bbpress forum (http://mdbootstrap.com/forums/forum/support/) code tag doesnt work . Regardless whether we use it or not all HTML markups are executed instead of displayed. The only way to display it is to replace all <> with &gt and &lt

    Any idea?

    Robin W
    Moderator

    try the shortcodes in my style pack

    [bsp-display-topic-index show=’5′]

    https://wordpress.org/plugins/bbp-style-pack/

    Schoelje
    Participant

    Note: else if should be elseif.
    It still works, though.

    How do I set this topic to resolved?

    Schoelje
    Participant

    It took some time to make this topic visible on the forum. So, I’ve solved my own problem.

    Instead of writing an htacces file I chose to write an alternative viewtopic.php script that collects the appropriate new bbPress URL from the database.

    If your new bbPress forum is online, you place the following script in your old phpBB domain and save it as viewtopic.php (exactly where the old viewtopic.php used to be located) and don’t forget to replace the “my_xxxx” values with your information:

    <?php
      // If all else fails, use this url.
      $defaulturl = "http://my_domain/forums/";
      
      // Your new bbPress database credentials.
      $host = "my_host";
      $db = "my_database";
      $dbuser ="my_database_user";
      $userpwd = "my_database_user_password";
      
      // Build the query according to url parameters p or t.
      $query = '';
      if (!empty($_GET['p'])) {
          $query = "SELECT xkcom_posts.guid FROM xkcom_postmeta 
                    INNER JOIN xkcom_posts ON xkcom_posts.ID = xkcom_postmeta.post_id 
                    WHERE xkcom_postmeta.meta_key = '_bbp_old_reply_id' 
                    AND xkcom_postmeta.meta_value = '" . $_GET['p'] . "';";
      }else if (!empty($_GET['t'])) {
          $query = "SELECT xkcom_posts.guid FROM xkcom_postmeta 
                    INNER JOIN xkcom_posts ON xkcom_posts.ID = xkcom_postmeta.post_id 
                    WHERE xkcom_postmeta.meta_key = '_bbp_old_topic_id' 
                    AND xkcom_postmeta.meta_value = '" . $_GET['t'] . "';";
      }
      
      // Set the new url to the default url
      $url = $defaulturl;
      
      // Check if we need to make a database connection.
      if (!empty($query)) {
        // Make a connection
        $mysqli = new mysqli($host, $dbuser, $userpwd, $db);
        
        // Check the connection.
        if (!$mysqli->connect_errno) {
          // Run the query.
          $result = $mysqli->query($query);
          
          // Get the new URL.
          if ($result) {
    	$row = $result->fetch_array(MYSQLI_ASSOC);
    	$guid = trim($row["guid"]);
    	if (!empty($guid)) {
    	  $url = $guid;
    	}
          }
    
          // Free the result set.
          $result->free();
    
          // Close the connection.
          $mysqli->close();
        }
      }
      
      //var_dump($url);
      
      // Write the header.
      header("Location: " . $url, true, 301);
    ?>
    #175105

    Topic: Global Access

    in forum Installation
    sharmavishal
    Participant

    Hi @johnjamesjacoby

    the codex mentions this for Allow Global Access
    In a WordPress Multisite install bbPress is activated on individual sites. Allowing global access will permit all users from across the network to post topics and replies on the forums for this particular site.

    i activated bbpress per site on my 3 network sites. still i dont see any setings for global access? does global access happen by default?

    Also is there some similar setting for bbpress like buddypress’s define(‘BP_ENABLE_MULTIBLOG’, true);?

    i got define(‘BP_ENABLE_MULTIBLOG’, true); enabled for my wp+bp multinetwork. But forums on the root site dont show up on the sub sites like groups/members do with that setting enabled.

    Thanks in advance.

    #175102
    u_Oi
    Participant

    Thanks @Casiepa

    But I don’t want count the replies, I just wanna add a Label to Topics with 0 replies, and hide it if somebody reply the topic.

    I found the info here:

    24. Show status labels for bbPress Topics

    Any other suggestion?

    I think the label (no replies) should be on the documentation by default.

    ropyro
    Participant

    Hello,

    I have a forum currently set up for our organization. I am using some fellow employees to test it but it looks like people are able to go in and make posts for our blog (saved but not published in the Contributor, Participant roles). I don’t want that. Users should only be able to post to our website forum, and nothing else. Is there a line of code that I’m missing for this?

    I would also like to know if there is a way to mask being able to see one another user’s posting stats. TIA!

    website is creatingourcommonwealth.org. Our WordPress template is Ribosome, if that helps any.

    Schoelje
    Participant

    I’ve successfully imported phpBB data into bbPress. Now, I’d like to redirect URLs like
    http://my_phpbb_domain.com/viewtopic.php?f=1&t=2
    to:
    http://my_wordpress_domain.com/forums/topic/corresponding_topic/

    I’ve search the web and have been experimenting with several solutions but without any luck. Anything I do throws a 404.

    These are some of the links I tried out:

    Rewriting URLs

    Redirection to new bbPress board?

    As you can see, these topics are at least 7 years old. On the other hand, I don’t expect that something has changed on how to write redirects in an htaccess file.

    Does somebody here has some experience with this?

    #175070
    nemoclown
    Participant

    Ok Update: I did the Short code for creating forums… I added a Page, then input the shortcode into it, And plugged that page into a menu as a sub option as you can unfortunately view at my website Gamingcommunity.us . I limited the function of the shortcode to be used only by moderators and keymasters, But how do I hide the visibility of the menu’d sub page to anyone who doesn’t have the permission to use it?

    #175069
    pcpro178
    Participant

    Are there shortcodes for getting a member/user’s recent posts or comments? I don’t see anything like this in the documentation. It seems like a rather basic thing to have with a bulletin board or forum.

    wdppoppe81
    Participant

    Hi All,

    After configuring the importing form and clicking the start button, a failure message appears after amount of time;

    Unknown column 'forums.forum_topics' in 'field list'
    

    After clicking again on the start button only the reactions will be converted from phpBB to bbpress.

    How can I import the topics and users properly, without encounter these failures?

    Grtz.

    Willem

Viewing 25 results - 6,351 through 6,375 (of 32,505 total)
Skip to toolbar