Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    I’m afraid that at the moment you might need to hack into the code to make this work under events-manager/buddypress/bp-em-activity.php

    Thread Starter aldebaranmirko

    (@aldebaranmirko)

    ok, I’ve looked but I could not do anything.
    I just wanted to add the photo and the date of the event

    how could I do?

    thanks

    Plugin Support angelo_nwl

    (@angelo_nwl)

    did you already looked in function bp_em_record_activity_event_save() and then the EM placeholders ?

    https://wp-events-plugin.com/documentation/placeholders/

    Thread Starter aldebaranmirko

    (@aldebaranmirko)

    excuse but it’s just that I work with php

    function bp_em_record_activity_event_save( $result, $EM_Event ){
    	if( $result && $EM_Event->event_status == 1 && $EM_Event->get_previous_status() != 1 ){
    		$user = get_userdata($EM_Event->event_owner);
    		$member_link = bp_core_get_user_domain($user->ID);
    		if( empty($EM_Event->group_id) ){
    			bp_em_record_activity( array(
    				'user_id' => $user->ID,
    				'action' => sprintf(__('%s added the event %s','dbem'), "<a href='".$member_link."'>".$user->display_name."</a>", $EM_Event->output('#_EVENTLINK') ),
    				'primary_link' => $EM_Event->output('#_EVENTURL'),
    				'type' => 'new_event',
    				'item_id' => $EM_Event->event_id,
    				'hide_sitewide' => $EM_Event->event_private
    			));
    		}else{
    			//tis a group event
    			$group = new BP_Groups_Group($EM_Event->group_id);
    			bp_em_record_activity( array(
    				'user_id' => $user->ID,
    				'action' => sprintf(__('%s added the event %s to %s.','dbem'), "<a href='".$member_link."'>".$user->display_name."</a>", $EM_Event->output('#_EVENTLINK'), '<a href="'.bp_get_group_permalink($group).'">'.bp_get_group_name($group).'</a>' ),
    				'component' => 'groups',
    				'type' => 'new_event',
    				'item_id' => $EM_Event->group_id,
    				'hide_sitewide' => $EM_Event->event_private
    			));
    		}
    	}
    	return $result;
    }
    add_filter('em_event_save','bp_em_record_activity_event_save', 10, 2);

    I entered #_EVENTIMAGE everywhere but never appears.
    if in the action line change EVENTLINK with EVENTIMAGE then you see instead of the link but I can not in any other way.
    could you help me?

    Plugin Support angelo_nwl

    (@angelo_nwl)

    hmm, this works for me

    function bp_em_record_activity_event_save( $result, $EM_Event ){
    	if( $result && $EM_Event->event_status == 1 && $EM_Event->get_previous_status() != 1 ){
    		$user = get_userdata($EM_Event->event_owner);
    		$member_link = bp_core_get_user_domain($user->ID);
    		if( empty($EM_Event->group_id) ){
    			bp_em_record_activity( array(
    				'user_id' => $user->ID,
    				'action' => sprintf(__('%s %s added the event %s','dbem'), $EM_Event->output('#_EVENTIMAGE{72,72}'), "<a href='".$member_link."'>".$user->display_name."</a>", $EM_Event->output('#_EVENTLINK') ),
    				'primary_link' => $EM_Event->output('#_EVENTURL'),
    				'type' => 'new_event',
    				'item_id' => $EM_Event->event_id,
    				'hide_sitewide' => $EM_Event->event_private
    			));
    		}else{
    			//tis a group event
    			$group = new BP_Groups_Group($EM_Event->group_id);
    			bp_em_record_activity( array(
    				'user_id' => $user->ID,
    				'action' => sprintf(__('%s %s added the event %s to %s.','dbem'), "<a href='".$member_link."'>".$user->display_name."</a>", $EM_Event->output('#_EVENIMAGE{72,72}'), $EM_Event->output('#_EVENTLINK'), '<a href="'.bp_get_group_permalink($group).'">'.bp_get_group_name($group).'</a>' ),
    				'component' => 'groups',
    				'type' => 'new_event',
    				'item_id' => $EM_Event->group_id,
    				'hide_sitewide' => $EM_Event->event_private
    			));
    		}
    	}
    	return $result;
    }
    add_filter('em_event_save','bp_em_record_activity_event_save', 10, 2);

    take note that this will take effect to the new events you created after using this code and will not work on existing events

    Thread Starter aldebaranmirko

    (@aldebaranmirko)

    ok work but I would go on the line below after the picture, I tried to put the tag
    but does not work, when will be settled this thing is perfect

    Where / how are you adding the tag?

    Thread Starter aldebaranmirko

    (@aldebaranmirko)

    'action' => sprintf(__("%s <br/>%s Ha aggiunto l'evento %s",'dbem'), $EM_Event->output('#_EVENTIMAGE{300,300}<br/>'),'<br/>', "<a href='".$member_link."'>".$user->display_name."</a>", $EM_Event->output('#_EVENTLINK') ),

    I wrote to all the places where I have tried to insert the tag

    Are you sure you have a featured image set for that event? Does it work with just #_EVENTIMAGE, without sizes?

    I’m having problems also with the code above. I added the #_EVENTIMAGE, exactly like above and nothing shows up. ??

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘insert the image and place in the activity of BuddyPress’ is closed to new replies.