Robin W (@robin-w)

Forum Replies Created

Viewing 25 replies - 4,126 through 4,150 (of 14,181 total)
  • @robin-w

    Moderator

    thanks for sharing the solution 🙂

    @robin-w

    Moderator

    that section does not look like bbpress showing it.

    I would need to see it on the real site to guess what it is showing

    @robin-w

    Moderator

    yes, strtotime(‘now’) will pick up gmt, so needs adjusting, you night want to look at

    $now = date_create( date_i18n( 'Y-m-d H:i:s' ) );

    @robin-w

    Moderator

    ok try this for topics in a forum

    add_filter ('bbp_get_topic_freshness_link' , 'rew_check_freshness2', 10 , 5 ) ;
    
    function rew_check_freshness2 ($anchor, $topic_id, $time_since, $link_url, $title) {
    	$last_active = get_post_meta( $topic_id, '_bbp_last_active_time', true );
    	$diff = strtotime('now') - strtotime($last_active) ;
    	if ($diff<86400) {
    	$anchor = '<span class="fresh">'.$anchor.'</span>' ;
    	}
    return $anchor ;	
    }

    @robin-w

    Moderator

    Just realised, frenchlemans wanted it against the forum list – but you show nothing there, so you want it against the topic list in each forum – yes ?

    @robin-w

    Moderator

    ok, that’s where it should be, and it should work.

    where are you putting the code ?

    @robin-w

    Moderator

    Great – thanks for posting back – looks smart and glad you are fixed !!

    @robin-w

    Moderator

    ahh – think I have misunderstood now I re-read, given the post you attached to, I thought your question was regarding the freshness columm, but now I don’t know.

    my code adds a class in the freshness column

    <li class="bbp-forum-freshness">
    <span class="fresh"><a href="http://gos.rewweb.co.uk/forums/topic/eferwer/" title="EFERWER">8 hours, 14 minutes ago</a></span>

    so can you explain exactly what you want to turn green?

    @robin-w

    Moderator

    try this

    add_filter ('bbp_get_forum_freshness_link' , 'rew_check_freshness', 10 , 6 ) ;
    
    function rew_check_freshness ($anchor, $forum_id, $time_since, $link_url, $title, $active_id) {
    	$last_active = get_post_meta( $forum_id, '_bbp_last_active_time', true );
    	$diff = strtotime('now') - strtotime($last_active) ;
    	if ($diff<86400) {
    	$anchor = '<span class="fresh">'.$anchor.'</span>' ;
    	}
    return $anchor ;	
    }

    This adds an extra span class called ‘fresh’ if the last active is less than 24 hours.

    you can then style this in css eg

    .fresh {
    background-color : green ;
    }

    @robin-w

    Moderator

    Great – glad you are fixed !!

    @robin-w

    Moderator

    the easiest was is to create a page with the same permalink as your forum slug, so in your case ‘forums’

    so create a page called ‘forums’

    in the content put the html you want and follow with the shortcode [bbp-forum-index] if you are using blocks, wordpress has a shortcode block type ‘sh’ in type and it will appear.

    and publish – check that it appears as http://mysite.com/forums

    and that should work

    @robin-w

    Moderator

    in which case you would hook to

    $subject = apply_filters( 'bbp_subscription_mail_title', '[' . $blog_name . '] ' . $topic_title, $reply_id, $topic_id );

    in bbpress 2.6.6\includes\common\functions.php line 1124 and 1291

    @robin-w

    Moderator

    no problem – glad you are fixed !

    @robin-w

    Moderator

    ok,

    the default display order is freshness, followed by author – you have it the other way around.

    try changing the line above

    add_action( 'bbp_theme_after_topic_author', 'rew_freshness_display_image');

    to

    add_action( 'bbp_theme_after_forum_freshness_link', 'rew_freshness_display_image');

    @robin-w

    Moderator

    you don’t need stylepack, it’s just that the answer is different if you do !

    I’ll come back with code when I get a moment 🙂

    @robin-w

    Moderator

    @frenchlemans

    so can you detail the settings in freshness tab please

    @robin-w

    Moderator

    are you using style pack? and freshness tab ?

    @robin-w

    Moderator

    yes it’s a know bug on the list to fix.

    in the meantime set it to 5256000 and that gives them 10 years to edit, which should be enough 🙂

    @robin-w

    Moderator

    Put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

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

    or use

    Code Snippets

    
    add_action( 'bbp_theme_after_topic_author', 'rew_freshness_display_image');
    
    function rew_freshness_display_image ($forum_id = 0) {
    	// Verify forum and get last active meta
    	$forum_id  = bbp_get_forum_id( $forum_id );
    		$active_id = bbp_get_forum_last_active_id( $forum_id );
    		$link_url  = $title = '';
    
    		if ( empty( $active_id ) )
    			$active_id = bbp_get_forum_last_reply_id( $forum_id );
    
    		if ( empty( $active_id ) )
    			$active_id = bbp_get_forum_last_topic_id( $forum_id );
    
    		if ( bbp_is_topic( $active_id ) ) {
    			//then reset forum_id to the forum of the active topic in case it is a sub forum
    			$forum_id = bbp_get_topic_forum_id($active_id);
    			$link_url = bbp_get_forum_last_topic_permalink( $forum_id );
    			$title    = bbp_get_forum_last_topic_title( $forum_id );
    		} elseif ( bbp_is_reply( $active_id ) ) {
    			//then reset forum_id to the forum of the active topic in case it is a sub forum
    			$forum_id = bbp_get_reply_forum_id($active_id);
    			$link_url = bbp_get_forum_last_reply_url( $forum_id );
    			$title    = bbp_get_forum_last_reply_title( $forum_id );
    		}
    		
    		$anchor = '<a class="rew_freshness_display_image" href="' . esc_url( $link_url ) . '" title="' . esc_attr( $title ) . '"><img src="http://mysite.com/wp-content/uploads/2013/06/Brauhaus-2.jpg">' . '</a>';
    	
    echo '<p>'.$anchor.'</p>' ;
    }

    and change the <img src="http://mysite.com/wp-content/uploads/2013/06/Brauhaus-2.jpg" /> to the image you want – make sure it is sized right !!

    @robin-w

    Moderator

    the easiest way is to use

    bbp style pack

    once activated go to

    dashboard>settings>bbp style pack>Subscription Emails

    and you can amend headings there

    In reply to: delete account

    @robin-w

    Moderator

    yes, that should be fine – just do it when the site is least active !

    @robin-w

    Moderator

    So all the same image – yes ?

    In reply to: delete account

    @robin-w

    Moderator

    it could be a theme or plugin issue

    Themes

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

    Plugins

    If that doesn’t work, also deactivate all plugins apart from bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    If you cannot do this to your site (say because it is live) then use the ‘troubleshooting’ features of this plugin to let you test without affecting other users

    Health Check & Troubleshooting

    Then come back

    In reply to: delete account

    @robin-w

    Moderator

    so dashboard>users>select user and delete is not working ?

    @robin-w

    Moderator

    Not quite sure what you question is.

    bbpress just uses wordpress registration and login, and your site permits automatic registration, so users can just sign up as long as they have a valid email address.

Viewing 25 replies - 4,126 through 4,150 (of 14,181 total)