Search Results for 'code'
-
Search Results
-
Hi all,
Just wondering if anyone has a shared login working with bbPress RC1 & WordPress 2.8 beta?
I have WordPress installed at root level and bbPress in a sub directory using the WordPress users table.
When setting up bbPress I went through all the integration settings.
Now users can log in at either end no problem, it’s just that they are not logged in on the other end when visiting the forum/wordpress.
I then regenerated the keys using http://api.wordpress.org/secret-key/1.1/ and placed these in both config files with the required BB_ bit for the bbPress config.
I added the following to my bbPress config:
$bb->wp_siteurl = 'http://site.com/';
// that's your WordPress URL, not bbPress
$bb->wp_home = 'http://site.com/';
// almost always the same as siteurl unless you tinker
$bb->wp_table_prefix = 'wp_';
// should almost always be wp_ unless you tinkered
$bb->user_bbdb_name = 'xxxx';
// this is the MYSQL database name for *WordPress*
// you can copy it right out of WordPress !
$bb->user_bbdb_user = 'xxxx';
// this is the MYSQL user name for *WordPress*
// you can copy it right out of WordPress !
$bb->user_bbdb_password = 'xxxx';
// this is the MYSQL password for *WordPress*
// you can copy it right out of WordPress !
$bb->user_bbdb_host = 'localhost';
// 99.9% of the time it's going to be localhost, unless you are on DreamHost or some other weird ISP
$bb->custom_user_table = 'wp_users';
// 99.9% of the time it's going to be wp_users
$bb->custom_user_meta_table = 'wp_usermeta';
// 99.9% of the time it's going to be wp_usermeta
$bb->authcookie = 'auth code i set with wp plugin';
// in theory you should be able to leave this out
// but this is going to be copied from WordPress cookie
// this *must* match the WordPress setting
// do NOT use the 1234567 part, use your own cookiehash from WordPress - see the note at the very bottom
$bb->cookiedomain = '.site.com';
// note the leading DOT - this is important
// this *must* match the WordPress setting
$bb->cookiepath = '/';
// I *highly* recommend you set the cookie path to /
// this *must* match the WordPress setting
$bb->sitecookiepath = '/';
// I *highly* recommend you set the cookie path to /
// this *must* match the WordPress setting
$wp->cookiedomain = '.site.com';
define(COOKIE_DOMAIN,'.site.com');
// note the leading DOT - this is important
// we list both for WordPress legacy compatibility
$wp->cookiepath = '/';
$wp->sitecookiepath = '/';
define('COOKIEPATH', '/' );
define('SITECOOKIEPATH', '/');
// I *highly* recommend you set the cookie path to /Now when I log in at the bbPress side, a wordpress_logged_in_xxxxx cookie is created but then when I visit the wordpress end, I am not logged in.
When I do then log in on the WP end, it creates another wordpress_logged_in_xxxxx cookie, the cookie names are both the exact same but their values are different.
Anybody got any tips on how to fix this?
I worked through the screencast to integrate bbPress with wordpress and all seems to be working well.
The thing is I can not figure out how to get bbPress to work within my theme, I want the wordpress theme to be a kind of ‘wrapper’ for the forum, putting just a link in the header to the forum, then for bbPress to come up on the page.
Is there a simple code tag I can put on a page to make this happen or else how do I do it?
Hi guys,
This is my first post here, but I’ve been building an wp/bb integrated site for a few weeks now, and I’ve come to the point where I think it’s time to write my first plugin. I want this plugin to redirect users to my WordPress login page if they are not logged in. It is important that the forums remain private and also that there is only one point of entry to the site for users, so as to avoid any confusion.
I have _ck_’s Hidden Forums plugin set up to control access to forums, and that’s working fine, but I need some advice on how to handle an issue or two in the code I’ve written so far. Now, I don’t do a ton of programming, and this is my first attempt at anything like this, so bear with me if I’ve committed any cardinal sins.
<?
add_action('bb_init','login_redirect_init',300);
function login_redirect_init()
{
global $bb_current_user;
$id = (!empty($bb_current_user)) ? intval($bb_current_user->ID) : 0;
if( $id < 1 )
{
$redirection = 'http://'.$_SERVER['SERVER_NAME'].'/caa/wp-login.php?redirect_to='.$_SERVER['REQUEST_URI'];
if (function_exists('status_header'))
status_header( 302 );
header("HTTP/1.1 302 Temporary Redirect");
header("Location:".$redirection);
exit();
}
}
?>As it is now, accessing bbPress redirects to wp-login with the proper redirection URL (I’m using the WP Members Only plugin), but then logging in from there kicks me back to the wp-login page again. I’m thinking that perhaps
bb_initis not the hook for me, as it appears that the login process is not getting a chance to do its thing, and thus I’m getting booted out. As a test, I tried bb_head, but of course the headers have been sent by then, and the redirect does not work.So, if this is in fact the issue, what hook should be using? Or am I going about this all wrong? I’d really appreciate any and all input into this. Thanks, guys.
Topic: How to use user metadata?
Hi,
Does anyone know a good tutorial / documentation on how to use user’s meta data in bbpress? I assume, they are meant for storing user custom data.
If there are no good tutorials on subject, can somebody point me to a good and simple plugin, which uses meta data for storing custom data? I could read the code and learn it by myself.
Thanks!
Thanks
/ part of the url, removing this, the page is found. Replacing it with %3A%2F%2F d does not work either.