Search Results for 'custom activity page'
-
AuthorSearch Results
-
May 3, 2018 at 10:11 pm #272679
In reply to: Shortcode to create Edit Profile Page
ma3ry
ParticipantMy coder gave me the following information. It works for me. If it doesn’t work for you, I’m sorry but I don’t know what to tell you. I’m not a coder.
CUSTOM MENU SHORTCODES
Create a simple shortcode by adding the following in child-theme’s functions.php file
add_shortcode( 'bp_user_profile_link', 'bp_user_profile_link_shortcode'); function bp_user_profile_link_shortcode( $atts ){ $atts = shortcode_atts( array( 'text' => 'Profile', 'target' => '' ), $atts ); if( !is_user_logged_in() ) return ''; $target_link = bp_loggedin_user_domain(); switch( $atts['target'] ){ case 'settings' : $target_link .= 'settings/'; break; case 'profile' : $target_link .= 'profile/'; break; case 'edit_profile' : $target_link .= 'profile/edit/'; break; } return "<a href='" . $target_link . "'>" . $atts['text'] . "</a>"; }Now this gives you the chance to choose which profile link you want to target. So
1) For the main member page (activity) use the following shortcode:
[bp_user_profile_link text=”Profile” ]2) For the View Profile page
[bp_user_profile_link text=”View My Profile” target=”profile”]3) For the Edit Profile page
[bp_user_profile_link text=”Edit My Profile” target=”edit_profile”]CUSTOM MENU URL (this may be very specific to my website. I don’t know.
Edit Profile: https://yourwebsite.com/members/–sububsername–/profile/edit/group/1/
Hope this helps.
April 30, 2018 at 8:29 pm #272543Venutius
ModeratorWhat plugin did you use to add the option to only display a menu item to logged in users? Seems like that is what is not functioning. hiding the activity link by hiding the menu item does not hide the activity page from non logged in users, if they know the url they will still be able to view it, to prevent that you should explore the security options available to you. There a number of privacy plugins for bp with a range of features, is it only the Activity page you want to hide?
BuddyPress uses the default WordPress login page, there’s a number of customisers for this, for example: https://wordpress.org/plugins/admin-custom-login/
April 23, 2018 at 8:26 pm #272364In reply to: Custom Post Type permalink in Activity feed
Brendan
ParticipantI’ll give another example, since this appears to me to be a bug.
Buddypress requires pretty permalinks, so why is my permalink a?p=123type??
Here’s the code I’m using to add a custom post type to my activity feed.add_post_type_support( 'community-story', 'buddypress-activity' ); function customize_page_tracking_args() { // Check if the Activity component is active before using it. if ( ! bp_is_active( 'activity' ) ) { return; } bp_activity_set_post_type_tracking_args( 'community-story', array( 'component_id' => 'activity', 'action_id' => 'new_community-story', 'bp_activity_admin_filter' => __( 'Shared a new story', 'buddypress' ), 'bp_activity_front_filter' => __( 'Community Story', 'buddypress' ), 'contexts' => array( 'activity', 'member' ), 'activity_comment' => true, 'bp_activity_new_post' => __( '%1$s shared a new <a href="%2$s">Community Story</a>', 'buddypress' ), 'bp_activity_new_post_ms' => __( '%1$s posted a new <a href="%2$s">Community Story</a>, on the site %3$s', 'buddypress' ), 'position' => 100, ) ); } add_action( 'init', 'customize_page_tracking_args', 1000 ); function record_cpt_activity_content( $cpt ) { if ( 'new_community-story' === $cpt['type'] ) { $cpt['content'] = ' '; } return $cpt; } add_filter('bp_before_activity_add_parse_args', 'record_cpt_activity_content');And here’s the result
<p> <a href="https://domain.online/members/thirty3/">UserName/a> shared a new <a href="https://domain.online/?p=313">Community Story</a> <a href="https://domain.online/?p=313" class="view activity-time-since bp-tooltip" data-bp-tooltip="View Discussion"><span class="time-since" data-livestamp="2018-04-23T20:07:18+0000">17 minutes ago</span></a> </p>April 4, 2018 at 10:10 pm #271791Brendan
ParticipantSure thing. I want to be able to have users post in those three post-types because of how they function. A blog post (custom post type) is suited for a story, a longer-form thing. A forum post is great for Q/A, and a “Tutor Tip” for example sits somewhere between a blog post and a simple status update, so I’m thinking about a second custom post type.
The main UX design choice for this is to have all of those options in one place, rather than sub-pages or sub-menus, etc.
It’s also easy for our moderators to be able to “feature” a blog post.
With buddypress, it’s my understanding that blog posts (with plugins like buddyblock, etc) show up in the activity feed, forum posts can be told to show up in the activity feed.
My thought is either to have three fields(Story, Question, Tip) , which have buttons that toggle their respective visibility.
Or
Have the one field, and the buttons change the destination on submit to one of the three.
Does that help?
January 28, 2018 at 10:14 am #270378ngoegan
ParticipantActually, there was something else in there, I deleted it. Here’s the error I’m getting with just your code now:
//redirect all users to homepage function bbg_bp_loggedin_register_page_redirect_to( $redirect_to ) { if ( bp_is_component_front_page( 'register' ) ) $redirect_to = bp_get_root_domain() . '/activity'; return $redirect_to; } add_filter( 'bp_loggedin_register_page_redirect_to', 'bbg_bp_loggedin_register_page_redirect_to' ); Warning: Cannot modify header information - headers already sent by (output started at /home4/cgoegan/public_html/charlottemasoneducation.org/wp-content/plugins/bp-custom.php:14) in /home4/cgoegan/public_html/charlottemasoneducation.org/wp-includes/pluggable.php on line 1216January 28, 2018 at 10:12 am #270377ngoegan
ParticipantI tried and am now getting this error on the site:
/** * Add location to BP Member directory */ function my_directory() { if ( bp_is_active( 'xprofile' ) ) if ( $field_7 = xprofile_get_field_data( 'Location', bp_get_member_user_id() ) ) : echo ' '; echo $field_7; echo ' '; endif; } add_filter ( 'bp_directory_members_item', 'my_directory' ); /** * */redirect all users to homepage function bbg_bp_loggedin_register_page_redirect_to( $redirect_to ) { if ( bp_is_component_front_page( 'register' ) ) $redirect_to = bp_get_root_domain() . '/activity'; return $redirect_to; } add_filter( 'bp_loggedin_register_page_redirect_to', 'bbg_bp_loggedin_register_page_redirect_to' ); Warning: Cannot modify header information - headers already sent by (output started at /home4/cgoegan/public_html/charlottemasoneducation.org/wp-content/plugins/bp-custom.php:33) in /home4/cgoegan/public_html/charlottemasoneducation.org/wp-includes/pluggable.php on line 1216January 28, 2018 at 9:57 am #270375Shashi Kumar
Participant@ngoegan the logic in the Buddypress is correct why an user would like to go to register page when he is already registered and logged in. According to your stated problem your can make register page as static homepage and add the above code in your child’s theme function file or bp-custom.php. It will redirect all your logged in user to activity page.
To know about how to add bp-custom file read this beautiful postJanuary 18, 2018 at 3:13 am #270163stoi2m1
ParticipantI found the default theme was also showing issues which I missed.
I had both Groups and Members as a Child Page to My Activity Page, named Community. This was causing both single members profiles and single groups to not work. Until I find a solution I have made them Main Pages (no parent assigned). Is there a way to set the slug? I found these deprecated constants, is there some new way?
Deprecated Method in bp-custom.php use:
define ( 'BP_MEMBERS_SLUG', 'community/groups' ); define ( 'BP_GROUPS_SLUG', 'community/members' );From the following link:
I also found my other issue in bp-custom.php. Forgot all about that one.
I created an aggregate feed called “My Feed” to display a more personal feed (which is working just fine). I used it on both the Activity in Profiles and the Main Activity Stream (site wide). I am using the following function to change the default sub nav for activities in profiles (Profile >> Activity >> Default Sub Nav) to “My Feed”. This works for profiles but causes the Site Activity to stop working.
function gzp_set_default_activity_sub_nav() { bp_core_new_nav_default ( array( 'parent_slug' => buddypress()->activity->id, 'subnav_slug' => 'my-feed', 'screen_function' => 'gzp_bp_my_feed_screen_activity' ) ); } add_action( 'bp_setup_nav', 'gzp_set_default_activity_sub_nav', 20 );December 30, 2017 at 8:56 am #269844leog371
ParticipantHey Frank, I guess the best question to ask you after all this is how comfortable are you with digging into or working with html, css and basic php?
If a pre made theme is what your looking for, how comfortable are you with taking hours and days looking thru theme demos to find your golden pony or at least making child themes or customizing code?
And then to answer you more specifically to your “How long would it take to develop a theme like the one I described?” , I guess that just depends really. Over the years I have accumulated many libraries of code and theme snippets and I know where everything is in WP/BP core and template files. So for me, A fully custom and dressed out theme might take anywhere from 3 days to 3 weeks if I know exactly what I am working towards at the beginning and have a clear, though out, planned out idea. If I hen peck it or free hand it” like I do from time to time” It may take a day or it might take 8 months, lol.
As a bit of comfort to your quandary, everything you asked for in your opening inquiry is all ready done for you in BuddyPress “for the most part”. A theme like the one you describe sounds like a 3 day to 1 week job to me. Keep in mind however that with me saying that, things always have a way changing and evolving into monsters, lol.
So lets break down your theme and see how it look on paper…. He He, my favorite part…
1. I want users to come to my site, register, and log in…… (Its all ready there) just have to set it up to your liking. It can all be customized quite a bit as well.
2. I would love to be able to customize the way these pages look!(background image, logo, and content inside them)……… (The logo, background and most of the design items are easy breezy as long as your ok with basic html and css and not looking for flying dragons and wizards shooting lightning bolts across the screen. Alas, even those can be done with css, flash and JS, lol. )
3. I’m not looking for a full-blown social media site (yet)…….No need to have what you dont want to use. BP has a full host of controls to limit what can be done onsite by users or what is implemented frontend in its settings. WP Dash/settings/buddypress. Select what you want to use. You also have the ability to write functions, and use hooks and actions and filters to limit or build on anything you like.
4. I want to build a site that where users can log in, create a “blog” excerpt with media …… There are several ways to do this in buddypress, just have to plan it out and test the methods and see what works for you. Mu, Activity and Groups/Forums.
5. They should also be able to put a location tag on it. ….. it sounds like this is what x-profile fields are good for. Just create your custom location field and add it with a template tag in the loop you want to use it in. They fill out the filed on their profile page and it will display in that loop.
6. When they post it, the only people I want to see that are the people they added as friends or if they have their profile set to public……BuddyPress frontend “user profile area” has a settings tab, under it are quite a few privacy features, not fully comprehensive in my opinion but there are a few plugins that add on to this and you can code it in as well. either way. Easy task.
7. And when it shows up on their friend’s news feed it should just show a featured image, title, and the beginning of their text with a like counter….. Easy enough, just write the loop that way, lol. Easy to do.
8. When their friends click on that post it brings them to the full blog post, not just the featured image. Their friends can favorite the content or comment on it. …..The natural behavior of WP and BP posts so we are good there.
9. On a users profile, I would like to show their recent posts, and posts they’ve favorited…. Thats what the friends tab shows but you can add custom queries, and stuff and otherwise tear it apart and pick it of the pieces you want and use them in other places to make custom loops and queries and all kinds of goodness, lol. As long as you make sure things are firing in the right places and make sure certain things are in the loops where they belong, No worries.
10. Site homepage is basically just a file called front-page.php. Copy the page.php from the theme root and then customize the heck out it. Work it up however you like.
As far as the themes go, I never use premade themes. I do however make full use of the libraries of code I have accumulated, (_s) and bootstrap for a lot of my work. Cheesy I know but hey, it saves me time and money and gives me freedom. I rarely find the need to actually make a complete custom theme or write much in the way of custom code from scratch anymore. And I certainly never purchase any themes. So I am not the best person to ask about themes really. I know that there are tons of themes that do all kinds of stuff available around the web. Just have to give them the litmus test and see if they fit your project.
Let me know if you have any other questions or what have you. I will be around.
December 11, 2017 at 3:27 pm #269512In reply to: Flatsome theme UX Page Builder not loading
Boone Gorges
KeymasterHi @billybelly – It’s difficult for us on the buddypress.org forums to provide concrete advice on a non-free product, because we don’t have access to test it. If you paid for the UX Builder project, then they ought to be the ones providing you with support.
That being said, it’s possible that BP templates are inherently incompatible with this plugin. BP technically uses WP pages like Activity, Register, etc, but it sorta hijacks the page loading process in a way that can make it incompatible with certain kinds of “builder” plugins. If you’re looking to customize the interior portions of a BP page, it’s best to do it either using CSS (which you can access via the Customizer and a plugin like https://wordpress.org/plugins/simple-custom-css/) or by overriding the templates in a child theme. See https://codex.buddypress.org/themes/theme-compatibility-1-7/a-quick-look-at-1-7-theme-compatibility/#overloading-template-compatibility-theme-files
December 11, 2017 at 1:52 pm #269508In reply to: Buddypress profile on existing navbar
peter-hamilton
ParticipantI think you need a child-theme and change the header.php to include your custom navigation, I have created a similar menu but did require a lot of work in the header.

When new messages the number of messages shows in the message-icon, links to profile page, also woocommerce integrated and a dashboard link for admin only.
The following is in my custom header.php
First code links to profile.
<li><a href="<?php echo bp_loggedin_user_domain(); ?>" class="activitylink" title="My Account"><span class="dashicons dashicons-admin-users"></span></a></li>This code deals with messages.
<li><a href="<?php global $current_user; echo home_url() . '/members/' . $current_user->user_login . '/messages/'; ?>"><span class="dashicons dashicons-admin-comments"></span><span class="commentcount"><?php if (bp_get_total_unread_messages_count( bp_loggedin_user_id() ) > 0 ) { ?> <?php bp_total_unread_messages_count( bp_loggedin_user_id() ) ?><?php } ?></span></a> </li>Since I did not want too much in my nav I only used these buddypress features, more would clog up my website too much.
But where it comes down to is with a child-theme you can make it exactly as you like.
Good luck
P.H.December 10, 2017 at 12:47 am #269492astrologeeks
ParticipantYou will need to add something like this to your bp-custom.php file. If you haven’t already, create this file and place it in the wp-content/plugins/ folder. I added “aside” to the name to tell buddypress this is a custom function and not re-declare an already existing function.
function bp_get_activity_delete_link_aside() { $url = bp_get_activity_delete_url(); $class = 'delete-activity'; // Determine if we're on a single activity page, and customize accordingly. if ( bp_is_activity_component() && is_numeric( bp_current_action() ) ) { $class = 'delete-activity-single'; } $link = '<a href="' . esc_url( $url ) . '" class="item-button bp-secondary-action ' . $class . ' confirm btn white btn-xs" rel="nofollow" style="padding: .2195rem .5rem;font-size: 0.8rem;">' . __( '<i class="fa fa-fw fa-trash text-muted"></i>', 'buddypress' ) . '</a>'; /** * Filters the activity delete link. * * @since 1.1.0 * * @param string $link Activity delete HTML link. */ return apply_filters( 'bp_get_activity_delete_link', $link ); } function bp_activity_delete_link_aside() { echo bp_get_activity_delete_link_aside(); }November 4, 2017 at 2:05 pm #268823Topic: Login Issues
in forum How-to & TroubleshootingMike
ParticipantWordpress 4.8.3, BuddyPress 2.9.2, self hosted on an Apache (shared) server.
I really want this to work but I install WP and BP without errors. I set ‘activity’ as a static front page. I test the site (there are no other users) and all looks OK.
I logout. I login. The page still appears to be logged out. The page doesn’t refresh to the ‘activity’ page with me as logged in.
I have tried with themes twentyfifteen, sixteen and seventeen.
I’ve searched the entire internet for a solution, not just here, and many people suggest redirect plugins. I’ve tried a few but it doesn’t work for me.
Some solutions suggest bp_custom code. I tried and it didn’t work.
The only solution I sort of found for myself was to place a “who’s online” widget on the page. After I login (and appear logged out) I click the link in the widget to my profile page. Then I can return to the home page and see I am logged in, BUT even that sometimes fails.
Please, someone, tell me what causes this incorrect login issue and how to finally resolve it.
November 3, 2017 at 4:53 pm #268805In reply to: set a default tab for non friends
David Cavins
KeymasterWhat about using a custom member front page? Then you’d have total flexibility:
Custom Front Pages for your users profilesOtherwise, I think you could conditionally filter
bp_displayed_user_get_front_templateto specifymembers/single/activity.phpfor self and friends andmembers/single/profile.phpfor non-friends. See this function:
https://buddypress.trac.wordpress.org/browser/tags/2.9.2/src/bp-members/bp-members-template.php#L1397August 1, 2017 at 6:11 pm #267331In reply to: 2.9 Group description turncoated
Joost abrahams
Participant1. Which version of WordPress are you running?
4.8
2. Did you install WordPress as a directory or subdomain install?
directory
3. If a directory install, is it in root or in a subdirectory?
root
4. Did you upgrade from a previous version of WordPress? If so, from which version?
No
5. Was WordPress functioning properly before installing/upgrading BuddyPress (BP)? e.g. permalinks, creating a new post, commenting.
Yes
6. Which version of BP are you running?
2.9
7. Did you upgraded from a previous version of BP? If so, from which version?
2.8.2
8. Do you have any plugins other than BuddyPress installed and activated? If so, which ones?
Ban Hammer: 2.6
bbPress: 2.6-rc-3
BP Blog Author Profile Link: 2.8.1
BP Idea Stream: 1.0.1
BP XProfile WordPress User Sync: 0.6.4
BuddyDrive: 2.1.1
BuddyPress: 2.9.0
BuddyPress Docs: 1.9.4
BuddyPress Edit Activity: 1.0.8
BuddyPress Groups Extras: 3.6.9.1
Co-Authors Plus: 3.2.2
Jetpack by WordPress.com: 5.1
JetPack Non-Admin Removal: 3.0
Login Site Icon: 1.0
Mantablog bp register text: 0.1
Mantablog bp remove rss: 0.1
Mantablog Custom Profile: 0.1
Mantablog meta desc homepage: 0.1
MediaPress: 1.1.6
Registration Honeypot: 1.1.0-alpha-1
SEO – Remove H1: 1.0.2
TablePress: 1.8
TinyMCE Advanced: 4.6.3
WP Idea Stream: 2.4.0
WP Revisions Control: 1.2.1
WP Sitemap Page: 1.69. Are you using the standard WordPress theme or customized theme?
standard WordPress theme
10. Which theme do you use ?
Generatepress
11. Have you modified the core files in any way?
No
12. Do you have any custom functions in bp-custom.php?
No
13. If running bbPress, which version? Or did your BuddyPress install come with a copy of bbPress built-in?
2.6rc3
14. Please provide a list of any errors in your server’s log files.
15. Which company provides your hosting?
16. Is your server running Windows, or if Linux; Apache, nginx or something else?
Linux; Apache
July 28, 2017 at 12:30 am #267240Eric Thomas Weber
ParticipantHi! I did follow the documentation. You’re right that those two pages work. Both of those pages use a certain template within the theme. That template uses a full-width page, without the sidebar and search bar that are on other pages. I’ve a few things to see what can remedy the matter:
1) Yes, I switched to a different template to test, and yes, on the 2016 template, BP works, so I don’t need to reinstall BP or get it working on its own. That part is working. I didn’t realize I’d have to reset all of my widgets and stuff. Fortunately, they weren’t deleted… Got those set up again.
2) I tried making all other relevant pages, creating pages for the stuff that BP uses, and setting each of those to use the template that works for Activity, Members, and Chapters. That didn’t work, though.
3) I tried creating a Custom CSS entry that uses the .buddypress class, telling it to use full-width for #primary. That made the page use full-width, but it didn’t make the functionality of BP work… Like on this page:
https://www.philosophersinamerica.com/chapters/create/step/group-details/Please help! I’ve reached out to my theme’s creator – and there’s no changing to a different theme. We’re super committed and it works really well for everything else, and he’s had no experience using BuddyPress. I need help! This is just the plugin I’ve been looking for to help my people create groups that they need to manage.
It seems to me that if we’re able to get some of the pages to work there’s GOT to be a way to get other relevant pages to use whatever that same setting is to work also. Any help would be hugely appreciated.
Best,Eric
June 28, 2017 at 1:01 pm #266747xavi3r12
ParticipantI have tried that it still returned the same error, however i have just noticed that if i delete my bp-custom.php everything works fine but my pages does not redirect users to there profile “if logged in” which was the purpose of the bp-custom.php file. This in the code in my bp-custom.php file
<?php // hacks and mods will go here /* Redirects to profile upon login */ add_action('login_form', 'redirect_after_login'); function redirect_after_login() { global $redirect_to; if (!isset($_GET['redirect_to'])) { $redirect_to = get_option('activity'); // sample-page = your page name after site_url } } function bp_help_redirect_to_profile(){ global $bp; if( is_user_logged_in() && bp_is_front_page() ) bp_core_redirect( get_option('home') . '/members/' . bp_core_get_username( bp_loggedin_user_id() ) . '/activity' ); } add_action( 'get_header', 'bp_help_redirect_to_profile',1); add_action('wp_logout','go_home'); function go_home(){ wp_redirect( home_url() ); exit(); } add_action( 'bp_complete_signup', 'buddydev_redirect_after_signup' ); function buddydev_redirect_after_signup() { $page = wp_redirect( get_option('siteurl') . '/profile' ); bp_core_redirect( site_url( $page ) ); } ?>So how do i fix this?? I need help Please
May 31, 2017 at 7:11 pm #266220shirleyddsn
ParticipantAnother Update:
Ok, I was finally able to create a change in the file I was trying to edit. For some reason, I wasn’t able to insert code in the exact place I was trying to last time, but I WAS able to add code elsewhere in the document.
Also, I noticed the name of the hook started with “bp”, so I moved my cover-image code to my bp-custom.php file in my child theme. But it didn’t work there either. I feel like there’s something else I’m supposed to do with
$settings['callback']. Or maybe I’m supposed to plug some more code in elsewhere. I could really use some help with this.Also, while playing with the profile templates, I noticed there were a few hooks (which I’m learning are the ‘actions’ I’m adding to) that don’t really seem to do anything but sit there. Do they exist only for me to add code to through my bp-custom.php? If so, why wouldn’t I just hard-code something into the template file?
For example:
do_action( 'bp_member_header_actions' );sits between the @username andlast-activity. But it’s empty. When the profile page loads, there’s nothing there. So that would make it an empty hook for me to plug stuff into, right?bp_profile_header_metais also empty. Are all hooks like that? Or do any of them have their own code/functions?I would still like to know where these actions are declared, and what possible functions lie inside them. Is there any way to find that information out? People create their own BP themes and plugins all the time so there has to be a way to figure this stuff out . . .
April 30, 2017 at 12:42 pm #265734In reply to: Custom Post Type Tracking
Nahum
Participantwell I was trying post the my code, but I think I spammed myself after trying to edit the reply to this …
CPT (and custom title thing)add_action('init', 'video_register_my_cpt'); function video_register_my_cpt() { register_post_type('video', array( 'label' => 'Videos', 'description' => 'Latest Videos', 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'menu_position' => 5, 'show_in_nav_menus' => false, 'capability_type' => 'post', 'hierarchical' => false, 'rewrite' => array('slug' => 'videos'), 'query_var' => true, 'has_archive' => true, 'exclude_from_search' => false, 'supports' => array('title','editor','excerpt','trackbacks','custom-fields','comments','revisions','thumbnail','author','page-attributes','buddypress-activity'), 'bp_activity' => array( 'component_id' => buddypress()->blogs->id, 'action_id' => 'new_video', 'format_callback' => 'bp_blogs_format_activity_action_new_blog_post', 'comment_action_id' => 'new_video_comment', 'comment_format_callback' => 'bp_activity_format_activity_action_custom_post_type_comment', 'contexts' => array( 'activity', 'member' ), 'position' => 40, ), 'taxonomies' => array('video_category','video_tag'), 'labels' => array( 'name' => 'Videos', 'singular_name' => 'Video', 'menu_name' => 'Videos', 'add_new' => 'Add Video', 'add_new_item' => 'Add New Video', 'edit' => 'Edit', 'edit_item' => 'Edit Video', 'new_item' => 'New Video', 'view' => 'View Video', 'view_item' => 'View Video', 'search_items' => 'Search Videos', 'not_found' => 'No Videos Found', 'not_found_in_trash' => 'No Videos Found in Trash', 'bp_activity_admin_filter' => __( 'New video published', 'custom-domain' ), 'bp_activity_front_filter' => __( 'Videos', 'custom-domain' ), 'bp_activity_new_post' => __( '%1$s added <a href="%2$s">[Video]</a>', 'custom-domain' ), 'bp_activity_new_post_ms' => __( '%1$s added <a href="%2$s">[Video]</a>','custom-domain' ), 'bp_activity_comments_admin_filter' => __( 'Comments about video', 'custom-domain' ), // label for the Admin dropdown filter 'bp_activity_comments_front_filter' => __( 'Video Comments', 'custom-domain' ), // label for the Front dropdown filter 'bp_activity_new_comment' => __( '%1$s commented on a <a href="%2$s">video</a>', 'custom-domain' ), 'bp_activity_new_comment_ms' => __( '%1$s commented on a <a href="%2$s">[Video]</a>, on the site %3$s', 'custom-domain' ) ) ) ); } function my_video_include_post_type_title( $action, $activity ) { if ( empty( $activity->id ) ) { return $action; } if ( 'new_video' != $activity->type && 'new_video_comment' !=$activity->type ) { return $action; } preg_match_all( '/<a.*?>([^>]*)<\/a>/', $action, $matches ); if ( empty( $matches[1][1] ) || '[Video]' != $matches[1][1] ) { return $action; } $post_type_title = bp_activity_get_meta( $activity->id, 'post_title' ); if ( empty( $post_type_title ) ) { switch_to_blog( $activity->item_id ); $post_type_title = get_post_field( 'post_title', $activity->secondary_item_id ); // We have a title save it in activity meta to avoid switching blogs too much if ( ! empty( $post_type_title ) ) { bp_activity_update_meta( $activity->id, 'post_title', $post_type_title ); } restore_current_blog(); } return str_replace( $matches[1][1], esc_html( $post_type_title ), $action ); } add_filter( 'bp_activity_custom_post_type_post_action', 'my_video_include_post_type_title', 10, 2 );BP CUSTOM
/*////////////////////////////////////////////////////////////////////////////////////////////*/ // Modifying CPT Activity Actions /*///////////////////////////////////////////////////////////////////////////////////////////*/ function record_blogpost_activity_action( $activity_action, $post, $post_permalink ) { global $bp; if( $post->post_type == 'jobs' || get_post_type($post->ID) == 'jobs' ) { $activity_action = sprintf( __( '%1$s', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>'); } elseif( $post->post_type == 'video' || get_post_type($post->ID) == 'video' ) { $activity_action = sprintf( __( '%1$s posted a video', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' ); } elseif($post->post_type == 'post' ) { $activity_action = sprintf( __( '%1$s posted a blog', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' ); } return $activity_action; } add_filter('bp_blogs_activity_new_post_action', 'record_blogpost_activity_action', 11, 3); /*////////////////////////////////////////////////////////////////////////////////////////////*/ // Modifying CPT Comment Activity Actions /*///////////////////////////////////////////////////////////////////////////////////////////*/ function comment_activity_action( $activity_action, $post, $post_permalink ) { global $bp; if( $post->post_type == 'post' ) { $activity_action = sprintf( __( '%1$s commented on %2$s', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' ); } elseif( $post->post_type == 'video' || get_post_type($post->ID) == 'video' ) { $activity_action = sprintf( __( '%1$s replied on the video %2$s', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . esc_url( $post_permalink ). '">' . $post->post_title . '</a>' ); } return $activity_action; } add_filter('bp_blogs_activity_new_comment_action', 'comment_activity_action', 11, 3); /*//// ? /////*/ function bbg_record_video_post_type_comments( $post_types ) { $post_types[] = 'video'; return $post_types; } //add_filter( 'bp_blogs_record_post_post_types', 'bbg_record_video_post_type_comments' ); //add_filter( 'bp_blogs_record_comment_post_types', 'bbg_record_video_post_type_comments' );doing it this way, everything works except my custom comment action.
February 22, 2017 at 4:54 am #264030In reply to: Display activity of a specific group
danbp
ParticipantHi,
you have to use a group_id and to ensure you’re in an appropriate loop (activity or group)
To get a group id, you can for ex. do:
// check for a group ID if( bp_has_groups() ) { // Grab current group ID bp_the_group(); $group_id = bp_get_group_ID(); } // apply our changes only to this group ID's // conditionnal action if ( $group_id == 22 OR $group_id == 8 ) {… and so on!
You may also use bp_parse_args, depending where you use your custom work. In other words, you can create a complete new activity loop on a distinct page template for only one group.
February 16, 2017 at 10:54 pm #263856In reply to: Some questions regarding buddypress
r-a-y
Keymaster- Site Tracking – The description on the Settings page says it all – “Record activity for new posts and comments from your site.“. This is useful if the Activity Streams component is also active.
- Login Widget – Not sure why you want extra tabs for a login widget… if you need extra functionality, you can always add your own widget if you have some coding ability.
- Profile photo by URL or user-selectable profile photo – This isn’t a core option. Would have to be a custom plugin for now.
- Mini-blog – No core option, unless a user’s activity stream is enough. There are plugins out there like BuddyBlog that offer some frontend blogging functionality.
- Disabling emails – I think putting the desired email in draft mode might be sufficient to disable email sending. Test and see what happens!
February 8, 2017 at 12:06 pm #263616In reply to: add subnav to activity
kalughodakiya
ParticipantJust add sub nav using bp_core_new_subnav_item and modify file activity.php just put your code before if ( is_user_logged_in() && bp_is_my_profile() && ( !bp_current_action() || bp_is_current_action( ‘just-me’ ) ) )
bp_get_template_part( ‘activity/post-form’ );with if condition like
if(is_user_logged_in() && bp_is_my_profile() && bp_is_current_action( ‘schedule_message’ )){
get_template_part( ‘custom_files/schedule_message’ );if current action is you tab slug then load you page template otherwise default
January 10, 2017 at 2:00 pm #262699In reply to: how display content in submenu?
luisa227
ParticipantSimple. I want to make functional code
My actual code is:
function bpfr_custom_profile_sub_nav() { global $bp; $parent_slug = 'activity'; //Add subnav item bp_core_new_subnav_item( array( 'name' => __( 'Swap' ), 'slug' => 'swap', 'parent_url' => $bp->displayed_user->domain . $parent_slug.'/', 'parent_slug' => $parent_slug, 'screen_function' => 'swapluisa', 'position' => 1, ) ); } add_action( 'bp_setup_nav', 'bpfr_custom_profile_sub_nav' ); function swapluisa() { add_action( 'bp_template_title', 'my_groups_page_function_to_show_screen_title' ); add_action( 'bp_template_content', 'my_groups_page_function_to_show_screen_content' ); } add_action( 'bp_setup_nav', 'my_bp_nav_adder', 50 ); function my_groups_page_function_to_show_screen_content() { return bp_get_template_part('members/single/swap'); // (OR THIS???) return bp_get_template_part('wp-content/themes/betheme-child/buddypress/members/single'); } function my_groups_page_function_to_show_screen_title() { echo 'My new Page Title'; } function luisa_register_template_location() { return 'members/single/'; // (OR THIS????) return 'members/single/';wp-content/themes/betheme-child/buddypress/members/single' } function luisa_template_start() { if( function_exists( 'bp_register_template_stack' ) ) bp_register_template_stack( 'luisa_register_template_location' ); } add_action( 'bp_init', 'luisa_template_start' );but dont’work!
I repeat, surely accidentally pointing to the folder, I can not figure out the exact solution. when i write “OR THIS??” i try but don’t work.
where am I wrong? thanks
January 9, 2017 at 8:33 pm #262676In reply to: how display content in submenu?
luisa227
Participantsorry 🙁 i don’t know!!!
I seem to do correctly, but does not work.
I also for testing entered my files everywhere, but does not find it anywhere !!!In my web-site the URL is
http://mysite.it/membri/testmember1/activity/swap/but it says “We are sorry, but the page you are looking for does not exist.”I have my swap.php (into there’s only a echo command)’s file in
wp-content/themes/child-theme/buddypress/members/single/
and inbp-custom.php(that is in my plugin folder) I writefunction my_groups_page_function_to_show_screen_content() { bp_get_template_part('members/single/swap'); } function luisa_register_template_location() { return 'wp-content/themes/betheme-child/buddypress/members/single'; }I try also to put the swap.php file into
wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/singlebut nothing is happen.where am I wrong? thanks
January 8, 2017 at 11:51 pm #262639In reply to: BuddyPress Enhancements and Tweaks
djsteveb
Participantdisclaimer, I am not a bp dev, just a long time user, and my knowledge is far from complete.
1 -each Profile / Member offered a separate gallery or media library?
This was a problem from the very beginning, and perhaps the biggest problem for bp aside from lousy filter options for the activity stream. Initially it was handled by the ‘bp-album’ plugin – which was later abandoned amidst some drama – rtmedia is kind of the standard for handling this now – but it’s bloated, important functions have gotten expensive, and it’s not well supported in core or themes – it’s terrible at keeping things separated like comments on media and galleries –
There is a new bp media like experimental thing that looks promising, and some attempts at making placeholders for bp media have been made in the past year, new hooks for bp attachment, etc. Some code has appeared on github showing a great start at possible core bp media handling – but not enough devs on that.if you must have media with bp I suggest getting the premium “press permit core” and ask for support in limiting what other users can see in the media library. God forbid you have a problem with users trolling other users – and you have media – as you can purchase the buddyblock plugin which will prevent most abuse user to user, but it does not hook into the separate commenting system that rt-media creates. I strongly encourage you to try the other media plugin and hope that works for what you need before getting stuck with rtmedia and no way to export it’s data to something else.
2 a cap on how many Mb’s a user is allowed to upload for the total amount of media space
Wordpress has a setting for this when using multi-site setup – but I think it affects only what gets posted to the user blogs aka sites. I think rtmedia has an optional purchase-able plugin for this if you use their system to allow for the media uploads – not sure if the other competing system has such functionality.This is a problem, and a solution should include a way for admins to look at users who have uploaded media, not just by user and space taken up, but also by date. There should be more control for deleting content with various parameters as well. I pity you if you find one day a user has uploaded 100s of photos that violate… terms.. and you have to delete each one at a time. If you find a way to handle this better with rtmedia I’d love for you to share it.
Currently I have tons of photos and videos that users have uploaded and no good way to look at or remove, aside from going profile to profile and manually checking what shows up there. A better way may exist, I have not found it yet.
3 – Why do all members have to be Authors in order to be able to Post because this was the only method that worked for me.
When you say post, that sounds like posting a post to a blog – either their own multi-site blog, or perhaps to a group blog. This is how worpdress is and is great for controlling things with blogs. If you mean a user needs to be an author in order to add to thier “activity stream” aka wall or profile or whatever, I do not think they need to be a blog author in order to do so… “What’s new” activity posts work fine without being a blog author.4 – BuddyPress and BB Press how should I set up my .htaccess file – this should be documented somewhere around here. Wish I could tell you, I don’t have any bb press running with any buddypress installs any longer.
If you don’t want robots to crawl your site, search for forums for making buddypress private – you’ll want to lock down your site with a password required to view anything – if you really want to block bots.. if it’s just the nicer bots you are referring to, like googlebot, yahoo and bigbots – then you can setup a robots.txt with something like
robots *
disallow /
allow index.phpbut I don’t think having the main engines index your index.php is really helpful with most WP themes.. you’d probably be better with “allow /about-us/” for example.. as most wp sites I’ve worked with dont have a good ol’ index.html
your experiences may vary..
With BP you eaither have lots of time to code, or you take everything as is for the most part. Auttomatic has not funded bp well since the first dev Andy left – it’s basically abandoned like unwanted bastard child that gets (almost) no support – and has been for years. Instead depending mainly on volunteer contributors that obviously have to do other things like earn a living and pay bills.
Some great people do amazing things making bp better – I appreciate those that are making the documentation better and fighting the good fight of dealing with all the wp core changes and how they affect bp when it updates – and other work to make it better. However what is seemingly most important to many webmasters and end users may not be on the roadmap for future releases – and finding developers to mod up BP is not as easy as one may hope either.
custom fixes today may well be broken with future updates, and no one has thought about the laws in Europe for privacy and users being able to export data you have them.. all kinds of things..
consider bp a huge mix of free code that is very experimental, and in my humble opinion should be removed from the wp plugin repo if automattic is not going to fund it properly – it certainly should not be on the first page view of plugins – anyone installing it likely has no idea what can of worms they are getting into.
If you are thinking of the future and how you may need to moderate user’s uploads and such, I strongly encourage you to test out the mediapress alternative – but realize in order to get core functionality with bp right now you will have to add on a walled garden from one place or another.. without any import / export options – before you invest too much of your time and your user’s pictures and videos into silos you may never escape, you right as well look into and test out peepso (https://www.peepso.com )- as they seem to have more skin in the game and have made at least some import / export things if I remember correctly.
again, I am not a bp dev. also I have not used mediapress yet – although I would with a fresh install – rtmedia has not met my expectations, although not a total fail, it is only 60% of what it should be. I have not used peepso yet either. Just a guy that’s been running a few bp installs for a few years, and my knowledge is fuzzy at best. surely @ma.tt, others thoughts, and your mileage may vary.
-
AuthorSearch Results
