I’ve already found the problem – I guess I’ve lost myself when trying to develop a plugin for both 0.9.0.2 and 1.0
. It’s working now and will be released today (I hope)…
The user_id of the user on the profile page might be in $user->ID
try global $user; $user_id=$user->ID;
($user is only available on the profile page)
This plugin is meant as a temporarily workaround until the bug can be fixed in WordPress – it will replace “anonymous” with the user login.
Install it on the WordPress side:
<?php
/*
Plugin Name: changes anonymous to member's login if display name missing (plugin for WordPress)
*/
function no_anonymous_members($author) { // this is a WORDPRESS plugin, not bbPress
global $comment;
if (empty($comment->comment_author) && !empty($comment->user_id)) {$user=get_userdata($comment->user_id); $author=$user->user_login;}
return $author;
} add_filter('get_comment_author', 'no_anonymous_members');
if ( !function_exists('get_userdata') ) :
function get_userdata( $user_id ) {
global $wpdb;
$user_id = absint($user_id);
if ( $user_id == 0 )
return false;
$user = wp_cache_get($user_id, 'users');
if ( $user ) {
if (empty($user->display_name)) {$user->display_name=$user->user_login;}
return $user;
}
if ( !$user = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->users WHERE ID = %d LIMIT 1", $user_id)) ) {
return false;
}
_fill_user($user);
if (empty($user->display_name)) {$user->display_name=$user->user_login;}
return $user;
}
endif;
?>
(The real answer of course is to insert the user_login when the comment is posted, however I cannot find a suitable hook in WordPress’s comment-template.php so I am doing it by completely replacing the get_userdata function in pluggable.php)
I guess I can create some code to fix the display name issue in existing databases. Give me a few minutes.
update: actually it’s as simple as this in phpMyAdmin:
UPDATE wp_users SET display_name=user_login WHERE display_name=''
or via a mini-plugin:
<?php
/*
Plugin Name: Fix Anonymous Members
*/
function fix_anonymous() {global $bbdb;
$bbdb->query("UPDATE $bbdb->users SET display_name=user_login WHERE display_name='' ");
} add_action('bb_init','fix_anonymous');
?>
save as _fix-anonymous.php (with leading underscore)
you only need to upload and run bbpress once with it loaded (no activation required) and then delete the plugin or it will slow down bbPress.
I am now writing a WordPress plugin to fix this without having to duplicate all the names in the table which is a horrendous waste of space.
Well we know what causes “anonymous” to show up, it’s because bbPress is not creating the display name for the user when the user registers on the bbPress side and then goes to use WordPress.
The question is, why is this suddenly happening when bbPress is supposed to create it already. This might be a question for Sam – but I hope he can reproduce the problem.
Did you add the above code to insert the display name?
I hope I didn’t lead you wrong by implying you should try 2.6 because that will be incompatible with bbPress 0.9
2.6 has compatibility with bbPress 1.0 alpha but a few plugins won’t work with the alpha yet (like bb-topic-views)
Oh and the display name persists in 1.0 alpha and is on line 487 in pluggable. I’ve filed a trac report:
https://trac.bbpress.org/ticket/922
I don’t think iframes work very will with bbPress. Are you trying to put the forum in an iframe?
<frameset rows="100%,*" border="0" frameborder="no" framespacing="0">
<frame name="site" src="http://hlvdubs.iamanerd.org.uk/forum" marginwidth="0" marginheight="0" noresize scrolling="auto">
<noframes>
<body bgcolor="#ffffff">
</body>
</noframes>
</frameset>
I think this is part or all of the problem. Don’t try to access bbPress from an iframe. You’ve got two different domains going on there.
hmm, i’ve thrown it back up and its still dead 
checking the source it seems ok
<link rel=”stylesheet” href=”http://www.hlvdubs.co.uk/forum/bb-templates/kakumei/style.css” type=”text/css”>
You don’t really need a plugin to install Google Analytics in your bbPress forum. Just paste the code from Google Analytics right before the closing </body> tag in your theme’s footer.php. No plugin required. I never understood the need for Analytics plugins for WordPress either. Editing a template file is pretty basic.
With 2.6 I still have anonymous names
somewhere between 0.8 and 0.9 the profile page became broken for most themes as “threads started” ($threads) was changed to the more accurate “topics started” ($topics)
If you don’t want to edit your theme profile page, here’s a mini-plugin to fix the problem:
function profile_fix_topics_to_threads() {global $topics, $threads; $threads=$topics;}
add_action( 'bb_profile.php', 'profile_fix_topics_to_threads');
Here’s a mini plugin that will cause the profile page to display the member # (handy if you are using pretty permalinks)
function bb_member_id_in_profile($keys) { // inserts member id into profile without hacking
global $self;
if (empty($self)==true && isset($_GET['tab'])==false && bb_get_location()=="profile-page") {
(array) $keys=array_merge(array_slice((array) $keys, 0 , 1), array('ID' => array(0, __('Member #'))), array_slice((array) $keys, 1));
}
return (array) $keys;
}
add_filter( 'get_profile_info_keys','bb_member_id_in_profile',255); // last item inserted = first item displayed
If I try and create a new user, I get the error:
Warning: mysql_insert_id(): supplied argument is not a valid MySQL-Link resource in /home/turner/public_html/lifelightcam/bbpress/bb-includes/db-mysql.php on line 180"
I can log into wordpress just fine with my user id and password, but not into bbpress. I checked and the user id does exist in wp_users
Hello 
I presently use a framework called CakePHP for my website. I have an existing users data model etc., that consists of many tables and so forth. It’d be a hassle for my users to have to set up a whole new account.
So, I was wondering if bbPress is by any chance customizable to the extent of database structure and basically the way databases are treated. I guess I’m looking for the most customizable forum script right now.
So can it seamlessly integrate with existing data, besides WordPress?
Yay, time to update some plugins to make sure management panels will look cool
.
Hello
I have encounter another problem when coding new plugin. I have a function that will return data from usermeta table:
function get_twitter($user_id) {
$user = bb_get_user( $user_id );
$bb_twitter = $user->social_twitter;
if ( $bb_twitter ) { return $bb_twitter; } else { return ""; }
}
It’s working fine with echo on profile edit page within other function with $user_id set as global:
function add_socialize_to_profile_edit() {
global $user_id, $bb_current_user, $bb_socialize;
$bb_twitter = get_twitter($user_id);
echo $bb_twitter;
}
But the same function is not working on standard profile page – therefore I can edit twitter account, but I can’t display it on profile page. Any ideas what to do in order to display it? How to get this $user_id on profile page?
It only affects posts made afterwards, not existing posts but some easy php/mysql code could fix existing posts.
But I could have sworn this was fixed in bbPress 0.9 with the WordPress Integration section built in. It should give the users a WordPress role and display name. Actually, WordPress should create the display name itself if it sees a user name without a display name. I wonder if this is a WP 2.6 issue which should not be used with bbPress 0.9
Hello everyone 
It’s not directly related to bbPress script, but somewhere around it. What do you think about making something like Weblog Tools Collection, but for bbPress? You know – the newest themes and plugins for bbPress, tips, tricks etc?
I was also thinking about something like: http://wordpress.org/extend/ideas/ – so people could submit their ideas for new plugins etc. And something like http://wordpress.org/extend/themes/ – even if I would like to submit some themes for bbPress, I don’t have a site to do this
.
What do you think?
I should point out that such changes in bb-config.php must be inserted ABOVE the line that says
/* Stop editing */ and not below it.
Also, you should go immediately into your config and change the path after that.
In fact you should probably change the path in the admin section FIRST and then rename the folder after it’s saved. bbPress will be disabled until you rename the folder but should spring back to life afterwards.
The menu I mean is under:
settings -> general
or http://your-website-name.com/your-forum-path/bb-admin/options-general.php
bbPress address (URL):
I’m interested in this too. Mostly I’m interested because my current forum that I’m converting from (phpbb) allows you to preview your post, and that feature will be sorely missed. Bring able to save a draft of it would fit right along side a preview, pretty much just like the way WordPress allows authors to save/preview drafts. Now, I’m not a php person in any way (although I wish I was) but I can see it could easily work to make a plug-in or mod that would allow you the option to save your post draft for later with a different post status and pull it or all your saved/unpublished drafts into a single page by pulling them based on the status and your user id. From there you could edit those posts and “publish” them by saving and changing the status code to so that bbPress “sees” it as a valid post rather than a “deleted” or “saved draft”.
I tinkered with this idea a little while ago but with my php knowledge limited to hacking peices here and there to suit my needs it’s just too much of a task. I can’t imagine it would be too complicated to implement. Let us know if this pans out Vili or anyone else who has an urge to work on something like this.
I’m installing bbPress on a website that is mainly flashbased, and I need the users to be able to login via a form placed inside the frontpage.swf file. This is usually easy: all that’s necessary is a .php file that communicates with the flash, that basically looks like this:
if($_POST == $correct_username && $_POST == $correct_password){
echo(“loggedin=true”);
} else {
echo(“loggedin=false”);
}
Flash will then read the variable returned and work from there.
The issue is that I can’t figure out how to verify the data against the users table. I’ve studied bb-login.php and login.php, but I still can’t find the code that does the actual logging in – the code that checks the password against the encrypted one in the database, sets the cookie, etcetera.
Could someone point me in the right direction?
bbPress has similar functions to detect what page you are on, ie. is_front() is_forum() is_topic() is_view() etc.
do a search of the code for “function is_”
I think I can transfer to phpBB. So there is a plugin to transfer from phpBB to BBpress? I’ll look for it.
If not, I’ll grab my database admin friend and see if he’ll help me.
(All moot till Yahoo gets mySQL working again; I can’t even access phpmyadmin.
)
oops! Just spent ages upgrading my blog today to 2.6 which broke an afternoon’s work I spent a while back integrating with BB press 0.9. Thankfully the 1.0 Alpha release isn’t too far away
I’ve never done it myself but I believe you first have to put the translation es_ES.mo file into bb-includes/languages directory.
Then you go into bb-config.php` and change the BBLANG setting:
define('BBLANG', 'es_ES');
Here is more info:
http://www.degabriel.es/2008/04/24/traduccion-de-bbpress-09-al-castellano/
and the file:
http://www.degabriel.es/wp-content/uploads/2008/04/es_es.mo
Unfortunately by some oversight, there is no directly link to the search feature on the default bbPress 0.9 templates (this is fixed in the next version – perhaps too prominently given how weak the built-in search is in bbPress).
You can make a link to search.php yourself in the header.php or footer.php to have it on all pages.
<a href="<?php bb_option('uri'); ?>search.php">Search</a>
Or you can make a mini-form that passes the field “search”
<form action="<?php bb_option('uri'); ?>search.php" method="get">
<input name="search" id="search"></form>