X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fconversation.php;h=1fd9c31eca3c55f20e21a795d7be5191032f2126;hb=55112cfdd0dc63c8ad7f719aea5b46db37fcf081;hp=e66b45f097b4fabe08a143930f42bce6707785e6;hpb=990d5e82a0c38831240590f907fb4c6efd62041d;p=friendica.git diff --git a/include/conversation.php b/include/conversation.php index e66b45f097..1fd9c31eca 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -91,6 +91,11 @@ function conversation(&$a, $items, $mode, $update) { $page_writeable = can_write_wall($a,$profile_owner); } + if($mode === 'notes') { + $profile_owner = $a->profile['profile_uid']; + $page_writeable = true; + } + if($mode === 'display') { $profile_owner = $a->profile['uid']; $page_writeable = can_write_wall($a,$profile_owner); @@ -109,6 +114,8 @@ function conversation(&$a, $items, $mode, $update) { $noshare_tpl = get_markup_template('like_noshare.tpl'); $tpl = get_markup_template('wall_item.tpl'); $wallwall = get_markup_template('wallwall_item.tpl'); + $droptpl = get_markup_template('wall_item_drop.tpl'); + $fakedrop = get_markup_template('wall_fake_drop.tpl'); $alike = array(); $dlike = array(); @@ -121,7 +128,6 @@ function conversation(&$a, $items, $mode, $update) { // - just loop through the items and format them minimally for display $tpl = get_markup_template('search_item.tpl'); - $droptpl = get_markup_template('wall_fake_drop.tpl'); foreach($items as $item) { @@ -166,18 +172,13 @@ function conversation(&$a, $items, $mode, $update) { } $drop = ''; - $dropping = false; - - if((intval($item['contact-id']) && $item['contact-id'] == remote_user()) || ($item['uid'] == local_user())) - $dropping = true; - $drop = replace_macros((($dropping)? $droptpl : $fakedrop), array('$id' => $item['id'], '$delete' => t('Delete'))); - - // localize_item($item); $drop = replace_macros($droptpl,array('$id' => $item['id'])); $lock = '
'; + + $body = prepare_body($item,true); $o .= replace_macros($tpl,array( '$id' => $item['item_id'], @@ -189,8 +190,8 @@ function conversation(&$a, $items, $mode, $update) { '$lock' => $lock, '$thumb' => $profile_avatar, '$title' => $item['title'], - '$body' => smilies(bbcode($item['body'])), - '$ago' => relative_date($item['created']), + '$body' => $body, + '$ago' => (($item['app']) ? sprintf( t('%s from %s'),relative_date($item['created']),$item['app']) : relative_date($item['created'])), '$location' => $location, '$indent' => '', '$owner_url' => $owner_url, @@ -263,7 +264,7 @@ function conversation(&$a, $items, $mode, $update) { $item_writeable = (($item['writable'] || $item['self']) ? true : false); - if($blowhard == $item['cid'] && (! $item['self']) && ($mode != 'profile')) { + if($blowhard == $item['cid'] && (! $item['self']) && ($mode != 'profile') && ($mode != 'notes')) { $blowhard_count ++; if($blowhard_count == 3) { $o .= ''; + if($dropping) + $o .= '
'; + return $o; } @@ -658,7 +675,7 @@ function format_like($cnt,$arr,$type,$id) { }} -function status_editor($a,$x) { +function status_editor($a,$x, $notes_cid = 0) { $o = ''; @@ -710,13 +727,17 @@ function status_editor($a,$x) { call_hooks('jot_tool', $jotplugins); call_hooks('jot_networks', $jotnets); + if($notes_cid) + $jotnets .= ''; + $tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins)); $o .= replace_macros($tpl,array( '$return_path' => $a->cmd, '$action' => 'item', - '$share' => t('Share'), + '$share' => (($x['button']) ? $x['button'] : t('Share')), '$upload' => t('Upload photo'), + '$attach' => t('Attach file'), '$weblink' => t('Insert web link'), '$youtube' => t('Insert YouTube video'), '$video' => t('Insert Vorbis [.ogg] video'), @@ -726,11 +747,13 @@ function status_editor($a,$x) { '$title' => t('Set title'), '$wait' => t('Please wait'), '$permset' => t('Permission settings'), + '$ptyp' => (($notes_cid) ? 'note' : 'wall'), '$content' => '', '$post_id' => '', '$baseurl' => $a->get_baseurl(), '$defloc' => $x['default_location'], '$visitor' => $x['visitor'], + '$pvisit' => (($notes_cid) ? 'none' : $x['visitor']), '$emailcc' => t('CC: email addresses'), '$public' => t('Public post'), '$jotnets' => $jotnets,