Search Results for 'custom activity page'
-
AuthorSearch Results
-
October 18, 2013 at 10:52 am #173050
In reply to: Linking user avatar to user profile page
binutzParticipantThank you for the response. I created a file named bp-custom.php in the plugin folder and added the code specified above into it. Unfortunately,it didn’t work!
However,it works when I add the same code into wp-config.php file.
Only issue that I find with this method is that it always redirects the logged in users to profile page bypassing the activity update. I would like to be redirected to activity updates after loging in. All I need is to show up the profile page when the profile avatar or the user name is clicked ,in the Members page. Can it be done anyway?October 15, 2013 at 8:36 pm #172893In reply to: Activity Stream post voting/sorting
danbpParticipantBP has no post, it’s WP. đ
BP has no rating system, so you need to create it first or use a rating plugin for the blog posts. And probably the votes won’t show up in the activities. I’m afraid that what you want will need some custom coding. đCan’t help you more, but here are some usefull resource.
The codex Activity Loop page.
Some advice to modify the Activity
A detailed tutorial, by @imath
A configurable activity widget
October 6, 2013 at 4:39 pm #172370In reply to: [Resolved] How to redirect bp users to activity page
bp-helpParticipant@tse11
Patience please! Deactivate the plugin you was using for redirecting and try this in bp-custom.php https://codex.buddypress.org/plugin-development/bp-custom-php/ :function bphelp_redirect() { if( is_user_logged_in() && is_super_admin && is_home) { // redirect to dashboard code bp_core_redirect( get_option( 'home' ) . '/wp-admin/' ); }else { if( is_user_loggedin() && !is_super_admin && is_home) { // redirect to activity code bp_core_redirect( get_option( 'home' ) . '/activity/' ); } } } add_action( 'template_redirect', 'bphelp_redirect', 1 );
October 6, 2013 at 8:37 am #172365In reply to: [Resolved] How to redirect bp users to activity page
bp-helpParticipant@tse11
Search the forum. This has been covered before! You could create a conditional to do this. Basically an if and else statement. You would need to include is_super_admin in the conditional check and the user would be redirected appropriately. For instance:function bphelp_redirect() { if( is_user_logged_in() && is_super_admin ) { // redirect to dashboard code }else { if( is_user_loggedin() && !is_super_admin ) { // redirect to activity code } } } add_action( 'template_redirect', 'bphelp_redirect', 1 );
This would go in bp-custom.php:
https://codex.buddypress.org/plugin-development/bp-custom-php/September 20, 2013 at 4:10 am #171569geoffreysfParticipantPutting this in the functions or bp-custom.php files did not work.
I finally managed to get the admin and any other user excluded from the members directory by modifying the bp_had_members query that was already in my members-loop.php file.
<?php if ( bp_has_members( bp_ajax_querystring( ‘members’ ).’&exclude=1,3,25′ . ‘&type=alphabetical&per_page=30’ ) ) : ?> <!– &exclude= user_ids of the people you want to exclude –>
By adding just this, it also removed the users from the total members count.
Note: I do not use friends or activity feeds on my site, so I have no idea if it hides from them, but I suppose it wouldn’t.
I have been looking high and low for the answer to this with my limited PHP knowledge… and wanted to share it back so other people could learn from it too.
And credit where it is due, this post led me to the answer.
https://buddypress.org/support/topic/member-parameters-not-working-with-bp_ajax_querystring/September 7, 2013 at 11:30 am #170989In reply to: Member counter on activity page not working
danbpParticipanthi @joesell89,
first, remove this wrong
add_filter( 'bp_get_total_member_count', 'bp_core_get_total_member_count' )
;
from your bp-custom.php. Correct references are in this file: bp-core-template.phpSee if things went well.
Pay attention to the cotes. In your example this line has another typo as the the one used for the function.
The mySql errors are due to mailchimp and wp slim stats plugins. Control first the slim stats settings or search for this problem on the plugin support forum.
Debug by deactivating both, and check if the errors remain.September 5, 2013 at 3:16 am #170864hornets2002ParticipantI need this too.
I used to customize my member profile pages using the legacy template file, “profile.php”.
Now I’m flummoxed as to how I should proceed applying the same modifications in 1.8.
August 27, 2013 at 1:57 am #170488In reply to: two page home page?
bp-helpParticipant@villnoweric
Just remove Home from the menu, then add activity to your custom menu. Then change the navigational label to “Activity Feed” or whatever you wish!August 27, 2013 at 1:05 am #170484In reply to: two page home page?
bp-helpParticipant@villnoweric
Try this it is a slightly modified snippet I did earlier but fits your requirement. Follow the instructions in the code.`
// PLEASE NOTE FOR THIS TO WORK:
// Before adding this code to bp-custom.php
// https://codex.buddypress.org/developer/customizing/bp-custom-php/
// you will need to create a new page in the dashboard and name it
// something like “Dummy Page” for example or any name you choose.
// Do not add this page to your menu because it is just a dummy page
// for the redirect. Then go to Dashboard/Settings/Reading.
// Under “Front page displays” select “A static page.” Then use the
// “Front page” drop-down menu to select the page you created. In my
// example for instance I selected “Dummy Page” for my front page.
// Done! Now logged out visitors get redirected to the register page,
// and logged in users get redirected to the activity stream./* Redirects to profile upon login, and logged out users are redirected to register page */
function bp_help_redirect_to_profile(){
if( is_user_logged_in() && bp_is_front_page() ) {
bp_core_redirect( get_option( ‘home’ ) . ‘/activity/’ );}else {
if ( !is_user_logged_in() && !bp_is_register_page() && !bp_is_activation_page() )
bp_core_redirect( get_option( ‘home’ ) . ‘/register/’ );
}
}add_action( ‘get_header’, ‘bp_help_redirect_to_profile’,1 );
`August 22, 2013 at 4:06 pm #170240In reply to: Use a BP legacy template in a child theme
yannlossouarnParticipantHello,
In fact I’d like to have two distinct behaviours for people who visit http://fablab-lannion.org home page :
– simple visitors should show the carrousel
– logged-in users should show a personal, customized view, that would notably contain a filtered activity flow that concern them.Is that more clear ?
August 19, 2013 at 8:05 pm #170064neo-tronicParticipantI should have updated this thread ages ago. Yes, I have long had custom post types showing up in my activity stream and it is pretty rock solid.
I use this snippet (which I found someplace but donât know where) and add it to bp-custom.php, which is a file you create in your plugins folder.
The snippet is currently written for MarketPress products, however, you can use it to support any custom post type. Edit the four things below to modify for your custom post type.
– Edit the function name to whatever you want, it just needs to be unique,
– Line 19 to be the the custom post type you want to use;
– Line 28 to reflect the activity record text you want,
– Line 62 to reflect the name of the function you created for your CPTIâm currently using about 7 different edits of it to support that many different CPTs in the activity stream and it works great. Yes, it works in BP 1.7
I’ve added this to my bp-custom.php file and get an error on the following Sektion. Can anyone help please? ( @prometheus-fire ? )
bp_blogs_record_activity( array( 'user_id' => (int)$post->post_author, 'action' => apply_filters( 'bp_blogs_activity_new_post_action', $activity_action, &$post, $post_permalink ), 'content' => apply_filters( 'bp_blogs_activity_new_post_content', $activity_content, &$post, $post_permalink ), 'primary_link' => apply_filters( 'bp_blogs_activity_new_post_primary_link', $post_permalink, $post_id ), 'type' => 'new_blog_post', 'item_id' => $blog_id, 'secondary_item_id' => $post_id, 'recorded_time' => $post->post_modified_gmt
Here the error message: Fatal error: Call-time pass-by-reference has been removed; If you would like to pass argument by reference, modify the declaration of apply_filters(). in /homepages/39/d415915588/htdocs/wp-content/plugins/bp-custom.php on line 35
August 14, 2013 at 7:31 pm #169857Siddharth PereiraParticipantOK. So i found a partial solution.
I tried adding the below pasted snippet to my bp-custom.php file inside my plugin folder and it worked for the activity page. I dont want to sound like a complete noob but can someone tell me how do i replicate this for the members and group page?
I tried variations of the code to support _groups_component and _members_component but that didnt work.
/* Prevent logged out users from accessing bp activity page */
function nonreg_visitor_redirect() {
global $bp;
if ( bp_is_activity_component() ) {
if(!is_user_logged_in()) { //just a visitor and not logged in
wp_redirect( get_option(‘siteurl’) . ‘/wp-login.php’ );
}
}
}
add_filter(‘get_header’,’nonreg_visitor_redirect’,1);August 6, 2013 at 1:44 pm #169445In reply to: Member counter on activity page not working
Anonymous User 7600456Inactive1. Which version of WordPress are you running? – 3.6 (but the problem was there before upgrading from 3.5.2)
2. Did you install WordPress as a directory or subdomain install? – N/A
3. If a directory install, is it in root or in a subdirectory? – N/A
4. Did you upgrade from a previous version of WordPress? If so, from which version? – 3.5.2
5. Was WordPress functioning properly before installing/upgrading BuddyPress (BP)? e.g. permalinks, creating a new post, commenting. – N/A
6. Which version of BP are you running? – 1.8.1
7. Did you upgraded from a previous version of BP? If so, from which version? – 1.8
8. Do you have any plugins other than BuddyPress installed and activated? If so, which ones? – Many but I have tried disabling them all except Buddypress and the problem is still there.
9. Are you using the standard BuddyPress themes or customized themes? – Customised theme but problem is persistent even with Twenty Twelve theme.
10. Have you modified the core files in any way? – No
11. Do you have any custom functions in bp-custom.php?
<?php // hacks and mods will go here function activity_publish_custom_post_types($cpts) { $cpts[] = 'page'; $cpts[] = 'attachment'; return $cpts; } add_filter ( 'bp_blogs_record_post_post_types', 'activity_publish_custom_post_types' ); add_filter ( 'bp_blogs_record_comment_post_types', 'activity_publish_custom_post_types' ); add_filter( âbp_get_total_member_countâ, âbp_core_get_total_member_countâ ); ?>
12. If running bbPress, which version? Or did your BuddyPress install come with a copy of bbPress built-in? – 2.3.2
13. Please provide a list of any errors in your serverâs log files.
text/x-generic error_log ASCII English text, with very long lines [31-Jul-2013 23:00:48 UTC] WordPress database error 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 'WHERE meta_key = 'entry_id' AND meta_value = '211'' at line 1 for query SELECT site_id FROM WHERE meta_key = 'entry_id' AND meta_value = '211' made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array, call_user_func_array, GFPMoreStripe::parse_request, GFPMoreStripe::cancel_subscription, do_action('gform_subscription_canceled'), call_user_func_array, GFPMoreStripe::downgrade_stripe_user, GFUserData::get_site_by_entry_id [01-Aug-2013 04:22:39 UTC] wpMandrill Error: Error : [01-Aug-2013 04:22:39 UTC] 2013-08-01 04:22:39 wpMandrill::sendEmail: Exception Caught => Invalid API Key [01-Aug-2013 04:22:39 UTC] blah@blah.com ([blah blah] Password Reset) [01-Aug-2013 16:08:26 UTC] WordPress database error 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 'WHERE meta_key = 'entry_id' AND meta_value = '217'' at line 1 for query SELECT site_id FROM WHERE meta_key = 'entry_id' AND meta_value = '217' made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array, call_user_func_array, GFPMoreStripe::parse_request, GFPMoreStripe::cancel_subscription, do_action('gform_subscription_canceled'), call_user_func_array, GFPMoreStripe::downgrade_stripe_user, GFUserData::get_site_by_entry_id [02-Aug-2013 13:43:45 UTC] wpMandrill Error: Error : [02-Aug-2013 13:43:45 UTC] 2013-08-02 13:43:45 wpMandrill::sendEmail: Exception Caught => Invalid API Key [02-Aug-2013 13:43:45 UTC] wpMandrill::wp_mail_native: blah@blah.net ([blah blah] First Order) [02-Aug-2013 17:07:36 UTC] wpMandrill Error: Error : [02-Aug-2013 17:07:36 UTC] 2013-08-02 17:07:36 wpMandrill::sendEmail: Exception Caught => Invalid API Key [02-Aug-2013 17:07:36 UTC] wpMandrill::wp_mail_native: blah@blah.net ([blah blah] First Order) [02-Aug-2013 21:57:15 UTC] wpMandrill Error: Error : [02-Aug-2013 21:57:15 UTC] 2013-08-02 21:57:15 wpMandrill::sendEmail: Exception Caught => Invalid API Key [02-Aug-2013 21:57:15 UTC] wpMandrill::wp_mail_native: blah@blah.com (Welcome to blahblah!) [06-Aug-2013 03:54:52 UTC] WordPress database error 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 'WHERE meta_key = 'entry_id' AND meta_value = '265'' at line 1 for query SELECT site_id FROM WHERE meta_key = 'entry_id' AND meta_value = '265' made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array, call_user_func_array, GFPMoreStripe::parse_request, GFPMoreStripe::cancel_subscription, do_action('gform_subscription_canceled'), call_user_func_array, GFPMoreStripe::downgrade_stripe_user, GFUserData::get_site_by_entry_id [06-Aug-2013 13:23:34 UTC] WordPress database error Unknown column '$autopurge_interval' in 'where clause' for query DELETE ts FROM wp_slim_stats ts WHERE ts.dt < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL $autopurge_interval DAY)) made by do_action_ref_array, call_user_func_array, wp_slimstat::wp_slimstat_purge
14. Which company provides your hosting? – OVH.com
15. Is your server running Windows, or if Linux; Apache, nginx or something else? – Apache
Thank you @mercime for your reply. I have disabled all plugins and used a fresh Twenty Twelve them and the problem is still there. Thanks in advance.
August 1, 2013 at 9:10 am #169202Roger CoathupParticipantYou shouldn’t be using Genesis Connect with current versions of BuddyPress.
From the Genesis Connect developer:
As of BP 1.7 you do not need to have GenesisConnect. We are currently maintaining it for customers who had BP installs prior to BP 1.7.
July 24, 2013 at 1:37 pm #168727In reply to: [Resolved] jQuery Easing Plugin Error
javiercentenoParticipantProblem solved. There was a conflict with other js libraries so I removed them and used only the ones that come with the default BuddyPress theme.
Now I have a separate issue where the Activity feed is not filtering when I select a filter. It works well in the Groups or Members page but not in the main “activity” page (or in my case “Newsfeed”). I’m going through each page in my custom theme and comparing it to the default theme to make sure I didn’t forget to include something. Hopefully I’ll figure it out soon!
July 24, 2013 at 4:15 am #168681In reply to: Activity Streams in Page and Groups
@mercimeParticipant@rayela open up your own text editor – NotePad on PC or TextMate on Mac.
– File > New
– Add the content per what I posted above
– File > Save As – bp-custom.php (note select All Files in dropdown)
– Upload bp-custom.php via FTP/cpanel to where I noted it aboveJuly 24, 2013 at 12:09 am #168671In reply to: Activity Streams in Page and Groups
@mercimeParticipant@rayela You create a file bp-custom.php and include the code there – make sure there’s no line or space above or beside opening <?
Then you upload that file from computer into your server wp-content/plugins/ folder via FTP or cpanel
July 23, 2013 at 11:51 pm #168670In reply to: Activity Streams in Page and Groups
Rachel BielParticipant@hnla, since you have been patient with me so far, Hugo, can you help me with my initial question of the Activity streams? I found the following and made notes in my forum help area on my site:
I want to disable replies on the Activity Streams because they do not carry through to the original post in the Group Forums.
My notes on how to do this:
Post on why this is confusing: http://commonsinabox.org/groups/help-support/forum/topic/your-members-might-be-confused-activity-stream-comment-vs-group-forum-reply/
Discussion about this on GitHub: https://github.com/cuny-academic-commons/commons-in-a-box/issues/73
Solution by boonebgorges (one of the BuddyPress authors):
Putting this line in your functions.php or bp-custom.php file will disable all activity stream commenting:add_filter( âbp_activity_can_commentâ, â__return_falseâ );
Note on bp-custom.php file:
Creating your filebp-custom.php does not exist by default. If you donât have a file located at /wp-content/plugins/bp-custom.php, go ahead and create a blank file with the following:
?
1
2
3
< ?php
// hacks and mods will go here
?>
Next, save the file as âbp-custom.phpâ and verify that this file is located at /wp-content/plugins/.Now, when you encounter a forum thread telling you to put a code snippet in bp-custom.php, youâll know what to do!
See: https://codex.buddypress.org/developer/customizing/bp-custom-php/Action:
How is this done? Do I go to my control panel and create a file there?July 5, 2013 at 9:32 am #167613In reply to: BP 1.7+ and later – Theme Compatibility Plans
valuserParticipantMany Thanks, Hugo.
After rechecking I am now down to just no sidebar control over activity page and group forums page. (though will need a little css tinkering which is no big deal) .
My resource to date is just https://codex.buddypress.org/theme-compatibility/ and this forum.
You say
Theme compatibility already provides for a custom bp version of page.php âbuddypress.phpâ in that you can specify named sidebars.
bit lost with that i’m afraid. It would be great if you could elaborate on that.
June 25, 2013 at 5:32 pm #166848In reply to: [Resolved] Adjusting Privacy Settings
bp-helpParticipant@bkypes
Try adding the below code to bp-custom.php if a logged out visitor tries to go to the activity page then they are redirected to login. For more info on bp-custom.php please see:
https://codex.buddypress.org/developer/customizing/bp-custom-php//* Prevent logged out users from accessing bp activity page */ function nonreg_visitor_redirect() { global $bp; if ( bp_is_activity_component() ) { if(!is_user_logged_in()) { //just a visitor and not logged in wp_redirect( get_option('siteurl') . '/wp-login.php' ); } } } add_filter('get_header','nonreg_visitor_redirect',1);
June 19, 2013 at 8:48 pm #166428In reply to: Hide Buddypress Profile based on Admin Field Value
dpetersParticipantWP Version: 3.5.1
BuddyPress: 1.7.2You want to âhideâ the profile page for a member who hasnât paid their dues?
What should happen if that page is accessed by that member or another member?
Redirect? Custom message page ?Either redirect to a listing of all active members or display an error page would be fine, (i.e. “This member is not currently an active member.”)
If âpaid duesâ is a boolean, then itâs easy to write a function.
Where is that boolean stored?It would be stored in their profile as an Admin-editable field, per the original post.
Does that member still appear on the Members page? In the Activity stream?
No to both. Hidden users would be able to login and update information but their profile wouldn’t be public-facing, just them and the admins.
This would be useful as we have staggered dues, allowing profiles to turn off/on.
June 19, 2013 at 8:41 pm #166426In reply to: Hide Buddypress Profile based on Admin Field Value
shanebpModeratorYou need to state which versions of WP & BP you use.
You want to ‘hide’ the profile page for a member who hasn’t paid their dues?
What should happen if that page is accessed by that member or another member?
Redirect? Custom message page ?If ‘paid dues’ is a boolean, then it’s easy to write a function.
Where is that boolean stored?Does that member still appear on the Members page? In the Activity stream?
iow. you need to be more specific about the behaviour that you want.
June 18, 2013 at 8:25 pm #166344In reply to: redirect to profile page?
bp-helpParticipant@famous
Try this just make sure you follow the instructions in the commented code. Place it in bp-custom.php :/* Redirects to profile upon login, and upon logout redirects to activity page unless changed */ function bp_help_redirect_to_profile(){ global $bp_unfiltered_uri; $bphelp_my_front_page = 'activity'; // WARNING: make sure you replace 'activity' in this line to the same thing you set dashboard/settings/reading front page to. if ( !is_user_logged_in() && ( $bp_unfiltered_uri[0] != $bphelp_my_front_page ) ) bp_core_redirect( get_option('home') ); elseif( is_user_logged_in() && ( $bp_unfiltered_uri[0] == $bphelp_my_front_page ) ) bp_core_redirect( get_option('home') . '/members/' . bp_core_get_username( bp_loggedin_user_id() ) . '/profile' ); } add_action( 'wp', 'bp_help_redirect_to_profile', 3 );
June 18, 2013 at 8:13 pm #166341In reply to: redirect to profile page?
bp-helpParticipant@famous
Try this just make sure you follow the instructions in the commented code. Place it in bp-custom.php :/* Redirects to profile upon login, and upon logout redirects to activity page unless changed in line 6 */ function bp_help_redirect_to_profile(){ global $bp_unfiltered_uri; $bphelp_my_home_page = 'activity'; // WARNING: make sure you replace 'activity' in this line to the same thing you set dashboard/settings/reading front page to. if ( !is_user_logged_in() && ( $bp_unfiltered_uri[0] != $bphelp_my_home_page ) ) bp_core_redirect( get_option('home') ); elseif( is_user_logged_in() && ( $bp_unfiltered_uri[0] == 'activity') ) bp_core_redirect( get_option('home') . '/members/' . bp_core_get_username( bp_loggedin_user_id() ) . '/profile' ); } add_action( 'wp', 'bp_help_redirect_to_profile', 3 );
June 18, 2013 at 3:16 pm #166287In reply to: [Resolved] BuddyBlog?
ldjautobodyParticipantYessssss! Thanks @andrewteg! I was seriously beginning to think I dreamed the whole thing up…not sure why I could not find this page, but that is EXACTLY where I was.
Now, since I have found what I was looking for, I’d really like to get some opinions of the plugin and see if this will actually do what I am planning for this site. I am open to all opinions and suggestions. My understanding of BuddyPress and bbPress is coming along and the site is starting to look like what I envisioned. You can see the preliminary site at http://accessories.ldjautobody.com.
First, let me explain what I have planned for this site and, like I said, I am open to all suggestions and comments. I would like to hear what the experts have to say. Good or bad, I need your opinions. You ALL have great ideas and I respect whatever you might have to say or add. đ
This blog and forum are dedicated to custom car and motorcycle enthusiasts everywhere. Car enthusiasts are passionate about their subject, and in addition to giving them a place to share their projects and discuss those among each other, I would also like to let them post some articles, hoping that the fresh content will keep the search engines hanging out on the site and help boost the rankings. I have never run a forum site or used BuddyPress or bbPress before and I’m not really sure how this all works in relation to SEO. I do, however, deal with car and motorcycle enthusiasts on a daily basis and I know that I can most likely count on them to get some very good discussions going among themselves and that is my hope for this site.
We will also be doing some affiliate marketing from this site, and my hope is that in a perfect World, the fresh content and activity level of the site will keep us ranking well in the search engines and bring some new customers to the site. Since we are an “auto body shop”, our normal advertising is concentrated in a very local area. The affiliate site, however, will have a much broader range and we will be advertising nationwide vs. the small local area that the body shop is limited to. So my hope is that the increased activity on the site will increase the number of people visiting and also help us reach out well beyond our local area. At least, that is our goal for now!
Thank you all again for all of your help. I am looking forward to hearing anything my experts have to add as we move forward with getting the site ready to launch. đ
Denise
-
AuthorSearch Results