From 7cd014e93ce1ebb2fded0bdcc093b982dd9ce57b Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 6 Jan 2013 04:07:10 -0800 Subject: make preview work fix some other nits --- include/conversation.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index ea2f84cbf..7ad231b58 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -472,7 +472,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { $page_template = get_markup_template("conversation.tpl"); - if($items && count($items)) { + if($items) { if($mode === 'network-new' || $mode === 'search' || $mode === 'community') { @@ -696,6 +696,9 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { $threads = null; } + if($page_mode === 'preview') + logger('preview: ' . print_r($threads,true)); + $o = replace_macros($page_template, array( '$baseurl' => $a->get_baseurl($ssl_state), '$live_update' => $live_update_div, @@ -707,6 +710,9 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { '$dropping' => ($page_dropping?t('Delete Selected Items'):False), )); + if($page_mode === 'preview') + logger('preview: ' . $o); + return $o; -- cgit v1.2.3 From a0d19ffb7241a1c7a4b85e6d0fd58fbb2f718468 Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Sun, 6 Jan 2013 14:42:51 -0700 Subject: implement Smarty3 --- include/conversation.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 7ad231b58..ecd6d358e 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -344,7 +344,6 @@ function visible_activity($item) { return true; } - /** * "Render" a conversation or list of items for HTML display. * There are two major forms of display: @@ -886,7 +885,7 @@ function status_editor($a,$x,$popup=false) { $o = ''; - $geotag = (($x['allow_location']) ? get_markup_template('jot_geotag.tpl') : ''); + $geotag = (($x['allow_location']) ? replace_macros(get_markup_template('jot_geotag.tpl'), array()) : ''); $plaintext = true; if(feature_enabled(local_user(),'richtext')) -- cgit v1.2.3 From a9aa74a8074fd2eec58dd5927313fcef4fd5d930 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 6 Jan 2013 16:36:02 -0800 Subject: make dislikes work - though they need a display tweak --- include/conversation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 7ad231b58..ba92c1a57 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -651,7 +651,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { // Can we put this after the visibility check? like_puller($a,$item,$alike,'like'); - if(feature_enabled($profile_uid,'dislike')) + if(feature_enabled($profile_owner,'dislike')) like_puller($a,$item,$dlike,'dislike'); // Only add what is visible -- cgit v1.2.3 From f0a08a05aedd8add7990f26c1a0d1894ddd06683 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 9 Jan 2013 23:07:13 -0800 Subject: fix the "personal" network filter and introduction notifications --- include/conversation.php | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 56bcef559..88da4a0b9 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1035,20 +1035,10 @@ function conv_sort($arr,$order) { foreach($parents as $i=>$_x) $parents[$i]['children'] = get_item_children($arr, $_x); - /*foreach($arr as $x) { - if($x['id'] != $x['parent']) { - $p = find_thread_parent_index($parents,$x); - if($p !== false) - $parents[$p]['children'][] = $x; - } - }*/ if(count($parents)) { foreach($parents as $k => $v) { if(count($parents[$k]['children'])) { $parents[$k]['children'] = sort_item_children($parents[$k]['children']); - /*$y = $parents[$k]['children']; - usort($y,'sort_thr_created_rev'); - $parents[$k]['children'] = $y;*/ } } } @@ -1059,8 +1049,6 @@ function conv_sort($arr,$order) { $ret[] = $x; if(count($x['children'])) add_children_to_list($x['children'], $ret); - /*foreach($x['children'] as $y) - $ret[] = $y;*/ } } -- cgit v1.2.3 From 639325b235deb67396b7e0b64c043f85599e6641 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 14 Jan 2013 16:49:57 -0800 Subject: progress on pages - they're still getting lost inside conversation(), but progress is progress. --- include/conversation.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 88da4a0b9..e5c035335 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -419,9 +419,6 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { } } - - - } elseif($mode === 'display') { @@ -432,6 +429,13 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { } + elseif($mode === 'page') { + $profile_owner = $a->profile['uid']; + $page_writeable = ($profile_owner == local_user()); + $live_update_div = '
' . "\r\n"; + } + + else if($mode === 'search') { $live_update_div = '' . "\r\n"; } -- cgit v1.2.3 From 62b1eb65dc1fe822f1e73d6c7469ac0213d117c4 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 15 Jan 2013 01:32:11 -0800 Subject: pages sorta working --- include/conversation.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index e5c035335..29c5938b0 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1090,3 +1090,16 @@ function render_location_google($item) { } return $location; } + + + +function prepare_page($item) { + return replace_macros(get_markup_template('page_display.tpl'),array( + '$author' => $item['author']['xchan_name'], + '$auth_url' => $item['author']['xchan_url'], + '$date' => datetime_convert('UTC',date_default_timezone_get(),$item['created'],'Y-m-d H:i'), + '$title' => smilies(bbcode($item['title'])), + '$body' => smilies(bbcode($item['body'])) + )); +} + -- cgit v1.2.3 From 132a5f0f9691d154a048874342a6ad042be2a9e3 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 25 Jan 2013 04:30:03 -0800 Subject: add new magic links to activity translations --- include/conversation.php | 46 ++++++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 20 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 29c5938b0..65110fc72 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1,8 +1,11 @@ get_observer(); + $obhash = (($observer) ? $observer['xchan_hash'] : ''); + $obaddr = (($observer) ? $observer['xchan_addr'] : ''); + for($i = 0; $i < count($images); $i++) { $search = '/\[url\=(.*?)\]\[!#saved_image' . $i . '#!\]\[\/url\]' . '/is'; - $replace = '[url=' . z_path() . '/redir/' . $cid - . '?f=1&url=' . '$1' . '][!#saved_image' . $i . '#!][/url]' ; + $replace = '[url=' . magiclink_url($obhash,$obaddr,'$1') . '][!#saved_image' . $i . '#!][/url]' ; $img_end = strpos($origbody, '[!#saved_image' . $i . '#!][/url]') + strlen('[!#saved_image' . $i . '#!][/url]'); $process_part = substr($origbody, 0, $img_end); @@ -108,8 +114,8 @@ function localize_item(&$item){ if($author_link && $author_name && $item_url) { - $author = '[url=' . zid($item['author']['xchan_url']) . ']' . $item['author']['xchan_name'] . '[/url]'; - $objauthor = '[url=' . zid($author_link) . ']' . $author_name . '[/url]'; + $author = '[url=' . chanlink_url($item['author']['xchan_url']) . ']' . $item['author']['xchan_name'] . '[/url]'; + $objauthor = '[url=' . chanlink_url($author_link) . ']' . $author_name . '[/url]'; switch($obj->type) { case ACTIVITY_OBJ_PHOTO: @@ -160,11 +166,11 @@ function localize_item(&$item){ $Bname = $obj['title']; - $A = '[url=' . zid($Alink) . ']' . $Aname . '[/url]'; - $B = '[url=' . zid($Blink) . ']' . $Bname . '[/url]'; - if ($Bphoto!="") $Bphoto = '[url=' . zid($Blink) . '][img=80x80]' . $Bphoto . '[/img][/url]'; + $A = '[url=' . chanlink_url($Alink) . ']' . $Aname . '[/url]'; + $B = '[url=' . chanlink_url($Blink) . ']' . $Bname . '[/url]'; + if ($Bphoto!="") $Bphoto = '[url=' . chanlink_url($Blink) . '][img=80x80]' . $Bphoto . '[/img][/url]'; - $item['body'] = $item['localize'] = sprintf( t('%1$s is now friends with %2$s'), $A, $B); + $item['body'] = $item['localize'] = sprintf( t('%1$s is now connected with %2$s'), $A, $B); $item['body'] .= "\n\n\n" . $Bphoto; } @@ -188,9 +194,9 @@ function localize_item(&$item){ } $Bname = $obj['title']; - $A = '[url=' . zid($Alink) . ']' . $Aname . '[/url]'; - $B = '[url=' . zid($Blink) . ']' . $Bname . '[/url]'; - if ($Bphoto!="") $Bphoto = '[url=' . zid($Blink) . '][img=80x80]' . $Bphoto . '[/img][/url]'; + $A = '[url=' . chanlink_url($Alink) . ']' . $Aname . '[/url]'; + $B = '[url=' . chanlink_url($Blink) . ']' . $Bname . '[/url]'; + if ($Bphoto!="") $Bphoto = '[url=' . chanlink_url($Blink) . '][img=80x80]' . $Bphoto . '[/img][/url]'; // we can't have a translation string with three positions but no distinguishable text // So here is the translate string. @@ -215,7 +221,7 @@ function localize_item(&$item){ $Aname = $item['author']['xchan_name']; $Alink = $item['author']['xchan_url']; - $A = '[url=' . zid($Alink) . ']' . $Aname . '[/url]'; + $A = '[url=' . chanlink_url($Alink) . ']' . $Aname . '[/url]'; $txt = t('%1$s is currently %2$s'); @@ -304,19 +310,19 @@ function localize_item(&$item){ // add zid's to public images if(preg_match_all('/\[url=(.*?)\/photos\/(.*?)\/image\/(.*?)\]\[img(.*?)\]h(.*?)\[\/img\]\[\/url\]/is',$item['body'],$matches,PREG_SET_ORDER)) { foreach($matches as $mtch) { - $item['body'] = str_replace($mtch[0],'[url=' . zid($mtch[1] . '/photos/' . $mtch[2] . '/image/' . $mtch[3] ,true) . '][img' . $mtch[4] . ']h' . $mtch[5] . '[/img][/url]',$item['body']); + $item['body'] = str_replace($mtch[0],'[url=' . chanlink_url($mtch[1] . '/photos/' . $mtch[2] . '/image/' . $mtch[3] ,true) . '][img' . $mtch[4] . ']h' . $mtch[5] . '[/img][/url]',$item['body']); } } // add sparkle links to appropriate permalinks - $x = stristr($item['plink'],'/display/'); - if($x) { - $sparkle = false; - $y = best_link_url($item,$sparkle,true); - if($sparkle) - $item['plink'] = $y . '?f=&url=' . $item['plink']; - } +// $x = stristr($item['plink'],'/display/'); +// if($x) { +// $sparkle = false; +// $y = best_link_url($item,$sparkle,true); + // if($sparkle) +// $item['plink'] = $y . '?f=&url=' . $item['plink']; +// } } /** -- cgit v1.2.3 From 62d08029d83b38912108127644ff9fa0a8da1a56 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 29 Jan 2013 14:29:40 -0800 Subject: connnnnnnnections --- include/conversation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 65110fc72..524b4340c 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -791,7 +791,7 @@ function item_photo_menu($item){ if($contact) { $poke_link = $a->get_baseurl($ssl_state) . '/poke/?f=&c=' . $contact['abook_id']; - $contact_url = $a->get_baseurl($ssl_state) . '/connnections/' . $contact['abook_id']; + $contact_url = $a->get_baseurl($ssl_state) . '/connections/' . $contact['abook_id']; $posts_link = $a->get_baseurl($ssl_state) . '/network/?cid=' . $contact['abook_id']; $clean_url = normalise_link($item['author-link']); -- cgit v1.2.3 From b41106f2fbebfd0bbc2bfc70efd3421073469f44 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 2 Feb 2013 16:34:00 -0800 Subject: allow non-linkable locations, self-linked locations and get rid of google default location link --- include/conversation.php | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 524b4340c..200e876d9 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -548,10 +548,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { $profile_avatar = $item['author']['xchan_photo_m']; - $locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => ''); - call_hooks('render_location',$locate); - - $location = ((strlen($locate['html'])) ? $locate['html'] : render_location_google($locate)); + $location = format_location($item); localize_item($item); if($mode === 'network-new') @@ -1085,9 +1082,25 @@ function find_thread_parent_index($arr,$x) { return false; } -function render_location_google($item) { - $location = (($item['location']) ? '' . $item['location'] . '' : ''); - $coord = (($item['coord']) ? '' . $item['coord'] . '' : ''); +function format_location($item) { + + if(strpos($item['location'],'#') === 0) { + $location = substr($item['location'],1); + $location = ((strpos($location,'[') !== false) ? bbcode($location) : $location); + } + else { + $locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => ''); + call_hooks('render_location',$locate); + $location = ((strlen($locate['html'])) ? $locate['html'] : render_location_default($locate)); + } + return $location; +} + +function render_location_default($item) { + + $location = $item['location']; + $coord = $item['coord']; + if($coord) { if($location) $location .= '
(' . $coord . ')'; -- cgit v1.2.3 From fb2b21626ece67862708600b11acb4c748c649f4 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 3 Feb 2013 19:53:16 -0800 Subject: clearly a chanview link is not going to work there, go back to zid. --- include/conversation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 200e876d9..94865e783 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -310,7 +310,7 @@ function localize_item(&$item){ // add zid's to public images if(preg_match_all('/\[url=(.*?)\/photos\/(.*?)\/image\/(.*?)\]\[img(.*?)\]h(.*?)\[\/img\]\[\/url\]/is',$item['body'],$matches,PREG_SET_ORDER)) { foreach($matches as $mtch) { - $item['body'] = str_replace($mtch[0],'[url=' . chanlink_url($mtch[1] . '/photos/' . $mtch[2] . '/image/' . $mtch[3] ,true) . '][img' . $mtch[4] . ']h' . $mtch[5] . '[/img][/url]',$item['body']); + $item['body'] = str_replace($mtch[0],'[url=' . zid( $mtch[1] . '/photos/' . $mtch[2] . '/image/' . $mtch[3]) . '][img' . $mtch[4] . ']h' . $mtch[5] . '[/img][/url]',$item['body']); } } -- cgit v1.2.3 From 421921d4d0f0327b2d62d4e1a169771a3feb7db3 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 4 Feb 2013 00:03:19 -0800 Subject: debugging mark all seen for various notification types --- include/conversation.php | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 94865e783..179bc8e0f 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -588,15 +588,15 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { 'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, $profile_url), 'profile_url' => $profile_link, 'item_photo_menu' => item_photo_menu($item), - 'name' => template_escape($profile_name), + 'name' => $profile_name, 'sparkle' => $sparkle, 'lock' => $lock, 'thumb' => $profile_avatar, - 'title' => template_escape($item['title']), - 'body' => template_escape($body), - 'tags' => template_escape($tags), - 'hashtags' => template_escape($hashtags), - 'mentions' => template_escape($mentions), + 'title' => $item['title'], + 'body' => $body, + 'tags' => $tags, + 'hashtags' => $hashtags, + 'mentions' => $mentions, 'txt_cats' => t('Categories:'), 'txt_folders' => t('Filed under:'), 'has_cats' => ((count($categories)) ? 'true' : ''), @@ -604,14 +604,14 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { 'categories' => $categories, 'folders' => $folders, - 'text' => strip_tags(template_escape($body)), + 'text' => strip_tags($body), 'ago' => relative_date($item['created']), 'app' => $item['app'], 'str_app' => sprintf( t(' from %s'), $item['app']), 'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'c'), - 'location' => template_escape($location), + 'location' => $location, 'indent' => '', - 'owner_name' => template_escape($owner_name), + 'owner_name' => $owner_name, 'owner_url' => $owner_url, 'owner_photo' => $owner_photo, 'plink' => get_plink($item), @@ -705,6 +705,10 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { if($page_mode === 'preview') logger('preview: ' . print_r($threads,true)); + +// logger('nouveau: ' . print_r($threads,true)); + + $o = replace_macros($page_template, array( '$baseurl' => $a->get_baseurl($ssl_state), '$live_update' => $live_update_div, -- cgit v1.2.3 From da388f4bc5bd3a1aaea3c54b94fe1f8e4cf10561 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 4 Feb 2013 17:46:04 -0800 Subject: fix new/search mod on network page, fix the parent queries on network and channel pages - which you probably didn't even notice were all stuffed up because the endless scroll made things right. --- include/conversation.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 179bc8e0f..03f53980d 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -583,6 +583,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { //$tmp_item = replace_macros($tpl,array( $tmp_item = array( 'template' => $tpl, + 'toplevel' => 'toplevel_item', 'tags' => $tags, 'id' => (($preview) ? 'P0' : $item['item_id']), 'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, $profile_url), @@ -632,8 +633,8 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { $arr = array('item' => $item, 'output' => $tmp_item); call_hooks('display_item', $arr); - $threads[$threadsid]['id'] = $item['item_id']; - $threads[$threadsid]['items'] = array($arr['output']); +// $threads[$threadsid]['id'] = $item['item_id']; + $threads[] = $arr['output']; } @@ -705,6 +706,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { if($page_mode === 'preview') logger('preview: ' . print_r($threads,true)); +// logger('page_template: ' . $page_template); // logger('nouveau: ' . print_r($threads,true)); @@ -720,8 +722,8 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { '$dropping' => ($page_dropping?t('Delete Selected Items'):False), )); - if($page_mode === 'preview') - logger('preview: ' . $o); +// if($page_mode === 'preview') +// logger('preview: ' . $o); return $o; -- cgit v1.2.3 From 66b36031781a1b4b00a14a294232c1b4606e62b3 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 4 Feb 2013 18:50:55 -0800 Subject: make preview work again after search/new template change --- include/conversation.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 03f53980d..8929c3aa5 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -706,7 +706,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { if($page_mode === 'preview') logger('preview: ' . print_r($threads,true)); -// logger('page_template: ' . $page_template); + logger('page_template: ' . $page_template); // logger('nouveau: ' . print_r($threads,true)); @@ -722,8 +722,8 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { '$dropping' => ($page_dropping?t('Delete Selected Items'):False), )); -// if($page_mode === 'preview') -// logger('preview: ' . $o); + if($page_mode === 'preview') + logger('preview: ' . $o); return $o; -- cgit v1.2.3 From a5671c0e2684161c80d1e7b4046e177129c0de42 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 4 Feb 2013 23:54:59 -0800 Subject: error 500 trying to debug templates --- include/conversation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 8929c3aa5..12d5c7160 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -706,7 +706,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { if($page_mode === 'preview') logger('preview: ' . print_r($threads,true)); - logger('page_template: ' . $page_template); +// logger('page_template: ' . $page_template); // logger('nouveau: ' . print_r($threads,true)); -- cgit v1.2.3 From d8c667288ecf6cd358751df250f2b45e476ff40c Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 9 Feb 2013 03:40:56 -0800 Subject: this seems to cut load times in half --- include/conversation.php | 48 ++++++++++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 18 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 12d5c7160..4758721a5 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -300,17 +300,21 @@ function localize_item(&$item){ */ $matches = null; - if(preg_match_all('/@\[url=(.*?)\]/is',$item['body'],$matches,PREG_SET_ORDER)) { - foreach($matches as $mtch) { - if(! strpos($mtch[1],'zid=')) - $item['body'] = str_replace($mtch[0],'@[url=' . zid($mtch[1]). ']',$item['body']); + if(strpos($item['body'],'[url') !== false) { + if(preg_match_all('/@\[url=(.*?)\]/is',$item['body'],$matches,PREG_SET_ORDER)) { + foreach($matches as $mtch) { + if(! strpos($mtch[1],'zid=')) + $item['body'] = str_replace($mtch[0],'@[url=' . zid($mtch[1]). ']',$item['body']); + } } } - // add zid's to public images - if(preg_match_all('/\[url=(.*?)\/photos\/(.*?)\/image\/(.*?)\]\[img(.*?)\]h(.*?)\[\/img\]\[\/url\]/is',$item['body'],$matches,PREG_SET_ORDER)) { - foreach($matches as $mtch) { + if(strpos($item['body'],'[img') !== false) { + // add zid's to public images + if(preg_match_all('/\[url=(.*?)\/photos\/(.*?)\/image\/(.*?)\]\[img(.*?)\]h(.*?)\[\/img\]\[\/url\]/is',$item['body'],$matches,PREG_SET_ORDER)) { + foreach($matches as $mtch) { $item['body'] = str_replace($mtch[0],'[url=' . zid( $mtch[1] . '/photos/' . $mtch[2] . '/image/' . $mtch[3]) . '][img' . $mtch[4] . ']h' . $mtch[5] . '[/img][/url]',$item['body']); + } } } @@ -378,6 +382,9 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { $previewing = (($preview) ? ' preview ' : ''); if($mode === 'network') { + + $t1 = dba_timer(); + $profile_owner = local_user(); $page_writeable = true; @@ -661,33 +668,33 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { if(feature_enabled($profile_owner,'dislike')) like_puller($a,$item,$dlike,'dislike'); - // Only add what is visible - if($item['network'] === NETWORK_MAIL && local_user() != $item['uid']) { - continue; - } if(! visible_activity($item)) { continue; } - - - $item['pagedrop'] = $page_dropping; - - if($item['id'] == $item['parent']) { +// $tx1 = dba_timer(); $item_object = new Item($item); $conv->add_thread($item_object); +// $tx2 = dba_timer(); +// if($mode === 'network') +// profiler($tx1,$tx2,'add thread ' . $item['id']); } } - + $t2 = dba_timer(); $threads = $conv->get_template_data($alike, $dlike); if(!$threads) { logger('[ERROR] conversation : Failed to get template data.', LOGGER_DEBUG); $threads = array(); } - + $t3 = dba_timer(); + if($mode === 'network') { + profiler($t1,$t2,'Conversation prepare'); + profiler($t2,$t3,'Conversation get_template'); + } + } } @@ -722,6 +729,11 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { '$dropping' => ($page_dropping?t('Delete Selected Items'):False), )); + if($mode === 'network') { + $t4 = dba_timer(); + profiler($t3,$t4,'conversation template'); + } + if($page_mode === 'preview') logger('preview: ' . $o); -- cgit v1.2.3 From 99c5f88963227a48544747e9dc8b13550b88c0f2 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 10 Feb 2013 04:55:29 -0800 Subject: mod_display - no fun. Not working at all. But a bit of progress. --- include/conversation.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 4758721a5..fe4ac54f5 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -409,6 +409,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { . ((x($_GET,'cmin')) ? '&cmin=' . $_GET['cmin'] : '') . ((x($_GET,'cmax')) ? '&cmax=' . $_GET['cmax'] : '') . ((x($_GET,'file')) ? '&file=' . $_GET['file'] : '') + . ((x($_GET,'uri')) ? '&uri=' . $_GET['uri'] : '') . "'; var profile_page = " . $a->pager['page'] . "; \r\n"; } @@ -435,8 +436,8 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { } elseif($mode === 'display') { - $profile_owner = $a->profile['uid']; - $page_writeable = ($profile_owner == local_user()); + $profile_owner = local_user(); + $page_writeable = false; $live_update_div = '
' . "\r\n"; -- cgit v1.2.3 From 2cfd73c57da302a1171f22a5b1b73a5d2195d3ad Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 10 Feb 2013 16:04:03 -0800 Subject: progress on mod/display - slow but any progress is good --- include/conversation.php | 1 + 1 file changed, 1 insertion(+) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index fe4ac54f5..c1748dea2 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -714,6 +714,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { if($page_mode === 'preview') logger('preview: ' . print_r($threads,true)); +// Do not un-comment if smarty3 is in use // logger('page_template: ' . $page_template); // logger('nouveau: ' . print_r($threads,true)); -- cgit v1.2.3 From 4bde38c4294a30af0ad77cc15368e179a3de8a31 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 13 Feb 2013 23:54:25 -0800 Subject: make 'view in context' actually go somewhere useful --- include/conversation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index c1748dea2..368a0b0df 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -632,7 +632,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { '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'=> z_root() . '/display/' . $item['uri'], 'title'=> t('View in context'))), 'previewing' => $previewing, 'wait' => t('Please wait'), 'thread_level' => 1, -- cgit v1.2.3 From cfd0dc1bffb8f7151db670af26f89a3a746fd88d Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 24 Feb 2013 20:21:37 -0800 Subject: little fixes --- include/conversation.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 368a0b0df..285c64cbb 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -126,9 +126,10 @@ function localize_item(&$item){ break; case ACTIVITY_OBJ_NOTE: default: - if(! ($item_flags & ITEM_THREAD_TOP)) - $post_type = t('comment'); - else +// wrong item_flags, this won't work +// if(! ($item_flags & ITEM_THREAD_TOP)) +// $post_type = t('comment'); +// else $post_type = t('status'); break; } -- cgit v1.2.3 From ea3940c4b0b8232e2de0771811b9f90ade9ee45f Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 25 Feb 2013 17:09:40 -0800 Subject: start formatting for Doxygen --- include/conversation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 285c64cbb..90a6aaa7f 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1,4 +1,4 @@ - Date: Wed, 27 Feb 2013 17:09:04 -0800 Subject: taking the next step on pages --- include/conversation.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 90a6aaa7f..f8507c595 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -949,6 +949,9 @@ function status_editor($a,$x,$popup=false) { '$return_path' => $a->query_string, '$action' => $a->get_baseurl(true) . '/item', '$share' => (x($x,'button') ? $x['button'] : t('Share')), + '$webpage' => (x($x,'webpage') ? '1' : ''), + '$placeholdpagetitle' => t('Page link title'), + '$pagetitle' => (x($x,'pagetitle') ? $x['pagetitle'] : ''), '$upload' => t('Upload photo'), '$shortupload' => t('upload photo'), '$attach' => t('Attach file'), -- cgit v1.2.3 From 8d442e6fc1364ea351a9b781e8173c1b679b7a91 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 4 Mar 2013 20:58:39 -0800 Subject: fix timeago (again), webfinger new spec implemented, some theme work --- include/conversation.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index f8507c595..e8c391967 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -618,7 +618,8 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { 'ago' => relative_date($item['created']), 'app' => $item['app'], 'str_app' => sprintf( t(' from %s'), $item['app']), - 'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'c'), + 'isotime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'c'), + 'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'r'), 'location' => $location, 'indent' => '', 'owner_name' => $owner_name, -- cgit v1.2.3 From dd22e1b5824b38fa2a1455df22dbee7da2201c76 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 5 Mar 2013 15:48:56 -0800 Subject: just tinkering and trying a few things - don't get upset. It can all be reverted it it sucks. Freedom's just another word for "nothin' left to lose" and I'm not sure it's possible to create a UI that's hated more than Friendica. So that gives us plenty of artististic license to explore some different directions and see if they lead to anything interesting. --- include/conversation.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index e8c391967..0d539c2e2 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -658,6 +658,12 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { $conv = new Conversation($mode, $preview); + // In the display mode we don't have a profile owner. + + if($mode === 'display' && $items) + $conv->set_profile_owner($items[0]['uid']); + + // get all the topmost parents // this shouldn't be needed, as we should have only them in our array // But for now, this array respects the old style, just in case -- cgit v1.2.3 From c5d0da43e57cf812dd3a88b04740728f7ae65523 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 6 Mar 2013 15:13:54 -0800 Subject: tweaky tweak, plus add share tracking db, and don't show acl for guest postings, and experiment with compressing pcss on the fly --- include/conversation.php | 1 + 1 file changed, 1 insertion(+) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 0d539c2e2..06bc7ff70 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -993,6 +993,7 @@ function status_editor($a,$x,$popup=false) { '$emtitle' => t('Example: bob@example.com, mary@example.com'), '$lockstate' => $x['lockstate'], '$acl' => $x['acl'], + '$showacl' => ((array_key_exists('showacl',$x)) ? $x['showacl'] : 'yes'), '$bang' => $x['bang'], '$profile_uid' => $x['profile_uid'], '$preview' => ((feature_enabled($x['profile_uid'],'preview')) ? t('Preview') : ''), -- cgit v1.2.3 From b86277b0ff7aa7ea5e04a646b628785fc31f0c3e Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 11 Mar 2013 16:13:09 -0700 Subject: dangerous typo that removes all your hublocs, fix reshare formatting --- include/conversation.php | 1 + 1 file changed, 1 insertion(+) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 06bc7ff70..9a2ddd151 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -652,6 +652,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { else { // Normal View +// logger('conv: items: ' . print_r($items,true)); require_once('include/ConversationObject.php'); require_once('include/ItemObject.php'); -- cgit v1.2.3 From ddf5bf8968a12501939cd37898d303967b748600 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 21 Mar 2013 18:25:41 -0700 Subject: rename 'uri' (and parent_uri) to 'mid' (and parent_mid) since these no longer remotely resemble uri's and are actually message_id's. This change is potentially destabilising because it touches a lot of code and structure. But it has to get done and there's no better time than the present. --- include/conversation.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 9a2ddd151..882d108f5 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -234,8 +234,8 @@ function localize_item(&$item){ if (activity_match($item['verb'],ACTIVITY_TAG)) { $r = q("SELECT * from `item`,`contact` WHERE - `item`.`contact-id`=`contact`.`id` AND `item`.`uri`='%s';", - dbesc($item['parent_uri'])); + `item`.`contact-id`=`contact`.`id` AND `item`.`mid`='%s';", + dbesc($item['parent_mid'])); if(count($r)==0) return; $obj=$r[0]; @@ -282,7 +282,7 @@ function localize_item(&$item){ $obj = parse_xml_string($xmlhead.$item['object']); if(strlen($obj->id)) { - $r = q("select * from item where uri = '%s' and uid = %d limit 1", + $r = q("select * from item where mid = '%s' and uid = %d limit 1", dbesc($obj->id), intval($item['uid']) ); @@ -634,7 +634,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { 'like' => '', 'dislike' => '', 'comment' => '', - 'conv' => (($preview) ? '' : array('href'=> z_root() . '/display/' . $item['uri'], 'title'=> t('View in context'))), + 'conv' => (($preview) ? '' : array('href'=> z_root() . '/display/' . $item['mid'], 'title'=> t('View in context'))), 'previewing' => $previewing, 'wait' => t('Please wait'), 'thread_level' => 1, @@ -870,7 +870,7 @@ function like_puller($a,$item,&$arr,$mode) { $url = zid($url); if(! $item['thr_parent']) - $item['thr_parent'] = $item['parent_uri']; + $item['thr_parent'] = $item['parent_mid']; if(! ((isset($arr[$item['thr_parent'] . '-l'])) && (is_array($arr[$item['thr_parent'] . '-l'])))) $arr[$item['thr_parent'] . '-l'] = array(); @@ -1017,12 +1017,12 @@ function get_item_children($arr, $parent) { foreach($arr as $item) { if($item['id'] != $item['parent']) { if(get_config('system','thread_allow')) { - // Fallback to parent_uri if thr_parent is not set + // Fallback to parent_mid if thr_parent is not set $thr_parent = $item['thr_parent']; if($thr_parent == '') - $thr_parent = $item['parent_uri']; + $thr_parent = $item['parent_mid']; - if($thr_parent == $parent['uri']) { + if($thr_parent == $parent['mid']) { $item['children'] = get_item_children($arr, $item); $children[] = $item; } -- cgit v1.2.3 From 50db4a7120d7e4417f097621e36359fbb8b6a5e4 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 28 Apr 2013 22:46:07 -0700 Subject: port superblock core code (except Red will use an xchan instead of a URL) --- include/conversation.php | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 882d108f5..a615dfcc5 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -375,6 +375,20 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { $ssl_state = ((local_user()) ? true : false); + + $arr_blocked = null; + + if(local_user()) { + $str_blocked = get_pconfig(local_user(),'system','blocked'); + if($str_blocked) { + $arr_blocked = explode(',',$str_blocked); + for($x = 0; $x < count($arr_blocked); $x ++) + $arr_blocked[$x] = trim($arr_blocked[$x]); + } + + } + + $profile_owner = 0; $page_writeable = false; $live_update_div = ''; @@ -497,10 +511,27 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { // "New Item View" on network page or search page results // - just loop through the items and format them minimally for display + + + + //$tpl = get_markup_template('search_item.tpl'); $tpl = 'search_item.tpl'; foreach($items as $item) { + + if($arr_blocked) { + $blocked = false; + foreach($arr_blocked as $b) { + if(($b) && ($item['author_xchan'] == $b)) { + $blocked = true; + break; + } + } + if($blocked) + continue; + } + $threadsid++; $comment = ''; @@ -672,6 +703,18 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { $threads = array(); foreach($items as $item) { + if($arr_blocked) { + $blocked = false; + foreach($arr_blocked as $b) { + if(($b) && ($item['author_xchan'] == $b)) { + $blocked = true; + break; + } + } + if($blocked) + continue; + } + // Can we put this after the visibility check? like_puller($a,$item,$alike,'like'); -- cgit v1.2.3 From 112dbf3abd543152ad4ed3f444331ac88c1f4c46 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 9 May 2013 18:08:00 -0700 Subject: get search page working with live-update and endless scroll, still not perfect - there may be duplicated content and possibly unauthorised content and 'timeago' not working correctly - will deal with those later, but at least you can see results. --- include/conversation.php | 3 --- 1 file changed, 3 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index a615dfcc5..59624959f 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -512,9 +512,6 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { // - just loop through the items and format them minimally for display - - - //$tpl = get_markup_template('search_item.tpl'); $tpl = 'search_item.tpl'; -- cgit v1.2.3 From e81e11382f9c746c59fa11b3baef401f8c328cd4 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 28 May 2013 01:50:28 -0700 Subject: cleanup localisation of like activities --- include/conversation.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 59624959f..6f463a39a 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -126,11 +126,9 @@ function localize_item(&$item){ break; case ACTIVITY_OBJ_NOTE: default: -// wrong item_flags, this won't work -// if(! ($item_flags & ITEM_THREAD_TOP)) -// $post_type = t('comment'); -// else - $post_type = t('status'); + $post_type = t('status'); + if($obj->id != $item['mid']) + $post_type = t('comment'); break; } -- cgit v1.2.3 From 4a072297f7ba036da475ccaaaef765abb4105501 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 12 Jun 2013 00:58:31 -0700 Subject: missed a few zrl/zmg conversions, like for translate_item and enotify messages --- include/conversation.php | 51 ++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 25 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 6f463a39a..13f67c4dd 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -114,8 +114,8 @@ function localize_item(&$item){ if($author_link && $author_name && $item_url) { - $author = '[url=' . chanlink_url($item['author']['xchan_url']) . ']' . $item['author']['xchan_name'] . '[/url]'; - $objauthor = '[url=' . chanlink_url($author_link) . ']' . $author_name . '[/url]'; + $author = '[zrl=' . chanlink_url($item['author']['xchan_url']) . ']' . $item['author']['xchan_name'] . '[/zrl]'; + $objauthor = '[zrl=' . chanlink_url($author_link) . ']' . $author_name . '[/zrl]'; switch($obj->type) { case ACTIVITY_OBJ_PHOTO: @@ -132,7 +132,7 @@ function localize_item(&$item){ break; } - $plink = '[url=' . zid($item_url) . ']' . $post_type . '[/url]'; + $plink = '[zrl=' . zid($item_url) . ']' . $post_type . '[/zrl]'; if(activity_match($item['verb'],ACTIVITY_LIKE)) { $bodyverb = t('%1$s likes %2$s\'s %3$s'); @@ -165,9 +165,9 @@ function localize_item(&$item){ $Bname = $obj['title']; - $A = '[url=' . chanlink_url($Alink) . ']' . $Aname . '[/url]'; - $B = '[url=' . chanlink_url($Blink) . ']' . $Bname . '[/url]'; - if ($Bphoto!="") $Bphoto = '[url=' . chanlink_url($Blink) . '][img=80x80]' . $Bphoto . '[/img][/url]'; + $A = '[zrl=' . chanlink_url($Alink) . ']' . $Aname . '[/zrl]'; + $B = '[zrl=' . chanlink_url($Blink) . ']' . $Bname . '[/zrl]'; + if ($Bphoto!="") $Bphoto = '[zrl=' . chanlink_url($Blink) . '][zmg=80x80]' . $Bphoto . '[/zmg][/zrl]'; $item['body'] = $item['localize'] = sprintf( t('%1$s is now connected with %2$s'), $A, $B); $item['body'] .= "\n\n\n" . $Bphoto; @@ -193,9 +193,9 @@ function localize_item(&$item){ } $Bname = $obj['title']; - $A = '[url=' . chanlink_url($Alink) . ']' . $Aname . '[/url]'; - $B = '[url=' . chanlink_url($Blink) . ']' . $Bname . '[/url]'; - if ($Bphoto!="") $Bphoto = '[url=' . chanlink_url($Blink) . '][img=80x80]' . $Bphoto . '[/img][/url]'; + $A = '[zrl=' . chanlink_url($Alink) . ']' . $Aname . '[/zrl]'; + $B = '[zrl=' . chanlink_url($Blink) . ']' . $Bname . '[/zrl]'; + if ($Bphoto!="") $Bphoto = '[zrl=' . chanlink_url($Blink) . '][zmg=80x80]' . $Bphoto . '[/zmg][/zrl]'; // we can't have a translation string with three positions but no distinguishable text // So here is the translate string. @@ -220,7 +220,7 @@ function localize_item(&$item){ $Aname = $item['author']['xchan_name']; $Alink = $item['author']['xchan_url']; - $A = '[url=' . chanlink_url($Alink) . ']' . $Aname . '[/url]'; + $A = '[zrl=' . chanlink_url($Alink) . ']' . $Aname . '[/zrl]'; $txt = t('%1$s is currently %2$s'); @@ -237,8 +237,8 @@ function localize_item(&$item){ if(count($r)==0) return; $obj=$r[0]; - $author = '[url=' . zid($item['author-link']) . ']' . $item['author-name'] . '[/url]'; - $objauthor = '[url=' . zid($obj['author-link']) . ']' . $obj['author-name'] . '[/url]'; + $author = '[zrl=' . zid($item['author-link']) . ']' . $item['author-name'] . '[/zrl]'; + $objauthor = '[zrl=' . zid($obj['author-link']) . ']' . $obj['author-name'] . '[/zrl]'; switch($obj['verb']){ case ACTIVITY_POST: @@ -253,17 +253,17 @@ function localize_item(&$item){ default: if($obj['resource_id']){ $post_type = t('photo'); - $m=array(); preg_match("/\[url=([^]]*)\]/", $obj['body'], $m); + $m=array(); preg_match("/\[[zu]rl=([^]]*)\]/", $obj['body'], $m); $rr['plink'] = $m[1]; } else { $post_type = t('status'); } } - $plink = '[url=' . $obj['plink'] . ']' . $post_type . '[/url]'; + $plink = '[zrl=' . $obj['plink'] . ']' . $post_type . '[/zrl]'; $parsedobj = parse_xml_string($xmlhead.$item['object']); - $tag = sprintf('#[url=%s]%s[/url]', $parsedobj->id, $parsedobj->content); + $tag = sprintf('#[zrl=%s]%s[/zrl]', $parsedobj->id, $parsedobj->content); $item['body'] = sprintf( t('%1$s tagged %2$s\'s %3$s with %4$s'), $author, $objauthor, $plink, $tag ); } @@ -288,9 +288,9 @@ function localize_item(&$item){ $target = $r[0]; $Bname = $target['author-name']; $Blink = $target['author-link']; - $A = '[url=' . zid($Alink) . ']' . $Aname . '[/url]'; - $B = '[url=' . zid($Blink) . ']' . $Bname . '[/url]'; - $P = '[url=' . $target['plink'] . ']' . t('post/item') . '[/url]'; + $A = '[zrl=' . zid($Alink) . ']' . $Aname . '[/zrl]'; + $B = '[zrl=' . zid($Blink) . ']' . $Bname . '[/zrl]'; + $P = '[zrl=' . $target['plink'] . ']' . t('post/item') . '[/zrl]'; $item['body'] = sprintf( t('%1$s marked %2$s\'s %3$s as favorite'), $A, $B, $P)."\n"; } @@ -298,25 +298,26 @@ function localize_item(&$item){ } */ +/* $matches = null; - if(strpos($item['body'],'[url') !== false) { - if(preg_match_all('/@\[url=(.*?)\]/is',$item['body'],$matches,PREG_SET_ORDER)) { + if(strpos($item['body'],'[zrl') !== false) { + if(preg_match_all('/@\[zrl=(.*?)\]/is',$item['body'],$matches,PREG_SET_ORDER)) { foreach($matches as $mtch) { if(! strpos($mtch[1],'zid=')) - $item['body'] = str_replace($mtch[0],'@[url=' . zid($mtch[1]). ']',$item['body']); + $item['body'] = str_replace($mtch[0],'@[zrl=' . zid($mtch[1]). ']',$item['body']); } } } - if(strpos($item['body'],'[img') !== false) { + if(strpos($item['body'],'[zmg') !== false) { // add zid's to public images - if(preg_match_all('/\[url=(.*?)\/photos\/(.*?)\/image\/(.*?)\]\[img(.*?)\]h(.*?)\[\/img\]\[\/url\]/is',$item['body'],$matches,PREG_SET_ORDER)) { + if(preg_match_all('/\[zrl=(.*?)\/photos\/(.*?)\/image\/(.*?)\]\[zmg(.*?)\]h(.*?)\[\/zmg\]\[\/zrl\]/is',$item['body'],$matches,PREG_SET_ORDER)) { foreach($matches as $mtch) { - $item['body'] = str_replace($mtch[0],'[url=' . zid( $mtch[1] . '/photos/' . $mtch[2] . '/image/' . $mtch[3]) . '][img' . $mtch[4] . ']h' . $mtch[5] . '[/img][/url]',$item['body']); + $item['body'] = str_replace($mtch[0],'[zrl=' . zid( $mtch[1] . '/photos/' . $mtch[2] . '/image/' . $mtch[3]) . '][zmg' . $mtch[4] . ']h' . $mtch[5] . '[/zmg][/zrl]',$item['body']); } } } - +*/ // add sparkle links to appropriate permalinks // $x = stristr($item['plink'],'/display/'); -- cgit v1.2.3 From 765d6e0a97f135755d6ec1322f6e3272bc0ae620 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 14 Jun 2013 16:54:58 -0700 Subject: push refresh messages, performance work on conversations and configs, doc updates --- include/conversation.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 13f67c4dd..8e69e9ea3 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -365,7 +365,7 @@ function visible_activity($item) { * */ -if(!function_exists('conversation')) { + function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { $tstart = dba_timer(); @@ -374,6 +374,8 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { $ssl_state = ((local_user()) ? true : false); + if(local_user()) + load_pconfig(local_user(),''); $arr_blocked = null; @@ -678,6 +680,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { } else { + // Normal View // logger('conv: items: ' . print_r($items,true)); @@ -790,7 +793,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { return $o; -}} +} function best_link_url($item) { -- cgit v1.2.3 From 40c8e89d8476696a2e4a57a27970f6067b803e22 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 18 Jun 2013 18:48:41 -0700 Subject: undo comment policy override - there are a handful of stored posts from the 17th-June with a broken policy (which won't have a comment box) but it seems to be working for both recent and older posts. --- include/conversation.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 8e69e9ea3..b6823e3c5 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -6,7 +6,7 @@ require_once('include/items.php'); // is identical to the code in mod/message.php for 'item_extract_images' and // 'item_redir_and_replace_images' -if(! function_exists('item_extract_images')) { + function item_extract_images($body) { $saved_image = array(); @@ -46,9 +46,9 @@ function item_extract_images($body) { $new_body = $new_body . $orig_body; return array('body' => $new_body, 'images' => $saved_image); -}} +} + -if(! function_exists('item_redir_and_replace_images')) { function item_redir_and_replace_images($body, $images, $cid) { $origbody = $body; @@ -81,7 +81,7 @@ function item_redir_and_replace_images($body, $images, $cid) { } return $newbody; -}} +} @@ -826,7 +826,7 @@ function best_link_url($item) { } -if(! function_exists('item_photo_menu')){ + function item_photo_menu($item){ $a = get_app(); $contact = null; @@ -893,9 +893,9 @@ function item_photo_menu($item){ elseif ($v!="") $o .= "
  • $k
  • \n"; } return $o; -}} +} + -if(! function_exists('like_puller')) { function like_puller($a,$item,&$arr,$mode) { $url = ''; @@ -923,7 +923,7 @@ function like_puller($a,$item,&$arr,$mode) { $arr[$item['thr_parent'] . '-l'][] = '' . $item['author']['xchan_name'] . ''; } return; -}} +} // Format the like/dislike text for a profile item // $cnt = number of people who like/dislike the item @@ -932,7 +932,7 @@ function like_puller($a,$item,&$arr,$mode) { // $id = item id // returns formatted text -if(! function_exists('format_like')) { + function format_like($cnt,$arr,$type,$id) { $o = ''; if($cnt == 1) @@ -956,7 +956,7 @@ function format_like($cnt,$arr,$type,$id) { $o .= "\t" . ''; } return $o; -}} +} function status_editor($a,$x,$popup=false) { -- cgit v1.2.3 From ba4f237be26608afdab9b00d6e58e38ac4238d1f Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 18 Jun 2013 20:14:56 -0700 Subject: provide support for "bob likes Lisa's channel" activities --- include/conversation.php | 49 +++++++++++++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 17 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index b6823e3c5..0b841aa77 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -108,6 +108,31 @@ function localize_item(&$item){ $item_url = get_rel_link($obj['link'],'alternate'); + $Bphoto = ''; + + switch($obj->type) { + case ACTIVITY_OBJ_PHOTO: + $post_type = t('photo'); + break; + case ACTIVITY_OBJ_EVENT: + $post_type = t('event'); + break; + case ACTIVITY_OBJ_PERSON: + $post_type = t('channel'); + $author_name = $obj['title']; + if($obj['link']) { + $author_link = get_rel_link($obj['link'],'alternate'); + $Bphoto = get_rel_link($obj['link'],'photo'); + } + break; + case ACTIVITY_OBJ_NOTE: + default: + $post_type = t('status'); + if($obj->id != $item['mid']) + $post_type = t('comment'); + break; + } + // If we couldn't parse something useful, don't bother translating. // We need something better than zid here, probably magic_link(), but it needs writing @@ -117,21 +142,6 @@ function localize_item(&$item){ $author = '[zrl=' . chanlink_url($item['author']['xchan_url']) . ']' . $item['author']['xchan_name'] . '[/zrl]'; $objauthor = '[zrl=' . chanlink_url($author_link) . ']' . $author_name . '[/zrl]'; - switch($obj->type) { - case ACTIVITY_OBJ_PHOTO: - $post_type = t('photo'); - break; - case ACTIVITY_OBJ_EVENT: - $post_type = t('event'); - break; - case ACTIVITY_OBJ_NOTE: - default: - $post_type = t('status'); - if($obj->id != $item['mid']) - $post_type = t('comment'); - break; - } - $plink = '[zrl=' . zid($item_url) . ']' . $post_type . '[/zrl]'; if(activity_match($item['verb'],ACTIVITY_LIKE)) { @@ -141,6 +151,8 @@ function localize_item(&$item){ $bodyverb = t('%1$s doesn\'t like %2$s\'s %3$s'); } $item['body'] = $item['localize'] = sprintf($bodyverb, $author, $objauthor, $plink); + if($Bphoto != "") + $item['body'] .= "\n\n\n" . '[zrl=' . chanlink_url($author_link) . '][zmg=80x80]' . $Bphoto . '[/zmg][/zrl]'; } @@ -148,7 +160,8 @@ function localize_item(&$item){ if (activity_match($item['verb'],ACTIVITY_FRIEND)) { - if ($item['obj_type']=="" || $item['obj_type']!== ACTIVITY_OBJ_PERSON) return; + +// if ($item['obj_type']=="" || $item['obj_type']!== ACTIVITY_OBJ_PERSON) return; $Aname = $item['author']['xchan_name']; $Alink = $item['author']['xchan_url']; @@ -349,7 +362,9 @@ function count_descendants($item) { function visible_activity($item) { - if(activity_match($item['verb'],ACTIVITY_LIKE) || activity_match($item['verb'],ACTIVITY_DISLIKE)) + // likes can apply to other things besides posts. Check if they are post children, in which case we handle them specially + + if((activity_match($item['verb'],ACTIVITY_LIKE) || activity_match($item['verb'],ACTIVITY_DISLIKE)) && ($item['mid'] != $item['parent_mid'])) return false; return true; } -- cgit v1.2.3 From 0b935b79dcb82bccd45bf8f68409b6cdf0fceb40 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 18 Jun 2013 20:30:20 -0700 Subject: Support arbitrary likes - "David likes Bob's bicycle" or "Nancy likes Margaret's breasts" or whatever... This is a tricky activity to construct. You will need to set the object owner to the owner of the "thing" and the object title to the name of the "thing". The thing liked can include a photo if desired. This will probably have issues working correctly in other activitystreams environments. --- include/conversation.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 0b841aa77..e12aa1fbc 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -125,6 +125,19 @@ function localize_item(&$item){ $Bphoto = get_rel_link($obj['link'],'photo'); } break; + case ACTIVITY_OBJ_THING: + $post_type = $obj['title']; + $author_name = (($obj['owner'] && $obj['owner']['name']) ? $obj['owner']['name'] : ''); + if($obj['owner'] && $obj['owner']['link']) + $author_link = get_rel_link($obj['owner']['link'],'alternate'); + else + $author_link = ''; + + if($obj['link']) { + $Bphoto = get_rel_link($obj['link'],'photo'); + } + break; + case ACTIVITY_OBJ_NOTE: default: $post_type = t('status'); -- cgit v1.2.3 From 9d03da134807a55c74a5b15895356dc8990f01db Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 18 Jun 2013 21:52:54 -0700 Subject: fall back on object author/actor if no owner --- include/conversation.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index e12aa1fbc..410143a7a 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -127,12 +127,12 @@ function localize_item(&$item){ break; case ACTIVITY_OBJ_THING: $post_type = $obj['title']; - $author_name = (($obj['owner'] && $obj['owner']['name']) ? $obj['owner']['name'] : ''); - if($obj['owner'] && $obj['owner']['link']) - $author_link = get_rel_link($obj['owner']['link'],'alternate'); - else - $author_link = ''; - + if($obj['owner']) { + if(array_key_exists('name',$obj['owner'])) + $obj['owner']['name']; + if(array_key_exists('link',$obj['owner'])) + $author_link = get_rel_link($obj['owner']['link'],'alternate'); + } if($obj['link']) { $Bphoto = get_rel_link($obj['link'],'photo'); } -- cgit v1.2.3 From 5a8cda632b4ba78e19d49b0c652f43940a18ea9e Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 9 Jul 2013 22:48:34 -0700 Subject: remove double tags on search results, updates to install doco to get rid of Friendica name there and clarify Red requirements. --- include/conversation.php | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 410143a7a..1023c068d 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -584,17 +584,6 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { $tags=array(); $hashtags = array(); $mentions = array(); - foreach(explode(',',$item['tag']) as $tag){ - $tag = trim($tag); - if ($tag!="") { - $t = bbcode($tag); - $tags[] = $t; - if($t[0] == '#') - $hashtags[] = $t; - elseif($t[0] == '@') - $mentions[] = $t; - } - } $sp = false; $profile_link = best_link_url($item,$sp); @@ -650,7 +639,6 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { $tmp_item = array( 'template' => $tpl, 'toplevel' => 'toplevel_item', - 'tags' => $tags, 'id' => (($preview) ? 'P0' : $item['item_id']), 'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, $profile_url), 'profile_url' => $profile_link, -- cgit v1.2.3 From 79dacc3f1ad86aabfc78c0ecb8603720dedd4cfe Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 29 Jul 2013 20:31:02 -0700 Subject: fix some weirdness on the zot feed --- include/conversation.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 1023c068d..61b563a5d 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1128,6 +1128,8 @@ function conv_sort($arr,$order) { usort($parents,'sort_thr_created'); elseif(stristr($order,'commented')) usort($parents,'sort_thr_commented'); + elseif(stristr($order,'ascending')) + usort($parents,'sort_thr_created_rev'); if(count($parents)) foreach($parents as $i=>$_x) -- cgit v1.2.3 From c965ed2bb620d12873fdf13aea13d18f12dba063 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 5 Aug 2013 17:32:33 -0700 Subject: enotify: localize things we know how to translate --- include/conversation.php | 4 ---- 1 file changed, 4 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 61b563a5d..fab8da9f9 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -91,10 +91,6 @@ function item_redir_and_replace_images($body, $images, $cid) { function localize_item(&$item){ - $extracted = item_extract_images($item['body']); - if($extracted['images']) - $item['body'] = item_redir_and_replace_images($extracted['body'], $extracted['images'], $item['contact-id']); - if (activity_match($item['verb'],ACTIVITY_LIKE) || activity_match($item['verb'],ACTIVITY_DISLIKE)){ $obj= json_decode($item['object'],true); -- cgit v1.2.3 From 71347bb9e0c5daca206b0ea32812874e165b7b63 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 6 Aug 2013 03:29:57 -0700 Subject: we've been storing json_encoded structures on disk in several places because it's a lot easier to parse than xml - but OMG do they get mangled - stored as single quoted strings when escaped as if double quoted. We need to use my new function json_decode_plus() wherever we need to parse one of these babies to make sure we get it right. Maybe we should've just used serialize(). --- include/conversation.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index fab8da9f9..2d92b37be 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -92,8 +92,8 @@ function item_redir_and_replace_images($body, $images, $cid) { function localize_item(&$item){ if (activity_match($item['verb'],ACTIVITY_LIKE) || activity_match($item['verb'],ACTIVITY_DISLIKE)){ - - $obj= json_decode($item['object'],true); + + $obj = json_decode_plus($item['object']); if($obj['author'] && $obj['author']['link']) $author_link = get_rel_link($obj['author']['link'],'alternate'); @@ -106,7 +106,7 @@ function localize_item(&$item){ $Bphoto = ''; - switch($obj->type) { + switch($obj['type']) { case ACTIVITY_OBJ_PHOTO: $post_type = t('photo'); break; @@ -142,12 +142,10 @@ function localize_item(&$item){ break; } - // If we couldn't parse something useful, don't bother translating. // We need something better than zid here, probably magic_link(), but it needs writing if($author_link && $author_name && $item_url) { - $author = '[zrl=' . chanlink_url($item['author']['xchan_url']) . ']' . $item['author']['xchan_name'] . '[/zrl]'; $objauthor = '[zrl=' . chanlink_url($author_link) . ']' . $author_name . '[/zrl]'; -- cgit v1.2.3 From 24b9799dcad3dc4a224ce2ceaf52645657106a60 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 6 Aug 2013 03:54:49 -0700 Subject: convert all stored json calls to json_decode_plus() --- include/conversation.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 2d92b37be..d80ff2cc7 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -174,7 +174,7 @@ function localize_item(&$item){ $Alink = $item['author']['xchan_url']; - $obj= json_decode($item['object'],true); + $obj= json_decode_plus($item['object']); $Blink = $Bphoto = ''; @@ -203,7 +203,7 @@ function localize_item(&$item){ $Alink = $item['author']['xchan_url']; - $obj= json_decode($item['object'],true); + $obj= json_decode_plus($item['object']); $Blink = $Bphoto = ''; -- cgit v1.2.3 From 085eec48692e08d05bf2f15a2e2cf05db575048f Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 8 Aug 2013 03:28:42 -0700 Subject: malformed ru string file --- include/conversation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index d80ff2cc7..6d551a5c9 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -137,7 +137,7 @@ function localize_item(&$item){ case ACTIVITY_OBJ_NOTE: default: $post_type = t('status'); - if($obj->id != $item['mid']) + if($obj['id'] != $item['mid']) $post_type = t('comment'); break; } -- cgit v1.2.3 From b9314935e6f85bb0098c651d021ce9bdc2753ecb Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 19 Aug 2013 19:05:11 -0700 Subject: localize_item() thinks all likes on posts are likes on comments because we didn't pass any info in the activity object to distinguish them from each other. --- include/conversation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 6d551a5c9..aade06b8a 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -137,7 +137,7 @@ function localize_item(&$item){ case ACTIVITY_OBJ_NOTE: default: $post_type = t('status'); - if($obj['id'] != $item['mid']) + if($obj['mid'] != $obj['parent_mid']) $post_type = t('comment'); break; } -- cgit v1.2.3 From 02a36948685737afdbbb9a292a338b304bb5cc04 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 20 Aug 2013 19:51:58 -0700 Subject: fix superblock for comments --- include/conversation.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index aade06b8a..9dab5931b 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -712,6 +712,8 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { $threads = array(); foreach($items as $item) { + // Check for any blocked authors + if($arr_blocked) { $blocked = false; foreach($arr_blocked as $b) { @@ -724,6 +726,18 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { continue; } + // Check all the kids too + + if($arr_blocked && $item['children']) { + for($d = 0; $d < count($item['children']); $d ++) { + foreach($arr_blocked as $b) { + if(($b) && ($item['children'][$d]['author_xchan'] == $b)) + $item['children'][$d]['author_blocked'] = true; + } + } + } + + // Can we put this after the visibility check? like_puller($a,$item,$alike,'like'); -- cgit v1.2.3 From 99a9aee03e55af84f6963bbdbe3e365a7721e93d Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 22 Aug 2013 06:15:00 -0700 Subject: extra logging for translating likes in notification emails - which is still failing on occasion. --- include/conversation.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 9dab5931b..6e6ffef94 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -162,6 +162,9 @@ function localize_item(&$item){ $item['body'] .= "\n\n\n" . '[zrl=' . chanlink_url($author_link) . '][zmg=80x80]' . $Bphoto . '[/zmg][/zrl]'; } + else { + logger('localize_item like failed: link ' . $author_link . ' name ' . $author_name . ' url ' . $item_url); + } } -- cgit v1.2.3 From 390a1ce552d57fe5eea6bc2ed43ea0b8bb07c77b Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 27 Aug 2013 18:40:33 -0700 Subject: more loose ends --- include/conversation.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 6e6ffef94..f6a5b90da 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -93,7 +93,10 @@ function localize_item(&$item){ if (activity_match($item['verb'],ACTIVITY_LIKE) || activity_match($item['verb'],ACTIVITY_DISLIKE)){ - $obj = json_decode_plus($item['object']); + if(is_array($item['object'])) + $obj = $item['object']; + else + $obj = json_decode_plus($item['object']); if($obj['author'] && $obj['author']['link']) $author_link = get_rel_link($obj['author']['link'],'alternate'); -- cgit v1.2.3 From 7bb92899218a2a0de261d3caeed1d723a508cc13 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 27 Aug 2013 21:06:11 -0700 Subject: Preparatory work for photo conversations (third time). Also take away unused "post new activity" preferences until they actually do something. --- include/conversation.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index f6a5b90da..bd1e12c4e 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -93,10 +93,7 @@ function localize_item(&$item){ if (activity_match($item['verb'],ACTIVITY_LIKE) || activity_match($item['verb'],ACTIVITY_DISLIKE)){ - if(is_array($item['object'])) - $obj = $item['object']; - else - $obj = json_decode_plus($item['object']); + $obj = json_decode_plus($item['object']); if($obj['author'] && $obj['author']['link']) $author_link = get_rel_link($obj['author']['link'],'alternate'); @@ -397,6 +394,7 @@ function visible_activity($item) { function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { $tstart = dba_timer(); + $content_html = ''; require_once('bbcode.php'); @@ -494,10 +492,16 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { } - else if($mode === 'search') { + elseif($mode === 'search') { $live_update_div = '' . "\r\n"; } - + elseif($mode === 'photos') { + $profile_onwer = $a->profile['profile_uid']; + $page_writeable = ($profile_owner == local_user()); + $live_update_div = '
    ' . "\r\n"; + // for photos we've already formatted the top-level item (the photo) + $content_html = $a->data['photo_html']; + } $page_dropping = ((local_user() && local_user() == $profile_owner) ? true : false); @@ -801,8 +805,9 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { // logger('nouveau: ' . print_r($threads,true)); - $o = replace_macros($page_template, array( + $o .= replace_macros($page_template, array( '$baseurl' => $a->get_baseurl($ssl_state), + '$photo_item' => $content_html, '$live_update' => $live_update_div, '$remove' => t('remove'), '$mode' => $mode, -- cgit v1.2.3 From c877d8f9fae246812930c2f2c45db40a52b09366 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 28 Aug 2013 17:57:45 -0700 Subject: It's a wretched mess, but at least photo comments show up again when viewing the photo. This is just temporary until these conversations are merged into the common conversation viewer, so it's not worth spending a lot of time cleaning up the remnants. --- include/conversation.php | 1 + 1 file changed, 1 insertion(+) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index bd1e12c4e..8648209e9 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1150,6 +1150,7 @@ function conv_sort($arr,$order) { elseif(stristr($order,'ascending')) usort($parents,'sort_thr_created_rev'); + if(count($parents)) foreach($parents as $i=>$_x) $parents[$i]['children'] = get_item_children($arr, $_x); -- cgit v1.2.3 From b4bd518e4032661cdfba4e17acdb94e19b23fdd2 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 28 Aug 2013 21:56:01 -0700 Subject: silence some warnings at php E_ALL levels --- include/conversation.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 8648209e9..82010b153 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -394,7 +394,9 @@ function visible_activity($item) { function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { $tstart = dba_timer(); + $t0 = $t1 = $t2 = $t3 = $t4 = $t5 = $t6 = null; $content_html = ''; + $o = ''; require_once('bbcode.php'); -- cgit v1.2.3 From d43a7659854c4bb6052c05a932b257883ea72748 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 31 Aug 2013 04:19:26 -0700 Subject: more debugging on localize_item top find out why likes are not translated in notifications, but are in displayed posts (using 'new' on matrix page) - in one case we're successfully pulling stuff from item['object'] and in the other we aren't - and it's the same object. --- include/conversation.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 82010b153..2157f8291 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -92,8 +92,14 @@ function item_redir_and_replace_images($body, $images, $cid) { function localize_item(&$item){ if (activity_match($item['verb'],ACTIVITY_LIKE) || activity_match($item['verb'],ACTIVITY_DISLIKE)){ - + + if(! $item['object']) + return; + $obj = json_decode_plus($item['object']); + if((! $obj) && ($item['object'])) { + logger('localize_item: failed to decode object: ' . print_r($item['object'],true)); + } if($obj['author'] && $obj['author']['link']) $author_link = get_rel_link($obj['author']['link'],'alternate'); -- cgit v1.2.3 From 8b7757e033c4483da24700722c186057bb431164 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 2 Sep 2013 01:38:17 -0700 Subject: webpage content-type -- needs cleaning up and a security check once all the important bits are in place. --- include/conversation.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 2157f8291..a357e1480 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1009,9 +1009,16 @@ function status_editor($a,$x,$popup=false) { $geotag = (($x['allow_location']) ? replace_macros(get_markup_template('jot_geotag.tpl'), array()) : ''); $plaintext = true; + if(feature_enabled(local_user(),'richtext')) $plaintext = false; + if(intval($x['plaintext'])) + $plaintext = true; + + if(intval($x['mimeselect'])) + $mimeselect = mimetype_select($x['profile_uid']); + $tpl = get_markup_template('jot-header.tpl'); $a->page['htmlhead'] .= replace_macros($tpl, array( @@ -1079,6 +1086,7 @@ function status_editor($a,$x,$popup=false) { '$emtitle' => t('Example: bob@example.com, mary@example.com'), '$lockstate' => $x['lockstate'], '$acl' => $x['acl'], + '$mimeselect' => $mimeselect, '$showacl' => ((array_key_exists('showacl',$x)) ? $x['showacl'] : 'yes'), '$bang' => $x['bang'], '$profile_uid' => $x['profile_uid'], -- cgit v1.2.3 From f44274bfca6137795ee878a076d5aeed0b330f64 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 2 Sep 2013 13:31:59 -0700 Subject: allow a channel owner to define a default mimetype on webpages (otherwise default to "choose") - also fix the selector w/r/t php code. There is no ui for setting either at the moment, but for instance with wiki pages we probably don't want to have multiple choice of the mimetype. Keep it simple. --- include/conversation.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index a357e1480..31bfdbef9 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1016,8 +1016,14 @@ function status_editor($a,$x,$popup=false) { if(intval($x['plaintext'])) $plaintext = true; - if(intval($x['mimeselect'])) - $mimeselect = mimetype_select($x['profile_uid']); + $mimeselct = ''; + if(array_key_exists('mimetype',$x) && $x['mimetype']) { + if($x['mimetype'] === 'choose') + $mimeselect = mimetype_select($x['profile_uid']); + else + $mimeselect = ''; + } + $tpl = get_markup_template('jot-header.tpl'); -- cgit v1.2.3 From 5f2a7573d5423e82b3a73ca91a4e72a56dab1a14 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 2 Sep 2013 13:39:13 -0700 Subject: only allow richtext editor on pages if bbcode is the default mimetype, otherwise use plaintext editor. This will eventually need work to support a visual editor for html or other types. --- include/conversation.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 31bfdbef9..c40691bba 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1013,17 +1013,17 @@ function status_editor($a,$x,$popup=false) { if(feature_enabled(local_user(),'richtext')) $plaintext = false; - if(intval($x['plaintext'])) - $plaintext = true; - $mimeselct = ''; if(array_key_exists('mimetype',$x) && $x['mimetype']) { - if($x['mimetype'] === 'choose') + if($x['mimetype'] != 'text/bbcode') + $plaintext = true; + if($x['mimetype'] === 'choose') { $mimeselect = mimetype_select($x['profile_uid']); + } else - $mimeselect = ''; + $mimeselect = ''; } - + $tpl = get_markup_template('jot-header.tpl'); -- cgit v1.2.3 From 7c775db9d6b9dc68bc05cded7ab93357aeeb9c3f Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 2 Sep 2013 16:01:29 -0700 Subject: fix webpage storage --- include/conversation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index c40691bba..8cee4f34f 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1055,7 +1055,7 @@ function status_editor($a,$x,$popup=false) { '$return_path' => $a->query_string, '$action' => $a->get_baseurl(true) . '/item', '$share' => (x($x,'button') ? $x['button'] : t('Share')), - '$webpage' => (x($x,'webpage') ? '1' : ''), + '$webpage' => (x($x,'webpage') ? $x['webpage'] : ''), '$placeholdpagetitle' => t('Page link title'), '$pagetitle' => (x($x,'pagetitle') ? $x['pagetitle'] : ''), '$upload' => t('Upload photo'), -- cgit v1.2.3 From dfa2efcecf976783c4fa06f4301a851eca8e97c6 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 2 Sep 2013 16:37:54 -0700 Subject: oh that's why --- include/conversation.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 8cee4f34f..299cc1431 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1248,12 +1248,13 @@ function render_location_default($item) { function prepare_page($item) { + return replace_macros(get_markup_template('page_display.tpl'),array( '$author' => $item['author']['xchan_name'], '$auth_url' => $item['author']['xchan_url'], '$date' => datetime_convert('UTC',date_default_timezone_get(),$item['created'],'Y-m-d H:i'), '$title' => smilies(bbcode($item['title'])), - '$body' => smilies(bbcode($item['body'])) + '$body' => prepare_text($item['body'],$item['mimetype']) )); } -- cgit v1.2.3 From a32d86f0a07e244faeb3fde36c002d9657b3552d Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 2 Sep 2013 17:48:48 -0700 Subject: preserve mimetype on page edits --- include/conversation.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 299cc1431..43de9fc8d 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1013,7 +1013,7 @@ function status_editor($a,$x,$popup=false) { if(feature_enabled(local_user(),'richtext')) $plaintext = false; - $mimeselct = ''; + $mimeselect = ''; if(array_key_exists('mimetype',$x) && $x['mimetype']) { if($x['mimetype'] != 'text/bbcode') $plaintext = true; @@ -1021,9 +1021,10 @@ function status_editor($a,$x,$popup=false) { $mimeselect = mimetype_select($x['profile_uid']); } else - $mimeselect = ''; + $mimeselect = ''; } + $webpage = ((x($x,'webpage')) ? $x['webpage'] : ''); $tpl = get_markup_template('jot-header.tpl'); @@ -1055,7 +1056,7 @@ function status_editor($a,$x,$popup=false) { '$return_path' => $a->query_string, '$action' => $a->get_baseurl(true) . '/item', '$share' => (x($x,'button') ? $x['button'] : t('Share')), - '$webpage' => (x($x,'webpage') ? $x['webpage'] : ''), + '$webpage' => $webpage, '$placeholdpagetitle' => t('Page link title'), '$pagetitle' => (x($x,'pagetitle') ? $x['pagetitle'] : ''), '$upload' => t('Upload photo'), @@ -1074,7 +1075,7 @@ function status_editor($a,$x,$popup=false) { '$shortnoloc' => t('clear location'), '$title' => "", '$placeholdertitle' => t('Set title'), - '$catsenabled' => ((feature_enabled($x['profile_uid'],'categories')) ? 'categories' : ''), + '$catsenabled' => ((feature_enabled($x['profile_uid'],'categories') && (! $webpage)) ? 'categories' : ''), '$category' => "", '$placeholdercategory' => t('Categories (comma-separated list)'), '$wait' => t('Please wait'), -- cgit v1.2.3 From 615bf237330519f0d21fccfe6a8f69b5bb4c0f69 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 2 Sep 2013 20:25:33 -0700 Subject: add a layout selector --- include/conversation.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 43de9fc8d..45a744dd8 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1023,7 +1023,18 @@ function status_editor($a,$x,$popup=false) { else $mimeselect = ''; } + + $layoutselect = ''; + if(array_key_exists('layout',$x) && $x['layout']) { + if($x['layout'] === 'choose') { + $layoutselect = layout_select($x['profile_uid']); + } + else + $layoutselect = ''; + } + + $webpage = ((x($x,'webpage')) ? $x['webpage'] : ''); $tpl = get_markup_template('jot-header.tpl'); @@ -1094,6 +1105,7 @@ function status_editor($a,$x,$popup=false) { '$lockstate' => $x['lockstate'], '$acl' => $x['acl'], '$mimeselect' => $mimeselect, + '$layoutselect' => $layoutselect, '$showacl' => ((array_key_exists('showacl',$x)) ? $x['showacl'] : 'yes'), '$bang' => $x['bang'], '$profile_uid' => $x['profile_uid'], -- cgit v1.2.3 From c360bf3252d3a6ec330a80ba70c19af9848a44e1 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 3 Sep 2013 17:49:47 -0700 Subject: personal config to just show the page content without author info - probably this needs to be a page option --- include/conversation.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 45a744dd8..5888d3679 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1262,10 +1262,12 @@ function render_location_default($item) { function prepare_page($item) { + $naked = ((pconfig($item['uid'],'system','nakedpage')) ? 1 : 0); + return replace_macros(get_markup_template('page_display.tpl'),array( - '$author' => $item['author']['xchan_name'], - '$auth_url' => $item['author']['xchan_url'], - '$date' => datetime_convert('UTC',date_default_timezone_get(),$item['created'],'Y-m-d H:i'), + '$author' => (($naked) ? '' : $item['author']['xchan_name']), + '$auth_url' => (($naked) ? '' : $item['author']['xchan_url'], + '$date' => (($naked) ? '' : datetime_convert('UTC',date_default_timezone_get(),$item['created'],'Y-m-d H:i')), '$title' => smilies(bbcode($item['title'])), '$body' => prepare_text($item['body'],$item['mimetype']) )); -- cgit v1.2.3 From bac2dcd46a6c5ebc7ba63fc60e0a90bfe48b8d87 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 3 Sep 2013 17:55:25 -0700 Subject: typo --- include/conversation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 5888d3679..176dc33d4 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1266,7 +1266,7 @@ function prepare_page($item) { return replace_macros(get_markup_template('page_display.tpl'),array( '$author' => (($naked) ? '' : $item['author']['xchan_name']), - '$auth_url' => (($naked) ? '' : $item['author']['xchan_url'], + '$auth_url' => (($naked) ? '' : $item['author']['xchan_url']), '$date' => (($naked) ? '' : datetime_convert('UTC',date_default_timezone_get(),$item['created'],'Y-m-d H:i')), '$title' => smilies(bbcode($item['title'])), '$body' => prepare_text($item['body'],$item['mimetype']) -- cgit v1.2.3 From 879ac359523623d779f3097e5aa02937d6518950 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 3 Sep 2013 18:00:09 -0700 Subject: my bad --- include/conversation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 176dc33d4..2b568c35e 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1262,7 +1262,7 @@ function render_location_default($item) { function prepare_page($item) { - $naked = ((pconfig($item['uid'],'system','nakedpage')) ? 1 : 0); + $naked = ((get_pconfig($item['uid'],'system','nakedpage')) ? 1 : 0); return replace_macros(get_markup_template('page_display.tpl'),array( '$author' => (($naked) ? '' : $item['author']['xchan_name']), -- cgit v1.2.3 From 99ea251b12f9bf361daf8abd96f6b3fab7023aa7 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 4 Sep 2013 21:24:57 -0700 Subject: provide templating options in comanche for the underlying webpage element - in this case the way the author is displayed. Leave this open for other forms templating options. --- include/conversation.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 2b568c35e..0c1479356 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1262,7 +1262,13 @@ function render_location_default($item) { function prepare_page($item) { + $a = get_app(); $naked = ((get_pconfig($item['uid'],'system','nakedpage')) ? 1 : 0); + if(array_key_exists('webpage',$a->layout) && array_key_exists('authored',$a->layout['webpage'])) { + if($a->layout['webpage']['authored'] === 'none') + $naked = 1; + // ... other possible options + } return replace_macros(get_markup_template('page_display.tpl'),array( '$author' => (($naked) ? '' : $item['author']['xchan_name']), -- cgit v1.2.3 From 129a119c84d87bffe099cea7ac5b0ed511c26f80 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 15 Sep 2013 03:48:43 -0700 Subject: implement what I hope will now be the server side of directory sync, add viewsrc to item_photo_menu, and log what changed in import_xchan update objects so we can find out why there are so many updates when nothing _obvious_ has changed that should trigger it. --- include/conversation.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 0c1479356..e7c7831c0 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -876,6 +876,12 @@ function item_photo_menu($item){ $ssl_state = false; + $sub_link=""; + $poke_link=""; + $contact_url=""; + $pm_url=""; + $vsrc_link = ""; + if(local_user()) { $ssl_state = true; if(! count($a->contacts)) @@ -884,14 +890,11 @@ function item_photo_menu($item){ $channel_hash = (($channel) ? $channel['channel_hash'] : ''); } - $sub_link=""; - $poke_link=""; - $contact_url=""; - $pm_url=""; - - if((local_user()) && local_user() == $item['uid'] && $item['parent'] == $item['id'] - && $channel && ($channel_hash != $item['author_xchan'])) { - $sub_link = 'javascript:dosubthread(' . $item['id'] . '); return false;'; + if((local_user()) && local_user() == $item['uid']) { + $vsrc_link = $a->get_baseurl() . '/viewsrc/' . $item['id']; + if($item['parent'] == $item['id'] && $channel && ($channel_hash != $item['author_xchan'])) { + $sub_link = 'javascript:dosubthread(' . $item['id'] . '); return false;'; + } } $profile_link = z_root() . "/chanview/?f=&hash=" . $item['author_xchan']; @@ -910,6 +913,7 @@ function item_photo_menu($item){ } $menu = Array( + t("View Source") => $vsrc_link, t("Follow Thread") => $sub_link, t("View Status") => $status_link, t("View Profile") => $profile_link, -- cgit v1.2.3 From c6d6c01fb619b37fa47f19966421a6636155180c Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 16 Sep 2013 22:40:53 -0700 Subject: use prepare_body in api calls to properly render content, add 'mode' to conversation templates so that themes can use the module context to suppress or show comments as desired --- include/conversation.php | 1 + 1 file changed, 1 insertion(+) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index e7c7831c0..c3f29295e 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -651,6 +651,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { $tmp_item = array( 'template' => $tpl, 'toplevel' => 'toplevel_item', + 'mode' => $mode, 'id' => (($preview) ? 'P0' : $item['item_id']), 'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, $profile_url), 'profile_url' => $profile_link, -- cgit v1.2.3 From fb03195c3f0dd461a0e8b809814f3cfbef515980 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 20 Sep 2013 18:07:16 -0700 Subject: OK, sure. --- include/conversation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index c3f29295e..254453ad1 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -919,7 +919,7 @@ function item_photo_menu($item){ t("View Status") => $status_link, t("View Profile") => $profile_link, t("View Photos") => $photos_link, - t("Network Posts") => $posts_link, + t("Matrix Activity") => $posts_link, t("Edit Contact") => $contact_url, t("Send PM") => $pm_url, t("Poke") => $poke_link -- cgit v1.2.3 From 78a8d176acae142cac9d20315672772eccd6c683 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 2 Oct 2013 21:04:48 -0700 Subject: post signatures --- include/conversation.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 254453ad1..bcd9ae51a 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -638,6 +638,11 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { $likebuttons = false; $shareable = false; + $verified = (($item['item_flags'] & ITEM_VERIFIED) ? t('Message is verified') : ''); + $unverified = ''; + + + $tags=array(); $terms = get_terms_oftype($item['term'],array(TERM_HASHTAG,TERM_MENTION,TERM_UNKNOWN)); if(count($terms)) @@ -665,6 +670,8 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { 'tags' => $tags, 'hashtags' => $hashtags, 'mentions' => $mentions, + 'verified' => $verified, + 'unverified' => $unverified, 'txt_cats' => t('Categories:'), 'txt_folders' => t('Filed under:'), 'has_cats' => ((count($categories)) ? 'true' : ''), -- cgit v1.2.3 From 0e793dea9bfc21a7c1c369d1db727d7ff900c90a Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 8 Oct 2013 21:17:11 -0700 Subject: replace a bunch of graphic icons with vector icons --- include/conversation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index bcd9ae51a..1820a8568 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -632,7 +632,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { ); $star = false; - $isstarred = "unstarred"; + $isstarred = "unstarred icon-star-empty"; $lock = false; $likebuttons = false; -- cgit v1.2.3 From 3772682204544e733baf910e6dfe35c0fe99e0e2 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 18 Oct 2013 14:25:55 -0700 Subject: Put a status editor on the display page if you're logged in. This fixes issue #113 and also provides the ability to reshare from that page. --- include/conversation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 1820a8568..f9568c23f 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1076,7 +1076,7 @@ function status_editor($a,$x,$popup=false) { call_hooks('jot_networks', $jotnets); $o .= replace_macros($tpl,array( - '$return_path' => $a->query_string, + '$return_path' => ((x($x,'return_path')) ? $x['return_path'] : $a->query_string), '$action' => $a->get_baseurl(true) . '/item', '$share' => (x($x,'button') ? $x['button'] : t('Share')), '$webpage' => $webpage, -- cgit v1.2.3 From c48da79adf648370beeeb0bab18f89963babebaa Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 20 Oct 2013 20:29:52 -0700 Subject: link to source - if it's on the display page link to original source (probably on a different site). All other conversations link to 'llink' which is a local copy and may provide a richer possibility of interactions, especially if you're logged in locally and it's your own copy of the post. --- include/conversation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index f9568c23f..c1d8e91f9 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -690,7 +690,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { 'owner_name' => $owner_name, 'owner_url' => $owner_url, 'owner_photo' => $owner_photo, - 'plink' => get_plink($item), + 'plink' => get_plink($item,$mode), 'edpost' => false, 'isstarred' => $isstarred, 'star' => $star, -- cgit v1.2.3 From 336768715ca2f4747c74ded1feda651b3d4b8e80 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 24 Oct 2013 18:19:39 -0700 Subject: Optionally pass a prepared "top level" item into conversation(). This will eventually be used by the photos module where the "top level item" of the conversation is a photo with editing and album navigation controls and doesn't look anything like a post. --- include/conversation.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index c1d8e91f9..a8b3150b4 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -397,7 +397,7 @@ function visible_activity($item) { */ -function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { +function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $prepared_item = '') { $tstart = dba_timer(); $t0 = $t1 = $t2 = $t3 = $t4 = $t5 = $t6 = null; @@ -723,7 +723,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { require_once('include/ConversationObject.php'); require_once('include/ItemObject.php'); - $conv = new Conversation($mode, $preview); + $conv = new Conversation($mode, $preview, $prepared_item); // In the display mode we don't have a profile owner. @@ -764,7 +764,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') { } - // Can we put this after the visibility check? + like_puller($a,$item,$alike,'like'); if(feature_enabled($profile_owner,'dislike')) -- cgit v1.2.3 From 9b7994a9b785bac7ae8314ae398352d336b26aef Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 27 Oct 2013 20:01:28 -0700 Subject: remote post module so that from anywhere on the web or at least within the matrix you'll be able to share content or we can have apps on other sites that post status updates on your wall. All with your permission of course as you'll have to click "share" to actually post it. --- include/conversation.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index a8b3150b4..497c2fda7 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1096,7 +1096,7 @@ function status_editor($a,$x,$popup=false) { '$shortsetloc' => t('set location'), '$noloc' => t('Clear browser location'), '$shortnoloc' => t('clear location'), - '$title' => "", + '$title' => ((x($x,'title')) ? htmlspecialchars($x['title']) : ''), '$placeholdertitle' => t('Set title'), '$catsenabled' => ((feature_enabled($x['profile_uid'],'categories') && (! $webpage)) ? 'categories' : ''), '$category' => "", @@ -1105,7 +1105,7 @@ function status_editor($a,$x,$popup=false) { '$permset' => t('Permission settings'), '$shortpermset' => t('permissions'), '$ptyp' => (($notes_cid) ? 'note' : 'wall'), - '$content' => '', + '$content' => ((x($x,'body')) ? htmlspecialchars($x['body']) : ''), '$post_id' => '', '$baseurl' => $a->get_baseurl(true), '$defloc' => $x['default_location'], -- cgit v1.2.3 From 1380bee82caad1dce6ffda7c35cb4ce3e94911f2 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 28 Oct 2013 17:48:42 -0700 Subject: Comanche documentation and some cleanup of layout page (including link to doco) and a few other webpage related cleanups --- include/conversation.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 497c2fda7..831a00519 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1072,6 +1072,11 @@ function status_editor($a,$x,$popup=false) { $jotplugins = ''; $jotnets = ''; + + $preview = ((feature_enabled($x['profile_uid'],'preview')) ? t('Preview') : ''); + if(x($x,'nopreview')) + $preview = ''; + call_hooks('jot_tool', $jotplugins); call_hooks('jot_networks', $jotnets); @@ -1080,7 +1085,7 @@ function status_editor($a,$x,$popup=false) { '$action' => $a->get_baseurl(true) . '/item', '$share' => (x($x,'button') ? $x['button'] : t('Share')), '$webpage' => $webpage, - '$placeholdpagetitle' => t('Page link title'), + '$placeholdpagetitle' => ((x($x,'ptlabel')) ? $x['ptlabel'] : t('Page link title')), '$pagetitle' => (x($x,'pagetitle') ? $x['pagetitle'] : ''), '$upload' => t('Upload photo'), '$shortupload' => t('upload photo'), @@ -1121,7 +1126,7 @@ function status_editor($a,$x,$popup=false) { '$showacl' => ((array_key_exists('showacl',$x)) ? $x['showacl'] : 'yes'), '$bang' => $x['bang'], '$profile_uid' => $x['profile_uid'], - '$preview' => ((feature_enabled($x['profile_uid'],'preview')) ? t('Preview') : ''), + '$preview' => $preview, '$sourceapp' => t($a->sourcename), '$jotplugins' => $jotplugins, )); -- cgit v1.2.3 From a5693df07fdf6fdf31247bfe0700d4c8096d4fbf Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 30 Oct 2013 17:33:10 -0700 Subject: issue #189 - show post edited time on relative date hovertip --- include/conversation.php | 1 + 1 file changed, 1 insertion(+) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 831a00519..e8b41e775 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -685,6 +685,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ 'str_app' => sprintf( t(' from %s'), $item['app']), 'isotime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'c'), 'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'r'), + 'editedtime' => (($item['edited'] != $item['created']) ? sprintf( t('last edited: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['edited'], 'r')) : ''), 'location' => $location, 'indent' => '', 'owner_name' => $owner_name, -- cgit v1.2.3 From 7381326b7a7a271da52464d15774a1309adb2bd5 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 7 Nov 2013 00:47:50 -0800 Subject: provide expire feature on post and comments as well as private messages. This requires a feature setting and is currently unmaskable - if the author says it's gone, there's not a lot you can do to stop it or try and save it. It's gone. --- include/conversation.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index e8b41e775..fc0ae98e6 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1064,7 +1064,8 @@ function status_editor($a,$x,$popup=false) { '$audurl' => t("Please enter an audio link/URL:"), '$term' => t('Tag term:'), '$fileas' => t('Save to Folder:'), - '$whereareu' => t('Where are you right now?') + '$whereareu' => t('Where are you right now?'), + '$expireswhen' => t('Expires YYYY-MM-DD HH:MM') )); @@ -1130,6 +1131,9 @@ function status_editor($a,$x,$popup=false) { '$preview' => $preview, '$sourceapp' => t($a->sourcename), '$jotplugins' => $jotplugins, + '$defexpire' => '', + '$feature_expire' => ((feature_enabled($x['profile_uid'],'content_expire') && (! $webpage)) ? 'block' : 'none'), + '$expires' => t('Set expiration date'), )); -- cgit v1.2.3 From ca4103debef7ecf36d93842750667e70c2a1e42a Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 10 Nov 2013 23:19:44 -0800 Subject: e2ee --- include/conversation.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index fc0ae98e6..88156ae63 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1134,6 +1134,8 @@ function status_editor($a,$x,$popup=false) { '$defexpire' => '', '$feature_expire' => ((feature_enabled($x['profile_uid'],'content_expire') && (! $webpage)) ? 'block' : 'none'), '$expires' => t('Set expiration date'), + '$feature_encrypt' => ((feature_enabled($x['profile_uid'],'content_encrypt') && (! $webpage)) ? 'block' : 'none'), + '$encrypt' => t('Encrypt text'), )); -- cgit v1.2.3 From a7c53d470b9be467fc047130383095a569ba74e8 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 11 Nov 2013 18:42:49 -0800 Subject: ability to use other ciphers --- include/conversation.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 88156ae63..59ca24d41 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1079,6 +1079,10 @@ function status_editor($a,$x,$popup=false) { if(x($x,'nopreview')) $preview = ''; + $cipher = get_pconfig($x['profile_uid'],'system','default_cipher'); + if(! $cipher) + $cipher = 'aes256'; + call_hooks('jot_tool', $jotplugins); call_hooks('jot_networks', $jotnets); @@ -1136,6 +1140,7 @@ function status_editor($a,$x,$popup=false) { '$expires' => t('Set expiration date'), '$feature_encrypt' => ((feature_enabled($x['profile_uid'],'content_encrypt') && (! $webpage)) ? 'block' : 'none'), '$encrypt' => t('Encrypt text'), + '$cipher' => $cipher, )); -- cgit v1.2.3 From 592c24e162400f87075c6cdc44b795cdb94da836 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 14 Nov 2013 15:41:25 -0800 Subject: e2ee in comments and a bit of cleanup so not every theme has to define how to insert bbcode, only if they're doing something special (e.g. this is how to implement a javascript plugin :-)), and I got rid of the predefined http:// in the bbcode for urls. You're almost always pasting a url which already has that bit and it just creates an extra step. --- include/conversation.php | 3 --- 1 file changed, 3 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 59ca24d41..e2a4a0723 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -532,9 +532,6 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ $items = $cb['items']; - $cmnt_tpl = get_markup_template('comment_item.tpl'); - $hide_comments_tpl = get_markup_template('hide_comments.tpl'); - $alike = array(); $dlike = array(); -- cgit v1.2.3 From 0b8c9654ea7e9e9357c5af689ed8a0d11d38d2f7 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 15 Nov 2013 03:10:00 -0800 Subject: allow rpost to set source app --- include/conversation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index e2a4a0723..fea53015e 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1130,7 +1130,7 @@ function status_editor($a,$x,$popup=false) { '$bang' => $x['bang'], '$profile_uid' => $x['profile_uid'], '$preview' => $preview, - '$sourceapp' => t($a->sourcename), + '$source' => ((x($x,'source')) ? $x['source'] : ''), '$jotplugins' => $jotplugins, '$defexpire' => '', '$feature_expire' => ((feature_enabled($x['profile_uid'],'content_expire') && (! $webpage)) ? 'block' : 'none'), -- cgit v1.2.3 From e8c9dafb90e556a9cc9590022ef1131d76b1129d Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 15 Nov 2013 15:32:26 -0800 Subject: revert to prepare_page - but have it call prepare_body --- include/conversation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index fea53015e..a2eeda25b 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1301,7 +1301,7 @@ function prepare_page($item) { '$auth_url' => (($naked) ? '' : $item['author']['xchan_url']), '$date' => (($naked) ? '' : datetime_convert('UTC',date_default_timezone_get(),$item['created'],'Y-m-d H:i')), '$title' => smilies(bbcode($item['title'])), - '$body' => prepare_text($item['body'],$item['mimetype']) + '$body' => prepare_body($item,true) )); } -- cgit v1.2.3 From 2239d472e56c49c314af57af2090c1206500446c Mon Sep 17 00:00:00 2001 From: Olivier Migeot Date: Thu, 28 Nov 2013 12:24:37 +0100 Subject: Plurals for conversation.php --- include/conversation.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index a2eeda25b..e20fef9f6 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -993,9 +993,9 @@ function format_like($cnt,$arr,$type,$id) { else { $spanatts = 'class="fakelink" onclick="openClose(\'' . $type . 'list-' . $id . '\');"'; $o .= (($type === 'like') ? - sprintf( t('%2$d people like this.'), $spanatts, $cnt) + sprintf( tt('%2$d people like this.','%2$d people like this.',$cnt), $spanatts, $cnt) : - sprintf( t('%2$d people don\'t like this.'), $spanatts, $cnt) ); + sprintf( tt('%2$d people don\'t like this.','%2$d people don\'t like this.',$cnt), $spanatts, $cnt) ); $o .= EOL ; $total = count($arr); if($total >= MAX_LIKERS) @@ -1004,7 +1004,7 @@ function format_like($cnt,$arr,$type,$id) { $arr[count($arr)-1] = t('and') . ' ' . $arr[count($arr)-1]; $str = implode(', ', $arr); if($total >= MAX_LIKERS) - $str .= sprintf( t(', and %d other people'), $total - MAX_LIKERS ); + $str .= sprintf( tt(', and %d other people',', and %d other people',$total - MAX_LIKERS), $total - MAX_LIKERS ); $str = (($type === 'like') ? sprintf( t('%s like this.'), $str) : sprintf( t('%s don\'t like this.'), $str)); $o .= "\t" . ''; } -- cgit v1.2.3 From 78d19f3395e8fd0660e58498c15850e1323ec4b3 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 5 Dec 2013 21:00:14 -0800 Subject: move profile tabs and network/matrix tabs to include/conversation --- include/conversation.php | 184 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 184 insertions(+) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index e20fef9f6..13990e89b 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1305,3 +1305,187 @@ function prepare_page($item) { )); } + +function network_tabs() { + $a = get_app(); + $no_active=''; + $starred_active = ''; + $new_active = ''; + $all_active = ''; + $search_active = ''; + $conv_active = ''; + $spam_active = ''; + $postord_active = ''; + + if(x($_GET,'new')) { + $new_active = 'active'; + } + + if(x($_GET,'search')) { + $search_active = 'active'; + } + + if(x($_GET,'star')) { + $starred_active = 'active'; + } + + if(x($_GET,'conv')) { + $conv_active = 'active'; + } + + if(x($_GET,'spam')) { + $spam_active = 'active'; + } + + + + if (($new_active == '') + && ($starred_active == '') + && ($conv_active == '') + && ($search_active == '') + && ($spam_active == '')) { + $no_active = 'active'; + } + + if ($no_active=='active' && x($_GET,'order')) { + switch($_GET['order']){ + case 'post': $postord_active = 'active'; $no_active=''; break; + case 'comment' : $all_active = 'active'; $no_active=''; break; + } + } + + if ($no_active=='active') $all_active='active'; + + $cmd = $a->cmd; + + // tabs + $tabs = array( + array( + 'label' => t('Commented Order'), + 'url'=>$a->get_baseurl(true) . '/' . $cmd . '?f=&order=comment' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : ''), + 'sel'=>$all_active, + 'title'=> t('Sort by Comment Date'), + ), + array( + 'label' => t('Posted Order'), + 'url'=>$a->get_baseurl(true) . '/' . $cmd . '?f=&order=post' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : ''), + 'sel'=>$postord_active, + 'title' => t('Sort by Post Date'), + ), + + array( + 'label' => t('Personal'), + 'url' => $a->get_baseurl(true) . '/' . $cmd . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&conv=1', + 'sel' => $conv_active, + 'title' => t('Posts that mention or involve you'), + ), + array( + 'label' => t('New'), + 'url' => $a->get_baseurl(true) . '/' . $cmd . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&new=1', + 'sel' => $new_active, + 'title' => t('Activity Stream - by date'), + ), + + ); + + if(feature_enabled(local_user(),'star_posts')) + $tabs[] = array( + 'label' => t('Starred'), + 'url'=>$a->get_baseurl(true) . '/' . $cmd . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&star=1', + 'sel'=>$starred_active, + 'title' => t('Favourite Posts'), + ); + + // Not yet implemented + + if(feature_enabled(local_user(),'spam_filter')) + $tabs[] = array( + 'label' => t('Spam'), + 'url'=>$a->get_baseurl(true) . '/network?f=&spam=1', + 'sel'=> $spam_active, + 'title' => t('Posts flagged as SPAM'), + ); + + $arr = array('tabs' => $tabs); + call_hooks('network_tabs', $arr); + + $tpl = get_markup_template('common_tabs.tpl'); + + return replace_macros($tpl,array('$tabs' => $arr['tabs'])); + +} + + + +function profile_tabs($a, $is_owner=False, $nickname=Null){ + //echo "
    "; var_dump($a->user); killme();
    +	
    +	$channel = $a->get_channel();
    +
    +	if (is_null($nickname))
    +		$nickname  = $channel['channel_address'];
    +		
    +	if(x($_GET,'tab'))
    +		$tab = notags(trim($_GET['tab']));
    +	
    +	$url = $a->get_baseurl() . '/channel/' . $nickname;
    +	$pr  = $a->get_baseurl() . '/profile/' . $nickname;
    +
    +	$tabs = array(
    +		array(
    +			'label' => t('Channel'),
    +			'url'   => $url,
    +			'sel'   => ((argv(0) == 'channel') ? 'active' : ''),
    +			'title' => t('Status Messages and Posts'),
    +			'id'    => 'status-tab',
    +		),
    +		array(
    +			'label' => t('About'),
    +			'url' 	=> $pr,
    +			'sel'	=> ((argv(0) == 'profile') ? 'active' : ''),
    +			'title' => t('Profile Details'),
    +			'id'    => 'profile-tab',
    +		),
    +		array(
    +			'label' => t('Photos'),
    +			'url'	=> $a->get_baseurl() . '/photos/' . $nickname,
    +			'sel'	=> ((argv(0) == 'photos') ? 'active' : ''),
    +			'title' => t('Photo Albums'),
    +			'id'    => 'photo-tab',
    +		),
    +	);
    +
    +
    +	if ($is_owner){
    +		$tabs[] = array(
    +			'label' => t('Events'),
    +			'url'	=> $a->get_baseurl() . '/events',
    +			'sel' 	=> ((argv(0) == 'events') ? 'active' : ''),
    +			'title' => t('Events and Calendar'),
    +			'id'    => 'events-tab',
    +		);
    +		if(feature_enabled(local_user(),'webpages')){
    +		$tabs[] = array(
    +			'label' => t('Webpages'),
    +			'url'	=> $a->get_baseurl() . '/webpages/' . $nickname,
    +			'sel' 	=> ((argv(0) == 'webpages') ? 'active' : ''),
    +			'title' => t('Manage Webpages'),
    +			'id'    => 'webpages-tab',
    +		);}
    +	}
    +	else {
    +		// FIXME
    +		// we probably need a listing of events that were created by 
    +		// this channel and are visible to the observer
    +
    +
    +	}
    +
    +
    +	$arr = array('is_owner' => $is_owner, 'nickname' => $nickname, 'tab' => (($tab) ? $tab : false), 'tabs' => $tabs);
    +	call_hooks('profile_tabs', $arr);
    +	
    +	$tpl = get_markup_template('common_tabs.tpl');
    +
    +	return replace_macros($tpl,array('$tabs' => $arr['tabs']));
    +}
    -- 
    cgit v1.2.3
    
    
    From b8454cbd1df76bb96af6a6d65ff40f08f6919dc5 Mon Sep 17 00:00:00 2001
    From: friendica 
    Date: Sat, 7 Dec 2013 23:29:26 -0800
    Subject: post_activity_item issues
    
    ---
     include/conversation.php | 4 ++++
     1 file changed, 4 insertions(+)
    
    (limited to 'include/conversation.php')
    
    diff --git a/include/conversation.php b/include/conversation.php
    index 13990e89b..f5fc9da93 100644
    --- a/include/conversation.php
    +++ b/include/conversation.php
    @@ -203,6 +203,10 @@ function localize_item(&$item){
     	}
     
     	if (stristr($item['verb'],ACTIVITY_POKE)) {
    +
    +		// FIXME for obscured private posts, until then leave untranslated
    +		return;
    +
     		$verb = urldecode(substr($item['verb'],strpos($item['verb'],'#')+1));
     		if(! $verb)
     			return;
    -- 
    cgit v1.2.3
    
    
    From 303324cdff3f7c8bc83fae89256a2133939944b2 Mon Sep 17 00:00:00 2001
    From: friendica 
    Date: Thu, 12 Dec 2013 02:15:02 -0800
    Subject: more htmlspecialchars sanitisation
    
    ---
     include/conversation.php | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    (limited to 'include/conversation.php')
    
    diff --git a/include/conversation.php b/include/conversation.php
    index f5fc9da93..29fb8a163 100644
    --- a/include/conversation.php
    +++ b/include/conversation.php
    @@ -1108,7 +1108,7 @@ function status_editor($a,$x,$popup=false) {
     		'$shortsetloc' => t('set location'),
     		'$noloc' => t('Clear browser location'),
     		'$shortnoloc' => t('clear location'),
    -		'$title' => ((x($x,'title')) ? htmlspecialchars($x['title']) : ''),
    +		'$title' => ((x($x,'title')) ? htmlspecialchars($x['title'], ENT_COMPAT,'UTF-8') : ''),
     		'$placeholdertitle' => t('Set title'),
     		'$catsenabled' => ((feature_enabled($x['profile_uid'],'categories') && (! $webpage)) ? 'categories' : ''),
     		'$category' => "",
    @@ -1117,7 +1117,7 @@ function status_editor($a,$x,$popup=false) {
     		'$permset' => t('Permission settings'),
     		'$shortpermset' => t('permissions'),
     		'$ptyp' => (($notes_cid) ? 'note' : 'wall'),
    -		'$content' => ((x($x,'body')) ? htmlspecialchars($x['body']) : ''),
    +		'$content' => ((x($x,'body')) ? htmlspecialchars($x['body'], ENT_COMPAT,'UTF-8') : ''),
     		'$post_id' => '',
     		'$baseurl' => $a->get_baseurl(true),
     		'$defloc' => $x['default_location'],
    -- 
    cgit v1.2.3
    
    
    From 38fd8410eb5c66928cb24bb87ad38657f53aec3a Mon Sep 17 00:00:00 2001
    From: friendica 
    Date: Wed, 18 Dec 2013 01:00:08 -0800
    Subject: split off mod_connections into mod_connections & mod_connedit - lots
     of links to fix
    
    ---
     include/conversation.php | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    (limited to 'include/conversation.php')
    
    diff --git a/include/conversation.php b/include/conversation.php
    index 29fb8a163..2ba3948bf 100644
    --- a/include/conversation.php
    +++ b/include/conversation.php
    @@ -915,7 +915,7 @@ function item_photo_menu($item){
     
     	if($contact) {
     		$poke_link = $a->get_baseurl($ssl_state) . '/poke/?f=&c=' . $contact['abook_id'];
    -		$contact_url = $a->get_baseurl($ssl_state) . '/connections/' . $contact['abook_id'];
    +		$contact_url = $a->get_baseurl($ssl_state) . '/connedit/' . $contact['abook_id'];
     		$posts_link = $a->get_baseurl($ssl_state) . '/network/?cid=' . $contact['abook_id'];
     
     		$clean_url = normalise_link($item['author-link']);
    -- 
    cgit v1.2.3
    
    
    From d32bbaf599c77aa415ee403a896b77f091f0e9fc Mon Sep 17 00:00:00 2001
    From: friendica 
    Date: Sat, 21 Dec 2013 23:47:44 -0800
    Subject: split private messages into two modules - "message" is just for
     message lists, "mail" is for reading and writing conversations. This is so we
     can Comanchify it cleanly.
    
    ---
     include/conversation.php | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    (limited to 'include/conversation.php')
    
    diff --git a/include/conversation.php b/include/conversation.php
    index 2ba3948bf..0bb13a17e 100644
    --- a/include/conversation.php
    +++ b/include/conversation.php
    @@ -908,7 +908,7 @@ function item_photo_menu($item){
     	}
     
         $profile_link = z_root() . "/chanview/?f=&hash=" . $item['author_xchan'];
    -	$pm_url = $a->get_baseurl($ssl_state) . '/message/new/?f=&hash=' . $item['author_xchan'];
    +	$pm_url = $a->get_baseurl($ssl_state) . '/mail/new/?f=&hash=' . $item['author_xchan'];
     
     	if($a->contacts && array_key_exists($item['author_xchan'],$a->contacts))
     		$contact = $a->contacts[$item['author_xchan']];
    -- 
    cgit v1.2.3
    
    
    From 25a533bd72c34e9775af71c010a39db6caf7b633 Mon Sep 17 00:00:00 2001
    From: Christian Vogeley 
    Date: Sun, 22 Dec 2013 14:21:57 +0100
    Subject: New modal dialog for item expiry
    
    ---
     include/conversation.php | 2 ++
     1 file changed, 2 insertions(+)
    
    (limited to 'include/conversation.php')
    
    diff --git a/include/conversation.php b/include/conversation.php
    index a2eeda25b..bb9440313 100644
    --- a/include/conversation.php
    +++ b/include/conversation.php
    @@ -1138,6 +1138,8 @@ function status_editor($a,$x,$popup=false) {
     		'$feature_encrypt' => ((feature_enabled($x['profile_uid'],'content_encrypt') && (! $webpage)) ? 'block' : 'none'),
     		'$encrypt' => t('Encrypt text'),
     		'$cipher' => $cipher,
    +		'$expiryModalOK' => t('OK'),
    +		'$expiryModalCANCEL' => t('Cancel'),
     	));
     
     
    -- 
    cgit v1.2.3
    
    
    From 50e39c330d9a73f69ddfdecfb5769a772b75167d Mon Sep 17 00:00:00 2001
    From: Thomas Willingham 
    Date: Mon, 23 Dec 2013 18:41:41 +0000
    Subject: Zidification of author links in webpages.
    
    ---
     include/conversation.php | 5 ++++-
     1 file changed, 4 insertions(+), 1 deletion(-)
    
    (limited to 'include/conversation.php')
    
    diff --git a/include/conversation.php b/include/conversation.php
    index d602174b0..99252027d 100644
    --- a/include/conversation.php
    +++ b/include/conversation.php
    @@ -1296,15 +1296,18 @@ function prepare_page($item) {
     
     	$a = get_app();
     	$naked = ((get_pconfig($item['uid'],'system','nakedpage')) ? 1 : 0);
    +	$observer = $a->get_observer();
    +	$zid = ($observer['xchan_addr']);
    +
     	if(array_key_exists('webpage',$a->layout) && array_key_exists('authored',$a->layout['webpage'])) {
     		if($a->layout['webpage']['authored'] === 'none')
     			$naked = 1;
     		// ... other possible options
     	}
    -
     	return replace_macros(get_markup_template('page_display.tpl'),array(
     		'$author' => (($naked) ? '' : $item['author']['xchan_name']),
     		'$auth_url' => (($naked) ? '' : $item['author']['xchan_url']),
    +		'$zid' => $zid,
     		'$date' => (($naked) ? '' : datetime_convert('UTC',date_default_timezone_get(),$item['created'],'Y-m-d H:i')),
     		'$title' => smilies(bbcode($item['title'])),
     		'$body' => prepare_body($item,true)
    -- 
    cgit v1.2.3
    
    
    From 79102218324e794bb7096e682d61841b570fc411 Mon Sep 17 00:00:00 2001
    From: friendica 
    Date: Wed, 8 Jan 2014 15:20:12 -0800
    Subject: preparatory work for supporting a "list view" mode for conversations.
     This would be useful for forum-like channels and/or block-oriented themes.
    
    ---
     include/conversation.php | 3 +++
     1 file changed, 3 insertions(+)
    
    (limited to 'include/conversation.php')
    
    diff --git a/include/conversation.php b/include/conversation.php
    index 99252027d..62db34974 100644
    --- a/include/conversation.php
    +++ b/include/conversation.php
    @@ -782,6 +782,9 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $
     //					$tx1 = dba_timer();
                         $item_object = new Item($item);
                         $conv->add_thread($item_object);
    +					if($page_mode === 'list') 
    +						$item_object->set_template('conv_list.tpl');
    +
     //					$tx2 = dba_timer();
     //					if($mode === 'network')
     //						profiler($tx1,$tx2,'add thread ' . $item['id']);
    -- 
    cgit v1.2.3
    
    
    From a78d9b973d6391e3a15f8a3ff2fe586a4bffe08c Mon Sep 17 00:00:00 2001
    From: friendica 
    Date: Thu, 9 Jan 2014 16:23:58 -0800
    Subject: simplify permalink selection logic
    
    ---
     include/conversation.php | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    (limited to 'include/conversation.php')
    
    diff --git a/include/conversation.php b/include/conversation.php
    index 62db34974..5977b65e8 100644
    --- a/include/conversation.php
    +++ b/include/conversation.php
    @@ -692,7 +692,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $
     					'owner_name' => $owner_name,
     					'owner_url' => $owner_url,
     					'owner_photo' => $owner_photo,
    -					'plink' => get_plink($item,$mode),
    +					'plink' => get_plink($item,false),
     					'edpost' => false,
     					'isstarred' => $isstarred,
     					'star' => $star,
    -- 
    cgit v1.2.3
    
    
    From 49882f2be4ef9d1b28c72f8101fe9b15d7176ff6 Mon Sep 17 00:00:00 2001
    From: friendica 
    Date: Thu, 9 Jan 2014 19:00:06 -0800
    Subject: add cloud link to profile_tabs and Comanchify the sucker
    
    ---
     include/conversation.php | 9 +++++++++
     1 file changed, 9 insertions(+)
    
    (limited to 'include/conversation.php')
    
    diff --git a/include/conversation.php b/include/conversation.php
    index 5977b65e8..a9bf69a3e 100644
    --- a/include/conversation.php
    +++ b/include/conversation.php
    @@ -1465,6 +1465,15 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){
     			'title' => t('Photo Albums'),
     			'id'    => 'photo-tab',
     		),
    +
    +		array(
    +			'label' => t('Files'),
    +			'url'	=> $a->get_baseurl() . '/cloud/' . $nickname,
    +			'sel'	=> ((argv(0) == 'cloud') ? 'active' : ''),
    +			'title' => t('Files and Storage'),
    +			'id'    => 'files-tab',
    +		),
    +
     	);
     
     
    -- 
    cgit v1.2.3
    
    
    From 3b375a3d3f6d0d7fef885edcc75097564a1f7987 Mon Sep 17 00:00:00 2001
    From: friendica 
    Date: Tue, 21 Jan 2014 23:09:33 -0800
    Subject: fix location of string file in Translations.md, fix some permissions
     and owner vagueness (potential bugs) in profile_tabs()
    
    ---
     include/conversation.php | 39 ++++++++++++++++++++++++---------------
     1 file changed, 24 insertions(+), 15 deletions(-)
    
    (limited to 'include/conversation.php')
    
    diff --git a/include/conversation.php b/include/conversation.php
    index a9bf69a3e..708348ddd 100644
    --- a/include/conversation.php
    +++ b/include/conversation.php
    @@ -1431,7 +1431,8 @@ function network_tabs() {
     
     function profile_tabs($a, $is_owner=False, $nickname=Null){
     	//echo "
    "; var_dump($a->user); killme();
    -	
    +
    +		
     	$channel = $a->get_channel();
     
     	if (is_null($nickname))
    @@ -1451,33 +1452,38 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){
     			'title' => t('Status Messages and Posts'),
     			'id'    => 'status-tab',
     		),
    -		array(
    +	);
    +
    +	$p = get_all_perms($a->profile['profile_uid'],get_observer_hash());
    +
    +	if($p['view_profile']) {
    +		$tabs[] = array(
     			'label' => t('About'),
     			'url' 	=> $pr,
     			'sel'	=> ((argv(0) == 'profile') ? 'active' : ''),
     			'title' => t('Profile Details'),
     			'id'    => 'profile-tab',
    -		),
    -		array(
    +		);
    +	}
    +	if($p['view_photos']) {
    +		$tabs[] = array(
     			'label' => t('Photos'),
     			'url'	=> $a->get_baseurl() . '/photos/' . $nickname,
     			'sel'	=> ((argv(0) == 'photos') ? 'active' : ''),
     			'title' => t('Photo Albums'),
     			'id'    => 'photo-tab',
    -		),
    -
    -		array(
    +		);
    +	}
    +	if($p['view_storage']) {
    +		$tabs[] = array(
     			'label' => t('Files'),
     			'url'	=> $a->get_baseurl() . '/cloud/' . $nickname,
     			'sel'	=> ((argv(0) == 'cloud') ? 'active' : ''),
     			'title' => t('Files and Storage'),
     			'id'    => 'files-tab',
    -		),
    -
    -	);
    -
    -
    -	if ($is_owner){
    +		);
    +	}
    +	if($is_owner) {
     		$tabs[] = array(
     			'label' => t('Events'),
     			'url'	=> $a->get_baseurl() . '/events',
    @@ -1485,15 +1491,18 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){
     			'title' => t('Events and Calendar'),
     			'id'    => 'events-tab',
     		);
    -		if(feature_enabled(local_user(),'webpages')){
    +	}
    +
    +	if($is_owner && feature_enabled($a->profile['profile_uid'],'webpages')) {
     		$tabs[] = array(
     			'label' => t('Webpages'),
     			'url'	=> $a->get_baseurl() . '/webpages/' . $nickname,
     			'sel' 	=> ((argv(0) == 'webpages') ? 'active' : ''),
     			'title' => t('Manage Webpages'),
     			'id'    => 'webpages-tab',
    -		);}
    +		);
     	}
    +
     	else {
     		// FIXME
     		// we probably need a listing of events that were created by 
    -- 
    cgit v1.2.3
    
    
    From eb868f6df8ce31497992bab1e8c4fd39bee8fe15 Mon Sep 17 00:00:00 2001
    From: marijus 
    Date: Wed, 22 Jan 2014 17:18:40 +0100
    Subject: make network tabs regard selected group (collection) and vice versa
    
    ---
     include/conversation.php | 6 +++---
     1 file changed, 3 insertions(+), 3 deletions(-)
    
    (limited to 'include/conversation.php')
    
    diff --git a/include/conversation.php b/include/conversation.php
    index 708348ddd..c0bed2a6b 100644
    --- a/include/conversation.php
    +++ b/include/conversation.php
    @@ -1374,13 +1374,13 @@ function network_tabs() {
     	$tabs = array(
     		array(
     			'label' => t('Commented Order'),
    -			'url'=>$a->get_baseurl(true) . '/' . $cmd . '?f=&order=comment' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : ''), 
    +			'url'=>$a->get_baseurl(true) . '/' . $cmd . '?f=&order=comment' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''), 
     			'sel'=>$all_active,
     			'title'=> t('Sort by Comment Date'),
     		),
     		array(
     			'label' => t('Posted Order'),
    -			'url'=>$a->get_baseurl(true) . '/' . $cmd . '?f=&order=post' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : ''), 
    +			'url'=>$a->get_baseurl(true) . '/' . $cmd . '?f=&order=post' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''), 
     			'sel'=>$postord_active,
     			'title' => t('Sort by Post Date'),
     		),
    @@ -1393,7 +1393,7 @@ function network_tabs() {
     		),
     		array(
     			'label' => t('New'),
    -			'url' => $a->get_baseurl(true) . '/' . $cmd . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&new=1',
    +			'url' => $a->get_baseurl(true) . '/' . $cmd . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&new=1' . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''),
     			'sel' => $new_active,
     			'title' => t('Activity Stream - by date'),
     		),
    -- 
    cgit v1.2.3
    
    
    From 25f7a7fac975f9858b771f7bb57d4c06c5ab0daf Mon Sep 17 00:00:00 2001
    From: Thomas Willingham 
    Date: Wed, 22 Jan 2014 22:17:12 +0000
    Subject: Give pages enough to construct a share button.
    
    ---
     include/conversation.php | 7 +++++--
     1 file changed, 5 insertions(+), 2 deletions(-)
    
    (limited to 'include/conversation.php')
    
    diff --git a/include/conversation.php b/include/conversation.php
    index 708348ddd..13f0d8970 100644
    --- a/include/conversation.php
    +++ b/include/conversation.php
    @@ -1301,7 +1301,8 @@ function prepare_page($item) {
     	$naked = ((get_pconfig($item['uid'],'system','nakedpage')) ? 1 : 0);
     	$observer = $a->get_observer();
     	$zid = ($observer['xchan_addr']);
    -
    +	$preview = substr(urlencode($item['body']), 0, 100);
    +	$link = z_root() . '/' . $a->cmd;
     	if(array_key_exists('webpage',$a->layout) && array_key_exists('authored',$a->layout['webpage'])) {
     		if($a->layout['webpage']['authored'] === 'none')
     			$naked = 1;
    @@ -1313,7 +1314,9 @@ function prepare_page($item) {
     		'$zid' => $zid,
     		'$date' => (($naked) ? '' : datetime_convert('UTC',date_default_timezone_get(),$item['created'],'Y-m-d H:i')),
     		'$title' => smilies(bbcode($item['title'])),
    -		'$body' => prepare_body($item,true)
    +		'$body' => prepare_body($item,true),
    +		'$preview' => $preview,
    +		'$link' => $link
     	));
     }
     
    -- 
    cgit v1.2.3
    
    
    From 040d87c999c02df82dd3acad97db498d12f8580a Mon Sep 17 00:00:00 2001
    From: marijus 
    Date: Wed, 22 Jan 2014 23:24:09 +0100
    Subject: update argument ?f=
    
    ---
     include/conversation.php | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    (limited to 'include/conversation.php')
    
    diff --git a/include/conversation.php b/include/conversation.php
    index c0bed2a6b..ddcb12b07 100644
    --- a/include/conversation.php
    +++ b/include/conversation.php
    @@ -1387,13 +1387,13 @@ function network_tabs() {
     
     		array(
     			'label' => t('Personal'),
    -			'url' => $a->get_baseurl(true) . '/' . $cmd . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&conv=1',
    +			'url' => $a->get_baseurl(true) . '/' . $cmd . '?f=' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . '&conv=1',
     			'sel' => $conv_active,
     			'title' => t('Posts that mention or involve you'),
     		),
     		array(
     			'label' => t('New'),
    -			'url' => $a->get_baseurl(true) . '/' . $cmd . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&new=1' . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''),
    +			'url' => $a->get_baseurl(true) . '/' . $cmd . '?f=' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . '&new=1' . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''),
     			'sel' => $new_active,
     			'title' => t('Activity Stream - by date'),
     		),
    -- 
    cgit v1.2.3
    
    
    From d57361ea4ace5d392623a316068fb5041d116ace Mon Sep 17 00:00:00 2001
    From: Thomas Willingham 
    Date: Fri, 24 Jan 2014 03:44:50 +0000
    Subject: Make share previews a bit longer.  We can't go any longer than this
     without suhosin starting to break things for channels with long names  - this
     limit works with the channel with the longest name in the matrix today, but
     we may need to make this a pconfig anyway.
    
    ---
     include/conversation.php | 11 +++++++++--
     1 file changed, 9 insertions(+), 2 deletions(-)
    
    (limited to 'include/conversation.php')
    
    diff --git a/include/conversation.php b/include/conversation.php
    index 46a01d3c9..4b292ca4d 100644
    --- a/include/conversation.php
    +++ b/include/conversation.php
    @@ -1296,12 +1296,18 @@ function render_location_default($item) {
     
     
     function prepare_page($item) {
    +$foo = $item['owner_xchan'];
     
     	$a = get_app();
    +	$upstreamshare = '1';
    +	if ($foo == 'njsQ2vWa65pH-kwIKfGINOqDT2k_05ZIAeQxP9Ozk16z1WLTxTNlly4_vQKx2huTPCQqMz8shvgB3f7JVPzkdw') {
    +		$upstreamshare = '';
    +	}
     	$naked = ((get_pconfig($item['uid'],'system','nakedpage')) ? 1 : 0);
     	$observer = $a->get_observer();
     	$zid = ($observer['xchan_addr']);
    -	$preview = substr(urlencode($item['body']), 0, 100);
    +	//240 chars is the longest we can have before we start hitting problems with suhosin sites
    +	$preview = substr(urlencode($item['body']), 0, 240);
     	$link = z_root() . '/' . $a->cmd;
     	if(array_key_exists('webpage',$a->layout) && array_key_exists('authored',$a->layout['webpage'])) {
     		if($a->layout['webpage']['authored'] === 'none')
    @@ -1316,7 +1322,8 @@ function prepare_page($item) {
     		'$title' => smilies(bbcode($item['title'])),
     		'$body' => prepare_body($item,true),
     		'$preview' => $preview,
    -		'$link' => $link
    +		'$link' => $link,
    +		'$upstreamshare' => $upstreamshare
     	));
     }
     
    -- 
    cgit v1.2.3
    
    
    From ad67d3e48332204128209feb164c308af96e0ce1 Mon Sep 17 00:00:00 2001
    From: Thomas Willingham 
    Date: Fri, 24 Jan 2014 03:48:54 +0000
    Subject: Ooops, included site specific hack
    
    ---
     include/conversation.php | 6 ------
     1 file changed, 6 deletions(-)
    
    (limited to 'include/conversation.php')
    
    diff --git a/include/conversation.php b/include/conversation.php
    index 4b292ca4d..cec5993b6 100644
    --- a/include/conversation.php
    +++ b/include/conversation.php
    @@ -1296,13 +1296,8 @@ function render_location_default($item) {
     
     
     function prepare_page($item) {
    -$foo = $item['owner_xchan'];
     
     	$a = get_app();
    -	$upstreamshare = '1';
    -	if ($foo == 'njsQ2vWa65pH-kwIKfGINOqDT2k_05ZIAeQxP9Ozk16z1WLTxTNlly4_vQKx2huTPCQqMz8shvgB3f7JVPzkdw') {
    -		$upstreamshare = '';
    -	}
     	$naked = ((get_pconfig($item['uid'],'system','nakedpage')) ? 1 : 0);
     	$observer = $a->get_observer();
     	$zid = ($observer['xchan_addr']);
    @@ -1323,7 +1318,6 @@ $foo = $item['owner_xchan'];
     		'$body' => prepare_body($item,true),
     		'$preview' => $preview,
     		'$link' => $link,
    -		'$upstreamshare' => $upstreamshare
     	));
     }
     
    -- 
    cgit v1.2.3
    
    
    From d296b02b0e522dbbd30ad7926e9f80f3c8c04328 Mon Sep 17 00:00:00 2001
    From: friendica 
    Date: Sun, 26 Jan 2014 14:15:57 -0800
    Subject: The final piece of the DAV authentication puzzle. Provide a directory
     view to an un-auth'd person (without asking for a password) by adding a query
     parameter 'davguest=1'. This is a bit of a hack, but there was no response on
     the official forum about how to do this correctly so it will have to do. On
     the downside, if permission is denied, it won't ask for a password - but
     we're talking about unauthenticated folks who didn't go through magic auth so
     chances are even if they authenticate, permission will still be denied.
    
    ---
     include/conversation.php | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    (limited to 'include/conversation.php')
    
    diff --git a/include/conversation.php b/include/conversation.php
    index cec5993b6..34d661004 100644
    --- a/include/conversation.php
    +++ b/include/conversation.php
    @@ -1481,7 +1481,7 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){
     	if($p['view_storage']) {
     		$tabs[] = array(
     			'label' => t('Files'),
    -			'url'	=> $a->get_baseurl() . '/cloud/' . $nickname,
    +			'url'	=> $a->get_baseurl() . '/cloud/' . $nickname . ((get_observer_hash()) ? '' : '?f=&davguest=1'),
     			'sel'	=> ((argv(0) == 'cloud') ? 'active' : ''),
     			'title' => t('Files and Storage'),
     			'id'    => 'files-tab',
    -- 
    cgit v1.2.3
    
    
    From f104b4dc275891785ec03abd779d8aafe5163815 Mon Sep 17 00:00:00 2001
    From: friendica 
    Date: Mon, 27 Jan 2014 23:49:42 -0800
    Subject: preserve expiration when editing
    
    ---
     include/conversation.php | 1 +
     1 file changed, 1 insertion(+)
    
    (limited to 'include/conversation.php')
    
    diff --git a/include/conversation.php b/include/conversation.php
    index 34d661004..316bc1612 100644
    --- a/include/conversation.php
    +++ b/include/conversation.php
    @@ -687,6 +687,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $
     					'isotime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'c'),
     					'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'r'),
     					'editedtime' => (($item['edited'] != $item['created']) ? sprintf( t('last edited: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['edited'], 'r')) : ''),
    +					'expiretime' => (($item['expires'] !== '0000-00-00 00:00:00') ? sprintf( t('Expires: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['expires'], 'r')):''),
     					'location' => $location,
     					'indent' => '',
     					'owner_name' => $owner_name,
    -- 
    cgit v1.2.3
    
    
    From aede006970fb9124161b4732b9f44002a35d17ef Mon Sep 17 00:00:00 2001
    From: friendica 
    Date: Tue, 4 Feb 2014 17:12:13 -0800
    Subject: bookmarks - mop up and go home
    
    ---
     include/conversation.php | 8 ++++++++
     1 file changed, 8 insertions(+)
    
    (limited to 'include/conversation.php')
    
    diff --git a/include/conversation.php b/include/conversation.php
    index 316bc1612..633435871 100644
    --- a/include/conversation.php
    +++ b/include/conversation.php
    @@ -1496,6 +1496,14 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){
     			'title' => t('Events and Calendar'),
     			'id'    => 'events-tab',
     		);
    +
    +		$tabs[] = array(
    +			'label' => t('Bookmarks'),
    +			'url'	=> $a->get_baseurl() . '/bookmarks',
    +			'sel' 	=> ((argv(0) == 'bookmarks') ? 'active' : ''),
    +			'title' => t('Saved Bookmarks'),
    +			'id'    => 'bookmarks-tab',
    +		);
     	}
     
     	if($is_owner && feature_enabled($a->profile['profile_uid'],'webpages')) {
    -- 
    cgit v1.2.3
    
    
    From 05a70a8760d705e80c548d96a9d083ab032dbd8b Mon Sep 17 00:00:00 2001
    From: friendica 
    Date: Wed, 5 Feb 2014 19:16:12 -0800
    Subject: add chatroom links
    
    ---
     include/conversation.php | 14 ++++++++++++++
     1 file changed, 14 insertions(+)
    
    (limited to 'include/conversation.php')
    
    diff --git a/include/conversation.php b/include/conversation.php
    index 633435871..77c7bac70 100644
    --- a/include/conversation.php
    +++ b/include/conversation.php
    @@ -1488,6 +1488,19 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){
     			'id'    => 'files-tab',
     		);
     	}
    +
    +	require_once('include/chat.php');
    +	$chats = chatroom_list($a->profile['profile_uid']);
    +
    +	$tabs[] = array(
    +		'label' => t('Chatrooms') . '(' . count($chats) . ')',
    +		'url'	=> $a->get_baseurl() . '/chat/' . $nickname,
    +		'sel' 	=> ((argv(0) == 'chat') ? 'active' : ''),
    +		'title' => t('Chatrooms'),
    +		'id'    => 'chat-tab',
    +	);
    +
    +
     	if($is_owner) {
     		$tabs[] = array(
     			'label' => t('Events'),
    @@ -1506,6 +1519,7 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){
     		);
     	}
     
    +
     	if($is_owner && feature_enabled($a->profile['profile_uid'],'webpages')) {
     		$tabs[] = array(
     			'label' => t('Webpages'),
    -- 
    cgit v1.2.3
    
    
    From 97739920ebfa0d7b0db95c61187d5820c0939f14 Mon Sep 17 00:00:00 2001
    From: friendica 
    Date: Sat, 8 Feb 2014 00:48:19 -0800
    Subject: create a new "subdued" CSS class for things that shouldn't be in your
     face unless you want them and intentionally hover over them. Typically this
     would be accomplished via an opacity or colour change, but themes are free to
     use other methods. Also changed the channel_tabs "chatroom" link to use the
     subdued class if no rooms have been created rather than a count of chatrooms.
     Themse should probably create a .subdued and .subdued:hover definition
     because we'll probably take most of the stuff which is now hardwired to use
     opacity by id and change it to use the class definition instead.
    
    ---
     include/conversation.php | 6 +++---
     1 file changed, 3 insertions(+), 3 deletions(-)
    
    (limited to 'include/conversation.php')
    
    diff --git a/include/conversation.php b/include/conversation.php
    index 77c7bac70..16ac4e909 100644
    --- a/include/conversation.php
    +++ b/include/conversation.php
    @@ -1491,11 +1491,11 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){
     
     	require_once('include/chat.php');
     	$chats = chatroom_list($a->profile['profile_uid']);
    -
    +	$subdued = ((count($chats)) ? '' : ' subdued');
     	$tabs[] = array(
    -		'label' => t('Chatrooms') . '(' . count($chats) . ')',
    +		'label' => t('Chatrooms'),
     		'url'	=> $a->get_baseurl() . '/chat/' . $nickname,
    -		'sel' 	=> ((argv(0) == 'chat') ? 'active' : ''),
    +		'sel' 	=> ((argv(0) == 'chat') ? 'active' . $subdued : '' . $subdued),
     		'title' => t('Chatrooms'),
     		'id'    => 'chat-tab',
     	);
    -- 
    cgit v1.2.3
    
    
    From 41d8cfa72a4c4d82bce37959512da95b040dba7b Mon Sep 17 00:00:00 2001
    From: friendica 
    Date: Thu, 27 Mar 2014 00:25:34 -0700
    Subject: link in the firehose
    
    ---
     include/conversation.php | 15 ++++++++++++++-
     1 file changed, 14 insertions(+), 1 deletion(-)
    
    (limited to 'include/conversation.php')
    
    diff --git a/include/conversation.php b/include/conversation.php
    index 16ac4e909..6a0936a09 100644
    --- a/include/conversation.php
    +++ b/include/conversation.php
    @@ -1333,6 +1333,7 @@ function network_tabs() {
     	$conv_active = '';
     	$spam_active = '';
     	$postord_active = '';
    +	$public_active = '';
     
     	if(x($_GET,'new')) {
     		$new_active = 'active';
    @@ -1354,13 +1355,18 @@ function network_tabs() {
     		$spam_active = 'active';
     	}
     
    +	if(x($_GET,'fh')) {
    +		$public_active = 'active';
    +	}
    +
     	
     	
     	if (($new_active == '') 
     		&& ($starred_active == '') 
     		&& ($conv_active == '')
     		&& ($search_active == '')
    -		&& ($spam_active == '')) {
    +		&& ($spam_active == '')
    +		&& ($public_active == '')) {
     			$no_active = 'active';
     	}
     
    @@ -1377,6 +1383,13 @@ function network_tabs() {
     
     	// tabs
     	$tabs = array(
    +		array(
    +			'label' => t('Public'),
    +			'url'=>$a->get_baseurl(true) . '/' . $cmd . '?f=&fh=1' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''), 
    +			'sel'=> $public_active,
    +			'title'=> t('View Public Streams'),
    +		),
    +
     		array(
     			'label' => t('Commented Order'),
     			'url'=>$a->get_baseurl(true) . '/' . $cmd . '?f=&order=comment' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''), 
    -- 
    cgit v1.2.3
    
    
    From a0674af4169a8c929c89887d4e7796b21ee55a91 Mon Sep 17 00:00:00 2001
    From: friendica 
    Date: Thu, 27 Mar 2014 15:35:29 -0700
    Subject: firehose fixes and optimisations. In particular  get rid of the
     unresponsive script warning when trying to load updates (sine they aren't our
     posts, we can't check for unseen, hence we can't really load updates). Also
     make the url selection pluggable.
    
    ---
     include/conversation.php | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    (limited to 'include/conversation.php')
    
    diff --git a/include/conversation.php b/include/conversation.php
    index 6a0936a09..eef2635df 100644
    --- a/include/conversation.php
    +++ b/include/conversation.php
    @@ -1384,10 +1384,10 @@ function network_tabs() {
     	// tabs
     	$tabs = array(
     		array(
    -			'label' => t('Public'),
    +			'label' => t('External'),
     			'url'=>$a->get_baseurl(true) . '/' . $cmd . '?f=&fh=1' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''), 
     			'sel'=> $public_active,
    -			'title'=> t('View Public Streams'),
    +			'title'=> t('Imported public streams'),
     		),
     
     		array(
    -- 
    cgit v1.2.3
    
    
    From 6925cf9fe55e5a420fbe7385dd170d8dd7a65d57 Mon Sep 17 00:00:00 2001
    From: friendica 
    Date: Fri, 28 Mar 2014 01:24:30 -0700
    Subject: external -> discover
    
    ---
     include/conversation.php | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    (limited to 'include/conversation.php')
    
    diff --git a/include/conversation.php b/include/conversation.php
    index eef2635df..ac1b4e456 100644
    --- a/include/conversation.php
    +++ b/include/conversation.php
    @@ -1384,7 +1384,7 @@ function network_tabs() {
     	// tabs
     	$tabs = array(
     		array(
    -			'label' => t('External'),
    +			'label' => t('Discover'),
     			'url'=>$a->get_baseurl(true) . '/' . $cmd . '?f=&fh=1' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''), 
     			'sel'=> $public_active,
     			'title'=> t('Imported public streams'),
    -- 
    cgit v1.2.3
    
    
    From fedd19ec95bfe963ab19d9e55f184b8ffe9f0da0 Mon Sep 17 00:00:00 2001
    From: Alexandre Hannud Abdo 
    Date: Sat, 29 Mar 2014 23:20:43 -0300
    Subject: Let the site admin choose whether to display the Discover tab.
    
    ---
     include/conversation.php | 21 +++++++++++----------
     1 file changed, 11 insertions(+), 10 deletions(-)
    
    (limited to 'include/conversation.php')
    
    diff --git a/include/conversation.php b/include/conversation.php
    index ac1b4e456..342392398 100644
    --- a/include/conversation.php
    +++ b/include/conversation.php
    @@ -1382,14 +1382,17 @@ function network_tabs() {
     	$cmd = $a->cmd;
     
     	// tabs
    -	$tabs = array(
    -		array(
    -			'label' => t('Discover'),
    -			'url'=>$a->get_baseurl(true) . '/' . $cmd . '?f=&fh=1' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''), 
    -			'sel'=> $public_active,
    -			'title'=> t('Imported public streams'),
    -		),
    +	$tabs = array();
    +
    +	if(get_config('system','discover_tab'))
    +		$tabs[] = array(
    +                        'label' => t('Discover'),
    +                        'url'=>$a->get_baseurl(true) . '/' . $cmd . '?f=&fh=1' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''),
    +                        'sel'=> $public_active,
    +                        'title'=> t('Imported public streams'),
    +                );
     
    +	array_push($tabs,
     		array(
     			'label' => t('Commented Order'),
     			'url'=>$a->get_baseurl(true) . '/' . $cmd . '?f=&order=comment' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''), 
    @@ -1402,7 +1405,6 @@ function network_tabs() {
     			'sel'=>$postord_active,
     			'title' => t('Sort by Post Date'),
     		),
    -
     		array(
     			'label' => t('Personal'),
     			'url' => $a->get_baseurl(true) . '/' . $cmd . '?f=' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . '&conv=1',
    @@ -1414,8 +1416,7 @@ function network_tabs() {
     			'url' => $a->get_baseurl(true) . '/' . $cmd . '?f=' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . '&new=1' . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''),
     			'sel' => $new_active,
     			'title' => t('Activity Stream - by date'),
    -		),
    -
    +		)
     	);
     
     	if(feature_enabled(local_user(),'star_posts')) 
    -- 
    cgit v1.2.3
    
    
    From 0b7588b1eb61053a92c71046a12c169300b7fff4 Mon Sep 17 00:00:00 2001
    From: friendica 
    Date: Sat, 29 Mar 2014 23:43:31 -0700
    Subject: issue #384
    
    ---
     include/conversation.php | 63 +++++++++++++++++++++++++++---------------------
     1 file changed, 35 insertions(+), 28 deletions(-)
    
    (limited to 'include/conversation.php')
    
    diff --git a/include/conversation.php b/include/conversation.php
    index 342392398..294c7e3e3 100644
    --- a/include/conversation.php
    +++ b/include/conversation.php
    @@ -1384,58 +1384,65 @@ function network_tabs() {
     	// tabs
     	$tabs = array();
     
    -	if(get_config('system','discover_tab'))
    +	if(get_config('system','discover_tab')) {
     		$tabs[] = array(
    -                        'label' => t('Discover'),
    -                        'url'=>$a->get_baseurl(true) . '/' . $cmd . '?f=&fh=1' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''),
    -                        'sel'=> $public_active,
    -                        'title'=> t('Imported public streams'),
    -                );
    +			'label' => t('Discover'),
    +			'url'=>$a->get_baseurl(true) . '/' . $cmd . '?f=&fh=1' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''),
    +			'sel'=> $public_active,
    +			'title'=> t('Imported public streams'),
    +		);
    +	}
     
    -	array_push($tabs,
    -		array(
    -			'label' => t('Commented Order'),
    -			'url'=>$a->get_baseurl(true) . '/' . $cmd . '?f=&order=comment' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''), 
    -			'sel'=>$all_active,
    -			'title'=> t('Sort by Comment Date'),
    -		),
    -		array(
    -			'label' => t('Posted Order'),
    -			'url'=>$a->get_baseurl(true) . '/' . $cmd . '?f=&order=post' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''), 
    -			'sel'=>$postord_active,
    -			'title' => t('Sort by Post Date'),
    -		),
    -		array(
    +	$tabs[] = array(
    +		'label' => t('Commented Order'),
    +		'url'=>$a->get_baseurl(true) . '/' . $cmd . '?f=&order=comment' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''), 
    +		'sel'=>$all_active,
    +		'title'=> t('Sort by Comment Date'),
    +	);
    +	
    +	$tabs[] = array(
    +		'label' => t('Posted Order'),
    +		'url'=>$a->get_baseurl(true) . '/' . $cmd . '?f=&order=post' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''), 
    +		'sel'=>$postord_active,
    +		'title' => t('Sort by Post Date'),
    +	);
    +
    +	if(feature_enabled(local_user(),'personal_tab')) {
    +		$tabs[] = array(
     			'label' => t('Personal'),
     			'url' => $a->get_baseurl(true) . '/' . $cmd . '?f=' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . '&conv=1',
     			'sel' => $conv_active,
     			'title' => t('Posts that mention or involve you'),
    -		),
    -		array(
    +		);
    +	}
    +
    +	if(feature_enable(local_user(),'new_tab')) { 
    +		$tabs[] = array(
     			'label' => t('New'),
     			'url' => $a->get_baseurl(true) . '/' . $cmd . '?f=' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . '&new=1' . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''),
     			'sel' => $new_active,
     			'title' => t('Activity Stream - by date'),
    -		)
    -	);
    +		);
    +	}
     
    -	if(feature_enabled(local_user(),'star_posts')) 
    +	if(feature_enabled(local_user(),'star_posts')) {
     		$tabs[] = array(
     			'label' => t('Starred'),
     			'url'=>$a->get_baseurl(true) . '/' . $cmd . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&star=1',
     			'sel'=>$starred_active,
     			'title' => t('Favourite Posts'),
     		);
    -
    +	}
     	// Not yet implemented
     
    -	if(feature_enabled(local_user(),'spam_filter')) 
    +	if(feature_enabled(local_user(),'spam_filter')) {
     		$tabs[] = array(
     			'label' => t('Spam'),
     			'url'=>$a->get_baseurl(true) . '/network?f=&spam=1',
     			'sel'=> $spam_active,
     			'title' => t('Posts flagged as SPAM'),
    -		);	
    +		);
    +	}	
     
     	$arr = array('tabs' => $tabs);
     	call_hooks('network_tabs', $arr);
    -- 
    cgit v1.2.3
    
    
    From 9e5f4243941f3e7f3290698d1072895c1019d917 Mon Sep 17 00:00:00 2001
    From: friendica 
    Date: Sat, 29 Mar 2014 23:45:21 -0700
    Subject: typo
    
    ---
     include/conversation.php | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    (limited to 'include/conversation.php')
    
    diff --git a/include/conversation.php b/include/conversation.php
    index 294c7e3e3..a6e81dd7f 100644
    --- a/include/conversation.php
    +++ b/include/conversation.php
    @@ -1416,7 +1416,7 @@ function network_tabs() {
     		);
     	}
     
    -	if(feature_enable(local_user(),'new_tab')) { 
    +	if(feature_enabled(local_user(),'new_tab')) { 
     		$tabs[] = array(
     			'label' => t('New'),
     			'url' => $a->get_baseurl(true) . '/' . $cmd . '?f=' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . '&new=1' . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''),
    -- 
    cgit v1.2.3
    
    
    From 1093e8d83efeabc7f4154ce04b5f7f554b9957e5 Mon Sep 17 00:00:00 2001
    From: Thomas Willingham 
    Date: Sun, 30 Mar 2014 22:59:37 +0100
    Subject: Default discover to on.
    
    ---
     include/conversation.php | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    (limited to 'include/conversation.php')
    
    diff --git a/include/conversation.php b/include/conversation.php
    index a6e81dd7f..af41e8fa7 100644
    --- a/include/conversation.php
    +++ b/include/conversation.php
    @@ -1384,7 +1384,7 @@ function network_tabs() {
     	// tabs
     	$tabs = array();
     
    -	if(get_config('system','discover_tab')) {
    +	if(! get_config('system','disable_discover_tab')) {
     		$tabs[] = array(
     			'label' => t('Discover'),
     			'url'=>$a->get_baseurl(true) . '/' . $cmd . '?f=&fh=1' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''),
    -- 
    cgit v1.2.3
    
    
    From 4901ef8faf743fd7fef97fc75a1c727804bf3df5 Mon Sep 17 00:00:00 2001
    From: friendica 
    Date: Sat, 5 Apr 2014 02:32:07 -0700
    Subject: provide the ability for rpost to post as another of your channels.
     This does not yet work, so the functionality has not been enabled.
    
    ---
     include/conversation.php | 9 +++++++++
     1 file changed, 9 insertions(+)
    
    (limited to 'include/conversation.php')
    
    diff --git a/include/conversation.php b/include/conversation.php
    index af41e8fa7..880639bf4 100644
    --- a/include/conversation.php
    +++ b/include/conversation.php
    @@ -1052,6 +1052,13 @@ function status_editor($a,$x,$popup=false) {
     	}
     	
     
    +	if(array_key_exists('channel_select',$x) && $x['channel_select']) {
    +		require_once('include/identity.php');
    +		$id_select = identity_selector();
    +	}
    +	else
    +		$id_select = '';
    +
     
     	$webpage = ((x($x,'webpage')) ? $x['webpage'] : '');
     
    @@ -1098,6 +1105,8 @@ function status_editor($a,$x,$popup=false) {
     		'$webpage' => $webpage,
     		'$placeholdpagetitle' => ((x($x,'ptlabel')) ? $x['ptlabel'] : t('Page link title')),
     		'$pagetitle' => (x($x,'pagetitle') ? $x['pagetitle'] : ''),		
    +		'$id_select' => $id_select,
    +		'$id_seltext' => t('Post as'),
     		'$upload' => t('Upload photo'),
     		'$shortupload' => t('upload photo'),
     		'$attach' => t('Attach file'),
    -- 
    cgit v1.2.3
    
    
    From 64dfe3ab64a7f39c2c88d141a7d8a8b9d60756ff Mon Sep 17 00:00:00 2001
    From: friendica 
    Date: Sun, 6 Apr 2014 03:47:53 -0700
    Subject: issue #395, item 2
    
    ---
     include/conversation.php | 6 ++++--
     1 file changed, 4 insertions(+), 2 deletions(-)
    
    (limited to 'include/conversation.php')
    
    diff --git a/include/conversation.php b/include/conversation.php
    index 880639bf4..149da3ac7 100644
    --- a/include/conversation.php
    +++ b/include/conversation.php
    @@ -1472,6 +1472,8 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){
     
     	if (is_null($nickname))
     		$nickname  = $channel['channel_address'];
    +
    +	$uid = (($a->profile['profile_uid']) ? $a->profile['profile_uid'] : local_user());
     		
     	if(x($_GET,'tab'))
     		$tab = notags(trim($_GET['tab']));
    @@ -1489,7 +1491,7 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){
     		),
     	);
     
    -	$p = get_all_perms($a->profile['profile_uid'],get_observer_hash());
    +	$p = get_all_perms($uid,get_observer_hash());
     
     	if($p['view_profile']) {
     		$tabs[] = array(
    @@ -1550,7 +1552,7 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){
     	}
     
     
    -	if($is_owner && feature_enabled($a->profile['profile_uid'],'webpages')) {
    +	if($is_owner && feature_enabled($uid,'webpages')) {
     		$tabs[] = array(
     			'label' => t('Webpages'),
     			'url'	=> $a->get_baseurl() . '/webpages/' . $nickname,
    -- 
    cgit v1.2.3
    
    
    From f7cb4e0ef0b6d40427858810404ad9caedb27ae3 Mon Sep 17 00:00:00 2001
    From: marijus 
    Date: Sun, 6 Apr 2014 21:14:24 +0200
    Subject: jot and location style fixes
    
    ---
     include/conversation.php | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    (limited to 'include/conversation.php')
    
    diff --git a/include/conversation.php b/include/conversation.php
    index 149da3ac7..df3f5f03c 100644
    --- a/include/conversation.php
    +++ b/include/conversation.php
    @@ -1296,7 +1296,7 @@ function render_location_default($item) {
     
     	if($coord) {
     		if($location)
    -			$location .= '
    (' . $coord . ')'; + $location .= ' (' . $coord . ')'; else $location = '' . $coord . ''; } -- cgit v1.2.3 From 6f555c50e110235d125645113a58d1a2fda2eee8 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 6 Apr 2014 18:40:37 -0700 Subject: a bit more work towards issue #395 - cleaning up some cases which were going to the url directly and which weren't going through chanview. Also worth noting - mentions in posts do not go through chanview. Perhaps it is time to kill chanview (except we then cannot implemented a "connected" or "connect" button since we don't have any control over the landing page). For the time being I'm just trying to trap as many of the "visit URL" links as possible and sending them to a common place. Then we can figure out how that common place should behave. --- include/conversation.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index df3f5f03c..e5cd3358f 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -911,7 +911,7 @@ function item_photo_menu($item){ } } - $profile_link = z_root() . "/chanview/?f=&hash=" . $item['author_xchan']; + $profile_link = chanlink_hash($item['author_xchan']); $pm_url = $a->get_baseurl($ssl_state) . '/mail/new/?f=&hash=' . $item['author_xchan']; if($a->contacts && array_key_exists($item['author_xchan'],$a->contacts)) @@ -964,13 +964,7 @@ function like_puller($a,$item,&$arr,$mode) { $verb = (($mode === 'like') ? ACTIVITY_LIKE : ACTIVITY_DISLIKE); if((activity_match($item['verb'],$verb)) && ($item['id'] != $item['parent'])) { - $url = $item['author']['xchan_url']; - if((local_user()) && (local_user() == $item['uid']) && ($item['network'] === 'dfrn') && (! $item['self']) && (link_compare($item['author-link'],$item['url']))) { - $url = $a->get_baseurl(true) . '/redir/' . $item['contact-id']; - $sparkle = ' class="sparkle" '; - } - else - $url = zid($url); + $url = chanlink_url($item['author']['xchan_url']); if(! $item['thr_parent']) $item['thr_parent'] = $item['parent_mid']; @@ -981,7 +975,7 @@ function like_puller($a,$item,&$arr,$mode) { $arr[$item['thr_parent']] = 1; else $arr[$item['thr_parent']] ++; - $arr[$item['thr_parent'] . '-l'][] = '' . $item['author']['xchan_name'] . ''; + $arr[$item['thr_parent'] . '-l'][] = '' . $item['author']['xchan_name'] . ''; } return; } -- cgit v1.2.3 From 95751dddff2b1b7a2074d37a5b3102f256842ae4 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 7 Apr 2014 20:20:28 -0700 Subject: some fixes to #395 --- include/conversation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index e5cd3358f..8803e74e7 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1516,7 +1516,7 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){ } require_once('include/chat.php'); - $chats = chatroom_list($a->profile['profile_uid']); + $chats = chatroom_list($uid); $subdued = ((count($chats)) ? '' : ' subdued'); $tabs[] = array( 'label' => t('Chatrooms'), -- cgit v1.2.3 From 9f621dac85c1c417b17d031e3ca2798c6b63ece7 Mon Sep 17 00:00:00 2001 From: marijus Date: Tue, 8 Apr 2014 22:07:06 +0200 Subject: change the way jot tools are displayed/hidden --- include/conversation.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 8803e74e7..5a7e9e2cd 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1144,9 +1144,9 @@ function status_editor($a,$x,$popup=false) { '$source' => ((x($x,'source')) ? $x['source'] : ''), '$jotplugins' => $jotplugins, '$defexpire' => '', - '$feature_expire' => ((feature_enabled($x['profile_uid'],'content_expire') && (! $webpage)) ? 'block' : 'none'), + '$feature_expire' => ((feature_enabled($x['profile_uid'],'content_expire') && (! $webpage)) ? true : false), '$expires' => t('Set expiration date'), - '$feature_encrypt' => ((feature_enabled($x['profile_uid'],'content_encrypt') && (! $webpage)) ? 'block' : 'none'), + '$feature_encrypt' => ((feature_enabled($x['profile_uid'],'content_encrypt') && (! $webpage)) ? true : false), '$encrypt' => t('Encrypt text'), '$cipher' => $cipher, '$expiryModalOK' => t('OK'), -- cgit v1.2.3 From b88a7fc23a185a6ecfbc451bddc7da33ea2c4d4c Mon Sep 17 00:00:00 2001 From: marijus Date: Wed, 9 Apr 2014 18:29:22 +0200 Subject: use $showacl to show/hide acl in jot.tpl - remove $pvisit and repair editblock and editlayout which still depended on it. --- include/conversation.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 5a7e9e2cd..09bdc022f 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1129,7 +1129,6 @@ function status_editor($a,$x,$popup=false) { '$baseurl' => $a->get_baseurl(true), '$defloc' => $x['default_location'], '$visitor' => $x['visitor'], - '$pvisit' => (($notes_cid) ? 'none' : $x['visitor']), '$public' => t('Public post'), '$jotnets' => $jotnets, '$emtitle' => t('Example: bob@example.com, mary@example.com'), @@ -1137,7 +1136,7 @@ function status_editor($a,$x,$popup=false) { '$acl' => $x['acl'], '$mimeselect' => $mimeselect, '$layoutselect' => $layoutselect, - '$showacl' => ((array_key_exists('showacl',$x)) ? $x['showacl'] : 'yes'), + '$showacl' => ((array_key_exists('showacl',$x)) ? $x['showacl'] : true), '$bang' => $x['bang'], '$profile_uid' => $x['profile_uid'], '$preview' => $preview, -- cgit v1.2.3 From 795d74171358abe23cc4be01dac0e48d04ee46b4 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 9 Apr 2014 21:11:49 -0700 Subject: issue #400 - lock not showing up for previews of private mentions (or 'new/search' item view) also reformat the new/search template to pick up recent changes to conv_item.tpl --- include/conversation.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 8803e74e7..d56e468ad 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -635,7 +635,11 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ $star = false; $isstarred = "unstarred icon-star-empty"; - $lock = false; + $lock = (($item['item_private'] || strlen($item['allow_cid']) || strlen($item['allow_gid']) || strlen($item['deny_cid']) || strlen($item['deny_gid'])) + ? t('Private Message') + : false + ); + $likebuttons = false; $shareable = false; -- cgit v1.2.3 From 3197ccbf5edf51eab49623c7c21e63af7de7f127 Mon Sep 17 00:00:00 2001 From: marijus Date: Fri, 11 Apr 2014 16:06:39 +0200 Subject: bootstrapify aclselector --- include/conversation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 9ffa1e77a..541da1d9b 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1153,7 +1153,7 @@ function status_editor($a,$x,$popup=false) { '$encrypt' => t('Encrypt text'), '$cipher' => $cipher, '$expiryModalOK' => t('OK'), - '$expiryModalCANCEL' => t('Cancel'), + '$expiryModalCANCEL' => t('Cancel') )); -- cgit v1.2.3 From 4e0b85267aae6aa8c982b56eb7c17ca2dae17f17 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Fri, 18 Apr 2014 16:34:48 +0100 Subject: We know why third party zids didn't work now, so don't use hacky workarounds anymore. --- include/conversation.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 541da1d9b..2d72f3489 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1303,11 +1303,9 @@ function render_location_default($item) { function prepare_page($item) { - $a = get_app(); $naked = ((get_pconfig($item['uid'],'system','nakedpage')) ? 1 : 0); $observer = $a->get_observer(); - $zid = ($observer['xchan_addr']); //240 chars is the longest we can have before we start hitting problems with suhosin sites $preview = substr(urlencode($item['body']), 0, 240); $link = z_root() . '/' . $a->cmd; @@ -1318,8 +1316,7 @@ function prepare_page($item) { } return replace_macros(get_markup_template('page_display.tpl'),array( '$author' => (($naked) ? '' : $item['author']['xchan_name']), - '$auth_url' => (($naked) ? '' : $item['author']['xchan_url']), - '$zid' => $zid, + '$auth_url' => (($naked) ? '' : zid($item['author']['xchan_url'])), '$date' => (($naked) ? '' : datetime_convert('UTC',date_default_timezone_get(),$item['created'],'Y-m-d H:i')), '$title' => smilies(bbcode($item['title'])), '$body' => prepare_body($item,true), -- cgit v1.2.3 From 30eb1b494a403acf0bcad461907ece77c707d574 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 28 May 2014 17:58:49 -0700 Subject: moods: simplify 'xyz is tired' rather than 'xyz is currently tired'. This is possible now that we have translation contexts, as before '$1 is $2' was ambiguous without a context - in this case 'mood'. --- include/conversation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 2d72f3489..21ce3bb66 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -255,7 +255,7 @@ function localize_item(&$item){ $A = '[zrl=' . chanlink_url($Alink) . ']' . $Aname . '[/zrl]'; - $txt = t('%1$s is currently %2$s'); + $txt = t('%1$s is %2$s','mood'); $item['body'] = sprintf($txt, $A, t($verb)); } -- cgit v1.2.3 From b9256eed307d6fa07fcd55067e7278ac421d3b96 Mon Sep 17 00:00:00 2001 From: marijus Date: Sat, 14 Jun 2014 15:31:36 +0200 Subject: unclutter menues a little --- include/conversation.php | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 21ce3bb66..d78ee2710 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1517,25 +1517,18 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){ require_once('include/chat.php'); $chats = chatroom_list($uid); - $subdued = ((count($chats)) ? '' : ' subdued'); - $tabs[] = array( - 'label' => t('Chatrooms'), - 'url' => $a->get_baseurl() . '/chat/' . $nickname, - 'sel' => ((argv(0) == 'chat') ? 'active' . $subdued : '' . $subdued), - 'title' => t('Chatrooms'), - 'id' => 'chat-tab', - ); - - - if($is_owner) { + if (count($chats)) { $tabs[] = array( - 'label' => t('Events'), - 'url' => $a->get_baseurl() . '/events', - 'sel' => ((argv(0) == 'events') ? 'active' : ''), - 'title' => t('Events and Calendar'), - 'id' => 'events-tab', + 'label' => t('Chatrooms'), + 'url' => $a->get_baseurl() . '/chat/' . $nickname, + 'sel' => ((argv(0) == 'chat') ? 'active' : '' ), + 'title' => t('Chatrooms'), + 'id' => 'chat-tab', ); + } + + if($is_owner) { $tabs[] = array( 'label' => t('Bookmarks'), 'url' => $a->get_baseurl() . '/bookmarks', -- cgit v1.2.3 From bd06e580078e4955acd6d7d6782f06ab076f08b6 Mon Sep 17 00:00:00 2001 From: marijus Date: Sat, 14 Jun 2014 15:38:44 +0200 Subject: whitespace --- include/conversation.php | 1 - 1 file changed, 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index d78ee2710..ee4952d7e 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1527,7 +1527,6 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){ ); } - if($is_owner) { $tabs[] = array( 'label' => t('Bookmarks'), -- cgit v1.2.3 From e1ec1e7c5fd5ca38b6ed87f8664f5718879c4364 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 15 Jun 2014 19:21:32 -0700 Subject: sort out the unobscure mess --- include/conversation.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index ee4952d7e..2933842a5 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1314,12 +1314,15 @@ function prepare_page($item) { $naked = 1; // ... other possible options } + + $body = prepare_body($item,true); + return replace_macros(get_markup_template('page_display.tpl'),array( '$author' => (($naked) ? '' : $item['author']['xchan_name']), '$auth_url' => (($naked) ? '' : zid($item['author']['xchan_url'])), '$date' => (($naked) ? '' : datetime_convert('UTC',date_default_timezone_get(),$item['created'],'Y-m-d H:i')), '$title' => smilies(bbcode($item['title'])), - '$body' => prepare_body($item,true), + '$body' => $body, '$preview' => $preview, '$link' => $link, )); -- cgit v1.2.3 From 38e0bb45309981441017085f02d3709f5a6ee639 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 15 Jun 2014 19:25:16 -0700 Subject: document why this works --- include/conversation.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 2933842a5..5c3933788 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1315,6 +1315,9 @@ function prepare_page($item) { // ... other possible options } + // prepare_body calls unobscure() as a side effect. Do it here so that + // the template will get passed an unobscured title. + $body = prepare_body($item,true); return replace_macros(get_markup_template('page_display.tpl'),array( -- cgit v1.2.3 From 224a2b9ddf38b6fa52fef3f0d8cbe4299e651c47 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 18 Jun 2014 20:33:28 -0700 Subject: put viewsrc back in a lightbox --- include/conversation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 5c3933788..a2cca1c77 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -909,7 +909,7 @@ function item_photo_menu($item){ } if((local_user()) && local_user() == $item['uid']) { - $vsrc_link = $a->get_baseurl() . '/viewsrc/' . $item['id']; + $vsrc_link = 'javascript:viewsrc(' . $item['id'] . '); return false;'; if($item['parent'] == $item['id'] && $channel && ($channel_hash != $item['author_xchan'])) { $sub_link = 'javascript:dosubthread(' . $item['id'] . '); return false;'; } -- cgit v1.2.3 From c4c1c37bd3388cf2be3f57bc29492e73644bc4ec Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 22 Jun 2014 22:16:26 -0700 Subject: profile likes --- include/conversation.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index a2cca1c77..0ca3e88f0 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -95,7 +95,10 @@ function localize_item(&$item){ if(! $item['object']) return; - + + if($item['item_flags'] & ITEM_THREAD_TOP) + return; + $obj = json_decode_plus($item['object']); if((! $obj) && ($item['object'])) { logger('localize_item: failed to decode object: ' . print_r($item['object'],true)); -- cgit v1.2.3