Hi everyone!
My aim is to add a “share button” into different sites just like available on facebook,g+ and twitter. For example:
A user is on a site with a tutorial and wants to share the link of the site on my buddypress page. Now I want to give the admin of the site a code for a button which will put the visitor on an extra site on which he can share the link on the mentioned buddypress-site.
For this I thought about giving the link via php and the post or get-form. What I want to know now is: How can I add a single site only with the posting-form of buddypress and take the passed link into the form?
The Process of my idea is the following:
1. A user is on a site with my “share button”
2. If he pushes this button the link of the site will be copy and
paste in a new opened site into the post-formular of buddypress
3. Now the user can post the link on my buddypress site if he is logged in. Otherwise he
will get an option to log-in with his user account
Thank you for your answer @danbp I will try to make a new site by using the custom post type form of wordpress.
Best Regards
Robert
What I have done is that I used a plugin that hides the admin bar for all the users (logged in and logged out) and users can’t see or use the toolbar. When the user is logged in, s/he can see the profile link in the menu which takes him/her to the default buddyPrss profile and s/he can start from there. That’s why if create group exist under the profile tab (without admin) it would make my life easier.
The theme I am using is not helping me to go around this and that’s why I was thinking of using a different theme that is BuddyPress ready.
@elliscooper29,
here some explanation about the name field
For theme customization, read first the codex.
Create a child theme, and add a copy of bp-legacy/buddypress/members/register.php to the child,
/your_cild_theme/buddypress/members/register.php.
Then you can give your beautiful registration page a chance to live ! 😉
If other questions around this, give your theme name.
my site is http://www.savecanadianhockey.ca wordpress 4.0 the newest download of buddypress. brand new install.
I love it. I only have one problem. I am using user-registration-aide for my registrations due to the fact that the wp registry was too vague. Not enough info. So I made a beautiful registration page and now I can’t get to it. Instead I get the same old thing that I searched to get rid of.
Any suggestions? Also noticed that the ‘Complete sign up button’ is hanging off the page by about 5px.
Also, why is the ‘Name’, a field seen by everyone instead of the ‘Username’? I noticed a fix but not exactly sure where to add it in the functions.php file in my child theme.
Trying to get everything ready for hockey season which is fast approaching.
Thank you.
Fred Ellis
Is it a recommended idea?
If you mastered the situation and know what you do, almost any idea is “recommanded”. 😉
You can do this by using a multisite install.
BP installed on the main site with his own theme (your-site.com) and another blog on sub-domain (mysub-domain/your-site.com) with another theme.
This is the most easiest install option. But you can also install BP on a secondary blog.
Registering is made on the main site, as it would be the hart of your network, and by consequence, the unique place where user can register.
References:
https://codex.wordpress.org/Before_You_Create_A_Network
https://codex.wordpress.org/Create_A_Network
@jessicana,
if you allow group creation to your members, they can do so by going to group directory.
The “create group” button is in the group header.
Once created, the member see on his profile, a tab named My Groups (or Groups) with a counter. On the tab, the group list created by him.
-> When users are logged out, they have no access to the Toolbar or to the Create Group button on the group directory.
This is so by default. Any other behaviour can be considered as theme related (for ex. if you use a theme specifically designed for BuddyPress). IMHO rare, but can eventually exist.
You can hide the Toolbar to logged out user in the buddypress settings.
About BP/WP jargon:
the Toolbar is the wordpress black toolbar at the top of the site.
the User menu is the menu at the top right corner, under wp’s Howdy
the buddymenu is the bar under the page header and before the page content. Depending the context (page, status), this menu bar has an associated sub menu.
@jessicana,
The field NAME in the field group BASE is required. This group is used for the registration page to work. As you already know, it’s also this group who allows you to show custom fields on the registration page.
The NAME field in BuddyPress is intended to receive first and last name and replace the two original fields (first name, last name) coming with WordPress.
That said, you can hide this field to users, but you can’t give them the choice to show/hide it.
The above snippet will hide the field NAME to all visitors/members, but not to site admin and the concerned profile.
function bpfr_make_name_members_only( $retval ) {
//hold all of our info
global $bp;
// is xprofile component active ?
if ( bp_is_active( 'xprofile' ) )
// The user ID of the currently logged in user
$current_user_id = (int) trim($bp->loggedin_user->id);
// The author that we are currently viewing
$author_id = (int) trim($bp->displayed_user->id);
// user can see only his name && admin can see everyone
if ($current_user_id !== $author_id && !current_user_can('delete_others_pages') ) {
$retval['exclude_fields'] = '1';
}
return $retval;
}
add_filter( 'bp_after_has_profile_parse_args', 'bpfr_make_name_members_only' );
Add this to your child-theme functions.php or to bp-custom.php
I have these two links:
http://www.DOMAIN.com/members/USERNAMES/groups/ – Appears under buddypress in the menu- (and)
http://www.DOMAIN.com/groups/ – Appears under pages in the menu –
I have the first one available to the registered users and it disappears when the user signs out, however, the second one doesn’t disappear when a user signs out. I am willing to make the second link unavailable when a user signs out. How to do this?
Thanks
Hello,
I am thinking of using special theme for buddpress on my sub domain and wordpress (e-commerce) theme on my domain. Can I make single sign in for them all? If yes, how?
Thanks
It’s best if you open a ticket for this on Trac:
https://buddypress.trac.wordpress.org
@gema75 thank you for this information, but nothing is mentionned about buddypress integration ?
You also omit to say that it’s a premium plugin for the price of $22 !
And, please, don’t jump into old post, mainly for advertising only.
Topic is now closed.
@mercime the default buttons and hovers in the buddypress profile pages are just simple one, like on this site.
I just want to make them look like my native theme.
I wanna change that, when I hover on some button, it should turn into blue buttons.
as in this site, on the top nav it changes the color on hove to dark blue, I wanna make the same in buddypress profile pages.
http://wp-themes.com/kotetsu/?TB_iframe=true&width=600&height=400
Unfortunately the original topic was closed.
Post Link: http://buddypress.org/support/topic/profile-page-activity-description/#post-188844
However I am having trouble fixing the problem. Let me recap. On my personal profile page is a topic box which has a description:
What’s new, The?
With Poedit and the renamed po file I have been able to track down the source code which is unchanged and is either:
What’s new in %s, %s? or What’s new, %s? I assume it is the latter.
Why is it calling up The in place of %s ?
Thanks,
Anthony
It’s not a buddypress issue, the members core widget on your homepage contains rounded avatars.
Did you updated your theme recently ?
Do you use a child theme or did you made the rounded css in the original theme ?
Ask your Premium theme support.
@iryna_b,
and what about if the user doesn’t use the widget navigation but goes directly to a group ?
Change the group landing tab ! Thought it’s simplier.
See here how to do it.
For the group header information, you can create a child-theme and modify group-header.php file
Line 40 you remove this:
<span class="activity"><?php printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() ); ?></span>
Hello,
im having a problem with buddypress profile avatars. They used to be circular and now they seem to be square and cutting off on the profile.
website: http://www.avitmusic.com
you will have to login to view this.
i have done a “inspect element” and found the margin is out by -53 and when changed to 0 it fits but i have no idea how to code this in the css. Also it stays square and does not go back into a nice circle!
cheers for any help!
WP -3.9.2
BuddyPress – 2.02
Hi, I wanted to use a widget BuddyPress Groups, but I wanted to make redirection not to a group directory but to a forum of a chosen group. Is it possible? So, when a user clicks on desired group name, he is being redirected right to the forum of that group?
Ans also, there fields under group title, saying how long is the group been active. How can I delete this characteristic?
Thank you!
plugins I would recommend:
buddypress-activity-plus
This adds images/video/links to your activity wall, which is a facebook-ish function.
There is another plugin in the making which should be an improved version called BP-attachments
GD-bbpress-attachments
Allows people to upload images to the forum, easier then the existing system.
And ofcourse the facebook plugin.
These plugins and some playing around with my templates allowed me to make a facebook-ish site.
BBFacelook
I also suggest to look into a theme called BuddyBoss, it is a change but this is a very facebook inspired theme.
Good luck
P.H.
After researching a bit further I think I could easily achieve what I’d like if only this function (in bp-activity-classes.php line 1186):
/**
* Create filter SQL clauses.
*
* @since BuddyPress (1.5.0)
*
* @param array $filter_array {
* Fields and values to filter by.
* @type array|string|id $user_id User ID(s).
* @type array|string $object Corresponds to the 'component'
* column in the database.
* @type array|string $action Corresponds to the 'type' column
* in the database.
* @type array|string|int $primary_id Corresponds to the 'item_id'
* column in the database.
* @type array|string|int $secondary_id Corresponds to the
* 'secondary_item_id' column in the database.
* @type int $offset Return only those items with an ID greater
* than the offset value.
* @type string $since Return only those items that have a
* date_recorded value greater than a given MySQL-formatted
* date.
* }
* @return string The filter clause, for use in a SQL query.
*/
public static function get_filter_sql( $filter_array ) {
$filter_sql = array();
if ( !empty( $filter_array['user_id'] ) ) {
$user_sql = BP_Activity_Activity::get_in_operator_sql( 'a.user_id', $filter_array['user_id'] );
if ( !empty( $user_sql ) )
$filter_sql[] = $user_sql;
}
if ( !empty( $filter_array['object'] ) ) {
$object_sql = BP_Activity_Activity::get_in_operator_sql( 'a.component', $filter_array['object'] );
if ( !empty( $object_sql ) )
$filter_sql[] = $object_sql;
}
if ( !empty( $filter_array['action'] ) ) {
$action_sql = BP_Activity_Activity::get_in_operator_sql( 'a.type', $filter_array['action'] );
if ( ! empty( $action_sql ) )
$filter_sql[] = $action_sql;
}
if ( !empty( $filter_array['primary_id'] ) ) {
$pid_sql = BP_Activity_Activity::get_in_operator_sql( 'a.item_id', $filter_array['primary_id'] );
if ( !empty( $pid_sql ) )
$filter_sql[] = $pid_sql;
}
if ( !empty( $filter_array['secondary_id'] ) ) {
$sid_sql = BP_Activity_Activity::get_in_operator_sql( 'a.secondary_item_id', $filter_array['secondary_id'] );
if ( !empty( $sid_sql ) )
$filter_sql[] = $sid_sql;
}
if ( ! empty( $filter_array['offset'] ) ) {
$sid_sql = absint( $filter_array['offset'] );
$filter_sql[] = "a.id >= {$sid_sql}";
}
if ( ! empty( $filter_array['since'] ) ) {
// Validate that this is a proper Y-m-d H:i:s date
// Trick: parse to UNIX date then translate back
$translated_date = date( 'Y-m-d H:i:s', strtotime( $filter_array['since'] ) );
if ( $translated_date === $filter_array['since'] ) {
$filter_sql[] = "a.date_recorded > '{$translated_date}'";
}
}
if ( empty( $filter_sql ) )
return false;
return join( ' AND ', $filter_sql );
}
would allow filters to be combined with OR rather than AND. That way I could easily filter on a bunch of user_ids and group_ids which would get me the results I’m after. I might try extending the class and overriding that function. Watch this space!
You have to test with another theme. And check your site settings.
All this is firstly a worpress installation issue, then a theme setting and finally a buddypress setting.
https://codex.wordpress.org/Debugging_in_WordPress
yes, you can have all this !
Profiles are public, but you can set them as “members only”.
And each member can choose the field visibility. Also it is very easy to let some fields public, allow to members or only to users friends.
You can also hide comments with your conditionnals.
Discover here all buddypress features and read a bit the codex to see all things you can realize with buddypress.
Hi @danbp. Okay so essentially what you are saying is I need to write a complex custom query?
I’ve been examining the Buddypress class and function files in detail over the last few weeks due to the lack of documentation for BuddyPress – not a criticism btw. Yep I’m familiar with meta_query and using that already to get groups by meta_value. I wrote a function for returning activity IDs based on group meta:
function wfw_get_group_activities_by_sport($sports = array())
{
global $bp,$wpdb;
if(!$sports)
return false;
// GET GROUP IDS WHICH HAVE CHOSEN SPORT SELECTED
foreach($sports as $sport)
{
$meta_query[] = array(
"key" => "group_sport",
"value" => $sport,
"compare" => 'LIKE'
);
}
if(count($meta_query) > 1)
$meta_query = array_merge(array('relation' => 'OR'), $meta_query);
$group_arr = BP_Groups_Group::get(array(
'per_page'=>-1,
'meta_query' => $meta_query
));
if(!$group_arr['total'] || !$group_arr['groups'])
return false;
foreach($group_arr['groups'] as $group)
{
$group_id_array[] = $group->;id;
}
$item_id = implode(",", $group_id_array);
$sql = "SELECT id FROM {$bp->activity->table_name} WHERE component = 'groups' AND item_id IN ({$item_id})";
$activity_id_array = $wpdb->get_col( $sql);
if(!$activity_id_array)
return false;
$activity_id = implode(',', $activity_id_array);
return $activity_id;
}
which I can then use to filter results:
$activity_id = wfw_get_group_activities_by_sport(array($_GET['sport']));
$filter = '&in='.$activity_id.'&object=groups';
if ($activity_id && bp_has_activities( bp_ajax_querystring( 'activity' ).$filter ) ) : ?>
Now I just need to somehow combine what I’m using but it sounds like a complex query is the way to go. I was looking for a more elegant solution using BP functions to achieve this but I guess it’s not yet possible.
Anybody else have experience in this?
Thanks.
Take a look to component class file, you will find anything related to how components and their filter are built. All component have such a file.
Is it possible to chain filters ? I don’t think so, or under condition to write a very complex query. And activities are ajaxified !
In bp-activities-class.php:307 you’ll find 'meta_query' => false, // Filter by activitymeta, so i presume, you know what you can do with this argument. 😉
See also bp_parse_args, who let you filter the activity loop very easily.
I’m running the latest versions of BP and WP. On the main activities page (for logged in user) I have a requirement to show activities by the user, the user’s friends and also activities from groups the user is a member of.
I can do the first bit to get activities from user and friends:
<?php
$user_ids = wfw_bp_get_user_and_friends_id();
$actions = 'activity_update,rtmedia_update,new_blog_post,joined_group,created_group';
$args = array(
bp_ajax_querystring( 'activity' ),
'user_id' => $user_ids,
'action' => $actions
);
<?php if ( bp_has_activities( $args ) ) : ?>
I can also get activities from groups that the user is a member of but I can’t do both at the same time. How can I modify this to get both activities of the user and friends but also groups the user is a member of?
Additionally, I would also like to extend this further to get the above and also activities from groups that have a certain group meta value regardless of membership. E.g. show activities from groups where meta value = “swimming”. I can do this but not at the same time as getting activities from friends.
I’m happy to code and more than competent with PHP just looking for some advice as I’m relatively new to BuddyPress (3 weeks). I had considered running an additional bp_has_activites() and merging the results with the initial query. Or is it possible to chain filters together (that would be cool).
Many thanks.
I want to build a site that allows members to join to participate in forum discussions after they login. All members of the site will be in the same industry but work in various cities around the US.
But I also want to be able to set up the site as a vehicle for them to promote (advertise) their business to people (non-members) in their local areas. Are the member profiles “public”? What information is displayed in a public (non-member) view? I would not want non-members seeing comments made by members in the various discussion boards.
I am hoping that if BP can do this, that the end result would be something similar to combining Angie’s List or Yelp! with Facebook.