Robin W (@robin-w)

Forum Replies Created

Viewing 25 replies - 12,801 through 12,825 (of 13,958 total)
  • @robin-w

    Moderator

    ok, may be a little rough, but seems to work

    put this in your functions file

    //This function adds the author to the reply
    function reply_display_author () {
    	global $countr ;
    	if ($countr == 5 ) {
    	echo '<span class="bbp-topic-started-by">' ;
    	printf( __( 'Topic started by: %1$s', 'bbpress' ), bbp_get_topic_author_link( array( 'size' => '14' ) )) ; 
    	echo '</span>' ;
    	}
    	else {
    	return ;
    	}
    	}
    	
    	add_action ('bbp_theme_before_reply_content', 'reply_display_author') ;
    	

    and then create a file called bbpress in the root of your theme and copy across loop-replies.php

    then amend from line 42 so that it reads

    <?php if ( bbp_thread_replies() ) : ?>
    
    			<?php bbp_list_replies(); ?>
    			
    			
    		<?php else : ?>
    			<?php global $countr ;
    			$countr=-1 ; ?>
    		
    			<?php while ( bbp_replies() ) : bbp_the_reply(); ?>
    			
    			<?php 
    			$countr ++ ; 
    			
    			<?php bbp_get_template_part( 'loop', 'single-reply' ); ?>
    
    			<?php endwhile; ?>
    			
    			
    		<?php endif; ?>

    seems to do the trick !

    @robin-w

    Moderator

    ok, so do you get this when you click edit on the profile page, or when you try to access the profile page?

    @robin-w

    Moderator

    Is it all or just some users?

    try setting yourself up with a new username and participant and see if you can replicate the problem.

    what are they/you seeing – ie do they get the edit option?

    @robin-w

    Moderator

    This dropped into your functions file puts it in every reply – just thinking about how you’re get every 5th !

    //This function adds the author to the reply
    function reply_display_author () {
    	if( get_post_type() == 'reply' ) {
    	echo '<span class="bbp-topic-started-by">' ;
    	printf( __( 'Topic started by: %1$s', 'bbpress' ), bbp_get_topic_author_link( array( 'size' => '14' ) )) ; 
    	echo '</span>' ;
    	}
    	else {
    	return ;
    	}
    	}
    add_action ('bbp_theme_before_reply_content', 'reply_display_author') ;

    @robin-w

    Moderator

    Great – keep looking – there must be a reason , and if not database, then next will be
    checking plugins are the same (inc version)
    wordpress is the same (inc version) and
    theme is the same (inc version).
    Then it would be either

    file corruption, so re-installing all the above software.
    or server issue, check server specific files, check same php, MySQL and other software versions.

    but there must be a cause !

    @robin-w

    Moderator

    So your test site works, but you live site doesn’t?

    If there on the same servers, then it has to be a difference in either settings (database) or code.

    I’d try to work out which by backing up my test site, and then restoring my live site database to it

    see https://codex.bbpress.org/creating-a-test-site/

    for details if you’re not familiar.

    That should let you see which is it, and you can progress from there

    come back and let us know how you get on

    In reply to: Freshness Date Format

    @robin-w

    Moderator

    great – if you need the 5.2 version, come back and I’ll cut a version for you and put it on my website.

    @robin-w

    Moderator

    could be done with code, but suspect not sufficient demand that anyone has coded it !

    @robin-w

    Moderator

    post a link to the site, and I’ll take a look

    In reply to: Freshness Date Format

    @robin-w

    Moderator

    ok, php version use different code see

    https://codex.wordpress.org/Widgets_API

    The widget can then be registered using the widgets_init hook: 
    
    PHP 5.3+ only: 
    add_action( 'widgets_init', function(){
         register_widget( 'My_Widget' );
    });
    
    PHP 5.2+: 
    add_action('widgets_init',
         create_function('', 'return register_widget("My_Widget");')
    );
    
    

    I’m using code for 5.3 + – so if your site is using earlier, you would need to amend the line.

    @robin-w

    Moderator

    “Still working on the forums page and ultimately would like more control over the breadcrumb, like changing the Home URL, or removing Home alltogether, in which I’ve used another plugin to turn it into a dash.”

    Layout and functionality – Examples you can use

    on the forum display, still think given that it says “continue reading” I suspect that your theme is treating this as a post, and just giving what it thinks is an ‘excerpt’.

    Try creating a file in the root of your theme called bbpress.php and putting the following code into it

    <?php
    /**
     * bbPress wrapper template.
     
     */
    
    get_header(); ?>
    
    <?php while( have_posts() ): the_post(); ?>
    
    	<?php the_content(); ?>
    
    <?php endwhile; ?>
    
    <?php get_footer(); ?>
    
    

    @robin-w

    Moderator

    Great – glad you’re fixed !

    @robin-w

    Moderator

    Sorry, yes I do understand your English, but I don not understand what you are trying to do.

    Can you give an example of what you wish to change?

    @robin-w

    Moderator

    ‘I have the theme setup running on two domains, the one i use for testing, the funny thing is when posting on that site, the first post of the thread is shown.’

    This would tend to suggest that something is different or not set the same. Are both on remote servers, or is one on a local PC running wamp or mamp?

    Not showing a topic is a common symptom, but with many different causes, so there is no one solution.

    There are a number of things you can try.

    Resetting permalinks – sometimes fixes – in your WordPress Administration Screens navigate to Settings > Permalinks, select a different permalink structure and save. Then select your preferred permalink structure and save again.

    Repair Forums – Dashboard>tools>forums>repair forum and run one at a time.

    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.

    Themes

    If plugins don’t pinpoint the problem, switch to a default theme such as twentytwelve, and see if this fixes.

    @robin-w

    Moderator

    I can if you give me a bit more detail 🙂

    What are you trying to do?

    In reply to: bbp-forum-info

    @robin-w

    Moderator

    put the following in your functions file

    //This function changes the text wherever it is quoted
    function change_translate_text( $translated_text ) {
    	if ( $translated_text == 'Forum' ) {
    	$translated_text = 'Tournaments' ;
    	}
    	return $translated_text;
    }
    add_filter( 'gettext', 'change_translate_text', 20 );
    

    @robin-w

    Moderator

    You would need to cut some code, but basically you would be looking at

    using some code from the widget to find the latest topic

    then maybe using the shotcodes

    [bbp-single-topic id=$topic_id] – Display a single topic. eg. [bbp-single-topic id=4096]

    and if it has a reply

    [bbp-single-reply id=$reply_id] – Display a single reply eg. [bbp-single-reply id=32768]

    using the do-shortcode function https://codex.wordpress.org/Function_Reference/do_shortcode

    If you do this, please post the result here for the benefit of others !

    @robin-w

    Moderator

    Your arcade-basic theme claims to be compatible with bbpress, so I’d also look at plugins

    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.

    @robin-w

    Moderator

    ok, can you look at

    Codex

    getting started part 1, and see if anything in there helps

    Come back

    In reply to: CSS Plugin

    @robin-w

    Moderator

    @blankstage – great – I only started with wrodpress and bbpress 13 months ago, and have learnt a fantastic amount since then !

    In reply to: Freshness Date Format

    @robin-w

    Moderator

    or it may be the php version you are using – can you let me know what this is if you know?

    In reply to: Freshness Date Format

    @robin-w

    Moderator

    @morgensonne

    Interesting – I’ve just deleted and re-downloaded the plugin from wordpress and it activated with no problems.

    However I would be interested if your test server is a ‘local’ one using wamp or mamp? that might be the issue.

    Please come back either way, and I’ll try and resolve for you.

    @robin-w

    Moderator

    no plugin, but this page shows how to add them using code

    (I haven’t quite finished it, but it should work!)

    Custom Capabilities

    @robin-w

    Moderator

    ok, the answer is somewhere in this function

    function bbp_title( $title = '', $sep = '&raquo;', $seplocation = '' ) {
    
    	// Title array
    	$new_title = array();
    
    	/** Archives **************************************************************/
    
    	// Forum Archive
    	if ( bbp_is_forum_archive() ) {
    		$new_title['text'] = bbp_get_forum_archive_title();
    
    	// Topic Archive
    	} elseif ( bbp_is_topic_archive() ) {
    		$new_title['text'] = bbp_get_topic_archive_title();
    
    	/** Edit ******************************************************************/
    
    	// Forum edit page
    	} elseif ( bbp_is_forum_edit() ) {
    		$new_title['text']   = bbp_get_forum_title();
    		$new_title['format'] = esc_attr__( 'Forum Edit: %s', 'bbpress' );
    
    	// Topic edit page
    	} elseif ( bbp_is_topic_edit() ) {
    		$new_title['text']   = bbp_get_topic_title();
    		$new_title['format'] = esc_attr__( 'Topic Edit: %s', 'bbpress' );
    
    	// Reply edit page
    	} elseif ( bbp_is_reply_edit() ) {
    		$new_title['text']   = bbp_get_reply_title();
    		$new_title['format'] = esc_attr__( 'Reply Edit: %s', 'bbpress' );
    
    	// Topic tag edit page
    	} elseif ( bbp_is_topic_tag_edit() ) {
    		$new_title['text']   = bbp_get_topic_tag_name();
    		$new_title['format'] = esc_attr__( 'Topic Tag Edit: %s', 'bbpress' );
    
    	/** Singles ***************************************************************/
    
    	// Forum page
    	} elseif ( bbp_is_single_forum() ) {
    		$new_title['text']   = bbp_get_forum_title();
    		$new_title['format'] = esc_attr__( 'Forum: %s', 'bbpress' );
    
    	// Topic page
    	} elseif ( bbp_is_single_topic() ) {
    		$new_title['text']   = bbp_get_topic_title();
    		$new_title['format'] = esc_attr__( 'Topic: %s', 'bbpress' );
    
    	// Replies
    	} elseif ( bbp_is_single_reply() ) {
    		$new_title['text']   = bbp_get_reply_title();
    
    	// Topic tag page
    	} elseif ( bbp_is_topic_tag() || get_query_var( 'bbp_topic_tag' ) ) {
    		$new_title['text']   = bbp_get_topic_tag_name();
    		$new_title['format'] = esc_attr__( 'Topic Tag: %s', 'bbpress' );
    
    	/** Users *****************************************************************/
    
    	// Profile page
    	} elseif ( bbp_is_single_user() ) {
    
    		// User is viewing their own profile
    		if ( bbp_is_user_home() ) {
    			$new_title['text'] = esc_attr_x( 'Your', 'User viewing his/her own profile', 'bbpress' );
    
    		// User is viewing someone else's profile (so use their display name)
    		} else {
    			$new_title['text'] = sprintf( esc_attr_x( "%s's", 'User viewing another users profile', 'bbpress' ), get_userdata( bbp_get_user_id() )->display_name );
    		}
    
    		// User topics created
    		if ( bbp_is_single_user_topics() ) {
    			$new_title['format'] = esc_attr__( "%s Topics",        'bbpress' );
    
    		// User rueplies created
    		} elseif ( bbp_is_single_user_replies() ) {
    			$new_title['format'] = esc_attr__( "%s Replies",       'bbpress' );
    
    		// User favorites
    		} elseif ( bbp_is_favorites() ) {
    			$new_title['format'] = esc_attr__( "%s Favorites",     'bbpress' );
    
    		// User subscriptions
    		} elseif ( bbp_is_subscriptions() ) {
    			$new_title['format'] = esc_attr__( "%s Subscriptions", 'bbpress' );
    
    		// User "home"
    		} else {
    			$new_title['format'] = esc_attr__( "%s Profile",       'bbpress' );
    		}
    
    	// Profile edit page
    	} elseif ( bbp_is_single_user_edit() ) {
    
    		// Current user
    		if ( bbp_is_user_home_edit() ) {
    			$new_title['text']   = esc_attr__( 'Edit Your Profile', 'bbpress' );
    
    		// Other user
    		} else {
    			$new_title['text']   = get_userdata( bbp_get_user_id() )->display_name;
    			$new_title['format'] = esc_attr__( "Edit %s's Profile", 'bbpress' );
    		}
    
    	/** Views *****************************************************************/
    
    	// Views
    	} elseif ( bbp_is_single_view() ) {
    		$new_title['text']   = bbp_get_view_title();
    		$new_title['format'] = esc_attr__( 'View: %s', 'bbpress' );
    
    	/** Search ****************************************************************/
    
    	// Search
    	} elseif ( bbp_is_search() ) {
    		$new_title['text'] = bbp_get_search_title();
    	}
    
    	// This filter is deprecated. Use 'bbp_before_title_parse_args' instead.
    	$new_title = apply_filters( 'bbp_raw_title_array', $new_title );
    
    	// Set title array defaults
    	$new_title = bbp_parse_args( $new_title, array(
    		'text'   => $title,
    		'format' => '%s'
    	), 'title' );
    
    	// Get the formatted raw title
    	$new_title = sprintf( $new_title['format'], $new_title['text'] );
    
    	// Filter the raw title
    	$new_title = apply_filters( 'bbp_raw_title', $new_title, $sep, $seplocation );
    
    	// Compare new title with original title
    	if ( $new_title === $title )
    		return $title;
    
    	// Temporary separator, for accurate flipping, if necessary
    	$t_sep  = '%WP_TITILE_SEP%';
    	$prefix = '';
    
    	if ( !empty( $new_title ) )
    		$prefix = " $sep ";
    
    	// sep on right, so reverse the order
    	if ( 'right' === $seplocation ) {
    		$new_title_array = array_reverse( explode( $t_sep, $new_title ) );
    		$new_title       = implode( " $sep ", $new_title_array ) . $prefix;
    
    	// sep on left, do not reverse
    	} else {
    		$new_title_array = explode( $t_sep, $new_title );
    		$new_title       = $prefix . implode( " $sep ", $new_title_array );
    	}
    
    	// Filter and return
    	return apply_filters( 'bbp_title', $new_title, $sep, $seplocation );
    }
    

    a filter such as

    function amend_title () {
    	if ( bbp_is_single_forum() ) {
    		$new_title['text']   = 'YA book forum' ;
    		$new_title['format'] = esc_attr__( 'YA book Forum', 'bbpress' );
    		}
     return $new_title;
    }
    add_filter('bbp_before_title_parse_args', 'amend_title' );
    

    should sort it but doesn’t, and I’m too tired to work out why 🙂

    Over to you !

    @robin-w

    Moderator

    ok, I can see that – don’t know how you would fix – sorry ! Hopefully someone who can will be along

Viewing 25 replies - 12,801 through 12,825 (of 13,958 total)