Ah in that case, I think thats great. Since the author is the primary content creator of the thread, all things considering, I think it will work well.
You should considering polishing up that code and releasing it as a bbPress plugin on the WordPress.org plugin repository 🙂 You’d have to dynamically hook into the user edit page and maybe a few other changes, but the base of the work there is probably done.
So here is how I would do it (I think) if I wanted something easy yet half way elegant.
I’d create a /login page in WordPress that has a custom page template (page-login.php) that contains some custom stuff. It still breaks the process up into two parts, which is not ideal, but its the easiest way without putting in some time to get around that.
Essentially, it would be something like this. First ask for the customer ID. They enter that in and submit it. If it’s valid then reload the page and show the bbPress login.
if ( isset( $_GET['cid'] ) && !empty( $_GET['cid'] ) ) {
// cid (customer ID) is present, show the bbPress login form
echo 'Please enter your username and password to complete the login process';
echo do_shortcode('bbp-login');
} elseif ( $_GET['error'] == true ) {
// cid entered was not valid
echo 'The customer ID you entered is not valid.';
} else {
// cid is absent so show the form to validate it
// do your custom form here that asks for the customer ID. Then if the customer ID
// is correct/valid reload this page like /login?cid=123456 which will show
// the bbPress login form.
}
Another option would be on the first form to ask for the username. Then you could take that and have it auto fill in on the login form using the WordPress login form function (wouldn’t be able to use the bbPress shortcode for this).
Jared, thanks for the feedback. The more I thought about it, about a thousand different ways to do it popped into my head as well (spun my brain into a scrambled egg). At this point, I’ve basically started to write the custom login from the ground up. I’m going to create a shortcode out of it at the end.
I just started it but so far I just have the basic connection and query going:
function restrictForum(){
$db_name = 'dbname';
$con = mysql_connect("URL","username","password*");
mysql_select_db("$db_name")or die("cannot select DB");
$cust_no = $_POST['custno'];
$sql = "SELECT * FROM customer_data WHERE customer_number = $cust_no";
echo('Customer #');
}
I previously had this small bit into a shortcode that just checked if the user was logged in then provided the bbpress login form if they weren’t:
function restrictForum(){
if(!is_user_logged_in()){
echo('You must login to access the forum');
echo do_shortcode('[bbp-login]');
}
}
add_shortcode('forum-login-restrict','restrictForum');
i am having trouble in changing text color in bbpress.
my wordpress version is Version 3.4.2 and bbpress version is : 2.2.2
I am no expert in Css but have a little knowledge about css,after installing bbpress every thing was working perfect until i realised i am not able to view what i have written in the subject of a topic because my text color matches background color,resulting in a white screen.I went through some similar related topic but sadly was unable to fix the problem.If some one can guide me step by step what should be done to erase this problem i would be grateful.I use a custom theme on my website named PrestigeDarkVol 1.4.Below is a screen shot of the problem faced by me.
Do let me know which Css to edit and which lines and the location of the css file in file transfer protocol.Any help related to this topic is much appreciated. thank you very much in advanced.looking forward for a solution.
link to image : http://i1057.photobucket.com/albums/t388/p7ayboy/Untitled-1.png
Of course the user has to add his G+ profile URL manually (so that the rel=”me” link points to his/her profile) for his picture to show up in SERPs, but having a rel=author in the links from topics or replies to his/her profile still makes sence.
If future versions of bbpress would start using more HTML5 each reply could be an <article/> element which would be more semantic for Google authorship.
But for now only one author for a page counts ( the first one ). Thats why I suggested using lead topics so that the topic creator get the authorship on paged topics.
The thing that makes inline images tough is non-admin users cannot use the tag and shortcodes are not an option.
Currently there is an issue on trac (#1916) that would make it where img tags do not get filtered out. Once that’s done it would open the gate for plugins to handle inline images pretty easily.
Hmm, there could be numerous things causing this to not work. Likely user accounts via the FBC are missing some user metadata that bbPress is expecting or are otherwise not formatted correctly.
At this time I don’t think we are planning on officially supporting that plugin, though I do think having limited compatibility at some point in the future could great.
I got it to work in firefox by adding this when I had the same problem at appglobe.com:
#bbpress-forums .bbp-user-section ul.bbp-topics {
float: left !important;
width:100% !important; /*forgot this one on my last post @mamasaywhat */
}
Try that or the code above by Jared Atcihison and it should work in firefox.
the bad tweak :
function bbp_filter_blog_editable_roles( $all_roles = array() ) {
// Loop through bbPress roles
foreach ( array_keys( bbp_get_dynamic_roles() ) as $bbp_role ) {
// Loop through WordPress roles
foreach ( array_keys( $all_roles ) as $wp_role ) {
// If keys match, unset
if ( $wp_role == $bbp_role ) {
//unset( $all_roles[$wp_role] );
}
}
}
return $all_roles;
}
bbpress/core/capabilities/
And then Moderators are back……. I’m sure i missed something but plugins like “members” don’t do the trick. And i just want basic forum moderation works now.
I will never understand why endusers have to put their hands in the mess of bbpress and hack/tweak it just to use this plugin >:( I can’t trust in your plugin every updates are hell.
Then, don’t work as a dirty pig, and update the doc when you change such important things like roles! It just a little more repectfull for end users.
@RaphaelJeger I want to know!! 🙂
https://wordpress.org/extend/plugins/gd-bbpress-attachments/ works but doesn’t help with inline attachments, and the regular WordPress tinyMCE settings are not applied to the bbPress editor.
Oh, I see I forgot a “{” in my first code….it should be:
#bbpress-forums .bbp-user-section ul.bbp-topics {float: left !important;}
Thats strange, I checked out your profile topics page in firebug and added a float left at this section:
#bbpress-forums ul.bbp-lead-topic, #bbpress-forums ul.bbp-topics, #bbpress-forums ul.bbp-forums, #bbpress-forums ul.bbp-replies {
border: 1px solid #EEEEEE;
clear: both;
float: left; // Added this
font-size: 12px;
margin-bottom: 20px;
overflow: hidden;
}
and when I did so it got visible.
Try this instead at the bottom of your style.css:
#bbpress-forums ul.bbp-topics { float: left !important; }
Try this at the bottom of your CSS file:
#bbpress-forums .bbp-user-section ul.bbp-topics
float: left !important;
}
The following is what I use at AppGlobe:
/* Add Google+ profile URL as profile contact method */
function appglobe_add_google_profile( $contactmethods ) {
$contactmethods['google_profile_url'] = 'Google Profile URL';
return $contactmethods;
}
add_filter( 'user_contactmethods', 'appglobe_add_google_profile', 10, 1);
/* Remove nofollow, and ad author to the profile link */
function appglobe_switch_nofollow_for_author($str) {
$str = preg_replace(
'~<a ([^>]*)\s*(["|\']{1}\w*)\s*nofollow([^>]*)>~U',
'<a ${1}${2}${3}>', $str);
return str_replace(array(' rel=""', " rel=''"), 'rel=author', $str);
}
add_filter( 'bbp_get_topic_author_link', 'appglobe_switch_nofollow_for_author' );
And then in your user-profile.php (create a bbpress folder in your theme root, and copy it over) you can add this:
<?php if( bbp_get_displayed_user_field( 'google_profile_url' ) ) : ?>
<h2 class="author-subtitle">Google Profile</h2>
<?php if( bbp_get_user_role(bbp_get_displayed_user_id()) == 'bbp_keymaster' || bbp_get_user_role(bbp_get_displayed_user_id()) == 'bbp_moderator') : ?>
<a rel="me" class="bbp-user-url" href="<?php esc_url(bbp_displayed_user_field( 'google_profile_url' )); ?>"><?php bbp_displayed_user_field( 'google_profile_url' ); ?>
</a>
<?php else : ?>
<a rel="me nofollow" class="bbp-user-url" href="<?php esc_url(bbp_displayed_user_field( 'google_profile_url')); ?>"><?php bbp_displayed_user_field( 'google_profile_url'); ?>
</a>
<?php endif; ?>
Since I beleave only the first rel=me link on a page counts there would be best to use topic lead:
add_filter( 'bbp_show_lead_topic', '__return_true' );
…by doing so each page will be considered authored by the topic creator even if its paged.
Right now bbPress doesn’t do anything with that.
It’s a good idea, but a plugin would need to be made to capture each users Google+ profile link (assuming there is one) and then put the stuff in the header as needed.
This is getting more complicated the more I realize what I need to do. Basically I have to add an extra login field to the WordPress / BBPress login. But the data in the field I have to add to the form resides on a separate database. So the complicated part is that I have ‘Username’ and ‘Password’ that is authenticated on the WordPress database and “Customer Number” that resides on another database. I’m not sure if there is a way to authenticate one login using multiple db’s.
Is ckeditor compatible with the latest version of BBpress?
Thanks!
Martin
I need to prevent users from being able to see the forum unless they are logged in. The trick is, the login form needs to authenticate against an external database that is contained in one of our servers (not WP or BBPress).
I’m trying to figure out the smartest way to do this. I thought of just creating a regular PHP login, but I’m not sure exactly how to restrict the forum this way. Right now I have all of my forums set to “private” which pretty much does the restriction for you.
It’s a bit complicated but any suggestions would be awesome.
I’ve never used plugins for user roles.
And i don’t understand anything :
i can’t promote users as moderators anymore, Moderator roles no longer exist inside wordpress and every wordpress roles wich are not admins can’t moderate forums.
Then old moderators can’t log in wp-admin to edit bbpress subjects/replies anymore but they can edit replies and topics inside forums…
What the hell is this mess?? Why wasn’t it said before i upgrade??
Thanks Martin…
Ive managed to edit some bbpress templates to include the “Featured” image for the forum.. but i was aiming to have something like different icons for forums read / unread like most other forum software has.
Cheers again, i’ll keep playing around with it and see what i can manage.
Regards, Darren
Do you think making a child theme will resolve this issue, or is there an easier fix to the problem?
I am having trouble understanding where exactly the formatting of the bullet points is coming from… is there somewhere in the bbpress plugin editor that is determining the formatting or is there somewhere in the theme that is telling it to format tables as bullet points?
There could be a fix coming via BP Group Organiser plugin.
WP 3.4.2
BBPress Plugin – 2.2.2
1) Installed BBPress plugin. Did basic setting in admin for the plugin.
2) Copied archive-forum.php and single-forum.php from bbpress plugin directory to mytheme root directory.
3) Copied “css/bbpress.css” to mytheme root directory and then customized.
4) Installed “bbPress Search Widget” plugin. Put it in Primary Area.
5) That’s it. I have not created any new template/page for the forum.
All look fine and working but I have this problem.
If you go to this page http://www.clouni.com/askquestions/
You will notice the search widget in lower right side. How can I put it above the forum breadcrumb “CLOUNI › Forums” ?