Search Results for 'custom activity page'
-
Search Results
-
Under certain circumstances, there is an infinite loop inside the
bp_legacy_theme_new_activity_comment()
function. Specifically, when all of thesecondary_item_id
fields are zero, the$parent_id
will continually be set to zero. An infinite loop ensues and eventually the script will time out. This causes new activity items to not display until the page is refreshed, as mentioned here: https://buddypress.org/support/topic/activity-comments-post-blank-until-refresh/.This error happens when attempting to add a comment to a group post. I believe this is a similar problem as the one expressed here: https://buddypress.org/support/topic/activity-comments-post-blank-until-refresh/
For information:
- WordPress
4.5.3
- BuddyPress
2.6.1.1
- Single site install in web root
- There are indeed other plugins activated on this site. The full list is below. This site is for a client, and I’m unsure of which plugins can be safely deactivated to test.
- We’re using a customized theme, but I have tested with the TwentySixteen theme and found the same results.
- The core BuddyPress files have not been modified to my knowledge.
- The site is hosted on Page.ly, but I can reproduce the problems in a local VVV install
- The live site is http://www.lifeofdad.com/
I believe that this may be a problem inside BuddyPress itself, as the function with the infinite loop is part of BuddyPress. The Javascript that makes the Ajax request is part of the BuddyPress Wall plugin, but from what I can tell the problem is in the aforementioned
bp_legacy_theme_new_activity_comment()
function.My specific concern is this loop:
// Load the new activity item into the $activities_template global. bp_has_activities( 'display_comments=stream&hide_spam=false&show_hidden=true&include=' . $comment_id ); // Swap the current comment with the activity item we just loaded. if ( isset( $activities_template->activities[0] ) ) { $activities_template->activity = new stdClass(); $activities_template->activity->id = $activities_template->activities[0]->item_id; $activities_template->activity->current_comment = $activities_template->activities[0]; // Because the whole tree has not been loaded, we manually // determine depth. $depth = 1; $parent_id = (int) $activities_template->activities[0]->secondary_item_id; while ( $parent_id !== (int) $activities_template->activities[0]->item_id ) { $depth++; $p_obj = new BP_Activity_Activity( $parent_id ); $parent_id = (int) $p_obj->secondary_item_id; } $activities_template->activity->current_comment->depth = $depth; }
I’ve run XDebug locally to inspect the items in the loop as it is running. If some of the raw variable data is required, I can provide that.
I have tried making some changes to the code in this loop to prevent the infinite loop from occurring. While successful in that endeavor with a few tweaks, the result is that the comment sent back through the Ajax response is the wrong comment, and a page refresh is still needed.
I considered filing a bug in Trac, but I wasn’t certain whether something else could possibly be interfering.
+--------------------------------------+--------+-----------+---------+ | name | status | update | version | +--------------------------------------+--------+-----------+---------+ | akismet | active | none | 3.1.11 | | all-in-one-seo-pack | active | available | 2.3.7 | | appbuddy | active | available | 2.0.7 | | appcamera | active | available | 2.0.0 | | appfbconnect | active | none | 2.3.0 | | apppresser | active | none | 2.5.0 | | apppush | active | available | 2.1.0 | | appshare | active | none | 2.1.0 | | appswiper | active | available | 2.2.1 | | bp-profile-search | active | none | 4.5.2 | | buddypress | active | none | 2.6.1.1 | | buddypress-activity-plus | active | none | 1.6.4 | | bp-moderation | active | none | 0.1.7 | | buddypress-nocaptcha-register-box | active | none | 1.1.3 | | buddypress-toolbar | active | none | 1.6.0 | | buddypress-wall | active | none | 0.9.4 | | buddypress-xprofile-image-field | active | none | 2.0.1 | | category-posts | active | none | 4.6.1 | | contact-form-7 | active | none | 4.4.2 | | contact-form-7-to-database-extension | active | none | 2.10.20 | | cubell-themes-functionality | active | none | 3.1 | | envato-wordpress-toolkit | active | none | 1.7.3 | | hashbuddy | active | none | 1.5.2 | | login-with-ajax | active | none | 3.1.6 | | mailchimp-for-wp | active | none | 3.1.11 | | nav-menu-roles | active | none | 1.8.2 | | nextend-facebook-connect | active | none | 1.5.9 | | buddypress-media | active | none | 4.0.4 | | vine-embed | active | none | 0.2 | | wds-lod-automatic-friends | active | none | 0.1.0 | | wds-lod-base | active | none | 0.1.0 | | wds-lod-bp | active | none | 0.1.0 | | wds-lod-post-types | active | none | 0.1.0 | | wds-lod-widgets | active | none | 0.1.0 | | wordpress-importer | active | none | 0.6.1 | +--------------------------------------+--------+-----------+---------+
Wordpress: 4.5.3
Buddypress: 2.6.1.1
Theme: Child of Twentyfourteen
Site: http://social.tgdgaming.com/activity/ (to get you past the login)Plugins:
Bowe Codes
Buddypress Activity Plus
Buddypress Friend of a Friend (FOAF)
BuddyPress Groups Extras
BuddyPress Profile Shortcodes —-(Has a bad profile link as well, {site.com/members/user//} has //)
Custom Admin Footer Text
Custom Menu Wizard
iFlyChat ————– (Stopped working around the same time as the other issues)
jonradio Multiple Themes
Menu Icons
Mutual Buddies
Peter’s Login Redirect
Scrollbar
WYSIWYG Widgets / Widget BlocksProblem Pages:
Profile Edit: site.com/members/user/profile/edit/
Profile Activity: site.com/members/user/activity/ (on profile view site.com/members/user/ —works)
Group Manage: site.com/groups/group/admin/More Info:
I believe the issues started when I was screwing around trying to add a extra sidebar. I did try to add one manually and with plugins (that may have been the cause). Trying to go to these links gives a white screen with nothing loaded in when inspecting with chrome.Troubleshooting:
Disabling plugins one by one.
Disabling all non-essential plugins (all but buddypress and jonradio Multiple Themes).
Re-installing the Base Theme.
Re-installing Buddypress.
Overwriting WordPress with Fresh files.Any help is greatly appreciated. I can try to get anymore info you need
Ps. Please excuse the bad styling had a bad upload with a style.css that overwrote the main theme with another theme and it’s being reworked with better css practices.Topic: Custom post type
Hi,
I’m running a plugin called ignitiondeck for wordpress. This plugin creates a custom post type for projects called ‘ignition_product’. These pages allow for comments, but I can’t get buddypress to track mentions in these comments.
Site tracking is on and comment notifications works for my page comments. I’ve tried using in my functions.php but it doesn’t help.
add_filter ( âbp_blogs_record_post_post_typesâ, âactivity_publish_custom_post_typesâ,1,1 );
function activity_publish_custom_post_types( $post_types ) {
$post_types[] = âignition_productâ;
return $post_types;
}Running 2.6.1.1
I’ve been attempting to customize the feed item generated for my custom post type on my buddypress/multisite installation. I’m really just trying to change the default text.
I’ve found what SHOULD be the correct code and I’ve set it up for my site, but… the changes never take. I’m not caching anything so that’s one potential complication excluded.
This is my current code (placed in bp_custom.php in my /plugins folder) :
add_post_type_support( 'webcomic', 'buddypress-activity' ); function customize_webcomic_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( 'webcomic', array( 'component_id' => buddypress()->blogs->id, 'action_id' => 'new_webcomic_update', 'bp_activity_admin_filter' => __( 'Updated the Comic', 'custom-domain' ), 'bp_activity_front_filter' => __( 'Webcomic', 'custom-domain' ), 'contexts' => array( 'activity', 'member' ), 'activity_comment' => true, 'bp_activity_new_post' => __( '%1$s posted a new <a href="%2$s">comic page</a>', 'custom-textdomain' ), 'bp_activity_new_post_ms' => __( '%1$s posted a new <a href="%2$s">comic page</a>, on the site %3$s', 'custom-textdomain' ), 'position' => 100, ) ); } add_action( 'bp_init', 'customize_webcomic_tracking_args' );
So the custom post type “webcomic” is generated via a plugin (called Webcomic), it’s not something I’m registering in my functions.php file. I’ve tried every “fix” I can find, and none of the changes can make this code stick! (this includes changing bp_init to just init).
I’m running buddypress 2.6. I would really appreciate it if someone could help me troubleshoot this. Even just confirming that the above code is correct would be a big help!
Thank you very much!
Hi, I am working with this code I found to show a CPT of fb_url_submit links. It works great but I would like to add other CPT’s to display in the same way on the Buddypress activity feeds, but with a different link of course.
When I try it says I cannot duplicate one of the CPT activity actions, and I am not a coder, so could someone please help me figure how to add the CPT’s of “news” and “images” while also showing them in the activity stream, and able to change the link that is displayed?
Thank you in advance!
<?php
function inspired_record_more_types( $types ) {
$types[] = 'fb_url_submit';
return $types;
}
add_filter( 'bp_blogs_record_post_post_types', 'inspired_record_more_types');
?><?php
add_filter('bp_blogs_activity_new_post_action', 'record_cpt_activity_action', 1, 3);
function record_cpt_activity_action( $activity_action, $post, $post_permalink ) {
global $bp;
if( $post->post_type == 'fb_url_submit' ) {
if ( is_multisite() )
$activity_action = sprintf( __( '%1$s added a new Facebook Page', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '' . $post->post_title . '', '' . get_blog_option( $blog_id, 'blogname' ) . '' );else
$activity_action = sprintf( __( '%1$s added a new Facebook Page', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '' . $post->post_title . '' );}
return $activity_action;
}
I just found out there was a parameter called ‘since’ to use with the activity loop to get activities since a certain date and time.
‘since’ => // Y-m-d H:i:s
Just looking for some quick help with this time function I created. I’m not great with code and don’t understand the workings of how WordPress/Buddypress works with the date and time, but I wanted to create a function that converts ‘hours ago’ into the Y-m-d H:i:s format so it can be used with the ‘since’ parameter.
function get_time_since( $hours_ago='' ) { // Local date and time right now $current_date = date('Y-m-d H:i:s'); // convert 'hours ago' to 'Y-m-d H:i:s' $date = date_create($current_date); date_sub($date, date_interval_create_from_date_string($hours_ago)); return date_format($date, 'Y-m-d H:i:s'); }
// example use // display posts in the last 6 hours function my_filter_activity( $loop ) { if ( is_page( 'custom-page' )) { $loop['since'] = get_time_since( '6 hours' ); } return $loop; } add_filter( 'bp_after_has_activity_parse_args', 'my_filter_activity' );
This works correctly where I am. The only thing I’m confused about is I don’t know if I have to detect a user’s time zone in the function for it to work correctly?
Hi, is anyone able to help me? i need a custom background where comments are distinguished from the standard background. At the moment my page has the one color for the background and there is no border for the where activity and comments go. I have no idea how to insert css so am hopeful on a plugin?
smartphone classifieds/com/auI’m trying to build a page to show a filtered activity stream but am completely unsure how to approach the problem. I’ve built my solution using CPTs and would like to be able to query based on custom meta box info in the CPTs.
For example, my CPTs include Beer and Check-In. So a user could “check-in” and mention which Beer they are drinking. The check-ins are recorded as activities and these display just fine in the activity stream (“Ben is drinking Molson Export Ale and rated it a 5”). Now I’d like to build a page that shows information about a Beer and the list of check-in activities for that particular Beer.
I think I know how to query the CPTs to get the info I want but don’t want to have to duplicate the BP functions. Ideally I’d like to filter the activity stream based on the info from the CPT custom meta info but I haven’t found a way to do that.
Have any of you seen something like that? Or could you provide an educated guess of where I might look for more info?
Any help or support would be greatly appreciated as I am stumped.
Thanks,
BenHi,
I am just copypaste code user – just simple user and need someone to help me. Please. I found below code, i am adding to bp-custom its working. But i need to extend this code, if i want to add second or more custom post type, how will i do? I read lots of article , try to solve 2 days but i cant. Try it 100 different version but no no no….Can anyone can show me how to add moe than one… Thanks and sorry my bad English..
<?php add_post_type_support( âbookâ, â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( âbookâ, array( âcomponent_idâ => âactivityâ, âaction_idâ => ânew_bookâ, âbp_activity_admin_filterâ => __( âMy Bookâ, âcustom-domainâ ), âbp_activity_front_filterâ => __( âBookâ, âcustom-domainâ ), âcontextsâ => array( âactivityâ, âmemberâ ), âbp_activity_new_postâ => __( â%1$s published <a href="â%2$sâ">Book Suggest</a>â, âcustom-textdomainâ ), âbp_activity_new_post_msâ => __( â%1$s published <a href="â%2$sâ">Book</a>, on the site %3$sâ, âcustom-textdomainâ ), âcomment_action_idâ => ânew_book_commentâ, âbp_activity_comments_admin_filterâ => __( âCommented Bookâ, âcustom-textdomainâ ), âbp_activity_comments_front_filterâ => __( âBook Commentsâ, âcustom-textdomainâ ), âbp_activity_new_commentâ => __( â%1$s commented on the <a href="â%2$sâ">Book</a>â, âcustom-textdomainâ ), âbp_activity_new_comment_msâ => __( â%1$s commented on the <a href="â%2$sâ">Book</a>, on the site %3$sâ, âcustom-textdomainâ ), âpositionâ => 100, ) ); } add_action( âinitâ, âcustomize_page_tracking_argsâ, 1000 ); ?>
Hey Guys,
I have a customized WordPress Website which also makes use of BuddyPress as the core for user profiles. Until now this only required BP Core, Community and XProfile Extension to run.
Now with the new requirement for a forum I was going to install AnsPress which requires Activity Stream and Notifications to be enabled (otherwise it throws fatal errors around).And here comes the fun -> when I enable activity stream, my BP Profile Page is kind of “overwritten” by the stream.
I hope somebody can clarify for me:
Normally, when I visit my or any profile via /members/xyz the buddypress.php somehow loads the contents from theme/members/single/profile.php in which bp_current_action() gives case “public” and bp_is_active(‘xprofile’) is true. Then my members/single/profile/profile-loop.php is loaded.But when I activate Activity Stream in BP and I visit my profile then somehow theme/buddypress/members/single/home.php is loaded and that shows the activity stream on my page and not the profile parts anymore.
What I think what I need is that the members/xyz URL links to the profile and not the “home” page – but how? Unfortunately my knowledge of WP as a programming framework is limited and I am not able to debug this any further as to where the decision is made to load home instead of profile.
Hope you can understand the problem and help me with it. I do not need to show the BP activity stream, it is just necessary for the plugin to not throw errors.
Hi all, was wandering if any one might be able to help.
I have created a page called ‘community’ which displays ALL forums available to a member. I’ve set the default component to ‘community’ in my bp-custom.php and this is working great. The only thing is it seems when a click on another members profile and it loads the ‘community’ page as the default page.
Is there a way I can stop this? So if a logged in user clicks on their own profile it shows them the forums to start with, but if they click someone elses profile it will display that members activity, or profile information?
Many thanks!
Phil
The name “Admin” appears when creating a group, post updated, etc in the activity stream and other areas. I noticed that there is a “bp_get_activity_user_link” filter.
How can I create a function that “disables” the Admin link but creates link for all other users?
function disable_admin_profile_link( $link ) { if( $link != bp_loggedin_user_domain() ) $link = // custom url return $link; } add_filter( 'bp_get_activity_user_link', 'disable_admin_profile_link', 15, 1 );
vs something like this
function _bp_core_get_user_domain($domain) { $url = get_home_url(); $user_id = bp_get_member_user_id(); if (empty($user_id)) { $user_id = bp_get_activity_user_id(); } if (empty($user_id)) { //$user_id = bp_displayed_user_id(); } $user_info = get_userdata($user_id); $link = $user_info->display_name; $domain = '' . $url . '/profiles/' . $link . ''; return $domain; } add_filter('bp_core_get_user_domain', '_bp_core_get_user_domain', 10, 4); apply_filters( 'bp_get_activity_user_link', '_bp_core_get_user_domain', 15, 1);
Not sure how to code it… If user is Admin, then link to homepage. If not, then link to their profile?
Hi,
Does anyone know if itâs possible, under the âMembersâ page (where members/users are listed), to show some selected info from their profile i.e. phone number, email etc?
I was also wondering if, after you select a user, you can set their page to go straight to their âprofileâ page and not âactivityâ page.
Thanks
Andrew - WordPress
Hi there,
I am creating a custom theme and need to integrate BuddyPress. I am working locally.
I have a custom template and created the activity loop. This works great. Now I want to show the post-form at the top of my activity loop. Which I have done by calling in activity/post-form.php. However, you type in the textarea box and hit post comment and nothing happens. Any ideas?
I know the activity feed is working on /activity so everything is setup correctly with my theme. I just want to show it in a column on my new template page.
<div id="buddypress">
<div class="activity-comment">
<?php locate_template( array( 'buddypress/activity/post-form.php' ), true ); ?>
</div>
<?php if ( bp_has_activities( bp_ajax_querystring( 'activity' ) . '&action=activity_update' ) ) : ?>
<?php while ( bp_activities() ) : bp_the_activity(); ?>
<?php locate_template( array( 'buddypress/activity/entry.php' ), true, false ); ?>
<?php endwhile; ?>
<?php endif; ?>
</div>