Yeah, you could copy the wp_register() function into your functions.php file, modify it (and its name), and then use the modified function instead.
Actually it should be
global $id;
Sorry. And for the last line, you have the right idea but you have to use the string concatenation (putting together into one) operator: the dot . This part is gonna be a bit more complicated, but solution at the bottom.
Strings are indicated by using apostrophes ' ... ' or quotation marks " ... ". If you start a string with one of them, the other one doesn’t affect anything. Variable names inside the quotation marks " will be replaced with their value, but inside ' they will not. The strings here are made using apostrophes ', so you can have valid HTML code without problems: '<a href="..."' works, but "<a href="..."" doesn’t. But that means variable names inside the string won’t get replaced with their value. So you have to concatenate the strings, like this: '<a href="...' . $id . '"> ...';
$link = $before . '<a href="' . get_option('siteurl') . '/bbpress/profile.php?id=' . $id . '">' . __('Profile') . '</a>' . $after;
Should work. Bit tired and therefore also inclined to ramble; sorry about that.
“you could just copy all of wp_register() into your theme (everything from function wp_register() { to the final }”
-> do you mean copying in my theme functions.php file and then calling the fuction in the sidebar?
“WordPress sets $id to be the user ID. It should be available, so just try it. If it’s not, you will need to put global: $id; in the line of code above it, so it knows you mean the global variable $id and not a new one.”
-> I didn’t understand this. Do you mean something like this?
global: $id;
$link = $before . '<a href="' . get_option('siteurl') . '/bbpress/profile.php$id">' . __('Profile') . '</a>' . $after;
Tenemos una baja!
Bueno a mi me falta poco ya con el bbpress, lo tendre que traducir a mano porque tras la integracion no hay manera de cargar un .mo pero da igual.
Gracias por la ayuda y un saludo!
That’s strange with the email. Thanks for the zip, but I’m having trouble with my dev server and I’d rather not put things on my public server. Can you open an page of this on your browser, say the forum index, go to File > Save, save everything and give it to me?
fle64 email bounced back. here is the link for rapidshare http://rapidshare.com/files/37263443/mysoberlife.zip thanks again!
Hi folks,
Just trying to iron out the niggles in my forum. I’ve noticed that my forum is very slow compared to the forum here, which seems surprising given my forum’s lack of activity! Could it be related to the permalinks structure or .htaccess? I’ve tried setting the permalinks up in config, with multiview in the .htaccess, and while it works fine in FF (still slow though) it won’t appear in IE (I get a 404). So I’ve disabled permalinks in order for it to work in IE.
Now, some info. My forum is in a subdirectory from my main WordPress install. I had to enable the php5 handler in the site root .htaccess file for all the new bits and bobs in WP 2.2 to work properly. Here’s what my root .htaccess file looks like:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.ochremusic.com$ [NC]
RewriteRule ^(.*)$ http://ochremusic.com/$1 [R=301,L]
AddHandler application/x-httpd-php5 .php
Would any of that inherited by the forum subdir cause any problems with the bbPress permalink structure, or cause speed issues? Tried optimising the db, but no difference.
Any help on these issues would be very gratefully received, thanks.
PS. Also, for some reason I get a 404 trying to validate the forum on W3. Clues as to why?
(Sorry!)
Fell64 – You rock, thanks for this information! It is very much appreciated.
En serio que me gustaría poder ayudarte más :_(
Pero al final… decidí cambiar de nuevo y seguir con Vanilla de Lussumo, bbpress está demasiado verde y le faltan funciones que ya uso en Vanilla, es más, ya tengo hacks para muchas cosas y me gusta como me ha quedado.
La integración con la DB de WordPress, las sesiones, etc… va de perlas con Vanilla, así que nada me impedía ya seguir con Vanilla.
Tengo más o menos una integración gráfica, de perfiles y de registro y logeo. Me quedó “casi” perfecto para mí ^^
Me gustaría poder aportando si es posible y sirve cosas aquí, me gusta el proyecto bbpress… pero por ahora.
Así que si te sirve de algo puedes registrarte y chequear mi sitio con esta integración:
http://www.laguardiadejaen.com/web/foro/
Un saludo y suerte.
PD: Puedes contactarme por aquí si necesitas algo, ok?
Was I supposed to target the same WP data base in the bbpress Config.php file so users can use one set of username/password to post in both WP and BBPRESS?
Yes. Delete the new database, change the settings in bb’s config.php and install again.
I have a fresh wordpress install at the root level of one of my sites:
http://seidon.com
(working)
I then created another database, then nested a bbpress install as follows:
http://seidon.com/photography-forums/
(working)
Not working – Users still have to create accounts on both sites, to post on both sites.
Was I supposed to target the same WP data base in the bbpress Config.php file so users can use one set of username/password to post in both WP and BBPRESS?
I thought I tuned my config file and even loaded the php intgration plugin (and activated it), but new registrations don’t work in both sites yet. Please help!
Hey fel64! thanks for the answer;
“If you’re not comfortable writing a plugin I’d be worried about hacking core files.”
-> I’m not skilled enough, I’m learning like you, through wordpress, but it is too much for just half month and I’d like to upload the new web by the end of next week.
Regarding the code, I asked this same question in wp forums and user whooami told me that;
“youre doing that assbackwards. The smart way to do what you want to do is to use an if/else statement inside your theme.”
The original code is like this;
function wp_register( $before = '<li>', $after = '</li>' ) {
if ( ! is_user_logged_in() ) {
if ( get_option('users_can_register') )
$link = $before . '<a href="' . get_option('siteurl') . '/wp-login.php?action=register">' . __('Register') . '</a>' . $after;
else
$link = '';
} else {
$link = $before . '<a href="' . get_option('siteurl') . '/wp-admin/">' . __('Site Admin') . '</a>' . $after;
}
echo apply_filters('register', $link);
}
so bearing in mind the code you provided and guessing that I need to generate both links in the same way;
function wp_register( $before = '<li>', $after = '</li>' ) {
if ( ! is_user_logged_in() ) {
if ( get_option('users_can_register') )
$link = $before . '<a href="' . get_option('siteurl') . '/wp-login.php?action=register">' . __('Register') . '</a>' . $after;
else
$link = '';
} else { if( current_user_can('administrate') ) {
$link = $before . '<a href="' . get_option('siteurl') . '/wp-admin/">' . __('Site Admin') . '</a>' . $after;}
else { $redirect_to = $bb_profile_link;
}
}
echo apply_filters('register', $link);
}
or replacing that $redirect_to = $bb_profile_link; for;
$link = $before . '<a href="' . get_option('siteurl') . '/bbpress/profile.php<!--call id user here --> ">' . __('Profile') . '</a>' . $after;
What I don’t know is how to add the id user to the link ??? Since it is the same id user than in wordpress the must be a way
I don’t know of any plugins for bbpress. But you can modify wp-syntax (which uses geshi highlighter). Maybe you can make it into a plugin too
Is there a plugin that enables you to write code in a post? I know I can use the backtick/code-tag, but the code still looks wrong. I gets a lot of backslash’es. Like in this post:
http://wordpress.dk/forum/topic/187?replies=10#post-1099
We use bbPress for the danish WordPress support forum, so we post code examples quite often, why it is important, that they look right.
Well, I have think in a more elegant solution, but this is for wordpress users that inserted bbpress in their wordpress interface. I have it half working though. First of all, my wp-login and wp-registering forms are integrated in my custom theme because I hacked wb-login.php.
Whenever you login in wordpress there is a function in the sidebar, that displays two links;
Site Admin -> link to wp profile.php
Logout
This links are defined in /wp-includes/general-template.php -> line 50
$link = $before . '<a href="' . get_option('siteurl') . '/wp-admin/">' . __('Site Admin') . '</a>' . $after;
You can change /wp-admin/ for bbpress/profile.php
The first failure of this theory is that bbpress uses an id to show user profiles; bbpress/profile.php?id=1 and I have no idea how to add this id to the link plus I don’t know if bbpress user id are the same that in wordpress.
The second failure is that if you are the admin you should get the original link to /wp-admin/
this should be something like if user = admin then “link to /wp-admin/” else “link to /wp-admin/profile.php?id=n user”
but since I have no idea of how to code all this I can’t go further
“You’re the admin, right? You could just bookmark the page.”
-> Well, this is an option that I have in mind, but then all users that registered through bbpress will appear with “undefined” role in wordpress. And I can’t insert bbpress <?php login_form(); ?> in wordpress sidebar because it doesn’t work 
“Otherwise I suggest you write a plugin that uses the WP wp_login hook and changes the hopefully global $redirect_to depending on whether or not the user is admin. That’s for wp. bb default login behaviour is okay?”
-> Unfortunately, I have no idea of how to write a plugin or a simple function
I can badly modify already made code.
“I’m not sure what you’re trying to do. “
-> I’ll try to explain better
My web will be made with wordpress and bbpress. Only registered users can comment wp blog entries and post topics in the bbpress forum.
Login tables are integrated and bbpress is inside the wordpress interface. When you go to bbpress you can see there the wordpress header, footer and sidebar.
So, right now users could log in through two gates; wordpress sidebar or through bbpress frontpage.
Well, I want to get rid of of these two gates and I want to avoid users can access wordpress dashboard and profile because the interface of these two pages is different. However, admin still needs access to wp control panel.
As best as I can tell this does not work on 0.8.1. The code appears to have changed quite a bit between then and now. Thinking that the latest replies are not getting responses because the status on this thread is set to “resolved”, I created a new thread at https://bbpress.org/forums/topic/1256 however after 5 days there is still no response. It looks like sourceforge users are too small a minority.
I finally found an example of someone sending email the sourceforge way, via a database and cron, and it is in php. Of course it is heavily specific to it’s parent project’s setup. Would someone please take a look at this and give an indication how it might be adapted to bbPress?
Thank you.
Drupal on Sourceforge: http://starkos.industriousone.com/drupal_on_sourceforge
I’m bummed! I just stabalized a good install of BBPress. Good news is I have no content in there, so I guess a fresh install isn’t too painful.
I’m going to go back and do a fresh install of WP at the root level of one of my sites, then nest BBPress in a directory called ‘forums’ on that site (this is where I assume I’ll tweak the config file FOR BBPRESS to access the existing WP users before running through the browser installation pages).
Does this sound right?
So steps in this order:
1. Fresh install of WordPress 2
2. Fresh install of BBPress nested in a directory (just moving files)
3. Before fully installing BBPress, tweak config file to target existing WordPress DB table for users
4. Adjust cookies
I’m good on most of this but what about item #4?
Thanks for any comments in advance!
David Martinez
Hi,
I am wanting to run two copies of bbpress one for the forums and for a modules directory like this site has. I was wondering if any one could share with me what all would be involved in sharing the registration system? And where I should begin to look?
After integrating wp and bb and having wordpress header, footer and sidebar for both, wp and bb, I have these wordpress functions in my sidebar;
<?php wp_register(”); ?>
<?php wp_loginout(); ?>
<?php wp_meta(); ?>
And in bb press frontpage I have this one;
<?php login_form(); ?>
First, I thought I could replace wp functions in the sidebar for bbpress’ <?php login_form(); ?> but this function it is not defined for wordpress and I have got an error.
Besides there are two other problems;
* if users register through bbpress, their roles are not defined in wordpress
* if I remove wordpress meta functions from the sidebar I lose the link to the admin control panel.
Well, another option would be using the wp functions for login;
<?php wp_register(”); ?>
<?php wp_loginout(); ?>
<?php wp_meta(); ?>
and then changing their beaviour so;
* whenever you login you are not taken to the control panel unless you are the admin
* whenever you are an user and you click in “site admin” link wich appears above the log-out link, you are taken to the bbpress profile.php
My questions are; first of all, do you find any sense in all of this or is it just crap? 
does anybody know where is defined wordpress login meta links so I can change them?
and finally, does anybody have a better idea?
I just intergrated bbpress and I think thats it. You dont need anything else.