Conflicts: include/Contact.php include/ItemObject.php include/api.php include/attach.php include/diaspora.php include/dir_fns.php include/enotify.php include/event.php include/expire.php include/items.php include/notifier.php include/notify.php include/photos.php include/taxonomy.php include/text.php include/widgets.php include/zot.php mod/admin.php mod/channel.php mod/dirsearch.php mod/display.php mod/editwebpage.php mod/events.php mod/home.php mod/item.php mod/manage.php mod/mood.php mod/network.php mod/page.php mod/photos.php mod/ping.php mod/post.php mod/thing.php mod/viewsrc.php view/css/mod_events.css
		
			
				
	
	
		
			38 lines
		
	
	
		
			969 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			38 lines
		
	
	
		
			969 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php /** @file */
 | |
| 
 | |
| 
 | |
| function format_notification($item) {
 | |
| 
 | |
| 	$ret = '';
 | |
| 
 | |
| 	require_once('include/conversation.php');
 | |
| 
 | |
| 	// Call localize_item with the "brief" flag to get a one line status for activities. 
 | |
| 	// This should set $item['localized'] to indicate we have a brief summary.
 | |
| 
 | |
| 	localize_item($item);
 | |
| 
 | |
| 	if($item_localize) {
 | |
| 		$itemem_text = $item['localize'];
 | |
| 	}
 | |
| 	else {
 | |
| 		$itemem_text = (($item['item_thread_top'])
 | |
| 			? t('created a new post')
 | |
| 			: sprintf( t('commented on %s\'s post'), $item['owner']['xchan_name']));
 | |
| 	}
 | |
| 
 | |
| 	// convert this logic into a json array just like the system notifications
 | |
| 
 | |
| 	return array(
 | |
| 		'notify_link' => $item['llink'], 
 | |
| 		'name' => $item['author']['xchan_name'],
 | |
| 		'url' => $item['author']['xchan_url'],
 | |
| 		'photo' => $item['author']['xchan_photo_s'],
 | |
| 		'when' => relative_date($item['created']), 
 | |
| 		'class' => (intval($item['item_unseen']) ? 'notify-unseen' : 'notify-seen'), 
 | |
| 		'message' => strip_tags(bbcode($itemem_text))
 | |
| 	);
 | |
| 
 | |
| }
 | |
| 
 |