Change the colour of the stickies to something else? Or change it every time? I don’t understand what you want to do.
You can’t change the colour based on who’s read it because there’s no way to tell who’s read the new post or not (hence it not being new if they have read it). There is however a plugin to track who’s read what last post but that which unfortunately needs yet another plugin.
bbPress is very weak in the user event tracking department. Not even a built in last login date which is a serious flaw in design.
It is being done on this forum. I will ask mdawaffe what he did because a new sticky is a different color (than other stickes) for about 10 days.
Trent
yeah yeah…..forgot….asking him now!
Trent
From our fearless leader!
/*
Plugin Name: Recent Stickies
Author: Micheal Adams
Description: Adds a class to recent sticky posts
*/
function recent_sticky_class( $class, $topic_id ) {
$topic = get_topic( $topic_id );
if ( !$topic->topic_sticky )
return $class;
if ( get_topic_start_time( 'timestamp' ) < time() - 604800 )
return $class;
$class[] = 'recent-sticky';
return $class;
}
add_filter( 'topic_class', 'recent_sticky_class', 10, 2 );
Trent
@_ck_: Wasn’t there a plugin already to change the style unread posts? I think it could be easily adapted.
but then again,
@Trent: Good work
Very nifty, thanks.
It only works for newly created sticky topics. Is there a way to make it work if you un-sticky and re-sticky an old sticky topic?
Hmm……not with this method because it is searching for topics that are new and sticky based off the timestamp of the item and the current server time. I guess if you found a way to edit the timestamp to being ‘new’ again it would work with that way.
Other than that, it would require having all sticky posts checked against a new table entry for this plugin, which is much more work and much more page requests.
Trent