I think what you are looking for is in the loop-single-topic.php template and the other one is maybe loop-single-forum.php.
Hello I am using bbpress in conjunction with buddypress. I also activated the function to allow forum creation with creation of a buddypress group.
Additionally I want to have forum page. When I place the shortcode on a page all forums are displayed also the ones that are created with buddypress group. Is it possible to exclude these forums form the page?
Another potential idea would be to modify the code to “limit” the repair tool amount of replies it’s trying to do each time.
I’m not sure how many forums your site has, but maybe restricting that by forum ID may drop you down from 3 million to something more reasonable to process in under 30 seconds?
The reply position is stored in wp_posts in menu_order, the first reply of a topic should be 0, then each reply after that increments by 1, that is what the end goal should be.
You could also try running that same query you did above where it returned 3,763,193 total replies, then run the repair reply menu order repair tool and run the query again then subtract that new total from the original 3,763,193 to see how many replies are getting there menu order updated before PHP times out, then divide 3,763,193 by that number and you’d have a theoretical value of how many times you would need to run that tool before all replies are actually repaired 😉
Two functions bbp_update_reply_position() and bbp_get_reply_position_raw() are what you need to look at:
https://bbpress.trac.wordpress.org/browser/branches/2.5/includes/replies/functions.php#L2113
https://bbpress.trac.wordpress.org/browser/branches/2.5/includes/replies/functions.php#L2149
The two functions above are what calculates the reply position in the database as it doesn’t actually exist in the database until either a) a new reply is added to a topic or b) the repair tool is ran to calculate the reply order.
Well, i ran:
SELECT a.ID FROM bb_posts AS a
INNER JOIN (
SELECT menu_order, post_parent
FROM bb_posts
GROUP BY menu_order, post_parent
HAVING COUNT( * ) >1
)b
ON a.menu_order = b.menu_order
AND a.post_parent = b.post_parent
WHERE post_type = 'reply';
3,763,193 total, Query took 11.5215 sec
I guess it’s only SELECT and yep, it returns what is have to be fixed?
Script seems to make “bbp_update_reply_position” with that information. Where can i find the reply position in DB?
You would want to do a search and replace in your database to change it from a BBCode link to a compatible link e.g. http://youtube.com/video_url.
I’m not familiar with “Aeva media” so can’t really help in that regard.
Using a search and replace plugin like the following might be what you need:
https://wordpress.org/plugins/search-and-replace/
You would search for the “Aeva media” BBCode, eg. [aver_video]video_url[/aver_video] and replace it with http://aver-vidio-domain.com/video_url
Found the patch, it needs lots of testing and I haven’t had the time to take even a cursory look at it yet https://bbpress.trac.wordpress.org/ticket/2731, so lets leave that aside for now.
The code is here, I’m not sure your level of PHP knowledge but I’ll just add the link to it for now and will follow up after you’ve had a look at the code:
https://bbpress.trac.wordpress.org/browser/branches/2.5/includes/admin/tools.php#L1134
I really appreciate!
Yep, it’s likely php script code limitation. I already asked for admin’s to encrease php_time_limit, but it’s still to small ))
I’ll go grab that code for you now, I’ve also got a patch that I’m trying to find that fixes this per the details below.
The thing is, the tool works as you noted that it works for when you’ve only got 2 replies, it fails on millions because the PHP code times out after 30 seconds, theoretically if you keep running that tool, click back after each white screen and hit go again you will eventually achieve said goal, with millions I would not advise this though.
Ok, run ONLY the following 3 repair tools: https://codex.bbpress.org/features/repair-forums/
* Recalculate the parent topic for each post
* Recalculate the parent forum for each post
* Recalculate last activity in each topic and forum
Do the replies look OK in the backend now?
If not then run this repair tool:
* Recalculate the position of each reply
How about now?
(The above should repair all the post_meta for you)
Ha… Using bb_ as your table prefix really did throw me 😉
If you look at lines 59-60 for your topics your selecting the forum_id from the phpbb_topics table and inserting it into post_parent
https://gist.github.com/anonymous/8d1cb71e69d52ac69f5d#file-gistfile1-sql-L59-L60
The same needs to happen for replies, so you should be able to get the topic_id that the reply is for and then insert that into the reply post_parent
https://gist.github.com/anonymous/8d1cb71e69d52ac69f5d#file-gistfile1-sql-L59-L60
The following should do it, assuming that topic_id is actually in the phpbb_posts_text table.
INSERT INTO
bb_posts(post_title,post_excerpt,post_name,post_content,post_type,post_parent)
SELECT post_subject, post_id, post_subject, REPLACE (post_text, CONCAT (":", bbcode_uid), ""), 'reply', topic_id FROM phpbb_posts_text;
I’m not really sure you have to worry about the post meta table?? Nevermind it is most likely important for post IDs and such.
https://codex.wordpress.org/Database_Description#Table:_wp_postmeta
And as for sql code to check DB for consistency , I do not know what to tell ya there either.
Maybe, there’s some SQL code to check my DB for consistency and to fix some relationship problems if they’re present?
I guess, for such a big number of replies it could be faster, than any php tool, and also more clear, as i’m already working through DB manually.
@mmice
bbPress v2 does not have a bb_posts database table , that is in bbPress v1 standalone. Which is what @netweb is referring that you are trying to import into the old v1 version even though your suppose to import to the latest version.
All of bbPress data is stored inside of the WordPress database tables.
In this guide I explain it.
Stored Database Data
Go through some common troubleshooting steps.
Troubleshooting
Its custom code to this site.
There might be some tutorial, I think someone linked to it before on here but I can’t remember where ti was.
This plugin has something close , but it has no styling.
https://wordpress.org/plugins/bbpress-info-widgets/
You might need to create a new user role for users to default as and set their capabilities to create replies but not create topics.
Custom Capabilities
So I edited the post and copied the SQL code to a gist on GitHub:
https://gist.github.com/anonymous/8d1cb71e69d52ac69f5d
First, it looks like you are importing the phpBB into bbPress 1.x, bbPress 1.x is not supported anymore.
Per @robkk post immediately above you should checkout that link to our docs on the codex on importing to bbPress 2.x, and in general look toward using the bbPress 2.x plugin for WordPress https://wordpress.org/plugins/bbpress/
I’d suggest taking a look at our phPBB v3.x importer and making any change to match the phpBB v1.x database schema changes you would need:
https://bbpress.trac.wordpress.org/browser/branches/2.5/includes/admin/converters/phpBB.php
I am having trouble getting my userpro avitars or profile pictures to be displayed on the bbpress home page and topics page where its says “freshness” or “latest post”. The profile pictures do show up when you go into a topic and reply but not on the home page. I want the little picture next to posters name under “freshness” or “latest post”. What code would i have to change and where can i find it? Im using a custom theme by the way.
You can either change WP_DEBUG to false inside wp-config.php
OR if you need debugging for development go to /plugins/bbpress/includes/core/sub-actions.php
function bbp_setup_current_user() {
if ( ! did_action( 'after_setup_theme' ) ) {
// comment out line below
// _doing_it_wrong( __FUNCTION__, __( 'The current user is being initialized without using $wp->init().', 'bbpress' ), '2.3' );
}
do_action( 'bbp_setup_current_user' );
}
Hi Robin W, thank you for providing the above code! It is just what I’ve been looking for!
I have a question. When I was testing, I noticed if I entered invalid login info, there was no redirect or error message, but it did display that in my address bar. What accounts for what happens on login failure?
Here is a sample that displayed in my browser after login failure:
Upside
The site I’m testing on is this one:
http://www.rashedlightsways.com
Also, small second question. It happens often that I’m on a site that I *think* I’ve registered on, but haven’t. If someone enters a login that is not correct AND that username doesn’t currently exist, is there a way to redirect to the registration page WITH that username?
So, for example, I type in username: MyFaveUser pw: 1234, and it doesn’t exist in my user table, so the user is redirected to “Hey, MyFaveUser doesn’t exist, but you can register with it! It’s available!” and then autofill the username field with MyFaveUser and leave the pw field blank?
I’ve been trying to bridge together new user registration and login in one field, and thought that might be a way to do it.
Thank you so very much!
– Omar
“Let Your Light Shine”
Hello,
I am trying to import my Kunena 3 forum to bbPress when switching from Joomla to WordPress.
The import always fails with this error:
WordPress database error: [Table 'bcbrainois2.jos_kunena_topics' doesn't exist]
SELECT convert(kunena_messages.id USING "utf8") AS id,convert(kunena_messages.catid USING "utf8") AS catid,convert(kunena_messages.thread USING "utf8") AS thread,convert(kunena_messages.ip USING "utf8") AS ip,convert(kunena_messages.userid USING "utf8") AS userid,convert(kunena_messages.subject USING "utf8") AS subject,convert(kunena_messages_text.message USING "utf8") AS message,convert(kunena_messages.time USING "utf8") AS time FROM jbcb_kunena_messages AS kunena_messages LEFT JOIN jbcb_kunena_messages_text AS kunena_messages_text ON kunena_messages_text.mesid = kunena_messages.id LEFT JOIN jos_kunena_topics AS kunena_topics ON kunena_messages.thread = kunena_topics.id WHERE kunena_messages.parent != 0 LIMIT 0, 100
My table prefix is jbcb_ I don’t know why the importer tries to import a jos_ table which doesn’t exist…
And the result of the import is a forum without any post, just the topics are imported.
Can someone help me on that one?
Thanks a lot,
Nicolas
I’d go with what you did, but put it in a child theme. That way it will be unaffected by changes to plugins or themes.
Functions files and child themes – explained !