Skip to:
Content
Pages
Categories
Search
Top
Bottom

One profile page to rule them all


  • Vili
    Participant

    @vilimaunula

    If you have integrated your bbPress with WordPress, you must have at least once thought about the problem of your users having two separate interfaces for modifying their profile settings.

    Furthermore, if your bbPress and WordPress both use a good deal of plugins, you end up with a situation where some settings (say, email notifications for new WordPress posts) have to be set on a WordPress profile page, whereas other settings (for example email notifications for new forum topics or replies) must be set through the bbPress interface. This will confuse your average user so much that they will simply not use any of your website’s fancy features at all.

    It would therefore be good to have just one user profile page that would merge everything from the two together. Preferably, this should also be a page that could be displayed within the website template, so that it would really look like being part of the website, and not behind a completely different-looking interface as is the case with WordPress user pages. (Those also scare people.)

    Would this be doable?

    I am personally not much of a coder, so I don’t know all the details of what is going on when the WordPress and bbPress profile pages get served, and how various plugins get to modify that process by adding new fields and buttons on those pages.

    I assume, however, that the most difficult thing for a “one profile page to rule them all” sort of an approach that I am thinking about here would be to keep track of additions to those profile pages. It should somehow be able to notice that some new bbPress or WordPress plugin has modified one of those user profile pages, and incorporate those changes to the merged profile page that is actually displayed to the end user.

    I would love to hear some input from those of you who know more than I do about the behind-the-scenes activity when it comes to user profiles in bbPress and WordPress. What do you think, how difficult would a plugin like this be to code?

Viewing 25 replies - 1 through 25 (of 38 total)

  • HowToGeek
    Member

    @howtogeek

    I’ve been struggling with exactly the same problem myself.

    I tend to think that the bbPress profile is the correct place to store and edit this information. Here’s what I see as the requirements:

    1) Plugin for WordPress to redirect the “Profile Edit” link to the bbPress profile edit screen, as well as link the profile view to the bbPress profile view.

    2) Plugin for bbPress to allow for editing of WordPress profile fields as well as a customizable list of new/extra fields. I believe that there is a plugin that does at least part of this already.

    3) The bbPress plugin would need to either know about WordPress settings like notifications, or would need to run the wordpress plugin filters that apply to profile edit. I’m not sure that the latter would be easy.


    Vili
    Participant

    @vilimaunula

    I would personally prefer to have a completely new profile page, not just a revamped bbPress one. The ultimate solution would of course be to allow the admin to choose whether to use the WordPress, bbPress or completely new page for user profiles. But that would again make the whole thing even more complicated.

    It’s a good point about redirection — the plugin should indeed make sure that all links to profile pages would go to the one set by the admin as the one to be used. (Whether WordPress, bbPress, or a totally separate page.)

    I think that using a completely whole new user page will cause a lot of difficulties. It’s better to go with bb (or wp) just for the API, which makes it a lot easier. In the end it might even be easiest to simply port your wp plugins to the bb profiles; wp plugins may expect certain things that just wouldn’t be available to bb or your new user page and either require loads of coding to make them work or just a little bit of rewriting.

    Since with integation you are having bbPress use the WP users, it would be easiest to write a plugin for either WP or bbPress to use the other’s profile page. It has the same userID, so I think that pulling a WP user page would be the easiest, but it might not be hard to do the opposite and have WP use bbPress’s page. Whichever ‘profile URL’ is the most pluggable I would guess.

    Trent


    Vili
    Participant

    @vilimaunula

    Thanks for the input, guys!

    Hi guys

    Great idea you have here. If you have any info about the development of such plugin, please warn us.

    bbx

    I’m trying to find a solution for this same issue and I know that it can be done because it has be done before here; :)

    http://www.babyquestions101.com/signup/

    unfortunately I don’t know exactly how. I guess all wordpress login links has been removed and replaced for bbpress login. The problem is that you lose access to wp control panel :( and that you are depending completely on the bbpress installation.

    I wish we could integrate;

    login

    profile

    avatars

    ranks

    message counts

    signatures

    forms toolbars

    emoticons

    I presume there isn’t any project to build a bridge like this, is there any? :)


    MaryJane
    Member

    @maryjane

    This is a very good idea! I would like this. I dont really like wp’s dashboard profile page. This would make wp and bbpress more intergrated!

    Did we get anywhere on this topic. I am in the same boat. Looking to have one profile page… Preferably bbpress’s profile. Am I just not noticing the plugin?


    _ck_
    Participant

    @_ck_

    Without direct edits to the the profile template it’s very hard to extend it, if not impossible. I’ve managed to add post count to the profile without template hacks via my post-count-plus plugin but putting in an avatar or gravatar is impossible without a hack.

    example: http://bbshowcase.org/forums/profile/_ck_

    But it’s easy to add tabs to the profile section via plugins.

    You can make supplemental pages.

    Just make a new tab to list all WordPress posts/comments.

    The posts don’t really matter to me. I just one one place for my users to have a profile. When they sign up for an account it takes them to the WP profile. They still need to go into the BB profile to change that info. Maybe I’ll just hack the wp profile page and add a link to the bbpress profile page. Think there is a better way?

    That may have come across wrong…. The posts don’t matter because I am using your plugin, and that feature is already working for me. :) However I feel two profile pages is a bit confusing for users. Do you think a link in the wp profile page would suffice since its rather difficult to have only one profile page?


    mrhoratio
    Member

    @mrhoratio

    Perhaps this idea of a single profile page for both WordPress and bbPress will be part of the recently accounted backPress.

    It would great to have a profile link such as:

    http://www.example.com/member/username

    that works for both WordPress and bbPress. Instead of separate ones at:

    http://www.example.com/forums/profile/username or

    `http://www.example.com/author/username


    Detective
    Member

    @detective

    If you have a WP profile (like the author archive or some other profile) you can redirect the bbPress profile using this hook:

    //add_action('bb_init', 'profile_redirect');

    function profile_redirect() {
    if (is_bb_profile() && $_GET['tab'] != 'edit' && $_GET['tab'] != 'favorites') {
    $user = bb_get_user($_GET['id']);
    if ($user) wp_redirect("http://www.example.com/member/" . $user->user_nicename);
    }
    }

    I did this using this plugin for WordPress profiles, so even users who don’t have published posts have a profile. It works but you miss the profile edit messages (like “your profile has been updated”).


    chrissydunno
    Member

    @chrissydunno

    where in the code do you add your redirect hook exactly?

    Hello,

    Sorry for updating an old post but where do I have to put this previous code?

    Thanks


    dikkevandale
    Member

    @dikkevandale

    Any updates on creating a single profile?


    Hard Seat Sleeper
    Participant

    @hseatsleeper

    Isn’t this what BuddyPress is for?

    BuddyPress would be yet another profile page… unless they have a solution for the multiple profiles problem?


    af3
    Participant

    @af3

    The code from detective works. I’m using wpmu+bp+bb; so i added this to bb theme functions.php (yes! if you dont have custom functions.php, just create one) and it works.

    add_action(‘bb_init’, ‘profile_redirect’);

    function profile_redirect() {

    if (is_bb_profile() && $_GET != ‘edit’ && $_GET != ‘favorites’) {

    $user = bb_get_user($_GET);

    if ($user) wp_redirect(“http://www.example.com/members/” . $user->user_nicename);

    }

    }

    now, trying to find code to show user’s forum (bbpress) posts to show in the BP profile.


    af3
    Participant

    @af3

    oppss.. i think this works 9to show topis started by the user) to be shown in bp profile:

    <h2>Latest Topics Started in Forum</h2>

    <ul>
    <?php
    $query="SELECT * FROM bb_topics WHERE topic_status=0 AND topic_poster=$current_displayed_user ORDER BY topic_time DESC LIMIT 10";
    $results=$wpdb->get_results($query);
    foreach ($results as $result) {
    echo "
    <li><a>topic_id."'>".$result->topic_title."</a></li>
    ";
    }
    ?>
    </ul>

    af3, I ran into the problem that you can not manage your favorites without going to your BBpress profile. Some of the bbpress plugins I was using needed to be edited in the profile, like signatures, notifications, etc etc. It’s a big issue to me. I’ll bring it up during the chat tonight.

    I got around that by creating a tab called signatures in the buddypress profile and then have it show up in the posts and got rid of the program.

    This hack redirects non-editing users from their WordPress profile to their forum profile. Set $my_forums_directory to the directory or URL of the forums, and save it as a WordPress plugin.

    Sometimes the page headers have already been sent, so wp_redirect() can’t be relied on, and instead the HTML has to perform the redirect.

    WordPress users that can edit posts will still see the normal WordPress user screens. Since these screens don’t integrate well, it might be sensible to redirect admin users to /forums/bb-admin/users.php – but I’ve not done that here.

    add_action('admin_head', 'my_wp_profile_redirect', 0);

    function my_wp_profile_redirect() {
    // Based on a part of Kim Parsell's http://wordpress.org/extend/plugins/wp-hide-dashboard/
    global $parent_file, $current_user, $user_login;
    $my_forums_directory = "/forums/"; // Set this to the directory or URL of the forums.
    if (!current_user_can('edit_posts') && $parent_file == 'users.php') {
    $my_profile_destination = $my_forums_directory."profile/".esc_attr( str_replace( " ", "-", strtolower( $user_login ) ) )."/edit";
    if (!headers_sent()) {
    wp_redirect($my_profile_destination);
    } else {
    echo '<meta http-equiv="refresh" content="0; url='.$my_profile_destination.'"><script type="text/javascript">document.location.href="'.$my_profile_destination.'"</script></head>';
    echo '<body><a href="'.$my_profile_destination.'">View profile</a></body></html>';
    }
    exit();
    }
    }


    af3
    Participant

    @af3

    @gerikg, yep — noticed that too. What I did was just to exclude the favorite edit like this: if (is_bb_profile() && $_GET != ‘favorites’)

    Good idea to add new profile field in bp for signature. thx


    af3
    Participant

    @af3

    btw, i added favorite edit link from bp profile with this: <?php if($current_displayed_user == $current_loggedin_user) { ?> (<a href="/forum/profile.php?id=<?php echo $current_loggedin_user; ?>&tab=favorites">Edit Forum Favorites</a>) <?php } ?>

Viewing 25 replies - 1 through 25 (of 38 total)

You must be logged in to reply to this topic.