Forum Replies Created
-
In reply to: BP GroupBlog, P2 ready (with bugs)! Please review…
Does member directory search still work with this? Can someone who has this plugin beta installed please check?
I’m working on a variation of Groupblog + P2, more integrated into my custom theme. It broke the directory search. Something in P2 seems to clash with the directory search ajax.
In reply to: xprofile vs usermeta syncing problemsI’m still on 1.1.3. In 1.1.3 xprofile only gets synchronized with wp_usermeta when the user updates his account, which means you can never count on the data being there, which makes it pointless.
Lousy synchronization between xprofile and usermeta is not a bug, it’s a conscious design feature. Why? I’ve brought this issue up many times and have never received a clear answer.
I use a custom function like this below to synchronize member data upon registration into all the different, unconnected places in the database where data is stored:
function synchro_wp_usermeta($user_id, $password, $meta) {
global $bp, $wpdb;
$uid = get_userdata($user_id);
$email = $uid->user_email;
$fullname = $meta[field_1];
... whatever you need here ....
update_usermeta( $user_id, 'nickname', $fullname );
update_usermeta( $user_id, 'first_name', $firstname );
update_usermeta( $user_id, 'last_name', $lastname );
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET display_name = %s WHERE ID = %d", $fullname, $user_id ) );
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET user_url = %s WHERE ID = %d", bp_core_get_user_domain( $user_id ), $user_id ) );
}
add_action( 'wpmu_activate_user', 'synchro_wp_usermeta', 10, 3);Not sure if this still works in 1.2. I had posted my work-arounds under ‘FAQ: How To, Code Snippets and Solutions’, but they have been deleted. So I guess they solved the issues in 1.2?
To synch xprofile you’d need to create the fields in xprofile that you have in wp_usermeta and then do something backwards like the above function, if that hook etc. is still valid.
In reply to: Ajax (or javascript?) area not workingAjax breaks when you look at it funny. Noone really knows how it works. It’s magic. Try offering a goat?
In reply to: Broke member search again – troubleshoot ajax?Anyone? Which files/functions are involved in members search? Which parts are most likely to break? What’s the best way to troubleshoot this?
In reply to: Broke member search again – troubleshoot ajax?No, still using version 1.1.3. My custom theme is very different. Directory search works fine in the version that’s currently live. It’s broken in a new version of the theme that integrates P2, installed on a few test sites.
There is probably a javascript clash somewhere. Or it may have something to do with that _wp_http_referer that I see in the form. What is that? I need some new ideas how to troubleshoot those ajax search fields.
In reply to: Double passwords“It’s not a bug, it’s a feature.”
In reply to: Problem next_posts_link() in P2 integration attemptOK, slightly modified to prevent the function from messing with dots (.) and return the result instead of echo:
function removedoubles($string){
$string = preg_replace("/([,?!])/"," 1",$string);
$parts = explode("/",$string);
$unique = array_unique($parts);
$unique = implode("/",$unique);
$unique = preg_replace("/s([,?!])/","1",$unique);
return $unique;
}This applied to function next_posts and previous_posts in /wp_includes/link_template.php:
function next_posts( $max_page = 0, $echo = true ) {
$output = removedoubles(esc_url( get_next_posts_page_link( $max_page ) ) );
if ( $echo )
echo $output;
else
return $output;
}This works. Changes in core files is not ideal of course, so I’ll probably have to copy a lot of code and turn it into a custom version in functions.php.
Or is there a cleaner way? Is it possible to put something in functions.php that “catches” any calls for function previous_posts() and redirects them to a function custom_previous_posts() in functions.php?
In reply to: Problem next_posts_link() in P2 integration attemptThis works to remove doubles from a URL:
$string = "http://website.com/blogname/blogname/page/2/";
$string = preg_replace("/([,.?!])/"," \\1",$string);
$parts = explode("/",$string);
$unique = array_unique($parts);
$unique = implode("/",$unique);
$unique = preg_replace("/\s([,.?!])/","\\1",$unique);
echo $unique;This outputs:
http://website.com/blogname/page/2
Now I have to turn it into a function…
In reply to: Gravatar redirect chains cause too much load timeattempting to ensure that these scripts and calls loaded as late as possible was best so that at least the page content could load
How would you do that? That is my problem; half the page hangs while the browser goes back and forth to gravatar.com.
In reply to: Redirecting to profile page after loginadd_filter("login_redirect","bpdev_redirect_to_profile",10,3);
function bpdev_redirect_to_profile($redirect_to_calculated,$redirect_url_specified,$user)
{
if(empty($redirect_to_calculated))
$redirect_to_calculated=admin_url();
/*if the user is not site admin,redirect to his/her profile*/
if(!is_site_admin($user->user_login))
return bp_core_get_user_domain($user->ID );
else
return $redirect_to_calculated; /*if site admin or not logged in,do not do anything much*/
}I put it in bp-custom.php. Probably also works in functions.php.
He also has this essential logout redirect to homepage plugin. Both should have been default wp/bp behavior imho.
Just because you have your opinion that devs should “stop all new features” that doesn´t necessarily mean that everybody shares your opinion.
I don’t know if that correctly reflects Erich73’s opinion, but I wholeheartedly share it.
Groups are Buddypress’ killer app imho, but I could come up with dozens of other use cases for groups. Why does everything have to be built into the core?
In reply to: Any Experience with JQuery Tools LibraryjQuery UI is a little bloated
But the whole thing is included in WP by default, right? Are there parts you can safely strip out?
In reply to: Any Experience with JQuery Tools LibraryjQuery is native to WordPress. In my custom theme I try to leverage what’s built-in as much as possible and jQuery is very flexible. This looks like the standard jQuery library conveniently packaged with some popular applications. I’m not sure what if anything it adds to what’s already in WP.
In reply to: Spam, Spam and more spamAre there any downsides to blocking proxy servers?
In reply to: Several Buddypress sites one login?This could be done but the issue would be security as you are grabbing data across domains.
I figured that would be an issue and it is important. In my case the sites are all on the same hosting account, so only the database connections would be slightly different. Everything happens on the server. I don’t think any user data would have to be pushed or pulled across http. And in any security issue you have to weigh security against convenience to the user; my sites are not banking sites.
A third party single sign-on solution is not the same as offering single sign-on within your own network of sites. I do use the Facebook Login on my sites and think it’s pretty cool, but personally I’m not a fan of Facebook and it’s not going to be The Standard forever. Should I add Twitter Login? LinkedIn login? OpenID seems to be going nowhere. There will never be one web standard that you can implement and be done with it.
@gmax21, the multiblog approach could work if you start from scratch, but it sounds like you’d run into all kinds of other thorny issues if you add different projects over time and later decide you want to give users access to those other projects. It sounds complicated and unwieldy to do everything in one installation.
In reply to: Several Buddypress sites one login?I would need this as well at some point
Say you have a network of four sites. When a user tries to log in one of the sites (‘New Community’) with a username and password from one of the other three sites, he gets this:
ERROR: Invalid username. Lost your password?
Would it be very complicated to write a plugin that checks if the entered username exists in the other three databases? And then verify the user’s password by checking in that same database? And then enter that user’s data, including username + pass, into the ‘New Community’ database?
Could it copy some functions/code from the new Facebook Login plugin?
In reply to: Problem next_posts_link() in P2 integration attemptI don’t see any Blog URL or WP URL settings in wp-admin/options-general.php or wpmu-options.php
But the problem sees to be in that $request part. $base pretty much does what it is supposed to do, despite the confusing different ‘tags’. The P2 theme is not for WPMU/BP, so it’s not really a surprise things get mixed up on member blogs.
Thanks for the suggestions, jivany! I have to drop this now and get back to my day job…
In reply to: Problem next_posts_link() in P2 integration attemptWhich WP settings page?
In reply to: Problem next_posts_link() in P2 integration attemptIn that function get_pagenum_link() the first appearance is this line:
$request = remove_query_arg( 'paged' );In reply to: Problem next_posts_link() in P2 integration attemptThanks jivany!
When I replace that $base with ‘http://thewebsite.com/’ there’s only one blogname. Unfortunately then the link that’s supposed to go back to the blog index goes to the main site homepage.
So $request adds the blogname again? I think that’s what led me to the $request = preg_replace regex stuff. That’s where I get stuck…
In reply to: WP-FB connect profile.@Bowe, I think jimcale wants to pull in additional data from the Facebook profile to fill out the profile on Buddypress. Out of the box the plugin does the basics very nicely – I have it live on three sites with integration to my mailing lists.
But theoretically you can do much more with it. Haven’t had time to really look into that yet – my day job is not in web development.
In reply to: WP-FB connect profile.Apparently there are hooks, actions, filters and other mysterious things you can use to add your own functions to get more data or do stuff – see Buddypress.php in the plugin folder. I have no clue how that works. You’ll have to search through the thread on the plugin page or be real nice to the developers.
In reply to: BuddyPress Membership SitesThis plugin (s2Member) now has Buddypress support. Haven’t tested it yet, but it looks very promising.
In reply to: Overriding the themes function.php = blank pageYup. A child funcions.php file is the one file that will NOT override the parent file. It adds to it. So you have to make sure your functions have unique names.
So you can move child specific functions to a file named functions.php in the child theme folder?
Tried it. It works! Nice. I’m cleaning up my messy custom theme and this helps a lot.
Thanks for the confirmation r-a-y!
In reply to: Security warningThanks for the warning!