Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 4,001 through 4,025 (of 32,481 total)
  • Author
    Search Results
  • Robin W
    Moderator

    so 303 should read

    $sticky_query['perm'] = $r['perm'];

    yes ?

    robertstaddon
    Participant

    Here is the incorrect piece of code that is currently there:

    	// Lean on the 'perm' query var value of 'readable' to provide statuses
    	} else {
    		$sticky_query['post_status'] = $r['perm'];
    	}

    And here is how the code should read:

    	// Lean on the 'perm' query var value of 'readable' to provide statuses
    	} else {
    		$sticky_query['perm'] = $r['perm'];
    	}
    Robin W
    Moderator

    try this filter

    //make sure scheduled stickies don't show - pending fix by bbpress
    add_filter ('bbp_get_stickies', 'rew_get_stickies' , 10 , 2) ;
    function rew_get_stickies ($stickies, $forum_id ) {
    	$return = array () ;
    	//check if any are future
    	foreach ($stickies as $sticky) {
    		if (get_post_status( $sticky ) !='future') 
    		 array_push ($return, $sticky) ;
    	}
    return $return ;	
    }
    #196348
    Robin W
    Moderator

    your site is using the bbpress.min.css file

    you should copy the bbpress.css file to your childtheme as per

    Theme Compatibility

    and amend it there

    #196346

    In reply to: View group members

    Robin W
    Moderator

    I don’t know of any plugins that do this, and it si not settings, so you would need someone to write code to do this

    You will also under most countries data protection laws need the approval of users to their email address being published to other users.

    #196324
    clementeronimo
    Participant

    Hi I push this topic cause I have the same problem.

    I set up a topic on a specific page with shortcode [bbp-single-topic id=$topic_id] on this page https://www.lebanquetdesaintleu.fr/evenement/du-bruit-et-de-fureur-chronique-rap/2018-11-15/

    But when there are too many answers it creates a second page. And when I click I get a 404. But if I try to go to the forum with the direct URL it works. https://www.lebanquetdesaintleu.fr/forums/topic/forum-de-bruit-et-de-fureur-chronique-rap/

    I’m using Avada theme and Buddypress.

    How can I fix it ? Is there a way to show all the exchange on the same page ??

    Thanks,
    Clément

    #196309

    In reply to: Custom Fields

    Robin W
    Moderator

    you need to alter ‘post’ to topic and reply eg (untested)

    function adding_custom_meta_boxes( $post_type, $post ) {
        add_meta_box( 
            'my-meta-box',
            __( 'My Meta Box' ),
            'render_my_meta_box',
            'topic',
            'normal',
            'default'
        );
    add_meta_box( 
            'my-meta-box2',
            __( 'My Meta Box 2' ),
            'render_my_meta_box',
            'reply',
            'normal',
            'default'
        );
    
    }
    add_action( 'add_meta_boxes', 'adding_custom_meta_boxes', 10, 2 );
    #196294
    elxafil
    Participant

    Greetings,

    I am looking for the pro version of the plugin: https://wordpress.org/plugins/bbp-user-ranks-lite/ which allows the ability for me to have role based badges below certain members on my forums however both the author’s website and the codecanyon posts of this plugin have been disabled so I am unable to get this plugin, if anyone has a copy they can send me or somewhere I can buy it I will be greatful.

    #196288
    Robin W
    Moderator

    I can’t immediately think of any existing code.

    Option 1 is the quick answer, but more manual.

    It could be coded, a simple way would be to stop replies on the front end if a reply didn’t exist unless an admin.

    you would need to amend form-reply.php – do you

    1. have a child theme and
    2. know how to ftp files to and from your PC?

    If so contact me via my website

    http://www.rewweb.co.uk

    #196287
    Robin W
    Moderator

    lots of ways to do this, you might want to have a think about the best for you

    I have a plugin called

    Private groups

    which lets you set up groups and may be the best solution

    alternately

    if you are able to ftp and edit files the message is held in

    wp-content/plugins/bbpress/templates/default/bbpress/feedback-no-forums.php

    so

    create a directory on your theme called ‘bbpress’
    ie wp-content/themes/%your-theme-name%/bbpress

    where %your-theme-name% is the name of your theme

    find
    wp-content/plugins/bbpress/templates/default/bbpress/feedback-no-forums.php
    Make a copy of this file, and put in in the directory called bbpress that you created above, so you end up with
    wp-content/themes/%your-theme-name%/bbpress/feedback-no-forums.php
    bbPress will now use this template instead of the original
    and you can amend this

    so go into it and amend the message to what you desire.

    You could instead put this in your functions file or put it in a code plugin such as

    PHP code snippets (Insert PHP)

    function rew_change_text( $translated_text, $text, $domain ) {
    	if ( $text == 'Oh bother! No forums were found here!' ) {
    	$translated_text = 'whatever you want it to say in here!' ;
    	}
    	return $translated_text;
    }
    
    add_filter( 'gettext', 'rew_change_text', 20, 3 );
    
    #196284
    Robin W
    Moderator

    yes crack that code open it is in includes/widgets, you should find a good place to filter – probably change 159-161 – set the ‘post_parent__in’ to the forum of the current buddypress group, and the settings in the widget will be ignored.

    #196283
    rgilman
    Participant

    Hi Robin, thanks for your response. It looks like (style pack) latest activity gets me close and will provide a great starting point and tutorial from a bbp master.

    Apologies for the lack of clarity in my initial post. Let me explain a bit more.

    I’m developing a site that builds on Commons In A Box. You can see more about what we are doing at https://github.com/ContextInstitute/bfcom. The readme and wiki are out-of-date in the details but the general direction is right.

    We are designing for a large number of BuddyPress groups, each with its own forum. It will be a private site with access only to registered users. Most users will be involved in only a subset of the groups/forums.

    Each user will have a personalized home page/dashboard. One of the features on that dashboard will be a listing of the most recent posts/replies in topics in all of the forums to which that user belongs. So we need to start from something like groups_get_user_groups( bp_loggedin_user_id() ) and then go into something like what you do in (style pack) latest activity.

    Having (style pack) latest activity as a starting point feels like a tremendous help.

    Thank you again. 🙂

    #196274

    Topic: Custom Fields

    in forum Troubleshooting
    Clivesmith
    Participant

    On my site I am the only one that can create a new topic (anyone can reply) I am trying to introduce a couple of pieces of text that will be added to the end of the content of each reply. (they are twitter names and twitter hashtags).

    I have found this piece of code that allows me to add some input fields to a new topic but it only works at the front end, I have been trying with no luck to find a hook I can use to get this to work on the back end. Can any one help please ?

    add_action ( ‘bbp_theme_before_topic_form_content’, ‘bbp_extra_fields’);
    function bbp_extra_fields() {
    $value = get_post_meta( bbp_get_topic_id(), ‘bbp_extra_field1’, true);
    echo ‘<label for=”bbp_extra_field1″>hashtag</label><br>’;
    echo “<input type=’text’ name=’bbp_extra_field1′ value='”.$value.”<br>’>”;
    $value = get_post_meta( bbp_get_topic_id(), ‘bbp_extra_field2’, true);
    echo ‘<br><label for=”bbp_extra_field2″>Twitter Name</label><br>’;
    echo “<input type=’text’ name=’bbp_extra_field2′ value='”.$value.”‘>”;
    }
    /* Write out to meta table */
    add_action ( ‘bbp_new_topic’, ‘bbp_save_extra_fields’, 10, 1 );
    add_action ( ‘bbp_edit_topic’, ‘bbp_save_extra_fields’, 10, 1 );
    $topic_id = bbp_get_topic_id();
    function bbp_save_extra_fields($topic_id) {
    if (isset($_POST) && $_POST[‘bbp_extra_field1’]!=”)
    update_post_meta( $topic_id, ‘bbp_extra_field1’, $_POST[‘bbp_extra_field1’] );
    if (isset($_POST) && $_POST[‘bbp_extra_field2’]!=”)
    update_post_meta( $topic_id, ‘bbp_extra_field2’, $_POST[‘bbp_extra_field2’] );
    }

    #196261
    Robin W
    Moderator

    not tested as going out soon, but this should work

    add_action ( 'bbp_new_topic', 'myprefix_assign_tag_to_post', 10, 4 );
    add_action ( 'bbp_edit_topic', 'myprefix_assign_tag_to_post', 10, 4 );
    
    function myprefix_assign_tag_to_post($topic_id, $forum_id, $anonymous_data, $topic_author) {
    if( $forum_id == '168'  && bbp_current_user_can_publish_topics() ) {
    	wp_set_post_terms( $topic_id, 'introductions', 'topic-tag', true );
    }
    
    elseif($forum_id == '1343' && bbp_current_user_can_publish_topics() ) {
    		wp_set_post_terms( $topic_id, 'discovery', 'topic-tag', true );
    
    }
    }
    #196257
    rgilman
    Participant

    How can I code an activity stream that lists only the most recent post for each topic, not all recent posts (which can include many posts from the same topic) as the standard widget does?

    I’m using bbPress 2.5.14, BuddyPress 3.20 and WordPress 4.9.8 on a local dev server so no public link to the site.

    #196256
    GeekyJules
    Participant

    I’m trying to write a conditional statement to auto tag new topics based on forum.

    This is what I have so far

    add_action ( 'bbp_insert_topic', 'myprefix_assign_tag_to_post' , 10, 1 );
    add_action ( 'bbp_new_topic', 'myprefix_assign_tag_to_post', 10, 1 );
    add_action ( 'bbp_edit_topic', 'myprefix_assign_tag_to_post', 10, 1 );
    
    function myprefix_assign_tag_to_post($topic_id) {
    if( bbp_is_forum ( '168' ) && bbp_current_user_can_publish_topics() ) {
    	wp_set_post_terms( $topic_id, 'introductions', 'topic-tag', true );
    }
    
    elseif( bbp_is_forum ( '1343' ) && bbp_current_user_can_publish_topics() ) {
    		wp_set_post_terms( $topic_id, 'discovery', 'topic-tag', true );
    
    }
    }
    

    The problem is, this automatically tags the new topics with “Introductions” regardless of the forum. I tried replacing ‘bbp_is_forum’ with ‘bbp_is_single_forum’, and the same thing happens. I’ve tried replacing it with ‘bbp_is_forum_archive’ and nothing happens. I’ve even tried replacing the ID with slug, with and without the single quotes, trying it with just one IF statement, and I’m not getting the desired results.

    I also tried using is_page, hoping it would be using the default WordPress call since it used in the functions.php for topics. No joy.

    So, if someone could please tell me what I should be using instead of is_forum, is_single_forum, is_etc, that would be great.

    #196253
    maxlevel
    Participant

    I have 5 different forums.
    Only one of them should serve as a Q&A forum where people can ask us questions. Nobody should be able to reply before we reply. I could think of two ways to make that happen:

    1. The forum is moderated and all topics have to be approved before they are posted together with our answers. After posting other people can reply too.

    2. All the topics are initially private. So we can answer it and then make it public for receiving further replies.

    I could not find code or plugins to make that happen and would be very grateful for any advice.

    #196241

    In reply to: Custom Topic Statuses?

    krioteh
    Participant

    Buddy-bbPress Support The topic still works with bbPress 2.6, albeit with errors.
    You can return the form to the console settings of a specific forum using this code:

    
    add_action('add_meta_boxes', 'bbbp_support'); 
    add_action('save_post', 'bbbp_save'); 
    
    function bbbp_support() {
    	add_meta_box('bbbp_support', 'BbbPress Support', 
    	'bbbp_support_callback', 'forum'); 
    }
    // HTML код блока
    function bbbp_support_callback( $forum = falce ){
    		if ( empty( $forum->ID ) ) {
    			return;
    		}
    
    		$support_feature = bpbbpst_get_forum_support_setting( $forum->ID );
    
    		$mailing_list_style = '';
    		if ( 3 === (int) $support_feature ) {
    			$mailing_list_style = 'style="display:none"';
    		}
    
    		$support_only_style = 'style="display:none"';
    
    		if ( 2 === (int) $support_feature ) {
    			$support_only_style = '';
    		}
    
    		bpbbpst_display_forum_setting_options( $support_feature );
    		?>
    		<div class="bpbbpst-mailing-list" <?php echo $mailing_list_style;?>>
    			<h4><?php _e( 'Who should receive an email notification when a new support topic is posted ?', 'buddy-bbpress-support-topic' );?></h4>
    
    			<?php bpbbpst_checklist_moderators( $forum->ID );?>
    		</div>
    
    		<?php do_action_ref_array( 'bpbbpst_forum_support_options', array( $forum->ID, $mailing_list_style ) ); ?>
    
    		<div class="bpbbpst-support-guides" <?php echo $support_only_style;?>>
    			<h4><?php _e( 'New Topic form extras', 'buddy-bbpress-support-topic' );?></h4>
    			<label class="screen-reader-text" for="support-topic-intro"><?php esc_html_e( 'New Topic Guide', 'buddy-bbpress-support-topic' ); ?></label>
    			<textarea rows="3" cols="40" name="_bpbbpst_support_topic[intro]" id="support-topic-intro" style="width:100%"><?php echo bpbbpst_get_forum_support_topic_intro( $forum->ID );?></textarea>
    			<p class="description"><?php printf( esc_html__( 'Use this field to insert some instructions above the new topic form. Allowed tags are: %s', 'buddy-bbpress-support-topic' ), join( ', ', array_keys( (array) wp_kses_allowed_html( 'forum' ) ) ) ); ?></p>
    
    			<label class="screen-reader-text" for="support-topic-tpl"><?php esc_html_e( 'New Topic Template', 'buddy-bbpress-support-topic' ); ?></label>
    			<textarea rows="3" cols="40" name="_bpbbpst_support_topic[tpl]" id="support-topic-tpl" style="width:100%"><?php echo bpbbpst_get_forum_support_topic_template( $forum->ID );?></textarea>
    			<p class="description"><?php esc_html_e( 'The text added within this field will be used as a template for the content of new topics.', 'buddy-bbpress-support-topic' ); ?></p>
    		</div>
    		<?php
    
    		do_action_ref_array( 'bpbbpst_forum_support_options_after_guides', array( $forum->ID, $support_only_style ) );
    	}
    	function bbbp_save( $forum_id = 0 ) {
    		$support_feature   = false;
    		$is_forum_category =  bbp_is_forum_category( $forum_id );
    
    		if ( ! empty( $_POST['_bpbbpst_forum_settings'] ) ) {
    			$support_feature = absint( $_POST['_bpbbpst_forum_settings'] );
    		}
    
    		// Forum is not a category, save the support metas
    		if ( ! empty( $support_feature ) && ! $is_forum_category ) {
    			update_post_meta( $forum_id, '_bpbbpst_forum_settings', $support_feature );
    
    			if ( 3 === (int) $support_feature ) {
    				delete_post_meta( $forum_id, '_bpbbpst_support_recipients' );
    				delete_post_meta( $forum_id, '_bpbbpst_support_topic_intro' );
    				delete_post_meta( $forum_id, '_bpbbpst_support_topic_tpl' );
    			} else {
    				$recipients = ! empty( $_POST['_bpbbpst_support_recipients'] ) ? array_map( 'intval', $_POST['_bpbbpst_support_recipients'] ) : false ;
    
    				if ( ! empty( $recipients ) && is_array( $recipients ) && count( $recipients ) > 0 ) {
    					update_post_meta( $forum_id, '_bpbbpst_support_recipients', $recipients );
    				} else {
    					delete_post_meta( $forum_id, '_bpbbpst_support_recipients' );
    				}
    
    				if ( 2 === (int) $support_feature ) {
    					if ( ! empty( $_POST['_bpbbpst_support_topic']['intro'] ) ) {
    						update_post_meta( $forum_id, '_bpbbpst_support_topic_intro', wp_unslash( $_POST['_bpbbpst_support_topic']['intro'] ) );
    					} else {
    						delete_post_meta( $forum_id, '_bpbbpst_support_topic_intro' );
    					}
    
    					if ( ! empty( $_POST['_bpbbpst_support_topic']['tpl'] ) ) {
    						update_post_meta( $forum_id, '_bpbbpst_support_topic_tpl', wp_unslash( $_POST['_bpbbpst_support_topic']['tpl'] ) );
    					} else {
    						delete_post_meta( $forum_id, '_bpbbpst_support_topic_tpl' );
    					}
    				} else if ( ! empty( $_POST['_bpbbpst_support_topic'] ) ) {
    					delete_post_meta( $forum_id, '_bpbbpst_support_topic_intro' );
    					delete_post_meta( $forum_id, '_bpbbpst_support_topic_tpl' );
    				}
    			}
    
    			do_action( 'bpbbpst_forum_settings_updated', $forum_id, $support_feature );
    
    		// Check for support metas to eventually remove them
    		} else if ( $is_forum_category ) {
    			$support_feature = get_post_meta( $forum_id, '_bpbbpst_forum_settings', true );
    
    			if ( ! empty( $support_feature ) ) {
    				delete_post_meta( $forum_id, '_bpbbpst_forum_settings' );
    				delete_post_meta( $forum_id, '_bpbbpst_support_recipients' );
    				delete_post_meta( $forum_id, '_bpbbpst_support_topic_intro' );
    				delete_post_meta( $forum_id, '_bpbbpst_support_topic_tpl' );
    			}
    		}
    
    		return $forum_id;
    	}
    

    Unfortunately, I have not yet found a way to eliminate errors when editing themes in the console: (

    #196239
    Robin W
    Moderator

    @domeboys I have remove the error code as it looked like it contained the card details of one of your customers.

    I can only repeat that you had a working site a week or so ago, and something changed to create the issues you have now. bbpress has not changed, but something has caused an error.

    This could be down to many issues, including updates you have done, or database corruption.

    I appreciate that you are feeling very frustrated.

    In your position, I would be asking HostGator to revert my site to before the issue and see if that fixes. I would also suggest you turn on debug to see if that reveals a site error.

    bbpress runs on over 300,000 websites worldwide, but there are infinite combinations of themes, plugins and data that make it impossible to say that bbpress will work in all circumstances, but the fact that your was, should mean that it could be again.

    I wish you luck in resolving.

    #196231
    eviang
    Participant

    Hi there, I took a look at that article (https://codex.bbpress.org/getting-started/forum-moderation/common-tasks/#deleting-topics) and cannot see the Trash Admin Link referenced for deleting topics from the frontend.

    Could you please advise where this might be found?

    Thanks,
    Evian

    #196220
    BrianHenryIE
    Participant

    I’ve been working on a converter to import our Invision v4 forum to bbPress. I’ve got the users, forums and topics all importing reasonably well.

    https://github.com/EnhancedAthlete/bbPress-Invision-v4-Converter

    I’m having trouble with the titles which are stored in a language table:

    core_sys_lang_words

    | word_id | ... | word_app | ... | word_key | word_default | word_custom | ...
    | 8379 | ... | forums | ... | forums_forum_2 | Generic Discussion | Generic Discussion | ...

    To retrieve a single forum title, I can use:
    SELECT word_default as forum_name FROM ipbforum.core_sys_lang_words WHERE word_key = CONCAT('forums_forum_', 2)

    or to retrieve them all, something like:

    
    SELECT word_default 
    FROM ipbforum.core_sys_lang_words 
    WHERE word_app = 'forums' 
    	AND word_key IN 
        (SELECT CONCAT(prefix, id)  FROM 
    		(SELECT 'forums_forum_' as prefix, ipbforum.forums_forums.id 
            FROM ipbforum.forums_forums) 
            AS t)
    

    Or all with the forum ids:

    
    SELECT ipbforum.core_sys_lang_words.word_default as forum_name, word_key_table.forum_id as forum_id 
    FROM ipbforum.core_sys_lang_words, 
    	(SELECT CONCAT(prefix, id) AS word_key, 
    					id AS forum_id 
    			FROM 
    				(SELECT 'forums_forum_' AS prefix, 
    								ipbforum.forums_forums.id 
    						FROM ipbforum.forums_forums) 
                            AS temp)
    	AS word_key_table
    WHERE ipbforum.core_sys_lang_words.word_key = word_key_table.word_key
    

    but I’m struggling to figure out how to write that in the BBP_Converter_Base extended class field_map[].

    I’ve looked at some other converters and don’t see anything similarly complicated so I’m assuming there’s a more straightforward way.

    Any pointers appreciated! Once this is figured, the converter should be good enough for most people’s use.

    #196214
    filout
    Participant

    In this thread (see bottom) i found the code. I think is better to remove it…

    #196189
    Robin W
    Moderator

    this seems to be some custom code the function vvd is not a bbpress one. I presume you have added this to your functions file, or a plugin has it ?

    I googled and got this thread where the snippet is mentioned

    http://bbpress37.rssing.com/chan-7465926/all_p128.html

    function vvd_no_view_ip( $author_ip, $r, $args ){
    	return __return_empty_string();
    }
    add_filter('bbp_get_author_ip','vvd_no_view_ip', 10, 3 );

    is this the code you are using ?

    haddly
    Participant

    so, with some help from a collegue, this is how to do it:

    update wp_users  
        set wp_users.user_email = "myemail@email.com"
        where
        wp_users.ID IN (
        select  
        wp_usermeta.user_id
        from wp_usermeta
        where (wp_usermeta.meta_key = "wp_capabilities") &&  (wp_usermeta.meta_value like 
        "%bbp_participant%")   
        )
        ;
    #196173
    filout
    Participant

    Hi,

    i get the error
    Too few arguments to function vvd_no_view_ip(), 2 passed in /home/sites/site64/web/wp-includes/class-wp-hook.php on line 286 and exactly 3 expected.
    Users can create topics and write comments in it but when i want to see the topc and get this error

    Regards, Thomas

    I used WordPress v4.9.8 and bbPress v2.5.14.

Viewing 25 results - 4,001 through 4,025 (of 32,481 total)
Skip to toolbar