Does anyone know of a way I could add a CSS class to items that a user has already viewed.
I have some custom code (taken from the bbpress Recent Replies widget) that essentially shows my recent replies on my forum’s home page. This:
$post_types,
'post_status' => join( ',', array( bbp_get_public_status_id(), bbp_get_closed_status_id() ) ),
'posts_per_page' => $max_shown,
'meta_query' => array( bbp_exclude_forum_ids( 'meta_query' ) )
) );
// Get replies and display them
if ( $widget_query->have_posts() ) :
echo $before_widget;
echo $before_title . $title . $after_title; ?>
have_posts() ) : $widget_query->the_post(); ?>
<li >
post->ID );
$author_link = bbp_get_reply_author_link( array( 'post_id' => $reply_id, 'type' => 'both', 'size' => 100 ) );
echo $author_link. ' on';
echo '<a href="' . esc_url( bbp_get_reply_url( $reply_id ) ) . '" title="' . bbp_get_reply_excerpt( $reply_id, 50 ) . '">' . bbp_get_reply_topic_title( $reply_id ) . '</a>';
echo ''. bbp_get_reply_excerpt( $reply_id, 150 ) . '';
echo '' . get_the_date(), get_the_time().'';
?>
<?php echo $after_widget;
endif;
is_mb there is just a custom function I wrote to determine whether the page being viewed is the homepage or not. Anyway, I'd love to add a class to the opening LI tag if a user has already viewed that. Any ideas?
I think I found the solutions. in the user-favorites.php. I chanaged a little. and I come up with what i want.
Hi, First of all thank you very much for the bbpress plugin.
I like to make a favorites page just like the favorites pages on this forum.
When I managed to make template based on the profile page, the favorites page does not show lists.
Could you share the templeate code of Favorites pages and subscription page of this forum?
I’ll appreciate your help and advise on this.
Sungheon Lee from Seoul, South Korea.
/wp-content/plugins/bbpress/bbp-includes/bbp-topic-template.php line 686:
$total = bbp_get_topic_reply_count( $topic_id );
this is erroneous because of this:
/wp-content/plugins/bbpress/bbp-includes/bbp-core-filters.php line 158:
add_filter('bbp_get_topic_reply_count', 'bbp_number_format', 10);
Actually speaking bbp_get_user_topic_count, bbp_get_user_reply_count, bbp_get_user_post_count, bbp_get_forum_subforum_count, bbp_get_forum_topic_count, bbp_get_forum_reply_count, bbp_get_forum_post_count, bbp_get_topic_voice_count, bbp_get_topic_reply_count and bbp_get_topic_post_count are all affected by this bug.
I’m not 100% sure this is exactly what you were wanting to do, but I figured I’d post this for anyone else for finds this thread.
I released a plugin that basically hides bbPress from all users who are not logged in.
For example, if your forum is at YourDomain.com/forums and a vistor tries to go there who is not logged in, they will be redirected to a URL of your choice (defined in the settings). Also this plugin disables all bbPress RSS feeds and most shortcodes.
https://wordpress.org/extend/plugins/bbpress-members-only/
@Zaerl I would also suggest having a look at @mordauk (Pippin’s) code at GitHub and contributing and or extending the functionality of this existing plugin. The code is on GitHub here https://github.com/pippinsplugins/bbp-mark-as-read
Yeah unfortunately there is no global filter for that. The code above is pretty much what you will need to do on all instances, but you just need to track down the other filters.
It’s quite strange. I forced 1.000.000 on bbp_get_topic_pagination with no luck. A “find . -name ‘*.php’ | xargs grep 1000” didn’t show the value hardcoded anywhere.
@renai42 – Thanks for the feedback. The great thing about bbPress being open-source is you’re able to fix the things you don’t like on your own with Subversion patches via our Trac.
Sorry you’re finding the CSS to be complicated. There are some compromises we made to be able to make bbPress as good as it can with every possible WordPress theme available. As such, some CSS rules are more strict than others, and we tend to have things wrapped in ID’s to allow groups of content to be styled and/aggressively reset.
The staff here are volunteers, every one of us. We operate under the assumption that if you’re in the code, asking code questions, that you’re comfortable taking on something new and foreign. I’ll defend the code here though, since bbPress’s code is nicely documented and orderly.
Volunteer community members represent the project, but they also represent themselves. If someone’s made you feel bad, that’s between you and them. We’re all adults here, and it doesn’t benefit anyone to talk above or below anyone else; when it happens, it weeds itself out pretty quickly.
Regarding CSS specifically, it’s in the name: it cascades down. This means you’re able to add whatever rules you’d like in the stack, and the browser will interpret those new rules in kind. If it’s not obvious enough to you, that just means you learned something new today. That’s not anyone’s fault, or anything that anyone should be upset about on either side.
Again, thanks for your feedback; if you’d like to talk privately about a specific matter or person, contact me privately (a Google search should bring up multiple ways to do this.)
What would those shortcodes be Jare Datch? I’m to interesting on making sure they never see the backend.
Ok simple question… What file/s do I need to add code to so it affects every bbpress page?
style type = ‘text/css’>#breadcrumbs { display: none !important; }/style>
Sorry, couldn’t work out how to display code without it hiding style tags
-
This reply was modified 13 years, 4 months ago by
Garindan.
-
This reply was modified 13 years, 4 months ago by
Garindan.
There is one “must have” plugin missing on 2.x, what worked well on 1.x -> unread post plugin. Its already discussed under this topic https://bbpress.org/forums/topic/adding-view-unread-posts-plugin/
In 3 words describing – when users logs in it sees unread topics in different color (new topics and topics with new replies counting from last user visit). When he enters topic its automaticaly redirected to last unread post inside topic.
Old 1.x source code you can see here -> http://paste.php.lv/720a5c85e7a31f117a104d2a14ce368f?lang=php its just one file.
Yes, that`s the right plugin, but i insert the code manuelly at loop-single-reply.php of bbpress right after the reply-content is called.
Thanks for your help
hey mate,
this is precisely the kind of overly simplistic response which turns people off using bbPress. Your suggestion is pretty much contained in the bbPress documentation already and is less than useful.
Sure, you need to copy bbpress.css to the right directory and edit it. But what you fail to mention, and what is mentioned nowhere in the bbPress documentation, is that many of the font specifications are not actually listed in that CSS file — you need to puzzle out the CSS entry yourself and add a new CSS entry, not edit an old one, to change the font size.
I spent three hours working this out last night. The correct entry is:
bbpress-forums .bbp-topic-content p,
bbpress-forums .bbp-reply-content p {
font-size: 12px;
}
I have seen this same response from the moderators on the bbPress forum dozens of times as I searched it last night. This same arrogance — ‘just copy the CSS file and edit it’. Technically you’re right, but without any detail or documentation around bbPress, this suggestion comes across as the contempt of an experienced web developer for someone who is, in their eyes, a ‘n00b’.
I operate a major WordPress site and edit its CSS files daily. And yet, the CSS for bbPress is hideously complex and hard to understand. I suggest that you guys modify your attitude and start looking for actual solutions to people’s problems … especially around making default themes easier to customise. Otherwise, bbPress, which is an awesome solution to a long-held problem for WordPress site owners, will remain the little-used forum software that it is.
Cheers,
Renai LeMay
Publisher, Delimiter.com.au
I think it would be a case of changing the order of the two filters? So when you apply a filter you have to set the priority:
https://codex.wordpress.org/Function_Reference/add_filter
If you change the priority of the filter on that plugin to be less than the filter on mine it might then work in the right order.
Which plugin are you using? Is it this: https://wordpress.org/extend/plugins/kk-i-like-it/
I can have a look if I can get the right plugin to test…
Copy the bbpress.css from the bbpress plugin directory to yourtheme/bbpress/bbpress.css and then edit the CSS/font size from there 🙂
I believe bbPress uses wp_mail() and does not explicitly set a “from”, so wordpress@domain.com is used by default.
https://codex.wordpress.org/Function_Reference/wp_mail
Hi all,
When email notifications are sent from our bbPress deployment, the ‘From’ address is being set to ‘wordpress@[domain]’. Looking into the WordPress core code (v3.4.2) in pluggable.php, this is done on line 336 when no ‘From’ header is passed in to the wp_mail() function. We’ve reviewed the bbPress configuration and can’t find anywhere that this can be set, have we missed a setting somewhere?
Note our site is using WordPress 3.4.2 Multisite with bbPress 2.1.2.
Looks like I’m getting the following error:
PHP Warning: require_once(bbp-converter.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in /home1/mojaveun/public_html/blog/wp-content/plugins/bbpress/bbp-includes/bbp-user-functions.php on line 1466
This should do the trick. Just drop it in your theme’s functions.php file.
https://gist.github.com/3868835
The body classes are applied dynamically using the WordPress body_class() function (https://codex.wordpress.org/Function_Reference/body_class)
You can use a little trickery to hook into it and remove classes, but if possible I probably won’t do that.
Why are you wanting to remove that body class?
There is no way to simply just stick the entire forum in a specific page.
You can use the bbPress shortcodes (https://codex.bbpress.org/shortcodes/) to create a page that houses a forum index, but that doesn’t stick everything in that page.
Even if you restrict a page that you create with a shortcode, bbPress generates all its own pages such as the forum/topic/reply index pages, user pages, etc.
You can certainly restrict the forum to certain memberships, but it’s going to require some custom code and a little elbow grease. It’s not something that you will be able to do by just marking a checkbox in the WishList settings.
Hey jezza, great Plugin – just what im looking for and it works perfect.
But I have an little issue especially with my theme, because i also added the KKLike-Button at the end of every reply so user can like each of them. This button is added after the content and as you manipulate the content to insert the adsense-code the Like-Button is now shown after the adsense-code. Hope you understand my bad english! 🙂 Any ideas to fix it?
I try with the default buddypress theme and the same.
shortcode don’t work -> [bbp-single-forum id=44] http://rplayers.com/forums/
but this shortcode works : [bbp-topic-index]
if I make an other page http://rplayers.com/forums2/ all shortcode works
So I go to settings > forums > Archives slug > forums base :: change forums by forums2
but http://rplayers.com/forums2/ shortcode don’t work
Need help … :-/
I have the same problems I think…
on http://rplayers.com/forums/ –> [bbp-single-forum id=44] don’t work
but [bbp-topic-index] this shortcode works
And when I do the same things there http://rplayers.com/forums2/ all shortcode works
I posted a message there but no reply https://bbpress.org/forums/topic/problem-with-shortcode/