X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fconversation.php;h=558942063f9382e7e95c66b3749625b910510eb7;hb=636033024873a9c20fa08273a6eb8fe01cac7182;hp=c278ec2f18534edf629ccc7c951c55300d46615d;hpb=d074656f26c1e509da19aed64467d0adc7b9d79b;p=friendica.git diff --git a/include/conversation.php b/include/conversation.php index c278ec2f18..558942063f 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1,6 +1,7 @@ ".$tag["term"].""; + $prefix = "#"; + } elseif ($tag["type"] == TERM_MENTION) { + $mentions[] = "@".$tag["term"].""; + $prefix = "@"; + } + $tags[] = $prefix."".$tag["term"].""; + } + + /*foreach(explode(',',$item['tag']) as $tag){ $tag = trim($tag); if ($tag!="") { $t = bbcode($tag); @@ -533,7 +578,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { elseif($t[0] == '@') $mentions[] = $t; } - } + }*/ $sp = false; $profile_link = best_link_url($item,$sp); @@ -576,7 +621,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { $likebuttons = false; $shareable = false; - $body = prepare_body($item,true); + $body = prepare_body($item,true, $preview); list($categories, $folders) = get_cats_and_terms($item); @@ -605,13 +650,14 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { $tmp_item = array( 'template' => $tpl, 'id' => (($preview) ? 'P0' : $item['item_id']), + 'network' => $item['item_network'], 'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])), 'profile_url' => $profile_link, 'item_photo_menu' => item_photo_menu($item), 'name' => $profile_name_e, 'sparkle' => $sparkle, 'lock' => $lock, - 'thumb' => $profile_avatar, + 'thumb' => proxy_url($profile_avatar), 'title' => $item['title_e'], 'body' => $body_e, 'tags' => $tags_e, @@ -630,7 +676,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { 'indent' => '', 'owner_name' => $owner_name_e, 'owner_url' => $owner_url, - 'owner_photo' => $owner_photo, + 'owner_photo' => proxy_url($owner_photo), 'plink' => get_plink($item), 'edpost' => false, 'isstarred' => $isstarred, @@ -640,7 +686,8 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { 'like' => '', 'dislike' => '', 'comment' => '', - 'conv' => (($preview) ? '' : array('href'=> $a->get_baseurl($ssl_state) . '/display/' . $nickname . '/' . $item['id'], 'title'=> t('View in context'))), + //'conv' => (($preview) ? '' : array('href'=> $a->get_baseurl($ssl_state) . '/display/' . $nickname . '/' . $item['id'], 'title'=> t('View in context'))), + 'conv' => (($preview) ? '' : array('href'=> $a->get_baseurl($ssl_state) . '/display/'.$item['guid'], 'title'=> t('View in context'))), 'previewing' => $previewing, 'wait' => t('Please wait'), 'thread_level' => 1, @@ -650,10 +697,10 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { call_hooks('display_item', $arr); $threads[$threadsid]['id'] = $item['item_id']; + $threads[$threadsid]['network'] = $item['item_network']; $threads[$threadsid]['items'] = array($arr['output']); } - } else { @@ -672,6 +719,21 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { $threads = array(); foreach($items as $item) { + if($arr_blocked) { + $blocked = false; + foreach($arr_blocked as $b) { + + if($b && link_compare($item['author-link'],$b)) { + $blocked = true; + break; + } + } + if($blocked) + continue; + } + + + // Can we put this after the visibility check? like_puller($a,$item,$alike,'like'); like_puller($a,$item,$dlike,'dislike'); @@ -695,6 +757,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { } $threads = $conv->get_template_data($alike, $dlike); + if(!$threads) { logger('[ERROR] conversation : Failed to get template data.', LOGGER_DEBUG); $threads = array(); @@ -704,6 +767,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { $o = replace_macros($page_template, array( '$baseurl' => $a->get_baseurl($ssl_state), + '$return_path' => $a->query_string, '$live_update' => $live_update_div, '$remove' => t('remove'), '$mode' => $mode, @@ -793,7 +857,7 @@ function item_photo_menu($item){ if(($cid) && (! $item['self'])) { $poke_link = $a->get_baseurl($ssl_state) . '/poke/?f=&c=' . $cid; $contact_url = $a->get_baseurl($ssl_state) . '/contacts/' . $cid; - $posts_link = $a->get_baseurl($ssl_state) . '/network/?cid=' . $cid; + $posts_link = $a->get_baseurl($ssl_state) . '/network/0?nets=all&cid=' . $cid; $clean_url = normalise_link($item['author-link']); @@ -908,7 +972,7 @@ function format_like($cnt,$arr,$type,$id) { $str .= sprintf( t(', and %d other people'), $total - MAX_LIKERS ); } $str = (($type === 'like') ? sprintf( t('%s like this.'), $str) : sprintf( t('%s don\'t like this.'), $str)); - $o .= "\t" . ''; + $o .= "\t" . ''; } return $o; }} @@ -962,8 +1026,6 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) { )); - $tpl = get_markup_template("jot.tpl"); - $jotplugins = ''; $jotnets = ''; @@ -983,21 +1045,47 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) { } } - if($mail_enabled) { - $selected = (($pubmail_enabled) ? ' checked="checked" ' : ''); - $jotnets .= '
' . t("Post to Email") . '
'; - } + if (!$a->user['hidewall']) { + if($mail_enabled) { + $selected = (($pubmail_enabled) ? ' checked="checked" ' : ''); + $jotnets .= '
' . t("Post to Email") . '
'; + } + + call_hooks('jot_networks', $jotnets); + } else + $jotnets .= sprintf(t('Connectors disabled, since "%s" is enabled.'), + t('Hide your profile details from unknown viewers?')); call_hooks('jot_tool', $jotplugins); - call_hooks('jot_networks', $jotnets); if($notes_cid) $jotnets .= ''; + + // Private/public post links for the non-JS ACL form + $private_post = 1; + if($_REQUEST['public']) + $private_post = 0; + + $query_str = $a->query_string; + if(strpos($query_str, 'public=1') !== false) + $query_str = str_replace(array('?public=1', '&public=1'), array('', ''), $query_str); + + // I think $a->query_string may never have ? in it, but I could be wrong + // It looks like it's from the index.php?q=[etc] rewrite that the web + // server does, which converts any ? to &, e.g. suggest&ignore=61 for suggest?ignore=61 + if(strpos($query_str, '?') === false) + $public_post_link = '?public=1'; + else + $public_post_link = '&public=1'; + + + // $tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins)); + $tpl = get_markup_template("jot.tpl"); $o .= replace_macros($tpl,array( - '$return_path' => $a->query_string, + '$return_path' => $query_str, '$action' => $a->get_baseurl(true) . '/item', '$share' => (x($x,'button') ? $x['button'] : t('Share')), '$upload' => t('Upload photo'), @@ -1033,14 +1121,22 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) { '$jotnets' => $jotnets, '$emtitle' => t('Example: bob@example.com, mary@example.com'), '$lockstate' => $x['lockstate'], - '$acl' => $x['acl'], '$bang' => $x['bang'], '$profile_uid' => $x['profile_uid'], '$preview' => ((feature_enabled($x['profile_uid'],'preview')) ? t('Preview') : ''), '$jotplugins' => $jotplugins, '$sourceapp' => t($a->sourcename), '$cancel' => t('Cancel'), - '$rand_num' => random_digits(12) + '$rand_num' => random_digits(12), + + // ACL permissions box + '$acl' => $x['acl'], + '$acl_data' => $x['acl_data'], + '$group_perms' => t('Post to Groups'), + '$contact_perms' => t('Post to Contacts'), + '$private' => t('Private post'), + '$is_private' => $private_post, + '$public_link' => $public_post_link, ));