OK, it did it again. There’s something else I don’t understand… how text that is inserted in ‘code’ tags are interpreted. Let’s try this one more time… The relevant function call to be inserted in the above code segment is:
<a href="<?php bbp_forum_permalink( bbp_get_topic_forum_id() ); ?>"><?php bbp_topic_forum_title( bbp_get_topic_forum_id() ); ?></a>
OK, so I totally misunderstood what was going on there… The ‘bbpress’ text has nothing to do with the display of the forum name.
The result I was after is acheived quite simply by using the function bbp_topic_forum_title in place of bop_forum_title in the above code segment (which still needs to be added to the loop-search-reply.php template—and that modified template file placed in the relevant <theme>/bbpress folder—as noted above):
"><?php bbp_topic_forum_title( bbp_get_topic_forum_id() ); ?>
Now, as I retype that code segment, I notice that something has gone wrong with the code segment I pasted into the original post. I’m not sure if that was me or not, but the line to be replaced with the above, should have been as follows:
"><?php bbp_forum_title( bbp_get_topic_forum_id() ); ?>
I hope that makes sense to anyone who’s interested.
Hi – I have a WordPress site that has been operational for 5 years.
I wanted to add a Discussion Forum using bbPress, and I have been successful in installing the bbPress plug-in.
Using the bbPress Shortcode Codex, I wanted to create a requirement for people to log into my new Discussion Forum using
[bbp-register] – Display the register screen.
[bbp-lost-pass] – Display the lost password screen.
However, when I test these two options, it appears that these two options actually create a new WordPress account – with no connection to my existing WordPress site at all. When I test the Register facility, a new page opens with the WordPress create account box (create username and password).
What is wrong with the Shortcode usage, please?
WordPress 5.4.1 running Enterprise theme.
Who and What I Find – About this site
bbPress Version 2.6.5
Codex updated. Thanks for pointing that out.
MySQL 8 removing support for zero dates is the problem.
WordPress is incompatible with NO_ZERO_DATE mode, but it being dropped entirely means these errors are going to pop up.
See: https://bbpress.trac.wordpress.org/ticket/3354
Going to patch and fix for 2.6.6, likely for a release next week.
I am experiencing a similar problem.
I get the exact same error message, although the forum does render (ie. no blank page).
As far as I understand, it appears to be because bbp_remove_adjacent_posts does not get called, and it tries to fetch adjacent posts with a default post_date of 0.
sorry this is a bbpress forum – this should get you started with bbpress
Step by step guide to setting up a bbPress forum – Part 1
I know nothing of buddypress, just directing you to their site
Its what ive found in my wor2975_usermeta table for my admin user.
212 5 wor2975_capabilities a:2:{s:13:"administrator";b:1;s:13:"bbp_moderator";b:1;}
213 5 wor2975_user_level 10
This allows any length title
add_filter( 'bbp_is_title_too_long', 'rew_dont_bother', 10 , 4 ) ;
function rew_dont_bother ($result, $title, $max, $len ){
return false ;
}
and this reduces content
//code to limit number of characters in topic contents to 500 characters
add_filter( 'bbp_new_topic_pre_content', 'rew_limit_topic_content' );
add_filter( 'bbp_edit_topic_pre_content', 'rew_limit_topic_content' );
function rew_limit_topic_content( $topic_content )
{
/* Check for number of characters in topic contents */
if (strlen($topic_content) > 500) {
$revised_content = substr($topic_content, 0, 500);
}
else {
$revised_content = $topic_content ;
}
return $revised_content ;
}
Put this in your child theme’s function file – or use
Code Snippets
Just had a chance to dig further into this – bbpress will only let a keymaster set another keymaster, so if you’re not a keymaster yourself then by default you can’t do this.
However this code should allow any admin to set a keymaster
add_filter( 'bbp_is_user_keymaster', 'rew_allow_keymaster', 10 , 3 );
function rew_allow_keymaster ($retval, $_user_id, $user_id) {
if (current_user_can( 'manage_options' )) $retval = true ;
return $retval ;
}
Put this in your child theme’s function file – or use
Code Snippets
BUT THEN TAKE IT OUT AFTER you have set up another – as it makes all admins in effect keymasters.
With the code above I am able to post but every post appears from “anonymous” 🙁
yes it is buddypress
you can change the text as per below
//This function changes the text wherever it is quoted
function change_translate_text( $translated_text ) {
if ( $translated_text == 'You have successfully created your account! To begin using this site you will need to activate your account via the email we have just sent to your address.
' ) {
$translated_text = 'new text';
}
return $translated_text;
}
add_filter( 'gettext', 'change_translate_text', 20 );
so just put what you want in place of ‘new text’
Put this in your child theme’s function file – or use
Code Snippets
slow down comes from a flood check function.
The flood time is set is
dashboard>settings>forums>flooding.
for this specific issue, I’d try setting that to a longer period and see if it makes a difference
Then you can disable this function using
add_filter( 'bbp_bypass_check_for_flood', 'rew_bypass_flood' ) ;
function rew_bypass_flood () {
return true ;
}
Put this in your child theme’s function file – or use
Code Snippets
great – it may well be buddypress or WordPress.
If you give me a link, I’ll register and might be able to tell from the code sent to the browser
Got a notification in my WP plugins admin page there’s an update of bbBress (Version: 2.6.5
– 5 days ago)
Following the changelog link, gets me here https://codex.bbpress.org/releases/
there is no mention of 2.6.5 (even 2.6.4 is still TBA)…..
so without knowing even the most basic things as to what might have changed I cannot in good faith update the plugin
PS: hmm, seems i need to click on “blog” next to the 2.6.4 “TBA” release …..
perhaps someone should update the https://codex.bbpress.org/releases/ page at some point
hmmm… not sure what to suggest -you must have code that is stopping that role.
what other plugins are you running?
ok, I’m not seeing this issue – can you as a test deactivate bbpress do shortcodes and then retest
Just “bbPress Do Short Codes”.
thanks for that, and yes I’ll look at the code. I think it does nothing unless you start to fill it in, but an activation tick box might be a better solution.
Thanks for letting me know and for posting your solution.
in both your cases (main search and empty search) then yes you will have a problem.
main search can be excluded by looping round the search results and excluding the forum if the search results are from more than one forum.
Global wp_query is available, and lists the query that was executed, so in there you would find the
‘key’ => ‘_bbp_forum_id’,
‘value’ => $forum_id,
‘compare’ => ‘=’, ,
part of the query, so you could use that with some nifty code to extract the forum number, but I’ll leave you to work out how to do that !!
Thanks Robin. That’s given me something to work with.
As it stands, this will include the current forum in the breadcrumb if the search is executed from a specific forum and the result set is not empty. That is certainly one of the cases addressed.
But if the search is executed from the main index page, and the result set is not empty, instead of the breadcrumb trail including just Forums > Search > etc., it will include the name of the the first forum that produced a search hit (and obviously not all, where there may be several hits in different forums), which is not really the intent.
If the search set is empty, however, the name of the forum from which the search was conducted is still missing and I’m not sure I can work out how to get around that, because your code is using one of the search hits to work out what forum to add to the breadcrumb. If the search set is empty, how then can I work out where I’ve come from? I think I’m going to have to know this to even fix the first problem above.
Is there a concept of something like a global variable here? Can we set the $forum_id variable any time we navigate to a particular forum and just call on that from where ever we are if needed?
I think it will be the case of the empty search where this will come in most handy, because the reader can quickly flick back to the forum in question and search again, rather than having to go back to the main index page and navigate back to the forum they were working with if they, for example, have just mistyped a search string.
Thanks again. I had no idea where to even begin…
that was an interesting challenge, as the forum ID is not known when the breadcrumbs start to show, so I had to look up the forum_id from the first result.
but this should work, just add it to your functions file
add_filter ('bbp_breadcrumbs' , 'rew_breadcrumb_search' ) ;
function rew_breadcrumb_search ($crumbs) {
//create a new array
$new_crumbs = array() ;
//find the forum from the first item in results
if ( bbp_has_search_results()) {
while ( bbp_search_results() ) : bbp_the_search_result();
$type = get_post_type() ;
if ($type == 'topic' ) $forum_id = bbp_get_topic_forum_id() ;
if ($type == 'reply' ) $forum_id = bbp_get_reply_forum_id() ;
if (!empty ($forum_id)) break ;
endwhile ;
}
//cycle through the crumbs until we find search
foreach ($crumbs as $crumb=>$data) {
if (strpos($data, 'search') !== false) {
//If the forum ID exits, add the breadcrumb
if( $forum_id && is_numeric( $forum_id ) ){
$new_crumbs[] = '<a href="' . esc_url( bbp_get_forum_permalink( $forum_id ) ) . '" class="bbp-breadcrumb-forum">' . bbp_get_forum_title($forum_id ) . '</a>';
}
}
$new_crumbs[] = $data ;
}
return $new_crumbs ;
}
Nevermind, managed to get it working with this workaround:
$author_id = get_post_field( 'post_author', $topic_id );
Now I have the proper $author_id! 🙂
Hello all.
I’ve been editing the bbPress 2.6.5 plugin a bit, in order to fit my use.
As of now, I just wanna track down the topic_id and the author_id.
That’s pretty simple, given the set of functions available for the community.
So I managed to write this little code here:
global $author_id;
global $id_of_topic;
$id_of_topic = bbp_get_topic_id();
$author_id = bbp_get_topic_author_id($id_of_topic);
The ID of the Topic is successfully retrieved, let’s say it’s “18446744073709551615”,
but once I pass that variable to bbp_get_topic_author_id(), the output of $author_id is 0.
Now that’s pretty weird considering that if I pass the number 18446744073709551615 directly into that function, everything goes fine, I retrieve the author_id successfully.
One thing I noticed tho, is that printing out $id_of_topic, once with %d and once with %u (just after I call bbp_get_topic_id() ), I get two different values.
– %d = 0
– %u = 18446744073709551615
Pretty weird.. How can I somehow pass the %u to bbp_get_topic_author_id()?
Thanks in advance! 🙂