Search Results for 'code'
-
Search Results
-
Topic: Display avatar in header
At my site http://www.doublepeace.se , when you log in, I’d like to have the users forum avatar displayed in the header. I tried just pasting <?php post_avatar(); ?> up there, and that didn’t work
I have both the My Views and Support Forums plugins installed. They work well together except for 1 thing. Both plugins add a new filter to bb_views.
If both plugins are running the new views from My Views are the only ones to show up. The Support Forums views are not listed. After poking through the code I was able to fix it by making sure that the Support Forums bb_views filter was added AFTER the My Views bb_views filter. To do so edit support-forum.php .
Replace line 432
add_filter('bb_views', array(&$this, 'addViews'));
With
add_filter('bb_views', array(&$this, 'addViews'), 200);
You should now be able to see the views from both plugins.
I’m no expert, but it seems like when My Views is adding my_views_init to the bb_views filter its overwriting whatever Support Forums has already added to the filter. Just a guess. I’m sure ck, so1o, mdawaffe, or SamBauers will know exactly what is going on.
Enjoy!
bbPress is installed in /forums and WPMU is installed in /blogs .
The cookie and database integration works fine.
I am able to access bbPress functions from within WPMU by adding this to the end of /blogs/wp-config.php
// Include bbPress functions in WPMU
define('WP_BB', true); // Avoid duplicate function declarations
require_once( ABSPATH . '../forums/bb-load.php');
I’m trying to add WPMU functions to bbPress. I’ve tried adding this to the beginning of /forums/config.php . I’ve also tried putting this in the beginning of the file.
require_once( dirname(__FILE__) . '/../blogs/wp-blog-header.php')
When I go to /forums/ I’m redirected to the WPMU sign up page (/blogs/wp-signup.php?new=%2F).
I’ve also created a simple file ( /test.php ) and tried to integrate it with wpmu. It it also redirected to the WPMU sign up page.
Test Start
<?php
require_once( dirname(__FILE__) . '/blogs/wp-blog-header.php');
?>
Test End
Do I need to create a WPMU rewrite rule in the wp_1_options rewrite rulerecord? There shouldn’t be any need for an .htaccess rewrite rule since /forums and /blogs are not in subfolders of either.
Any ideas how to make this work?
I don’t know if this is a bug or if it is working as intended, but I figured I’d document it.
Explanation of bbpress registration/login
When a user registers in bbpress the user_login field in the database is case sensitive. If you register with the name Tom, Tom is put in the database. When a user logs in however, it is not case sensitive. So Tom can log in as tom, TOM, tOM, ToM… you get the point. Now this doesn’t seem like it would pose any problems. But…
Explanation of WPMU registration/login
WordPress MU and I’d guess WordPress do things differently. You may run into problems with an integrated site because of this ‘bug’. When a user registers through WPMU the user_login field in the database is converted to all lowercase. If you register with the name Joe, joe is put in the database. This is different from how bbpress does things. So if Bob registers through bbpress with a capital in his login the user_login is set to Bob, but in WPMU if Bob registers with a capital in his login the user_login is set to bob. Just like bbpress, WPMU’s login is not case sensitive. So Joe can login as joe, JOE, jOE, JoE.
The problem occurs if a user registers with a capital letter in bbpress and then tries to login through WPMU. WPMU converts the input in the login field to lower case BEFORE it queries the database. So WPMU checks for user_login with all lowercase letters, but there may be capitals, so the login can fail.
Here’s a step by step explanation
1) Fred registers in bbpress with the name Fred
2) user_login is set as Fred
3) Fred attempts to login to through WPMU using Fred (capitals)
4) WPMU converts Fred to fred BEFORE the database is queried.
5) According to WPMU fred (lowercase) does not exist.
6) Login fails

To fix this I set bbpress to match WPMU’s functionality. To do so I edited the bb_new_user function in the pluggable.php file. I simply added the following line before the database query.
$user_login = strtolower($user_login);
Now when a user registers through bbpress his user_login is set to all lowercase letters.
What I’d like to do is make a plugin that replaces the bb_new_user function with a new one that makes this change so I don’t have to edit a core file, but I’m not that savvy yet.
While this really isn’t a bbpress bug it would be nice if bbpress and WPMU did things the the same so that integration was easier.
Topic: Magic quotes won’t go away…
I have a site in which I’m using bbPress for user login/registration, but I also have Gallery2 installed for photo gallery. Gallery is configured in “embedded” mode, so that bbPress login is used – i.e. a unified login.
When I try to type quotes in a text field in the embedded Gallery, I get escaped quotes (i.e. ” turns into /”). This doesn’t happen in bbPress, but it also doesn’t happen in the NON-embedded Gallery. So, it has to be something to do with the interaction of the two applications.
The thing is, I am out of ideas. bbPress turns off magic quotes w/in the code, and so does Gallery2, plus it’s off in my php.ini. Is there some code within bb-load.php or other included files which parse all text fields? Any thoughts?
Topic: where are my forums??
In order to get the forum running, I removed the forums where testing posts have been in. Now I have put new forums in the admin section.. But there are none of them showing!!
Not a single forum
help me
