rich! @ etiviti (@nuprn1)

Forum Replies Created

Viewing 22 replies - 1 through 22 (of 22 total)
  • From what I can gather, I suppose this means there won’t be any bbpressplugin-as-BuddyPress-component testing until some later stage

    i would assume bp1.3. though tempting to see what it takes now to get the new bbp coexisting. :P

    well you can always call bb_get_forum

    and the topic always has $topic->forum_id to pass in

    (might be something in the loop but i can’t remember without searching for it)

    bb_get_avatar( $topic->topic_last_poster, '16')

    i started on something a few months ago… but the priority is low on the list

    http://files.etiviti.com/misc/bbpress-vwg-forum.gif

    http://files.etiviti.com/misc/bbpress-vwg-main.gif

    I’m assuming your bbPress forums folder is on a separate domain than the buddyPress install? It’s not in the ‘default’ /forums location, right?

    Correct, standalone bbPress is installed on a subdomain (forums.mydomain.com) and obviously the group forum is activated within buddypress (mydomain.com/forums) as well. All share the same bb tables; so group discussions can be carried on via a more direct forum feel with extra bells and whistles.

    How the heck have you gotten BuddyPress’s activity stream to work with an external bbPress install?

    There is a plugin for BuddyPress called bbGroups (uses xmlrpc) but is outdated. I had to update the code for 1.2 due to the activity stream changes. (and i need to update once more since 1.2 RC1) – the XMLRPC is not ideal but does carry over the hidden/read-only and who has access. (i’d probably code it to access the db directly – but it works for my testing)

    Seems redundant to have 2 forum interfaces but this allows “outside” forums which may not be appropriate for setting up a group.

    But at some point BuddyPress 1.2 now expects the dates in GMT while standalone bbPress 1.0.2 must insert the timestamp on a topic/post differently. (I just haven’t had the time to sift over the code to figure it out yet)

    In reply to: @ links (mentions)

    if you look at the buddypress code for activity-notifications (can’t remember the filename) but they have a simple function that filters the content, checks for @<username> string, then validates against the usertable and rewrites the content with a link.

    In reply to: Future of bbPress

    quickly note some of the important things

    1) documentation, examples, and more documentation – from plug-ins to core. it is very difficult to ramp up and extend the functionality of bbPress when you have to spend considerable time researching how to hook into things. php is not my first language but i’d be more enticed to extend if there is something to fall back upon.

    2) cohesiveness of technologies used in other automattic products – bring bbPress into the fold and create a common experience; UI. why do we have a scaled down editor in bbPress for example. IMHO, it should be the same as WP – if i’m using another automattic product, i’d like the same experience as those are the reasons why i use it. …i understand the lightweight approach (which i like) but its also important to consider the expectations.

    2a) IntenseDebate – to me this is just a forum add-on to a blog post (topic). frankly the feature subset of ID is what a lot of forum administrators like (Comment Threading, Reply-By-Email, Email Notifications, Moderation/Blacklisting, Reputation Points & Comment Voting, +openid/etc login). again, just common experience of automattic.

    3) the whole standalone, bbpress => wp, bbpress <= => wp thing (if i want bbpress and wp to talk to each other, this should be a core level thing instead of a plug-in to cross pollinate content – sometimes it is just easier to shy away from bbpress and opt for ID – in this instance buddypress is too much for a small community) but i need another cup of coffee before i can touch further on this subject :-)

    CSS file is not loading – might be a permission issue or does not exist in the template folder

    In reply to: Pingbacks not working?

    i’d like to know as well, i see the records in the _meta table

    101 bb_post 35 pingback_queued

    etc…

    Sure… but be forewarned. i’m not familiar with php whatsoever and the bbPress structure. (so i’m sure i violated something) this is on 1.0. Not sure if this can be made into a plug-in or not, I have yet to read up on how to create those and the filter/hook stuff.

    (i have a small community ~1000 when all said and done – but some are savvy with firebug would just edit the form fields if disabled)

    profile-edit.php in the main root – everything labeled CHANGED

    // Instantiate the error object

    $errors = new WP_Error;

    if ( ‘post’ == strtolower($_SERVER) ) {

    $_POST = stripslashes_deep( $_POST );

    bb_check_admin_referer( ‘edit-profile_’ . $user_id );

    // Fix the URL before sanitizing it

    $user_url = bb_fix_link( $_POST );

    // Sanitize the profile info keys and check for missing required data

    foreach ( $profile_info_keys as $key => $label ) {

    $$key = apply_filters( ‘sanitize_profile_info’, $_POST[$key], $key, $_POST[$key] );

    if ( !$$key && $label[0] == 1 ) {

    $errors->add( $key, sprintf( __( ‘%s is required.’ ), esc_html( $label[1] ) ) );

    $$key = false;

    }

    }

    // Find out if we have a valid email address

    if ( isset( $user_email ) && !$user_email = is_email( $user_email ) ) {

    $errors->add( ‘user_email’, __( ‘Invalid email address’ ), array( ‘data’ => $_POST ) );

    }

    //CHANGED – added for duplicate email check on profile update

    if (isset( $user_email )) {

    if(changed_no_duplicate_email_update_user($user_email, $user->ID)) {

    $bad_input = true;

    $$key = false;

    $errors->add( ‘user_email’, __( ‘Email address already in use’ ), array( ‘data’ => $_POST ) );

    }

    }

    //ENDCHANGED

    // Deal with errors for users who can edit others data

    if ( bb_current_user_can(‘edit_users’) ) {

    // If we are deleting just do it and redirect

    if ( isset($_POST) && $_POST && $bb_current_id != $user->ID ) {

    bb_delete_user( $user->ID );

    wp_redirect( bb_get_uri(null, null, BB_URI_CONTEXT_HEADER) );

    exit;

    }

    // Get the user object

    $user_obj = new BP_User( $user->ID );

    // Store the new role

    $role = $_POST;

    // Deal with errors with the role

    if ( !isset($wp_roles->role_objects[$role]) ) {

    $errors->add( ‘role’, __( ‘Invalid Role’ ) );

    } elseif ( !bb_current_user_can( ‘keep_gate’ ) && ( ‘keymaster’ == $role || ‘keymaster’ == $user_obj->roles[0] ) ) {

    $errors->add( ‘role’, __( ‘You are not the Gate Keeper.’ ) );

    } elseif ( ‘keymaster’ == $user_obj->roles[0] && ‘keymaster’ != $role && $bb_current_id == $user->ID ) {

    $errors->add( ‘role’, __( ‘You are Keymaster, so you may not demote yourself.’ ) );

    }

    // Sanitize the profile admin keys and check for missing required data

    foreach ( $profile_admin_keys as $key => $label ) {

    if ( isset( $$key ) )

    continue;

    $$key = apply_filters( ‘sanitize_profile_admin’, $_POST[$key], $key, $_POST[$key] );

    if ( !$$key && $label[0] == 1 ) {

    $errors->add( $key, sprintf( __( ‘%s is required.’ ), esc_html( $label[1] ) ) );

    $$key = false;

    }

    }

    // Create variable for the requested roles

    foreach ( $assignable_caps as $cap => $label ) {

    if ( isset($$cap) )

    continue;

    $$cap = ( isset($_POST[$cap]) && $_POST[$cap] ) ? 1 : 0;

    }

    }

    // Deal with errors generated from the password form

    if ( bb_current_user_can( ‘change_user_password’, $user->ID ) ) {

    if ( ( !empty($_POST) || !empty($_POST) ) && $_POST !== $_POST ) {

    $errors->add( ‘pass’, __( ‘You must enter the same password twice.’ ) );

    } elseif( !empty($_POST) && !bb_current_user_can( ‘change_user_password’, $user->ID ) ) {

    $errors->add( ‘pass’, __( “You are not allowed to change this user’s password.” ) );

    }

    }

    // If there are no errors then update the records

    if ( !$errors->get_error_codes() ) {

    do_action(‘before_profile_edited’, $user->ID);

    //CHANGED – did we reset the email?

    $changed_do_email_reset = false;

    //ENDCHANGED

    if ( bb_current_user_can( ‘edit_user’, $user->ID ) ) {

    //CHANGED- if user updates email address – generate new password and email

    if ($user->user_email != $user_email) {

    $changed_do_email_reset = true;

    $changed_old_email = $user->user_email;

    }

    //ENDCHANGED

    // All these are always set at this point

    bb_update_user( $user->ID, $user_email, $user_url, $display_name );

    // Add user meta data

    foreach( $profile_info_keys as $key => $label ) {

    if ( ‘display_name’ == $key || ‘ID’ == $key || strpos($key, ‘user_’) === 0 )

    continue;

    if ( $$key != ” || isset($user->$key) )

    bb_update_usermeta( $user->ID, $key, $$key );

    }

    }

    if ( bb_current_user_can( ‘edit_users’ ) ) {

    if ( !array_key_exists($role, $user->capabilities) ) {

    $user_obj->set_role($role); // Only support one role for now

    if ( ‘blocked’ == $role && ‘blocked’ != $old_role )

    bb_break_password( $user->ID );

    elseif ( ‘blocked’ != $role && ‘blocked’ == $old_role )

    bb_fix_password( $user->ID );

    }

    foreach( $profile_admin_keys as $key => $label )

    if ( $$key != ” || isset($user->$key) )

    bb_update_usermeta( $user->ID, $key, $$key );

    foreach( $assignable_caps as $cap => $label ) {

    if ( ( !$already = array_key_exists($cap, $user->capabilities) ) && $$cap) {

    $user_obj->add_cap($cap);

    } elseif ( !$$cap && $already ) {

    $user_obj->remove_cap($cap);

    }

    }

    }

    //CHANGED – send confirmation emails, log them out

    if ($changed_do_email_reset) {

    $send_key_result = bb_reset_email( $user->user_login );

    if ( is_wp_error( $send_key_result ) )

    $error = $send_key_result->get_error_message();

    if ($changed_old_email) {

    $mail_result = bb_mail( $changed_old_email, bb_get_option(‘name’) . ‘: ‘ . __(‘Email Address Updated’), “Your email address has been updated and a confirmation message has been sent. Thanks!” );

    if (!$mail_result) {

    new WP_Error(‘sending_mail_failed’, __(‘The email notifying an email address change could not be sent.’));

    }

    }

    //kill their current session and break the password so they can’t log in until a reset.

    if ( bb_get_current_user_info( ‘ID’ ) == $user->ID ) {

    changed_break_password( $user->ID );

    bb_clear_auth_cookie();

    }

    //ENDCHANGED

    } else if ( bb_current_user_can( ‘change_user_password’, $user->ID ) && !empty($_POST) ) {

    $_POST = addslashes($_POST);

    bb_update_user_password( $user->ID, $_POST );

    if ( bb_get_current_user_info( ‘ID’ ) == $user->ID ) {

    bb_clear_auth_cookie();

    bb_set_auth_cookie( $user->ID );

    }

    }

    do_action(‘profile_edited’, $user->ID);

    //CHANGED – lets fire off a message on the template page to explain what we did

    if ($changed_do_email_reset) {

    wp_redirect( add_query_arg( ’emailupdated’, ‘true’, get_user_profile_link( $user->ID ) ) );

    //ENDCHANGED

    } else {

    wp_redirect( add_query_arg( ‘updated’, ‘true’, get_user_profile_link( $user->ID ) ) );

    }

    exit;

    }

    }

    then two helper functions

    function changed_no_duplicate_email_update_user($email, $id) {

    if ($email && $id) {

    global $bbdb;

    if ($bbdb->get_row($bbdb->prepare("SELECT ID FROM $bbdb->users WHERE user_email = %s AND ID <> %d ", $email, $id))) {

    return true;

    } else {

    return false;

    }

    }

    }

    function changed_break_password( $user_id ) {

    global $bbdb;

    $user_id = (int) $user_id;

    if ( !$user = bb_get_user( $user_id ) )

    return false;

    $secret = substr(bb_hash( ‘changed_break_password’ ), 0, 13);

    if ( false === strpos( $user->user_pass, ‘—‘ ) )

    return $bbdb->query( $bbdb->prepare(“UPDATE $bbdb->users SET user_pass = CONCAT(user_pass, ‘changed’, %s) WHERE ID = %d”, $secret, $user_id) );

    else

    return true;

    }

    ok, nevermind – figured things out. I found a bb_break_password function but since that is hooked into the blocked role. I just made a new one with a different $secret and cleared the auth cookie after changing the email (also sent out an email to the old address notifying of the change and initiated bb_reset_email on the new email)

    it would be great if a feature like this was incorporated into bbPress for the future. :)

    that is true. i modified the main register.php page (not the template – as i have a special flow for registration outside the standard bbpress way) and checked against the profile_info_keys and registered the error. But I guess one could override bb_new_user and throw a new error for a duplicate too

    But, i’m not sure how one would go about handling the updating of a profile, on the main profile-edit.php page, i see this hook but its after the error codes have been checked. So I guess one could hack this page for the time being for a duplicate email and handle appropriately

    if ( !$errors->get_error_codes() ) {
    do_action('before_profile_edited', $user->ID);

    both worked fine for me on 1.0 out of the box, no edits.

    In reply to: BBPRess friends plugin

    vBulletin allows you to have a simple “Buddy List” which links to a user’s profile. I think this would be a nice simple plug-in.

    In reply to: bbPress 1.0 released

    Dump your browser cache. That should have been fixed a couple trunks ago, and it’s fine on my site. That WAS how it was uglified mid-process

    ah bugger, fireftp decided to append instead of replace the CSS file. all fixed and beautified :P

    In reply to: bbPress 1.0 released

    seems the dashboard area is missing some styling of the tables or do we need to add some style to this? A lot of the utility screens are out of whack or pushed together. Tools & Settings submenu are formatted nicely though

    http://gallery.firevortex.net/bbpress-dashboard-1.0.gif

    http://gallery.firevortex.net/bbpress-dashboard-2-1.0.gif

    @nuprn1

    Are you integrating with WordPress there?

    No, straight install on MySQL 5.0.67

    I believe everything is working correctly, I can log in with the keymaster and setup forums and general settings.

    not sure how to submit a trac ticket… but this error showed up on a fresh install:

    [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘) /* WP_Users::append_meta */’ at line 1]

    SELECT user_id, meta_key, meta_value FROM bb1_usermeta WHERE user_id IN () /* WP_Users::append_meta */

    Caller: BB_Install->BB_Install, BB_Install->process_form, BB_Install->process_form_finalise_installation, bb_new_user, bb_get_user_by_nicename, WP_Users->get_user, WP_Users->append_meta

    maybe look at the WPMU plugin and see what needs to be changed to work

    http://wpmudev.org/project/WPMU-Invitation

    I get the same error as reported in firebug:

    favoritesToggle[1 === isFav ? “removeClass” : “addClass”] is not a function

    <urlhere>/bb-includes/js/topic-js.php?ver=20080401

    Line 55

    I’ve had problems with godaddy hosting and with other applications in the past. (caching of htaccess files)

    What if you took a copy of bbpress/db and created a local test site and see if things work properly? (xampplite)

Viewing 22 replies - 1 through 22 (of 22 total)