Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • I tried this code, but still didn’t work:

    /******************************************************
    /* Notification
     *****************************************************/
    function bp_like_setup_globals() {
        global $bp, $current_blog;
        $bp->bp_like->id = 'bp_like_notifier';
        $bp->bp_like->slug = 'BP_LIKE_SLUG';
        $bp->bp_like->notification_callback = 'like_format_notifications';
        $bp->active_components[$bp->bp_like->slug] = $bp->bp_like->id;
        do_action( 'bp_like_setup_globals' );
    }
    add_action( 'bp_setup_globals', 'bp_like_setup_globals' );
    
    function like_format_notifications( $action, $item_id, $secondary_item_id, $total_items ) {
    	global $bp;
    
    	$link=like_notifier_activity_get_permalink( $item_id ); 
    
    	if( 'activity_like' == $action ) {
    	if ( (int)$total_items > 1 )
    		return apply_filters( 'log_multiple_verifications_notification', '<a href="'. $link .'" title="' . __( 'Likes', 'bp-like' ) . '">' . sprintf( __('You have %d new likes', 'bp-like' ), (int)$total_items ) . '</a>', $total_items );
    		else
    		return apply_filters( 'log_single_verification_notification', '<a href="'. $link .'" title="' . __( 'likes', 'bp-like' ) . '">' . sprintf( __('You have %d new like', 'bp-like' ), (int)$total_items ) . '</a>', $total_items );
    	}
    
    	do_action( 'like_format_notifications', $action, $item_id, $secondary_item_id, $total_items );
    
    	return false;
    }
    function like_remove_screen_notifications() {
    	global $bp;
        if($has_access)//if user can view this activity, remove notification(just a safeguard for hidden activity)
    	bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, $bp->bp_like->id, 'new_like' );
    }
    add_action( 'bp_activity_screen_single_activity_permalink', 'like_remove_screen_notifications' );	
    
    //get the thread permalink for activity
    function like_notifier_activity_get_permalink( $item_id, $activity_obj = false ) {
    	global $bp;
    
    	if ( !$activity_obj )
    		$activity_obj = new BP_Activity_Activity( $item_id );
    
    		if ( 'activity_comment' == $activity_obj->type )
    			$link = $bp->root_domain . '/' . BP_ACTIVITY_SLUG . '/p/' . $activity_obj->item_id . '/';
    		else
    			$link = $bp->root_domain . '/' . BP_ACTIVITY_SLUG . '/p/' . $activity_obj->id . '/';
    
    	return apply_filters( 'like_notifier_activity_get_permalink', $link );
    }

    and inside bp_like_add_user_like() function I put this after $liked_count = count( $users_who_like ):
    bp_core_add_notification( $item_id, $user_id, $bp->bp_like->id, 'activity_like' );

    any help?

    Thread Starter Sami kamal

    (@kumo99)

    ok I fixed it with this in line 206:

    $terms = get_terms($v['taxname'],'hide_empty='.$v['hide'].'&orderby=term_group');

    I think this should be in core plus the extra pad for child terms.

    thanks

    Thread Starter Sami kamal

    (@kumo99)

    the following format seems to link posts to the hierarchical taxonomy.

    —————————-
    0,State
    State, County
    County, District
    ———————–

    However, the problem is when a county exists with same name under another state, or same district name under another county. In this case, the post is linked to existing county or district, it doesn’t take the top lovel “State” into consideration.

    any idea?

    Thread Starter Sami kamal

    (@kumo99)

    nice to here that.. another feature request is buddypress support this would make it very useful for buddypress community too.

    thanks

Viewing 4 replies - 1 through 4 (of 4 total)