Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 76 through 100 (of 690 total)
  • @peterverkooijen

    Participant

    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.

    @peterverkooijen

    Participant

    I’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.

    @peterverkooijen

    Participant

    Ajax breaks when you look at it funny. Noone really knows how it works. It’s magic. Try offering a goat?

    @peterverkooijen

    Participant

    Anyone? Which files/functions are involved in members search? Which parts are most likely to break? What’s the best way to troubleshoot this?

    @peterverkooijen

    Participant

    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

    @peterverkooijen

    Participant

    “It’s not a bug, it’s a feature.” :-(

    @peterverkooijen

    Participant

    OK, 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?

    @peterverkooijen

    Participant

    This 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…

    @peterverkooijen

    Participant

    attempting 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.

    @peterverkooijen

    Participant

    Brajesh Singh’s plugin:

    add_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.

    @peterverkooijen

    Participant

    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?

    @peterverkooijen

    Participant

    jQuery UI is a little bloated

    But the whole thing is included in WP by default, right? Are there parts you can safely strip out?

    @peterverkooijen

    Participant

    jQuery 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.

    @peterverkooijen

    Participant

    Are there any downsides to blocking proxy servers?

    @peterverkooijen

    Participant

    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.

    @peterverkooijen

    Participant

    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?

    @peterverkooijen

    Participant

    I 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…

    @peterverkooijen

    Participant

    Which WP settings page?

    @peterverkooijen

    Participant

    In that function get_pagenum_link() the first appearance is this line:

    $request = remove_query_arg( 'paged' );

    @peterverkooijen

    Participant

    Thanks 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.

    @peterverkooijen

    Participant

    @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.

    @peterverkooijen

    Participant

    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.

    @peterverkooijen

    Participant

    This plugin (s2Member) now has Buddypress support. Haven’t tested it yet, but it looks very promising.

    @peterverkooijen

    Participant

    Yup. 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 warning

    @peterverkooijen

    Participant

    Thanks for the warning!

Viewing 25 replies - 76 through 100 (of 690 total)
Skip to toolbar