Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 1 through 25 (of 50 total)
  • @colabsadmin

    Participant

    There’s no special way to do this in Kleo. You override it like you would with any other theme. The issue is that you have a space between compose and .php in the file name.

    @colabsadmin

    Participant

    Its a plugin conflict with BP Cover Photo. It works with older versions of BP. I’ll notify the plugin developers about it.

    @colabsadmin

    Participant

    @colabsadmin

    Participant

    More info: This also happens in WP Admin. Adding members and changing privacy settings dont save.

    @colabsadmin

    Participant

    +1 with BP 2.3.1. My 2.2+ sites do not have this issue. I’ve enabled the WP 2015 theme and deactivated all plugins except BP.

    @colabsadmin

    Participant

    The only way I got this to work is by duplicating the activity loop (passing the scope=favorites argument) and all of the code that formats the activities, which I was trying to avoid.

    @colabsadmin

    Participant

    That’s what I’m trying to do. Load that screen, but under a different tab.

    @colabsadmin

    Participant

    Sorry I thought I was clear. I dont need an example of how to create the tab and the submenus.

    What I did was write a class that creates a top level member area tab called Favorites that consolidates all types of favorites within a single tab. https://github.com/colabsadmin/bp-favorites/blob/master/bp-favorites.php

    The submenus that have been created so far are Activity, Topics, Posts and a few more for some CPTs that I’ve written. This will make it easier for my users to find their favorites when they cant remember if it came from a topic, posts, activity, etc. Instead of jumping around from tab to tab, its all in one tab. The only submenu that doesnt work is Activity. The code, which I provided in my first question, was copied directly from Buddypress core code with one change to use ‘bp_core_new_subnav_item’. I used similar code to display content in all the other submenus. For example, the following shows the favorite topics

    // Favorite topics
    bp_core_new_subnav_item( array(
    		'name'            => __( 'Topics', 'kleo' ),
    		'slug'            => "topics",
    		'parent_url'      => $bp->displayed_user->domain . $bp->bp_nav['favorites']['slug'] . '/',
    		'parent_slug'     => $bp->bp_nav['favorites']['slug'],
    		'screen_function' => 'bbp_member_forums_screen_favorites',
    		'position'        => 10,
    		'item_css_id'     => 'favorites'
    ));
    

    So, my question, does bp_activity_screen_favorites() only work within the context of /members/membername/activity action? Or can it be used elsewhere as in /members/membersname/favorites?

    @colabsadmin

    Participant

    Sorry for posting in “installing”. Tried to edit, but it takes me to buddypress.org main page. Wont allow me to edit.

    @colabsadmin

    Participant

    Have you asked the BP Private plugin devs? Seems that you could edit their code to do a check of each required field. They’re probably only checking if a person is logged in.

    if (!bp_is_my_profile() && !bp_custom_get_member_list_xprofile_data('Company') && !bp_custom_get_member_list_xprofile_data('Location'))

    The unfortunate part of this is that check would have to be done on every page causing unnecessary processing time to every page load, unless you set a cookie or a single flag in the db. But then what happens if a user removes the information in one of the fields at a later date.

    @colabsadmin

    Participant

    @colabsadmin

    Participant

    @shanebp Figured out the problem. I have the Buddypress Xprofile Custom Field Type plugin installed. Disabling that allowed the creation of the time zone options.

    @colabsadmin

    Participant

    @shanebp Sorry for the late reply on this. I didnt have a notification set. Anyhow, thanks for writing this!

    I installed the BP-Timezone plugin and activated it, but the loader is not adding the timezones to the db. The field gets added correctly. I’m running BP 2.0.2. Any ideas?

    As far as hook suggestions, since starting this topic I haven’t come across another place to hook into. Once I get this plugin to install correctly, I’ll hunt for other places to use it.

    Thanks again.

    @colabsadmin

    Participant

    Anyone figure this out yet?

    @colabsadmin

    Participant

    No one has any advice on this? Especially #1?

    @colabsadmin

    Participant

    If you can reproduce the blank condition every time when replying to forum topics, then I would focus on that for the time being. (The idea is to find something the fails EVERY TIME so you can troubleshoot it.) Start disabling plugins and revert back to a basic theme. If it’s stops happening, start re-enabling plugins one by one. That’s what I would do anyway.

    @colabsadmin

    Participant

    @colabsadmin

    Participant

    bp_notifications_add_notification was introduced in bp 1.9, so you’ll need at least that version.

    @colabsadmin

    Participant

    Looks like 3 of them are from the same topic (15959). Go into the db and do a search on the activity table for secondary_item_id = 15959. That will give you a link to the topic. Go to it and 1: see if it exists still (probably does) and 2: see if there is something weird about it.

    OH. Is bbpress up to date? Maybe there is a bbpress plugin causing issues?

    I just tested this on my site. I created a topic as one user. I logged in as another and replied to the top. Notification was sent… no problem. I logged in as administrator and deleted the topic completely. The notification title still showed up, so I doubt deletions are your issue.

    Sorry that I’m grabbing at straws. It would help if I was having this problem (glad I’m not) 🙂

    @colabsadmin

    Participant

    Have you looked in the db to verify they weren’t deletes? Do you have any plugins installed that might effect that? I remember testing a private activity once that sent notifications even though someone didnt have access to them.

    You can prove your theory about the majority being messages by looking in the notification table. In there there are fields that will tell you what component the notification is for (messages, mentions, friend requests, and so on). Hover you mouse over the read/delete actions for the notifications with missing titles. You’ll see the notification ID. Look for those specific IDs to see if there is a common component where this is happening. Either way, you can get the item_id (what you were actually notified on) and verify that item actually exists. If the component is ‘activity’ look for item_id in the activity table. If its from the messages component, then you can look for the item_id in the messages_messages table. (though even if the sender deletes the message, it will still be in the db, so this might not get you anywhere actually)

    I’m curious to know what you find. Good luck.

    @colabsadmin

    Participant

    I’m pretty sure you have to call a function to do that using ‘screen_function’ then a wp_redirect in the function.

    @colabsadmin

    Participant

    Hey Michael,

    That usually happens when someone deletes the item you’re being notified about. There’s a ticket open to have the notification deleted when the item is deleted but it hasn’t been implemented yet.

    https://buddypress.trac.wordpress.org/ticket/5308

    @colabsadmin

    Participant

    I found bp_notifications_get_registered_components() which will bring back an array “of component names that are currently active and have registered Notifications callbacks”.

    Updated code

    
    function qd_notifications_filter_form() {
    	// Setup local variables
    	$components   = bp_notifications_get_registered_components();
    	$selected = '';
    	
    
    	// Check for a filter
    	if ( !empty( $_REQUEST['s'] ) ) {
    		if ( in_array( $_REQUEST['s'], $components ) ) {
    			$selected = $_REQUEST['s'];
    		}
    	} ?>
    
    	<form action="" method="get" id="notifications-filter">
    		<label for="notifications-filter-list"><?php esc_html_e( 'Filter By:', 'buddypress' ); ?></label>
    
    		<select id="notifications-filter-list" name="s" onchange="this.form.submit();">
            	<option value="" <?php selected( $selected, '' ); ?>><?php _e( 'All', 'buddypress' ); ?></option>
                <?php
                foreach ($components as $component) {
                ?>
                	<option value="<?php echo $component; ?>" <?php selected( $selected, $component ); ?>><?php _e( $component, 'buddypress' ); ?></option>
                <?php
                }
    			?>
    			
    		</select>
    
    		<noscript>
    			<input id="submit" type="submit" name="form-submit" class="submit" value="<?php _e( 'Go', 'buddypress' ); ?>" />
    		</noscript>
    	</form>
    
    <?php
    }
    

    Still not perfect, but better.

    @colabsadmin

    Participant

    I’ve been playing around with the filtering aspect. Turns out Buddypress has a filter built in, so all you need to do is add a form (dropdown) to use it. I haven’t fully tested this but seems to work. I need a way to determine all possible notification component names and actions so it will autopopulate the dropdown when new plugins use notifications.

    I copied /plugins/buddypress/bp-template/members/single/notifications.php to my child theme and added the following right below the bp_notifications_sort_order_form call

    <li id="members-filter-select" class="last filter">
    	<?php qd_notifications_filter_form(); ?>
    </li>

    Then in my functions.php file, I added the dropdown code (I basically stole this from the code that generates the sort by date dropdown.

    
    function qd_notifications_filter_form() {
    
    	// Setup local variables
            // Need to figure out a way to autopopulate this array
    	$searchterms   = array( 'new_at_mention', 'bbp_new_reply','new_message','friendship_accepted','friendship_request','group_invite','localgroupnotifier','ac_notifier' );
    	$selected = '';
    
    	// Check for a custom sort_order
    	if ( !empty( $_REQUEST['s'] ) ) {
    		if ( in_array( $_REQUEST['s'], $searchterms ) ) {
    			$selected = $_REQUEST['s'];
    		}
    	} ?>
    
    	<form action="" method="get" id="notifications-filter">
    		<label for="notifications-filter-list"><?php esc_html_e( 'Filter By:', 'buddypress' ); ?></label>
    
    // need to loop through this instead of hardcoding the options.
    		<select id="notifications-filter-list" name="s" onchange="this.form.submit();">
            	<option value="" <?php selected( $selected, '' ); ?>><?php _e( 'All', 'buddypress' ); ?></option>
    			<option value="new_at_mention" <?php selected( $selected, 'new_at_mention' ); ?>><?php _e( 'Mentions', 'buddypress' ); ?></option>
    			<option value="bbp_new_reply"  <?php selected( $selected, 'bbp_new_reply'  ); ?>><?php _e( 'Forums', 'buddypress' ); ?></option>
                <option value="new_message"  <?php selected( $selected, 'new_message'  ); ?>><?php _e( 'Messages', 'buddypress' ); ?></option>
                <option value="ac_notifier"  <?php selected( $selected, 'ac_notifier'  ); ?>><?php _e( 'Activity', 'buddypress' ); ?></option>
                <option value="localgroupnotifier"  <?php selected( $selected, 'localgroupnotifier'  ); ?>><?php _e( 'Groups', 'buddypress' ); ?></option>
                <option value="friendship_accepted"  <?php selected( $selected, 'friendship_accepted'  ); ?>><?php _e( 'Friend Accepts', 'buddypress' ); ?></option>
                <option value="friendship_request"  <?php selected( $selected, 'friendship_request'  ); ?>><?php _e( 'Friend Requests', 'buddypress' ); ?></option>
    		</select>
    
    		<noscript>
    			<input id="submit" type="submit" name="form-submit" class="submit" value="<?php _e( 'Go', 'buddypress' ); ?>" />
    		</noscript>
    	</form>
    
    <?php
    }
    

    @colabsadmin

    Participant

    Not sure when I’ll start this (soon), but I’ll report back with details on what I come up with. Thanks for the code.

Viewing 25 replies - 1 through 25 (of 50 total)
Skip to toolbar