Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 6,401 through 6,425 (of 32,519 total)
  • Author
    Search Results
  • #174973
    Kineta
    Participant

    @veelow – That was exactly the problem I was having. It seems to be generated from the bbPress function: bbp_buddypress_add_notification (notification with your name instead of the person who responded). The code I posted addresses that problem. Did you try it?

    #174953
    Robkk
    Moderator

    @rainbowgolfcart bbPress can use words that are in your comment moderation and blacklisting input boxes in Settings > Discussion. Some plugins like the mojo marketplace plugin that @mclaurence noted can use a function and inject a custom list of words to these input boxes. Make sure to remove the interfering plugin.

    https://codex.bbpress.org/moderation-and-blacklisting/


    @mclaurence

    Its probably just the mojo marketplace plugin, ninja forms might be fine.

    https://github.com/mojoness/mojo-marketplace-wp-plugin/blob/f5a0985168b06d9202148acce928494b54218a57/inc/spam-prevention.php#L102

    #174951
    Kineta
    Participant

    I came up with a solution, based on the start @davidstriga made. I’ve been meaning to post it for anyone else having the same issue. I don’t have the same goal he did to notify everyone in a forum, just the person being replied to, so I removed the foreach loop. I also wanted the notification to go to the actual replied-to post in the thread and not just the initial topic at the top of the page. The forum I’m working on has titles on all the replies – but if you aren’t using titles on replies the notification just shows the topic title, but the link still goes to the relevant post/reply.

    If anyone is interested, here’s my solution. It’s working great on our site and takes care of the duplicate issues, as well as the GMT timestamp problem.

    Put this in your theme’s functions.php

    /* notifications */
    
    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 ) {
    
    	$current_topic_id = bbp_get_topic_id();
    	$ids_of_subs = bbp_get_topic_subscribers($current_topic_id);
    		
    		// 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 );
    		}		
    
    		// pass the $reply_id to the function that formats the notification
    		$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 ); 
    #174930
    Stephen Edgar
    Keymaster

    I also just created a new user on the phpBB board: foundation_user, activated the user and then made the user a founder, posted a reply to a topic and ran the importer and all worked as expected:

    Screen Shot

    #174925
    Stephen Edgar
    Keymaster

    I’m pretty sure the “founder” setting won’t have anything to do with it 🙂

    What I think has happened is when you first import your forums the users will be imported as user1, user2, user3, user4 etc, if you subsequently perform another import and you did not reset the forums, or delete delete the imported users then those same 4 previously imported users will remain and the import rather than overwriting these users will import those 4 users as imported_user1, imported_user2, imported_user3, imported_user4.

    I suspect this is what has happened and hence the mismatched post to author relationships.

    #174921

    In reply to: Link to recent topics

    Pascal Casier
    Moderator

    I’m not aware of a widget per member for that. You will probably have to code something yourself.
    Pascal.

    #174918
    Pascal Casier
    Moderator

    Hi,
    If you want to limit to seeing only 1, you can put this into your functions.php: https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/#22-show%c2%a0only-1-revision-log-on-topics-and-replies
    or if you prefer a plugin, check my bbP-toolkit

    If you do not want revisions at all, you could just switch them off : ‘/wp-admin > Settings > Forums > Forum Features > Revisions’

    Pascal.

    #174916
    dragondad
    Participant

    I enabled the TinyMCE, and use the visual editor, I can copy & paste, but all the code looks only fine in the editor, after submit, it has lots of HTML tags, it did not work, and the image is not copied as well, so it did not work.
    Any idea of how to resolve it, thanks.

    #174915
    fabwintle
    Participant

    Hi,
    We have a membership site with bbpress. I am trying to keep our members informed of the new questions in our forum. I am using mailchimp in conjunction with bbpress topic feed.

    I would like to remove the ‘This topic was last modified by x for the reason y’ line. See this screenshot.

    I am not a programmer but can modify code if i find a good template.

    Would anyone be able to point me in the right direction? to either some code or a developer?

    Thank you!

    #174905
    john2323
    Participant

    Hi, I have the Whoop theme and its designed to use bbPress but the menu shows ALL categories under one menu in a row. Including sub categories. I want to change it so it only shows the parent categories as currently there are at least 30 items in the menu.

    Is the below code what needs to be change and if so can you help me out by doing this? I don’t even want the menus collapsible. Just at link for each main category and thats it.

     <div class="whoop-forum-cats-list">
                            <ul class="whoop-forum-cats-list-inner">
                                <?php
                                
                                $forum_id = bbp_get_forum_id();
                                $forum_args = array(
                                    'posts_per_page' => 100,
                                    'post_type' => bbp_get_forum_post_type(),
                                    'order' => 'ASC'
                                );
                                $forums = query_posts( $forum_args );
                                foreach ($forums as $forum) {
                                    $link = get_permalink($forum->ID);
                                    if ($forum->ID == $forum_id) {
                                        $class = 'active';
                                    } else {
                                        $class = '';
                                    }
                                ?>
                                <li>
                                    <a class="<?php echo $class; ?>" href="<?php echo $link; ?>">
                                        <div class="forum-cat-text-wrap">
                                            <?php echo $forum->post_title; ?>
                                            <div class="forum-cat-last-updated">
                                            <?php echo bbp_get_forum_last_active_time( $forum->ID ); ?>
                                            </div>
                                        </div>
                                    </a>
                                </li>
    </ul>
    
    #174897
    Pascal Casier
    Moderator

    Hi,

    Please put code into the <code> tags (have done it for you now) 🙂

    Try to visualize the outcome of implode(', ', $user_info->roles), because it will give you multiple values separated by a comma, so it will probably never give ‘administrator’.

    Pascal.

    #174892
    mvaneijgen
    Participant

    I have moved my site from my local server to my live server and now after posting a message I get redirected to ?view=all#post-10096 instead of PAGENR/#post-10107 anyway how to fix this?

    #174889
    Pascal Casier
    Moderator

    Bonjour Luc,
    Spending 2 seconds on the code, it seems to add an export or import button on the forum (only for admin), so try in your ‘/wp-admin > Forums’ and check if there is an extra button to export somewhere.

    I am looking around if any other plugins or so would exist to help you out.

    Pascal.

    #174883
    Pascal Casier
    Moderator

    Hi,
    You seem to have this somewhere:

    .site .avatar {
        border-radius: 50%;
    }

    Remove it and you should have the (normal) square ones again.
    Pascal.

    #174878
    mikeyb
    Participant

    Hi guys

    I know this is more an issue with another plugin, but I thought I would post here as well in case anyone had an ideas

    See original post here

    I’m using the NextScripts: Social Networks Auto-Poster and since setting it up 3 days ago, I’ve come in after the weekend and found it’s killed any pages I have using BBpress shortcodes (eg [bbp-forum-index]) The direct links to the forums are working fine, it’s just pages containing shortocdes.

    Does anyone have any ideas please?

    #174866
    u_Oi
    Participant

    @Robkk sorry for the late answer…

    I am back with the project… I realized what you said, the html is available only for admin; but with your code solved everything!

    Thanks!

    In case anyone need… I made Visual Editor visible in bbPress with this code:

    /*Editor Visual bbPress*/
    function bbp_enable_visual_editor( $args = array() ) {
        $args['tinymce'] = true;
        return $args;
    }
    add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );
    u_Oi
    Participant

    Hi Guys!

    I found the guide where are the codes for “Show status labels for bbPress Topics”… Well, I want to add a label for “Topics with No replies”, i tried do it by myself but It makes me crazy..

    Does anybody know which reference or functions should I use?

    Thanks.

    #174859
    Robkk
    Moderator

    I haven’t tested this lately, but you could export then import 1 forum at a time using this plugin. This plugin might only import topics that are not closed, and it may autosubscribe topic authors to topics, and maybe auto favorite too.

    https://github.com/pippinsplugins/bbPress-Export-and-Import

    I recommend testing it out on a localhost installation.

    https://codex.bbpress.org/getting-started/testing-your-bbpress-installation/creating-a-test-site/

    #174849
    Robkk
    Moderator

    You are using Robin’s Private Groups plugin with BuddyPress, and using BuddyPress’ Group functionality right?? And this issue only seems to occur only for you, or users with similar roles??

    Have you tried the plugin and cache troubleshooting listed on this page.

    https://codex.bbpress.org/getting-started/troubleshooting/

    #174847
    Robkk
    Moderator

    For the submit button you can do something like this.

    #bbpress-forums fieldset.bbp-form button {
      font-size: 20px !important;
    }
    #174846
    Robkk
    Moderator

    Can you post a link to the page on your site that you put the search form shortcodes, so I could test and see what possibly could be the issue.

    #174840
    rateyourway
    Participant

    Hi!

    I am very new to bbpress and i’m trying to set it up on my site.

    I have created a bbpress forum page where i display shortcodes. The shortcode for the search shows up, but it won’t find any topic.

    Anyone has an idea of what i’m doing wrong?

    Thanks!

    #174838
    HBDev
    Participant

    Hello I have a website which relies on user roles such as administrator to show certain content. I have installed BBPress which seems to break my user roles for example all Administrators become Keymasters also which is fine but if I run a query such as the code below it evaluates to false.

    Any help would be greatly appreciated.

    
    <?php
             if (is_user_logged_in() ) { 
    
             $user_ID = get_current_user_id();
             $user_info = get_userdata($user_ID);
             if(isset($user_info->roles) && implode(', ', $user_info->roles) == 'administrator') { ?>;
             <?php } >;
    #174835
    JAMMI2580
    Participant

    if you feints there,robkk… I have the same problem with the font of the button “submit”

    #bbpress-forums div.bbp-the-content-wrapper div.bbp-submit-wrapper button id.bbp_reply_submit button submit {
      font-size: 20px !important;
    }

    thanks

    #174825
    Robkk
    Moderator

    I guess bbPress does not show the revisions for replies in the backend like I thought, I guess only topics then??

    Use this php code snippet to enable the metabox for revisions, add it to your functions,php file in your child theme or use a plugin like functionality.

    I think after 2 edits it will show up I think.

    function rkk_add_revision_support_for_replies() {
      add_post_type_support( 'reply', 'revisions' );
    }
    add_action( 'init', 'rkk_add_revision_support_for_replies' );
Viewing 25 results - 6,401 through 6,425 (of 32,519 total)
Skip to toolbar