Robin W (@robin-w)

Forum Replies Created

Viewing 25 replies - 7,701 through 7,725 (of 14,304 total)
  • @robin-w

    Moderator

    I’ve just added functionality to bbp-style pack for participants to close their own topics – to set see item 17 in Topic/Reply Display tab to set this

    bbp style pack

    @robin-w

    Moderator

    you’re welcome

    @robin-w

    Moderator

    can you give a link to an example please

    @robin-w

    Moderator

    thanks for posting this – it will help others

    @robin-w

    Moderator

    great – glad to have helped !!

    @robin-w

    Moderator

    @clivesmith

    If you fine with code, then this is how I would go about it

    1. create a split in topic & replies, so you have a place to put the ‘featured reply’
    Use this piece of code in your functions file

    bbp_show_lead_topic

    2. then you’ll need a flag for the featured reply.

    This code does an ‘advert’ flag for a topic, but has much of the code you’d need to do a flag for a reply to show it is featured – I’ll leave you to work out which bits you’ll need, but the key is the hook to

    add_action( 'bbp_theme_before_topic_form_submit_wrapper', 'at_checkbox' );

    change this to

    add_action( 'bbp_theme_before_reply_form_submit_wrapper', 'at_checkbox' );

    amend the references from topic to reply

    and add some if(bbp_keymaster() ) to make it only show for you, and you will be most of the way there

    // show the "Mark if it is an advert" checkbox on topic form
    	add_action( 'bbp_theme_before_topic_form_submit_wrapper', 'at_checkbox' );
    		
    function at_checkbox() {
        // Text for the topic form
    	global $topic_advert_text ;
    	?>
    		<p>
    
    			<input name="at_advert" id="at_advert" type="checkbox"<?php checked( '1', at_is_advert( bbp_get_topic_id() ) ); ?> value="1" tabindex="<?php bbp_tab_index(); ?>" />
    
    			<?php if ( bbp_is_topic_edit() && ( get_the_author_meta( 'ID' ) != bbp_get_current_user_id() ) ) : ?>
    
    				<label for="at_advert"><?php echo '<span class="dashicons dashicons-awards"></span>'.$topic_advert_text.'</label>' ;?>
    
    			<?php else : ?>
    
    				<label for="at_advert"><?php echo '<span class="dashicons dashicons-awards"></span>'.$topic_advert_text.'</label>' ;?>
    
    			<?php endif; ?>
    
    		</p>
    <?php
    }
    	
    //check if topic is advert
    function at_is_advert( $topic_id = 0 ) {
    	
    	$retval 	= false;
    
    	if ( ! empty( $topic_id ) ) {
    		$retval = get_post_meta( $topic_id, 'at_topic_is_advert', true );
    	}
    	return (bool) apply_filters( 'at_is_advert', (bool) $retval, $topic_id );
    }
    
    // save the advert state
    		add_action( 'bbp_new_topic',  'at_update_topic' );
    		add_action( 'bbp_edit_topic',  'at_update_topic' );
    
    //update topic 
    function at_update_topic( $topic_id = 0 ) {
    
    		if( isset( $_POST['at_advert'] ) )
    			update_post_meta( $topic_id, 'at_topic_is_advert', '1' );
    		else
    			delete_post_meta( $topic_id, 'at_topic_is_advert' );
    
    	}

    3. amend content-single-topic-lead.php in your child theme’s bbpress directory.

    by

    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/content-single-topic-lead.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/content-single-topic-lead.phpbbPress will now use this template instead of the original and you can amend this

    This then you can use to add some code

    if (at_is_advert( $reply_id )) then….. display this reply

    and you should be there

    so

    the reply form will show a checkbox to make a reply featured available only to say keymaster, and as keymaster you can edit a topic to make it a featured
    the content_single_topic_lead will check if a reply is featured and then show it if it is

    I wish I had the time to code this all for you, but please if you do work oyt some code, post back here for other to benefit

    @robin-w

    Moderator

    great – glad you are fixed, and thanks for posting what was wrong – this can help others

    @robin-w

    Moderator

    bbp style pack

    once activated go to

    dashboard>settings>bbp style pack>Buttons

    In reply to: Custom Topic Statuses?

    @robin-w

    Moderator

    bbpress does not do custom topic statuses, so they are coming from that support plugin, best post there as it is that plugin that needs to work with 2.6, but most plugin authors do not code for pre-release software as it changes.

    @robin-w

    Moderator

    ok, I cannot say why it is not working, it works in my test site

    I presume this code is going into you child theme’s function’s file – sorry but I do not know how technical you are, so I ask the obvious questions !

    you could try >9 and see if that works !

    In reply to: Per Forum Moderators

    @robin-w

    Moderator

    no sorry this is a 2.6 feature when 2.6 is released

    @robin-w

    Moderator

    that code will close the topic on 100 replies, so unless you tested with creating the 100th reply, then it would not work. Did you do this ?

    @robin-w

    Moderator

    ok, I would strongly suspect you membership wall, presumably a plugin – not a lot we can do if it is.

    This generic help should let you define where the issue is

    It could be a theme or plugin issue issue, so you’ll need to test to find out which

    Themes

    As a test switch to a default theme such as twentyfifteen, and see if this fixes.

    Plugins

    Deactivate all but bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    Then come back

    @robin-w

    Moderator

    that would take a lot of code, beyond free help

    @robin-w

    Moderator

    can you say specifically what you want – ie where you want to determine or show this?

    @robin-w

    Moderator

    are you totally unable to edit your forum, or are you just unable to add videos?

    @robin-w

    Moderator

    add this to your functions file, it closes the topic when the 100th reply is posted

    add_action( 'bbp_new_reply_post_extras', 'rew_close_topic' );
    
    function rew_close_topic ($reply_id) {
    //  find out the topic_id
    $topic_id = bbp_get_reply_topic_id ($reply_id) ;
    $count = bbp_get_topic_reply_count ($topic_id) ;
    if ($count == 100) bbp_close_topic( $topic_id );
    }
    In reply to: Double avatar

    @robin-w

    Moderator

    It could be a theme or plugin issue issue, so you’ll need to test to find out which

    Themes

    As a test switch to a default theme such as twentyfifteen, and see if this fixes.

    Plugins

    Deactivate all but bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    Then come back

    @robin-w

    Moderator

    No idea from your post of what code you are trying.

    bbp_has_replies is the function you need for the loop

    @robin-w

    Moderator

    Notifications is a buddypress thing – I think you need to report it to their support

    @robin-w

    Moderator

    the default is false, so it would do nothing – you should be using

    $show_lead[] = 'true';

    then it will use the template it talks about and you can style it

    @robin-w

    Moderator

    the function that bbpress uses is in

    includes/common/functions.php

    line 1055 starts the function, and lines 1150 to 1153 are the offending ones which stop it being sent to the author

    I’d suggest you unhook that function and then hook your own

    so in your child theme functions file maybe have

    remove_action( 'bbp_new_reply',    'bbp_notify_topic_subscribers',           11, 5 );
    add_action ( 'bbp_new_reply' , 'rew_notify_topic_subscribers', 11,5 ) ;
    

    and then copy the whole bbp_notify_topic_subscribers function to your functions file, rename it to ‘rew_notify_topic_subscribers’ and edit out the lines which stop it being sent to the author

    do come back if anything isn’t clear, I’m assuming a level of knowledge you may not have, and quite happy to help further

    @robin-w

    Moderator

    I tried plugins and themes, but i’m sure i can erase it from a file inside the bbpress folder. What file can it be?

    it is not in nay file that I know, it looks like part of an error

    you may be able to hide it with css, I can’t say without a live link

    @robin-w

    Moderator

    yes, that is the default position, I’ll try and work out some code in the next few days.

    If I have not come back in 3 days time, post again to remind me !

    In reply to: bbpress user roles

    @robin-w

    Moderator

    in bbpress plugin in my site the moderator roles the forum is not showing in dashboard,

    It could be a theme or plugin issue issue, so you’ll need to test to find out which

    Themes

    As a test switch to a default theme such as twentyfifteen, and see if this fixes.

    Plugins

    Deactivate all but bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    Then come back

Viewing 25 replies - 7,701 through 7,725 (of 14,304 total)