Tried applying the code and give me warning after activating the plugin
/* Plugin Name: BBPress Close Old Posts Description: Close BBPress 2.0+ posts that haven’t been updated in X days. Author: Raygun Version: 0.1 Author URI: http://madebyraygun.com Originally found here: https://wordpress.org/support/topic/plugin-bbpress-new-topic-notifications-new-reply-notications-too?replies=13 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ register_activation_hook(__FILE__, ‘bbpress_topic_scheduler’); add_action(‘bbpress_daily_event’, ‘bbpress_close_old_topics’); function bbpress_topic_scheduler() { wp_schedule_event(time(), ‘daily’, ‘bbpress_daily_event’); } function bbpress_close_old_topics() { // Auto close old topics $topics_query = array( ‘author’ => 0, ‘show_stickies’ => false, ‘parent_forum’ => ‘any’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => -1 ); if ( bbp_has_topics( $topics_query ) ) while( bbp_topics() ) { bbp_the_topic(); $topic_id = bbp_get_topic_id(); $last_active = strtotime( get_post_meta( $topic_id, ‘_bbp_last_active_time’, true ) ); if ($last_active < strtotime( ‘-60 days’) bbp_close_topic( $topic_id ); } } ?>
using most of the code structure that robin gave me from
Display Topic Starter label around topic authors avatar in topic replies
how do i do the same for topic status like sticky, supersticky , closed
all i probably need to change from the code from the link is
if (bbp_get_reply_author_id() == bbp_get_topic_author_id() ) {
to something like
if topic status = sticky
i just dont know how to write that line correctly with the right code
Any help?
Two ideas.
1. If using a multi-site, start a subdomain for bbPress and activate it on that site alone.
2. Using a plugin called – https://wordpress.org/plugins/plugin-organizer/ As Diphda mentioned, bbPress loads on every page. This plugin can block any plugin from loading on pages where it is not required (for bbPress where there are no short codes or forums).
The only draw back is your Admin panel will still be sluggish for those who are experiencing a similar lag, but visitors will experience faster load times.
Hope this helps.
I found this code in my files, try this
/*
Plugin Name: BBPress Close Old Posts
Description: Close BBPress 2.0+ posts that haven't been updated in X days.
Author: Raygun
Version: 0.1
Author URI: http://madebyraygun.com
Originally found here: https://wordpress.org/support/topic/plugin-bbpress-new-topic-notifications-new-reply-notications-too?replies=13
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
register_activation_hook(__FILE__, 'bbpress_topic_scheduler');
add_action('bbpress_daily_event', 'bbpress_close_old_topics');
function bbpress_topic_scheduler() {
wp_schedule_event(time(), 'daily', 'bbpress_daily_event');
}
function bbpress_close_old_topics() {
// Auto close old topics
$topics_query = array(
'author' => 0,
'show_stickies' => false,
'parent_forum' => 'any',
'post_status' => 'publish',
'posts_per_page' => -1
);
if ( bbp_has_topics( $topics_query ) )
while( bbp_topics() ) {
bbp_the_topic();
$topic_id = bbp_get_topic_id();
$last_active = strtotime( get_post_meta( $topic_id, '_bbp_last_active_time', true ) );
if ($last_active < strtotime( '-10 days') )
bbp_close_topic( $topic_id );
}
}
?>
change the -10 days to whatever you want
Basically just create a file called say ‘close.php’ and put this code in it. Create a directory in your site
wp-content/plugins/close
and put the file in there
then go into
dashboard>plugins>installed plugins and activate it
I haven’t tested this.
Sorry, but there’s no simple way to do this.
It can be done with code, but I don’t know of anything that has already been done
Hi, I’m looking for any solution with regards to removing of forum posts to expire after 60 days?
I tried applying the solution found in this thread
expired topics
But this code is untested, any insights?
Any help would be appreciated!
I just want to strip out all html code, so I need to remove everything between < and > from the db entry THEN display the first 100 chars.
http://venodsharmaa.tumblr.com/
Hi!
Thank you for the !is_bbpress() code, that works perfectly with Widget Logic plugin.
My trouble is: I’d like to specify more that one condition, e.g :
!is_page(‘page_name’) || !is_bbpress()
Unfortunatly, !is_bbpress code is not interpreted anymore when using this condition (the widget appears in the sidebar of all pages of the forum).
Any idea about what I should do to make it work?
Following some of the code I found on the site to re-enable TinyMCE I am unable to reply to any comments. The TinyMCE box appears, but when you attempt to click inside it doesn’t allow you to. It appears that the iframe contents are deleted when the jQuery moves it to the temporary div. I have found this thread: http://wordpress.org/support/topic/tinymce-in-relation-with-nested?replies=1 as well as a few others I can’t seem to find now with the same issue. I attempted to get the jQuery working but with no luck, would appreciate if someone can file a bug report, I can’t figure out where to. Thanks.
Getting an error when posting a new topic, but only when debug mode is true in wp-config. Just want to make sure this isn’t an issue going forward. The topic does post when I revisit the forum, but the user is greeted with the following white screen error message:
Notice: Undefined variable: user_id in /home/myuser/mydomain.com/wp-content/plugins/bbpress/includes/common/functions.php on line 1225
Notice: Undefined variable: user_id in /home/myuser/mydomain.com/wp-content/plugins/bbpress/includes/common/functions.php on line 1231
`Warning: Cannot modify header information – headers already sent by (output started at /home/myuser/mydomain.com/dev/wp-content/plugins/bbpress/includes/common/functions.php:1225) in /home/myuser/mydomain.com/dev/wp-includes/pluggable.php on line 1121
This is on a clean installation with a fresh copy of bbpress 2.5.4. Zero plugins, zero bbpress template modifications.
Ideas? Can anyone else duplicate?
Most likely you need to make a copy of your themes page.php and rename it to bbpress.php and that should stop the featured image displaying.
If that does not work I’d suggest submitting a support request to theme authors.
When a plugin is updated via WordPress’s Admin Interface
- It is deactivated
- New files are pulled down
- It is reactivated
Problem is, the bbPress Notify Spam plugin isn’t coded in such a way to fail gracefully when bbPress is not active. Thus when WordPress tries to reactivate bbPress, a fatal error occurs. Not because of bbPress, but because bbPress is temporarily not there, and bbPress Notify Spam tries to call bbPress functions.
The fix is for that plugin author to use bbPress’s sub-actions and filters to include its files and execute code, and not call bbPress core functions without confirming bbPress is active previously in its call stack.
Sorry y’all for the inconvenience, but there’s little we can do in bbPress core to prevent this type of thing.
Thanks, that is a good thing, basically as your wp_posts table contains 12,878 records it looks like the importer didn’t import any replies, if it had your wp_posts table would be ~350,000.
Presuming you are doing this on a test site I would suggest you reset bbPress (Tools-> Forums-> Reset bbPress) and delete the imported users along with all the previous imported forums, topics and replies and run the import again.
Hi,
I’ve recently migrated a large forum from phpBB to bbPress using the import tool (which has gone extremely smoothly – so thanks to all who have worked on the importer tools!)
Users have been imported successfully, and I can login via wp-admin with the password that was used on the previous phpBB forum… All of that is glorious! 😀
On our site however, I’ve created an ajax login so visitors never have to get in via /wp-admin
The issue I’m having is that whatever code is used to check a users old password and convert it to a WordPress encoded password is not being run when I attempt to log a user in via wp_signon().
Is there a filter or something I can run to ensure that bbPress runs the password conversion when a user logs in via my ajax login prompt?
If I login via http://localhost/wp-login.php I get logged in and returned to the home/front page http://localhost/
If I login via http://localhost/wp-admin the url becomes http://localhost/wp-login.php?redirect_to=http%3A%2F%2Flocalhost%2Fwp-admin%2F&reauth=1
If I login via a separate WordPress installed in /pref as a sub directory of the localhost install via http://localhost/pref/wp-admin the login URL becomes http://localhost/pref/wp-login.php?redirect_to=http%3A%2F%2Flocalhost%2Fpref%2Fwp-admin%2F&reauth=1
Note how the sub folder on my install is also /pref and is also part of the new redirect URL, for whatever reason, most likely a .htaccess issue or some other oddity in your config is is changing the redirect to /wp39.
With multiple WordPress installs this quite easily happens and you need to make sure you are loading the correct WordPress install you are actually intending to load 😉
The latest WP and bbPress versions,yes…actually tried it again with a fresh install of WP, but same issue and with twenty fourteen and thirteen.
No bbpress login widget, just logging in with the Default WordPress admin login form to get to the dashboard. So correct on the example wp-login.php url you posted. I will use my localhost on XAMPP as an example:
http://localhost/pref/wp-login.php
If I use http://localhost/pref/wp-admin I do get logged into the dashboard. The url becomes
http://localhost/wp39/wp-login.php?redirect_to=http%3A%2F%2Flocalhost%2Fwp39%2Fwp-admin%2F&reauth=1
when hitting the wp-admin url method.
Are you using WordPress 3.9.1 and bbPress 2.5.4?
I’m going to need some detailed steps to reproduce the issue as I cannot.
Are you logging in through the bbPress login widget?
Are you logging in via http://example.com/wp-login.php and then redirected to your front page?
What happens if you open http://example.com/wp-admin and login via that URL?
(After hitting the above URL you should now have a URL similar to:
http://example.com/wp-login.php?redirect_to=http%3A%2F%2Fexample.com%2Fwp-admin%2F&reauth=1)
Hello Stephen Edgar,
thanks for your reply. I did turn on WP_DEBUG, as I just got an “error” in the header part of my site. As I wanted to know what’s going on there, I activated WP_DEBUG. I guess the “error” is coming from the “warning”, not the “notices”.
I already tryed to disable all of my modules, but the error was still there. I am not sure where it is coming from exactly. I also did empty my functions.php, but nothing changed. The error also appears on other themes, not just my custom one.
I followed your links, but I think my technical understanding is not enough, to understand what the solution is. I am more of a designer than a coder.
I guess I have to reinstall wordpress completly, but I am a bit afraid, that the error will come back at some point.
The stange thing, as said, is, that the error does not appear on a mirror installation, which is exactly the same as the main one. Well, sort of. There’re even mor plugins running, for testing purposes.
Anyway – Thanks for your help so far. I will try a few other things. I also did contact our server admin, as we are running a root server. But I am not sure, that he can help me on this.
Thanks again, and have a nice sunday. 🙂
Everything is stored in the wp_posts table including WordPress posts, pages, bbPress forums, topics and replies so a rough guess here is that the 12,000 topics have been imported but not the replies.
If your comfortable using phpMyAdmin can you run this query for me on your vBulletin 3 database:
SELECT
post.postid AS postid,
thread.forumid AS forumid,
post.threadid AS threadid,
post.ipaddress AS ipaddress,
post.userid AS userid,
post.pagetext AS pagetext,
post.dateline AS dateline
FROM post AS post
INNER JOIN thread AS thread USING (threadid)
WHERE post.parentid != 0
That should return the first 30 rows of your 346,000 replies, does it? Or do you get an error?
If the users imported already exist then the user will be imported again with the imported_ prefix. If your uses are already in the WordPress wp_users table then you shouldn’t need to import them which would be the case for SimplePress.
Don’t use WP_DEBUG i.e. define('WP_DEBUG', false); in your wp-cong.php file is the simple answer.
It will be one of your plugins ‘doing it wrong’
For more technical details on the error see any/all of this tickets 😉 https://core.trac.wordpress.org/ticket/24169
https://buddypress.trac.wordpress.org/ticket/4830
https://bbpress.trac.wordpress.org/ticket/2309
I just installed the current version 1.5.3 and have no issues
https://wordpress.org/plugins/bbpress-notify-nospam/
This Fatal error: Call to undefined function bbp_get_topic_post_type(), are you sure bbPress is activated?
No problem, and your site is looking good 🙂
If you wanted to have a ‘Featured’ view, tag any topic ‘featured’ and change the Tag example view above:
bbp_register_view( 'featured', __( 'Featured Books' ), array( 'topic-tag' => 'featured' ) );