From 53d6d4c6556fe85a05ef6945d2ebc327e82cb3fb Mon Sep 17 00:00:00 2001 From: Klaus Date: Sat, 15 Feb 2014 21:48:40 +0100 Subject: Fix call to asset icons in RedBrowser. RedBrowser was not displaying asset icons correctly, because the URL was wrong. --- include/reddav.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/reddav.php b/include/reddav.php index a8d6739f0..cb2aa3bb9 100644 --- a/include/reddav.php +++ b/include/reddav.php @@ -1064,5 +1064,15 @@ class RedBrowser extends DAV\Browser\Plugin { } + /** + * This method takes a path/name of an asset and turns it into url + * suiteable for http access. + * + * @param string $assetName + * @return string + */ + protected function getAssetUrl($assetName) { + return '/cloud/?sabreAction=asset&assetName=' . urlencode($assetName); + } } -- cgit v1.2.3 From 01f31c2f2060a925c22b3f92e841d4f951d1825c Mon Sep 17 00:00:00 2001 From: Klaus Date: Sat, 15 Feb 2014 22:25:14 +0100 Subject: Make asset icons work in subdir installs as well. This should be the right way I guess, especially if red# is installed in a subdirectory. (untested) --- include/reddav.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/reddav.php b/include/reddav.php index cb2aa3bb9..6182aeacd 100644 --- a/include/reddav.php +++ b/include/reddav.php @@ -1072,7 +1072,7 @@ class RedBrowser extends DAV\Browser\Plugin { * @return string */ protected function getAssetUrl($assetName) { - return '/cloud/?sabreAction=asset&assetName=' . urlencode($assetName); + return z_root() .'/cloud/?sabreAction=asset&assetName=' . urlencode($assetName); } } -- cgit v1.2.3 From 29f6a1ee33b27886afc135e05ecac592651bb7b2 Mon Sep 17 00:00:00 2001 From: Klaus Date: Sun, 16 Feb 2014 10:25:32 +0100 Subject: removed unused function posted_date_widget This functions seems not to be used anywhere. include/widgets.php contains widget_archive($arr) which has the same functionality. --- include/items.php | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'include') diff --git a/include/items.php b/include/items.php index 3c10b8f5c..9dc65f89c 100755 --- a/include/items.php +++ b/include/items.php @@ -3622,26 +3622,6 @@ function posted_dates($uid,$wall) { } -function posted_date_widget($url,$uid,$wall) { - $o = ''; - - if(! feature_enabled($uid,'archives')) - return $o; - - $ret = posted_dates($uid,$wall); - if(! count($ret)) - return $o; - - $o = replace_macros(get_markup_template('posted_date_widget.tpl'),array( - '$title' => t('Archives'), - '$size' => ((count($ret) > 6) ? 6 : count($ret)), - '$url' => $url, - '$dates' => $ret - )); - return $o; -} - - function fetch_post_tags($items,$link = false) { $tag_finder = array(); -- cgit v1.2.3 From ebd52368bb134e57a54d853732b5b4970a8ce02b Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 16 Feb 2014 14:13:26 -0800 Subject: strip hard-wired zids from posted links as they will have the wrong identity when somebody tries to view the link --- include/items.php | 11 ++++++++++- include/text.php | 5 +++++ 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/items.php b/include/items.php index 3c10b8f5c..9bcdd7d0b 100755 --- a/include/items.php +++ b/include/items.php @@ -145,7 +145,9 @@ function can_comment_on_post($observer_xchan,$item) { * @function red_zrl_callback * preg_match function when fixing 'naked' links in mod item.php * Check if we've got a hubloc for the site and use a zrl if we do, a url if we don't. - * + * Remove any existing zid= param which may have been pasted by mistake - and will have + * the author's credentials. zid's are dynamic and can't really be passed around like + * that. */ @@ -159,6 +161,13 @@ function red_zrl_callback($matches) { if($r) $zrl = true; } + + $t = strip_zids($matches[2]); + if($t !== $matches[2]) { + $zrl = true; + $matches[2] = $t; + } + if($matches[1] === '#^') $matches[1] = ''; if($zrl) diff --git a/include/text.php b/include/text.php index 2b334068f..2f5accf6e 100755 --- a/include/text.php +++ b/include/text.php @@ -621,6 +621,11 @@ function get_tags($s) { } +function strip_zids($s) { + return preg_replace('/[\?&]zid=(.*?)(&|$)/ism','$2',$s); +} + + // quick and dirty quoted_printable encoding -- cgit v1.2.3 From 16cd9e2a7e111b4c1ea8babb69862cb82775fa09 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 16 Feb 2014 14:48:07 -0800 Subject: don't include deleted channels in number of channels service class checks --- include/identity.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/identity.php b/include/identity.php index 627e808ea..d0fffaede 100644 --- a/include/identity.php +++ b/include/identity.php @@ -22,8 +22,9 @@ require_once('include/crypto.php'); function identity_check_service_class($account_id) { $ret = array('success' => false, $message => ''); - $r = q("select count(channel_id) as total from channel where channel_account_id = %d ", - intval($account_id) + $r = q("select count(channel_id) as total from channel where channel_account_id = %d and not ( channel_pageflags & %d ) ", + intval($account_id), + intval(PAGE_REMOVED) ); if(! ($r && count($r))) { $ret['message'] = t('Unable to obtain identity information from database'); @@ -101,7 +102,7 @@ function get_sys_channel() { /** * @channel_total() - * Return the total number of channels on this site. No filtering is performed. + * Return the total number of channels on this site. No filtering is performed except to check PAGE_REMOVED * * @returns int * on error returns boolean false @@ -109,7 +110,10 @@ function get_sys_channel() { */ function channel_total() { - $r = q("select channel_id from channel where true"); + $r = q("select channel_id from channel where not ( channel_pageflags & %d )", + intval(PAGE_REMOVED) + ); + if(is_array($r)) return count($r); return false; -- cgit v1.2.3 From 70526915c87b57e4d91f0ab9a518d34a6dc04c82 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 16 Feb 2014 16:04:46 -0800 Subject: several things were not working correctly w/r/t community tagging. The preference vanished from settings at some point, and we also weren't updating the original post timestamp so that the changed taxonomy would propagate correctly as an edit. --- include/items.php | 7 +++++++ include/zot.php | 12 +++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/items.php b/include/items.php index 9bcdd7d0b..bf575860a 100755 --- a/include/items.php +++ b/include/items.php @@ -2263,6 +2263,13 @@ function tag_deliver($uid,$item_id) { if(is_array($j_obj['link'])) $taglink = get_rel_link($j_obj['link'],'alternate'); store_item_tag($u[0]['channel_id'],$p[0]['id'],TERM_OBJ_POST,TERM_HASHTAG,$j_obj['title'],$j_obj['id']); + $x = q("update item set edited = '%s', received = '%s', changed = '%s' where mid = '%s' and uid = %d limit 1", + dbesc(datetime_convert()), + dbesc(datetime_convert()), + dbesc(datetime_convert()), + dbesc($j_tgt['id']), + intval($u[0]['channel_id']) + ); proc_run('php','include/notifier.php','edit_post',$p[0]['id']); } } diff --git a/include/zot.php b/include/zot.php index 21eef073c..c9d426cc2 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1064,7 +1064,9 @@ function zot_import($arr, $sender_url) { } stringify_array_elms($recip_arr); $recips = implode(',',$recip_arr); - $r = q("select channel_hash as hash from channel where channel_hash in ( " . $recips . " ) "); + $r = q("select channel_hash as hash from channel where channel_hash in ( " . $recips . " ) and not ( channel_pageflags & %d ) ", + intval(PAGE_REMOVED) + ); if(! $r) { logger('recips: no recipients on this site'); continue; @@ -1222,8 +1224,7 @@ function public_recips($msg) { if(! $r) $r = array(); - $x = q("select channel_hash as hash from channel left join abook on abook_channel = channel_id where abook_xchan = '%s' - and (( " . $col . " & " . PERMS_SPECIFIC . " ) and ( abook_my_perms & " . $field . " )) OR ( " . $col . " & " . PERMS_CONTACTS . " ) ", + $x = q("select channel_hash as hash from channel left join abook on abook_channel = channel_id where abook_xchan = '%s' and not ( channel_pageflags & " . PAGE_REMOVED . " ) and (( " . $col . " & " . PERMS_SPECIFIC . " ) and ( abook_my_perms & " . $field . " )) OR ( " . $col . " & " . PERMS_CONTACTS . " ) ", dbesc($msg['notify']['sender']['hash']) ); @@ -1304,8 +1305,9 @@ function allowed_public_recips($msg) { $condensed_recips[] = $rr['hash']; $results = array(); - $r = q("select channel_hash as hash from channel left join abook on abook_channel = channel_id where abook_xchan = '%s' ", - dbesc($hash) + $r = q("select channel_hash as hash from channel left join abook on abook_channel = channel_id where abook_xchan = '%s' and not ( channel_pageflags & %d ) ", + dbesc($hash), + intval(PAGE_REMOVED) ); if($r) { foreach($r as $rr) -- cgit v1.2.3