From bb8beb26b4d87c27ce4c8dce3e1229a27a2d1a7e Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 29 Mar 2012 20:58:32 -0700 Subject: use zrl to get home again --- include/conversation.php | 43 ++++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 17 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 5de4fcb51..37856651e 100755 --- a/include/conversation.php +++ b/include/conversation.php @@ -94,9 +94,9 @@ function localize_item(&$item){ } - $A = '[url=' . $Alink . ']' . $Aname . '[/url]'; - $B = '[url=' . $Blink . ']' . $Bname . '[/url]'; - if ($Bphoto!="") $Bphoto = '[url=' . $Blink . '][img]' . $Bphoto . '[/img][/url]'; + $A = '[url=' . zrl($Alink) . ']' . $Aname . '[/url]'; + $B = '[url=' . zrl($Blink) . ']' . $Bname . '[/url]'; + if ($Bphoto!="") $Bphoto = '[url=' . zrl($Blink) . '][img]' . $Bphoto . '[/img][/url]'; $item['body'] = sprintf( t('%1$s is now friends with %2$s'), $A, $B)."\n\n\n".$Bphoto; @@ -108,8 +108,8 @@ function localize_item(&$item){ if(count($r)==0) return; $obj=$r[0]; - $author = '[url=' . $item['author-link'] . ']' . $item['author-name'] . '[/url]'; - $objauthor = '[url=' . $obj['author-link'] . ']' . $obj['author-name'] . '[/url]'; + $author = '[url=' . zrl($item['author-link']) . ']' . $item['author-name'] . '[/url]'; + $objauthor = '[url=' . zrl($obj['author-link']) . ']' . $obj['author-name'] . '[/url]'; switch($obj['verb']){ case ACTIVITY_POST: @@ -158,8 +158,8 @@ function localize_item(&$item){ $target = $r[0]; $Bname = $target['author-name']; $Blink = $target['author-link']; - $A = '[url=' . $Alink . ']' . $Aname . '[/url]'; - $B = '[url=' . $Blink . ']' . $Bname . '[/url]'; + $A = '[url=' . zrl($Alink) . ']' . $Aname . '[/url]'; + $B = '[url=' . zrl($Blink) . ']' . $Bname . '[/url]'; $P = '[url=' . $target['plink'] . ']' . t('post/item') . '[/url]'; $item['body'] = sprintf( t('%1$s marked %2$s\'s %3$s as favorite'), $A, $B, $P)."\n"; @@ -276,13 +276,16 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { if($item['author-link'] && (! $item['author-name'])) $profile_name = $item['author-link']; + + $sp = false; $profile_link = best_link_url($item,$sp); - if($sp) - $sparkle = ' sparkle'; if($profile_link === 'mailbox') $profile_link = ''; - + if($sp) + $sparkle = ' sparkle'; + else + $profile_link = zrl($profile_link); $normalised = normalise_link((strlen($item['author-link'])) ? $item['author-link'] : $item['url']); if(($normalised != 'mailbox') && (x($a->contacts[$normalised]))) @@ -484,7 +487,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { // This will have been stored in $a->page_contact by our calling page. // Put this person on the left of the wall-to-wall notice. - $owner_url = $a->page_contact['url']; + $owner_url = zrl($a->page_contact['url']); $owner_photo = $a->page_contact['thumb']; $owner_name = $a->page_contact['name']; $template = $wallwall; @@ -501,10 +504,12 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { $commentww = 'ww'; // If it is our contact, use a friendly redirect link if((link_compare($item['owner-link'],$item['url'])) - && ($item['network'] === 'dfrn')) { + && ($item['network'] === NETWORK_DFRN)) { $owner_url = $redirect_url; $osparkle = ' sparkle'; } + else + $owner_url = zrl($owner_url); } } @@ -596,14 +601,14 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { if($item['author-link'] && (! $item['author-name'])) $profile_name = $item['author-link']; - $sp = false; $profile_link = best_link_url($item,$sp); - if($sp) - $sparkle = ' sparkle'; - if($profile_link === 'mailbox') $profile_link = ''; + if($sp) + $sparkle = ' sparkle'; + else + $profile_link = zrl($profile_link); $normalised = normalise_link((strlen($item['author-link'])) ? $item['author-link'] : $item['url']); if(($normalised != 'mailbox') && (x($a->contacts,$normalised))) @@ -767,8 +772,10 @@ function item_photo_menu($item){ $photos_link = $profile_link . "?url=photos"; $profile_link = $profile_link . "?url=profile"; $pm_url = $a->get_baseurl($ssl_state) . '/message/new/' . $cid; + $zurl = ''; } else { + $profile_link = zrl($profile_link); if(local_user() && local_user() == $item['uid'] && link_compare($item['url'],$item['author-link'])) { $cid = $item['contact-id']; } @@ -795,7 +802,7 @@ function item_photo_menu($item){ $menu = Array( t("View status") => $status_link, t("View profile") => $profile_link, - t("View photos") => $photos_link, + t("View photos") => $photos_link, t("View recent") => $posts_link, t("Edit contact") => $contact_url, t("Send PM") => $pm_url, @@ -828,6 +835,8 @@ function like_puller($a,$item,&$arr,$mode) { $url = $a->get_baseurl(true) . '/redir/' . $item['contact-id']; $sparkle = ' class="sparkle" '; } + else + $url = zrl($url); if(! ((isset($arr[$item['parent'] . '-l'])) && (is_array($arr[$item['parent'] . '-l'])))) $arr[$item['parent'] . '-l'] = array(); if(! isset($arr[$item['parent']])) -- cgit v1.2.3 From 168cf3b9d4ca004dd589d14f4c8f31cd0d7e1265 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 29 Mar 2012 21:08:10 -0700 Subject: zrl on mentions --- 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 37856651e..6283cfe0a 100755 --- a/include/conversation.php +++ b/include/conversation.php @@ -166,6 +166,12 @@ function localize_item(&$item){ } } } + $matches = null; + if(preg_match_all('/@[url=(.*?)]/is',$item['body'],$matches,PREG_SET_ORDER)) { + foreach($matches as $mtch) { + $item['body'] = str_replace($mtch[0],'@[url=' . zrl($mtch[1]). ']',$item['body']); + } + } } -- cgit v1.2.3 From 9332312ce93cd4b7113f31109d4c1dd1656f6189 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 29 Mar 2012 21:18:47 -0700 Subject: silly mistake --- 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 6283cfe0a..1c3ee43b0 100755 --- a/include/conversation.php +++ b/include/conversation.php @@ -167,9 +167,10 @@ function localize_item(&$item){ } } $matches = null; - if(preg_match_all('/@[url=(.*?)]/is',$item['body'],$matches,PREG_SET_ORDER)) { + if(preg_match_all('/@\[url=(.*?)\]/is',$item['body'],$matches,PREG_SET_ORDER)) { foreach($matches as $mtch) { - $item['body'] = str_replace($mtch[0],'@[url=' . zrl($mtch[1]). ']',$item['body']); + if(! strpos($mtch[1],'zrl=')) + $item['body'] = str_replace($mtch[0],'@[url=' . zrl($mtch[1]). ']',$item['body']); } } -- cgit v1.2.3 From 87539dbec4b73039f7f5e4fa58c3398d9e496834 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 30 Mar 2012 02:22:57 -0700 Subject: bug #352 - qcomment plugin disabled, qcomments still allowed --- 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 1c3ee43b0..402713b32 100755 --- a/include/conversation.php +++ b/include/conversation.php @@ -532,9 +532,12 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { if ($shareable) $likebuttons['share'] = array( t('Share this'), t('share')); } + $qc = $qcomment = null; - $qc = ((local_user()) ? get_pconfig(local_user(),'qcomment','words') : null); - $qcomment = (($qc) ? explode("\n",$qc) : null); + if(in_array('qcomment',$a->plugins)) { + $qc = ((local_user()) ? get_pconfig(local_user(),'qcomment','words') : null); + $qcomment = (($qc) ? explode("\n",$qc) : null); + } if(($show_comment_box) || (($show_comment_box == false) && ($override_comment_box == false) && ($item['last-child']))) { $comment = replace_macros($cmnt_tpl,array( -- cgit v1.2.3 From bcc58016089c5e5c0e1e5e247d9253b4ac664c2c Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 30 Mar 2012 02:42:36 -0700 Subject: rename "file as" to "save to folder" --- 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 402713b32..a9fb807ad 100755 --- a/include/conversation.php +++ b/include/conversation.php @@ -595,7 +595,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { 'classtagger' => "", ); } - $filer = t("file as"); + $filer = t("save to folder"); } @@ -915,7 +915,7 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) { '$vidurl' => t("Please enter a video link/URL:"), '$audurl' => t("Please enter an audio link/URL:"), '$term' => t('Tag term:'), - '$fileas' => t('File as:'), + '$fileas' => t('Save to Folder:'), '$whereareu' => t('Where are you right now?') )); -- cgit v1.2.3 From e6fd6bfd89ada9b5aeea8fcac1614546deba85aa Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 31 Mar 2012 17:44:34 -0700 Subject: more error handling --- 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 a9fb807ad..5a922b2b5 100755 --- a/include/conversation.php +++ b/include/conversation.php @@ -250,7 +250,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { $threads = array(); $threadsid = -1; - if(count($items)) { + if($items && count($items)) { if($mode === 'network-new' || $mode === 'search' || $mode === 'community') { -- cgit v1.2.3 From 581b54c974a9b9a050a8a0b9a17a19bd41b1f2f5 Mon Sep 17 00:00:00 2001 From: Michael Johnston Date: Sun, 1 Apr 2012 21:28:31 -0400 Subject: allow users to set categories on their posts --- 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 5a922b2b5..df92a40ed 100755 --- a/include/conversation.php +++ b/include/conversation.php @@ -974,6 +974,8 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) { '$shortnoloc' => t('clear location'), '$title' => "", '$placeholdertitle' => t('Set title'), + '$category' => "", + '$placeholdercategory' => t('Categories (comma-separated list)'), '$wait' => t('Please wait'), '$permset' => t('Permission settings'), '$shortpermset' => t('permissions'), -- cgit v1.2.3