Hey all,
I had a previous post where i logged a user into bbpress by passing credentials from our site in the url. that worked fine but we were not using bbpress embedded in wordpress at the time.
Now we have changed the configuration by setting up a full WP site with bbpress as a plugin.
the goal is still the same: Send a user to our bbpress forum and automatically log them in.
We are using a single forum so i have made changes to
bbpress\bbp-theme-compat\bbpress\content-single-forum.php
Currently the user is logged in correctly. However when any topic link is pressed the “You must log in….” message is shown. Apparently is_user_logged_in returns false.
Any help on how to make the logged in user persist to more than the first page would be greatly appreciated.
We are using bbpress 2.1.2 and wp 3.4.1
My code for logging in a user is:
<br />
$loginCreds = array();<br />
$loginCreds['user_login'] = $user_login;<br />
$loginCreds['user_password'] = $_GET['password'] ;<br />
$loginCreds['remember'] = true ;<br />
$user = wp_signon( $loginCreds, false );<br />
if ( is_wp_error($user) ){<br />
echo $user->get_error_message();<br />
echo $_GET['password'] ;<br />
} else {<br />
$user_id = $user->ID;<br />
wp_set_current_user($user_id);<br />
wp_set_auth_cookie($user_id, true);<br />
}
Hi, I can help you with this. I am doing the same and needed to figure it out as well. Hopefully they’ll add this in updated versions… Seems like a basic feature that can add awesome visual option via CSS. Anyways, I will assume you know a bit of CSS. For the PHP, I recommend that you create a folder “bbpress” inside your WP theme folder, i.e. wp-content/themes/yourtheme/bbpress Then go to /plugins/bbpress/bbp-theme-compat/bbpress and copy/paste the file “loop-single-reply.php” to your newly created bbpress folder from above. What this does is now make bbPress use that file instead of the default one. Now you can make changes to it and not worry about updates to bbPress overwriting your changes. On line ~ 30, you’ll see an opening DIV with id=”post-*some php”…
On the next line, enter this:
$reply_id = bbp_get_reply_id( $reply_id );
$abc_role = bbp_get_user_display_role( bbp_get_reply_author_id( $reply_id ) );
Then the next line that’s already there should be:
div class="bbp-reply-author"
Turn it into this:
div class="bbp-reply-author ?php echo $abc_role ?>"
Add the bracket < before the first ?php in that above statment… I dont know why its not letting me show it.
And there you have it. The CSS class name will now contain the verbatim user role… This means that "Key Master" will actually be in the class.. No problem, just use:
div.Key { color: #abc }
to target the admin. Sure, “Master” will be in there but, but it’ll be taken as 2 different classes, “Key” and “Master”. With additional pvp, you could turn it into “keymaster” but its not necessary for 99.9% of applications and would just run more PHP. I’m literally doing this right now, so i havent checked other template files, but it’s the same thing.. So for instance, if you want to change the css in the index for only admins, to have lets say a special color link, find the template file that displays the index, add that same snippet in, and it will work the same. have fun. 🙂
…Bah, my code was swallowed.
Change <div id=”container”> to <div id=”primary”> in the forum pages.
My suggestion? Find a suiting CSS file in the theme, add
.bbp-forum-title { font-weight: bold; }
at the bottom, and call it a day.
Hy. I DO NOT want to use child theme! i hate it.
I need to do a little modify to the topic title. Example show it on “bold” style instead of “not bold” style. Yeah i know… when update version i need to repet the css modify or lost it so is better to use child theme… NO THANKS.
SO… on suorce code of my bbpress (plugin) page i found “<a class="bbp-forum-title" ……"
GOOD bbp-forum-title is "my man" … the question is WHERE (DEVIL) I FOUN IT?????? IN which
(cursed) CSS file???
Thank you.
PS. BuddyPress 1.6.1 + WordPress 3.4.1 + bbpress (plugin) 2.1.2
I’m looking for this too. I found a shortcode that do this, but I’m not sure if it’s the same of this forum. The shortcode is: [bbp-topic-index]
Hi All,
It seems Nofollow is not working.
I used
add_filter('post_text', 'bb_rel_nofollow');
add_filter('pre_post', 'bb_rel_nofollow');
But that didnot work even.
What shall be done?
Sorry, the code didn’t come up quite properly. Use this instead:
http://pastebin.com/XA2BPBhx
I’ve done the following steps:
1. Checked Allow BuddyPress Groups to have their own forums
2. Created a Group Forum
3. Selected Group Forum is the parent for all group forums
4. In Buddypress,unchecked Discussion Forums component.
5. In Group / Admim / Forum, created a new forum.
Upon completion of creating a new forum in group, I got redirect to Group Forum directory under bbpress page instead of group Forum tab. Under the group Forum tab, it shows This group does not currently have any forums.
I need some help to get things set up right. Thanks!
I looked into this myself, but I couldn’t find enough documentation to get started. I’m the kind of dev who can get stuff to work if given enough time and decent code examples. Hopefully as more bbpress 2.0 plugins are released there will be more to learn from.
I would agree that this is such a core feature as users surely use this to monitor activity. There is a shortcode which lists out new posts, you can see it on my site here. A list of new posts does go some of the way to help users monitor activity. There is also the RSS feed which is what I use to monitor all posts that are made.
I wouldn’t want to second guess JJJ but from the gist of his posts I get that he is very pro 3rd party involvement. In a number of cases his response has been to say if you want a feature enough then why not get to work on it and add it (obviously easier said than done as most users don’t have the skills!). Does the fact its commercial make a difference? I don’t know, I shouldn’t think so. Commercial WordPress plugins have been around for a while and are widely used.
Hi,
I have installed BBPress, in my current registration page I have the code [bbp-register] which works and lets a user register. However the only fields here are to choose a username and enter email, where an password is automatically sent. What I need is to have an password field which the user enters, rather than having a generated one. I would also like other custom fields such as gender and age.
The form is located in form-user-register.php
Its fine to add the extra input boxes here and display, but I don’t know how these would get stored and saved.
Any help on how to make the custom fields save and which files to look at would be extremely helpful.
Thanks in advance!
Apology if I am spoiling your thread, but I do have a question about bbpress post parent, maybe our question is related to the same answer, so, let me go on… In WP, if we want to find a post parent, we do
$post=get_post($id)
$parent_id= $post->post_parent
In bbpress, there is a fundtion to do the job
function bbp_get_reply_topic_id( $reply_id = 0 ) {
// Assume there is no topic id
$topic_id = 0;
// Check that reply_id is valid
if ( $reply_id = bbp_get_reply_id( $reply_id ) )
// Get topic_id from reply
if ( $topic_id = get_post_meta( $reply_id, '_bbp_topic_id', true ) )
// Validate the topic_id
$topic_id = bbp_get_topic_id( $topic_id );
return apply_filters( 'bbp_get_reply_topic_id', (int) $topic_id, $reply_id );
}
My question is-- why bbpress does not use WP's post\_parent, instead, it saves parent\_id in child's meta, make no use of native WP post table? The parent may got lost somewhere in the middle of the additional out of system steps.
Hi! In the loop-single-forum.php, there is this part of code:
do_action( ‘bbp_theme_before_forum_description’ );
do_action( 'bbp_theme_after_forum_description' );
And I need to see the description of the forum below it, but there is nothing. I definitely have written the Text, but the_content(); just doesn't work. I also had to do a very hard coded tweak, to show the description of the subforums and it worked, but It doesn't work for normal forums..
€: I editet two times and the “code-sample” function doesnt work. so I just inserted in manually.
€2: I cant believe it! This is really the last time I use bbpress, even this forum doesn’t work properly. It allways deletes my html..
-
This topic was modified 13 years, 11 months ago by
thefairystamp.
-
This topic was modified 13 years, 11 months ago by
thefairystamp.
-
This topic was modified 13 years, 11 months ago by
thefairystamp.
-
This topic was modified 13 years, 11 months ago by
thefairystamp.
I have installed bbpress plugin in my wordpress, but there is not latest topcis on my forums front page like on your http://bbpress.org/forums/
Anyone could give me a latest post loop code, so i can insert it manualy to my template?
many thanks!
I had the same issue… see: https://bbpress.org/forums/topic/how-to-override-bbpress-css/
I walked through the bbPress code, and discovered where it looked for its css. Amazed it wasn’t documented!
In your functions.php file add this code
add_action('login_redirect', 'redirect_login', 10, 3);
function redirect_login($redirect_to, $url, $user) {
if($user->errors['empty_password']){
wp_redirect(get_bloginfo('url').'/log-in-error/');
}
else if($user->errors['empty_username']){
wp_redirect(get_bloginfo('url').'/log-in-error/');
}
else if($user->errors['invalid_username']){
wp_redirect(get_bloginfo('url').'/log-in-error/');
}
else if($user->errors['incorrect_password']){
wp_redirect(get_bloginfo('url').'/log-in-error/');
}
else{
wp_redirect(get_bloginfo('url').'/forums/');
}
exit;
}
I created a page in wordpress called “log in error”, and chose that as the page to be redirected to if you do an incorrect login. In that page I wrote “Your username or password was incorrect. Please try again.” And then I chose bbPress – User Log In as the Template.
Hi there, I’m a longtime admin of several popular neighborhood forums on bbPress, and I just upgraded one of the forums to 2.1. It’s missing user navigation like login, register, logout, create new topic, favorites, subscriptions, etc., and I can’t find how to add those links manually (which I can, just don’t know what code to use). You can see this in action here: http://www.magnoliavoice.com/forums Please help?
-
This topic was modified 13 years, 11 months ago by
myballard.
Hi,
Our forums have been working on our website until recently (perhaps due to an edit we didn’t realize). Currently what is happening is that topics (if posted through the wp-admin) show up, but when you click on the forum you get the error “Page Not Found”.
Would this be an issue with the database or some other code error?
I am sorry, I can’t show the page because it’s for a work project that isn’t allowed to be publicly shared. But a couple screenshots:
Forum not showing:
https://www.dropbox.com/s/jx3rue9077p50w9/forumnotfound.jpg
Post showing up:
https://www.dropbox.com/s/hompyfucw2j95k2/post-showingup.jpg
Thank you for any help that you might be able to give.
-Stephanie
Hi, don’t know if this is a bug or just my doing it wrong. I have added a twitter and a facebook field to my user details, and removed the yim, aim and jabber fields. I’m also using the events manager plugin, who have added a Phone field to my user details. So when trying to edit my user details, front end with bbpress (form-user-edit.php) my user_contactmethods dosen’t get updated. This is the code i used:
add_action(‘roots_footer’, ‘roots_google_analytics’);
add_filter( ‘user_contactmethods’, ‘my_user_contactmethods’ );
function my_user_contactmethods( $user_contactmethods ) {
unset($user_contactmethods['yim']);
unset($user_contactmethods['aim']);
unset($user_contactmethods['jabber']);
$user_contactmethods['twitter'] = 'Twitter';
$user_contactmethods['facebook'] = 'Facebook';
return $user_contactmethods;
}
This is the code that shows my stuff front end (well it's your code, from form-user-edit.php)
http://pastebin.com/iYV5H6jv My problem is that it doesn’t output any values front end, but if I type something and press the update button, it gets updated backend, but still it turns blank front end. Hope you guys understand, any help, feedback or ideas is much appreciated.
-
This topic was modified 13 years, 12 months ago by
hixen.
-
This topic was modified 13 years, 12 months ago by
hixen.
-
This topic was modified 13 years, 12 months ago by
hixen.
-
This topic was modified 13 years, 12 months ago by
hixen.
-
This topic was modified 13 years, 12 months ago by
hixen.
-
This topic was modified 13 years, 12 months ago by
hixen.
-
This topic was modified 13 years, 12 months ago by
hixen.
-
This topic was modified 13 years, 11 months ago by
Stephen Edgar. Reason: Added topic tags
I have a login box now in the header of all pages on my site but if the form isn’t filled out and you click submit it doesn’t display an error message, instead it takes you to the wp-login page. How do I avoid that? Is there something I can add to the shortcode that will require information in the form?
http://www.brucechristian.com/ (temporary url for dubaitrailrunning.com) •
WordPress v. 3.4.1 •
bbPress v. 2.1.2
Hi, folks. Please let me know if there are other web files whose source code would be helpful to examine.
Thank you.
Why not use the shortcodes that come with bbPress?
https://codex.bbpress.org/shortcodes/