Search Results for 'display users posts'
-
AuthorSearch Results
-
August 2, 2009 at 8:30 pm #50530
In reply to: BBpress "post_author_link" problem?
Greg
ParticipantThe thing is that bbPress doesn’t know that the user “nbsmrt” has BP Name “murat”.
UPDATE: Scratch that – your display names should actually be working, and in fact I see that they are for users other than “nbsmrt”. The bit I put below is necessary if you want the author link to go back to their BP profile instead of the bbPress profile page.
I wanted the name to be consistent everywhere, so I have a bit of common code that displays the user’s details in forum posts, blog comments, etc. Note that it requires deep integration because I am accessing BP variables inside bbPress.
For example, here is what I do in the forum…
First, in post.php I get the author’s details like so:
$author_id = get_post_author_id( $post_id );
$author = get_userdata( $author_id );
$author_loginname = $author->user_login;
$author_displayname = get_post_author();Then I call a function to display the user link, avatar and other things. Part of this function does the following:
<?php
$author_url = _profile_url( $author_loginname );
?>
<div class="username">
<a href="<?php echo $author_url ?>"><?php echo $author_displayname ?></a>
</div>And here is the code for the _profile_url() function:
function _profile_url( $login_name=0 ) {
global $bp;
/* if no login name is specified, use logged in user */
if ($login_name) {
$url = $bp->root_domain . '/members/' . $login_name . '/profile';
} else {
$url = $bp->loggedin_user->domain . 'profile';
}
return $url;
}So the user’s BP Name is always used, and it always links to their BP profile.
My one concern about all this is that get_userdata() does a SQL query, adding one query for each author in a topic thread.
July 1, 2009 at 3:34 am #48334In reply to: How to use full name, first name + last name
Jeff Sayre
ParticipantFirst off, I do sympathize with your frustration on finding an acceptable set of solutions to your questions. Without writing the code for you, it is difficult to point you in the proper direction. There have been a number of options presented, that while being a compromise to your ultimate, desired solution, could produce satisfactory results.
Isn’t the whole point of Buddypress to turn the WordPress base into something more user-centric?
Yes and no. As I already said two posts above:
WPMU is not designed as a user-centric platform. It is blog-centric. BuddyPress puts the focus on the user.But, BuddyPress is still a layer that rests on top of WPMU, not the other way around. BP relies heavily on certain WPMU functions to handle much of the user registration process. And WPMU requires that the username field be populated (I realize that you know that).
This thread is NOT about the username issue.
I understand that. But what I quoted from your past post was about the username field and that is what I specifically answered in my last post.
This particular thread is entitled “How to use full name, first name + last name“. Burt already provided an answer to this question above via this thread where he shows you how to do exactly this in code.
I’ve understood all along in the various threads that you’ve started on this range of related topics that you want another option, some other way to insert your desired datum into the user_login field, or use newly created fields to allow registering users to enter their firstname and lastname, or that you want a way for users to enter their email for login, or a way to use BP’s xprofile table to display fname and lname in various ways and places, or a way to rearrange fields on the registration form, and that you hate WPMU’s concept of username and want a different option. I get all of this.
Others (including myself) have tried to be as helpful as possible in each of those threads, often rehashing the same answers. I don’t say this to be mean; I say this because we’ve tried to explain in multiple ways and multiple times that what you are after is not possible at this time without hacking the core (in some cases) or writing your own custom plugin(s).
https://buddypress.org/forums/topic.php?id=1746
https://buddypress.org/forums/topic.php?id=1811
https://buddypress.org/forums/topic.php?id=2118
https://buddypress.org/forums/topic.php?id=2119
https://buddypress.org/forums/topic.php?id=2926
How does Buddypress handle first name + last name?
It does and it doesn’t. There are no firstname and lastname fields in BuddyPress unless you create them as Mike Pratt explained above. BuddyPress has its own mandatory registration field that by default is called “Full Name”. Look in the BuddyPress submenu group in WPMU’s backend. Go to “BuddyPress > General Settings > Full Name field name”
Now, there is a function in bp-xprofile-filters.php called xprofile_sync_wp_profile() that will take the datum from the “Full Name” field and split it into a pseudo firstname and lastname and then insert that as meta data into the wp_usermeta table, but it can only do that if a user actually edits their fullname field to include a more than one-word name. So if a user does not edit that field, there will not be any fname/lname wp_usermeta entries for that user.
Buddypress puts a default first x-profile field Name on the registration form; is it possible to replace that with separate first name + last name fields?
You can change the “Full Name” field name to whatever you want but you cannot remove that field from the registration page nor edit it to be something other than a single textbox field–at least not without hacking the core. Look under the “Basic” field grouping in “BuddyPress > Profile Field Setup” to see what I mean.
Or is there already a native solution for first name + last name in WPMU that Buddypress could tap into? (Nicola Greco: ‘… you could replace it with the wp built-in name & last name, or use xprofile fields fot that …”)
In this post above, I explained that if you want to go this route, you’ll need to pull data from two records in wp_usermeta to extract the firstname, lastname combination. If you do not feel comfortable coding this yourself, you could hire a coder to write a simple function to do just that. But be aware, as I explained above, it is possible that not every user will have firstname and lastname meta date.
From your OP:
Default Buddypress is fine for teens/tweens who want to use their anonymous username, but it’s not suitable for a more grown-up business network, for example.
BuddyPress seems perfectly acceptable for business users. There are many professional, adult-based sites that are successfully attracting users to their BP sites. Mike Pratt’s site is a great example, for one.
I’ve been using my full name on this site from day one. It did not bother me that I had to use a single username when registering because I knew I had the option to fill out my full name for display purposes later. It also allowed me to brand BuddyPress.org with my unique name, creating a useful URI in the process.
In fact, the single username approach is what many sites use to allow users to brand themselves. Twitter, youtube, FriendFeed, Delicious, Digg, LinkedIn, and many more all require a unique, single-word username. Of course, some of these then allow you to (or even require) that you use an email for subsequent logins. This is in BP’s future as well.
In the not too distant future, there may be an option to allow users to sign on with their email address via OpenID or another protocol. See the BuddyPress Roadmap and read about the Open Stack.
But for now, your options are limited and if you want to change things you must code your own custom solution or hack the core.
There is not much more we can do, but as I said in my last post, if the username concept bothers you so much, you’ll have to go to the WPMU forums and see what solutions might be in the works–if any.
May 19, 2009 at 8:45 pm #45672In reply to: Author Avatars list plugin now works with BuddyPress
ndrwld
ParticipantI use it as substitute for default BP members widget. Mainly because without any code changes:
1. I can choose avatars size in px
2. Simple link avatars to blogs, their websites, member pages
3. There is possibility to chooce Sorting order (by posts number, registration date, login name, name display, user id…)
4. You can hide users by inserting their id
5. Choose to show users from selected blogs
6. Group by blogs
7. there are more features
I think it’s quite useful for those who don’t have much experience with loop and need simple customization widget.
Thanks bforchhammer to here is Changeset 118704 with possibility link avatars to bp member page.
May 7, 2009 at 4:24 pm #44715In reply to: Questions about groups.
enlightenmental1
Participant1.) adding someone as a moderator is the same as admin pretty much
3.) BP is not currently setup to do this, one way to accomplish this though, instead of doing <?PHP if is admin?> to create groups, do <?PHP if user is level X ?> then you can manually select users and make them authors or contributors… then they would have the power to create groups. this would also give them power to create blog posts on the main blog, so you may not want them to have that power.
hopefully in the future, BP will have more control over giving users authority levels and what not…
4.) bp is not setup to do this either yet. you would need to modify the core to allow that content to be displayed to non-members
everything you want IS possible, but would require some modifications to the core of buddypress. and this is not suggested
April 29, 2009 at 1:11 pm #43833In reply to: News Control
Burt Adsit
Participantalunsina, if you allow others to post to the main blog then then their posts will show up using the standard index.php template. When you select ‘blog’ from the home theme it runs a template called index.php. By default all posts in chronological order are displayed without any filtering by author. Whatever posts are most recent get displayed first. It doesn’t care who is the author.
This really isn’t something that bp controls. It’s just normal blog behavior. You can change what index.php displays when it is run by modifying the index.php template. Or you can not allow other users to post to the main blog.
April 23, 2009 at 7:36 pm #43349In reply to: buddypress + p2 theme
hyrxx
Participanti think the problem your having is the fact that p2 is not a “buddypress theme”
like in the main theme how it has a large widget area and 2 small ones, and also has a BLOG tab where the main blog is
the problem your having with p2 (and any other standard wordpress theme) is the BLOG tab is displayed on the main page rather than a large widget sidebar, as the recent blog posts thing is actually a widget, if you put this widget in your p2 sidebar you will see a direct comparison between the 2
currently you cant have a p2 “theme” that aggregates ALL blog posts like the buddypress widget does,
all the users will be posting to the main blog if you want them to use p2, and if you do then the current skin should be fine? it was designed to show comments
im sure you could add some nice jscript to add collapsing comments? this would probably bring better functionallity to your site if you didnt want the comments taking up the whole page?
March 2, 2009 at 7:39 am #39023In reply to: BP Avatars in bbPress
John James Jacoby
KeymasterWell, while the GF is in the shower, I’ll quick do this… Burt this is aimed directly at you, since I gather most others won’t want to do this kind of thing…
oci_bb_group_forums.php:
This prevents wrong inclusion order when using deep forum integration.
if (defined(BACKPRESS_PATH))
require_once( BACKPRESS_PATH . '/class.ixr.php' );This will return ALL user info, in the event that bbGroups does not exist yet for that user.
function oci_get_userdata($u){
$u = (int) $u;
$user = bb_get_user($u);
if ($user->bbGroups) {
return stripslashes_deep((array)$user->bbGroups);
} else {
return stripslashes_deep((array)$user);
}
}oci_bp_group_forums.php:
This prevents wrong inclusion order when using deep forum integration.
if (!defined(BBDB_NAME))
require_once(ABSPATH . WPINC . '/class-IXR.php');This is how I passed the user info over from xprofile to bbGroups:
/**
* oci_get_user_filter()
*
* Live example of how to use the filter mechanism to add info to the data going across to bbpress
* This filter adds the user's forums and forums where the user is staff into the $user array
* @return
* @param associative array $user from oci_get_user()
*/
function oci_get_user_filter($user){
$users_group_info = oci_get_users_group_info($user['id']);
$user['users_forums'] = $users_group_info['forum_ids'];
$user['user_is_staff'] = $users_group_info['staff_ids'];
$user['custom_title'] = bp_get_field_data('Custom Title', $user['id']);
$user['signature'] = bp_get_field_data('Signature', $user['id']);
$user['aim'] = bp_get_field_data('AIM', $user['id']);
$user['yahoo'] = bp_get_field_data('Yahoo!', $user['id']);
$user['gtalk'] = bp_get_field_data('GTalk', $user['id']);
$user['msn'] = bp_get_field_data('MSN', $user['id']);
$user['jabber'] = bp_get_field_data('Jabber', $user['id']);
$user['icq'] = bp_get_field_data('ICQ', $user['id']);
return $user;
}
add_filter('oci_get_user','oci_get_user_filter',10,1);oci_bb_custom.php
How I transfer the username (just in case fullname hasn’t been edited from wordpress.org transfer – see above oci_get_userdata changes):
function oci_user_name($u){
$bp_user = oci_get_userdata($u);
if ($bp_user['fullname']) {
return $bp_user['fullname'];
} else {
return $bp_user['display_name'];
}
}bbpress/active-theme/functions.php
What I added to make the custom functions go:
add_filter('get_user_profile_link', 'bppro_user_profile_link', 10, 2);
function bppro_user_profile_link($link, $uid) {
$user = bb_get_user($uid);
return(bb_get_option('wp_siteurl').'/members/' . $user->user_login);
}
function bppro_user_url() {
global $bp;
return($bp->loggedin_user->domain);
}
function bp_check_title($user) {
$user_id = get_post_author_id();
$user = bb_get_user($user_id);
$user_title = $user->bbGroups['custom_title'];
if ($user_title) {
return $user->bbGroups['custom_title'];
} else {
return;
}
}
add_filter('post_author_title', 'bp_check_title');
add_filter('post_author_title_link', 'bp_check_title');
function post_author_signature() {
$user_id = get_post_author_id();
$user = bb_get_user($user_id);
$user_signature = $user->bbGroups['signature'];
if ($user_signature) {
echo '<p class="post-signature">__________<br />' . $user->bbGroups['signature'] . '</p>';
}
}bbpress/active-theme/post.php
Displays avatar from BuddyPress if it exists, else bbPress/Gravatar. Also displays hooked data from above functions.php:
<div class="threadauthor">
<dl>
<dt><a class="oci-link" href="<?php echo oci_user_link($bb_post->poster_id); ?>"><?php echo oci_user_name($bb_post->poster_id); ?></a></dt>
<dd><span class="oci-title"><?php $patl = post_author_title_link(); ?></span></dd>
<dd><?php if (oci_user_avatar($bb_post->poster_id)) { echo oci_user_avatar($bb_post->poster_id); } else { post_author_avatar_link(); }?></dd>
</dl>
</div>
<div class="threadpost">
<div class="poststuff">
<?php printf( __('Posted %s ago'), bb_get_post_time() ); ?> <a href="<?php post_anchor_link(); ?>">#</a> <?php bb_post_admin(); ?><?php bb_quote_link(); ?>
</div>
<div class="post">
<?php post_text(); ?>
</div>
<?php post_author_signature(); ?>
</div>February 26, 2009 at 1:00 am #38784In reply to: Theme and plugin requests
hyrxx
Participanti would like to see member themes changeable on a per user basis so they can have their own skins as such, and also allow them to create their own, i think we need to collaborate as to what the user can change and what they cant, it would be nice to allow them selected css,
i would also like to see the modules changeable in a drag and drop kinda way and allow the user to choose which modules they do or do not want to use,
im interested in a love plugin which allows users to post a little love icon with thier wire posts but i could also see this being extended to comments, i have made a request for it before but got no replies so visit my profile for the topic,
last fm integration would be majorly cool i think, as it would rival many of the ‘apps’ out there on the larger social networks. building on this area of things you could also add twitter, etc. so i guess what im trying to say is focus on the users ‘lifestream’
when the user logs in i want them to go straight to the dashboard but the dashboard should have things like pending freind requests, groups to join, latest comments, profile stats (incuding who visited thier profile), options and such like, and an aggregation of thier freinds activity updates. when i visit my site i dont care what user a,b and c are up to im just interested in what my freinds x,y and z did recently,
so it would be very useful to have these widgets in the dashboard, that way everything is centralised for the user to do things,
another thing i thought would be useful was profile privacy options, allowing members to discriminate based on age eg, users over X cant visit profiles for members under 18 or whatever, maybe allow the user to choose who can contact them / add them etc,
also have a block ability and mark as spam,
the profile itself should have 3 modes of operation, public – everything is displayed, semi private, freinds can see full profile, non freinds can see selected modules / different modules only, and fully private – the user must be freinds to see anything other than name, age and city/ country.
i have used the profile sidebar plugin, but as of yet there are no freinds or group widgets for it, i would like to see these with a good amount of configurability options allowing for things like top freinds, other half etc
sorry for such a long post but i would like to see these features implemented as i think they would greatly enhance buddypress!!
thanks!!
January 25, 2009 at 12:13 pm #36700In reply to: Displaying Specially Tagged Posts
jodyw1
Participant“Can you also then have BP post the most recent -forum- posts from a users blog” should have read “**blog** posts…”
No need to be unduly confusing.
December 10, 2008 at 5:57 pm #34217st9bp
MemberI’ve also noticed that for certain users who do have blogs, in their Profile it says ‘hasn’t created any blogs yet’
-
AuthorSearch Results