From 0e0e0d018b5cd14ed8d1578c15b3fc57ba4bfa12 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 13 Oct 2013 19:29:54 -0700 Subject: provide config for preferred directory server --- include/dir_fns.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/dir_fns.php') diff --git a/include/dir_fns.php b/include/dir_fns.php index 585121434..5521f2738 100644 --- a/include/dir_fns.php +++ b/include/dir_fns.php @@ -3,6 +3,9 @@ require_once('include/permissions.php'); function find_upstream_directory($dirmode) { + $preferred = get_config('system','directory_server'); + if($preferred) + return array('url' => $preferred); return ''; } -- cgit v1.2.3 From bae7f4e07868563637594edb81933fc5f3ed49cf Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 13 Oct 2013 19:49:40 -0700 Subject: directory sort links on sidebar --- include/dir_fns.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/dir_fns.php') diff --git a/include/dir_fns.php b/include/dir_fns.php index 5521f2738..ba3aa1877 100644 --- a/include/dir_fns.php +++ b/include/dir_fns.php @@ -9,6 +9,17 @@ function find_upstream_directory($dirmode) { return ''; } +function dir_sort_links() { + + $o = replace_macros(get_markup_template('dir_sort_links.tpl'), array( + '$header' => t('Sort Options'), + '$normal' => t('Alphabetic'), + '$reverse' => t('Reverse Alphabetic'), + '$date' => t('Newest to Oldest') + )); + return $o; +} + function sync_directories($dirmode) { -- cgit v1.2.3 From 96ba0dccf993490f7019b94950bad23a354d3127 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 14 Oct 2013 20:51:26 -0700 Subject: sql typo in directory sync --- include/dir_fns.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/dir_fns.php') diff --git a/include/dir_fns.php b/include/dir_fns.php index ba3aa1877..e3cd8ae77 100644 --- a/include/dir_fns.php +++ b/include/dir_fns.php @@ -85,7 +85,7 @@ function sync_directories($dirmode) { if(is_array($t['flags']) && in_array('deleted',$t['flags'])) $ud_flags |= UPDATE_FLAGS_DELETED; $z = q("insert into updates ( ud_hash, ud_guid, ud_date, ud_flags, ud_addr ) - values ( '%s', '%s', '%s', '%d, '%s' ) ", + values ( '%s', '%s', '%s', %d, '%s' ) ", dbesc($t['hash']), dbesc($t['transaction_id']), dbesc($t['timestamp']), -- cgit v1.2.3 From 83daf51460db24356b0690aff2cfb5e639f98576 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 14 Oct 2013 21:56:56 -0700 Subject: extra logging --- include/dir_fns.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/dir_fns.php') diff --git a/include/dir_fns.php b/include/dir_fns.php index e3cd8ae77..adbcb6e3c 100644 --- a/include/dir_fns.php +++ b/include/dir_fns.php @@ -103,12 +103,15 @@ function update_directory_entry($ud) { logger('update_directory_entry: ' . print_r($ud,true), LOGGER_DATA); if($ud['ud_addr'] && (! ($ud['ud_flags'] & UPDATE_FLAGS_DELETED))) { + $success = false; $x = zot_finger($ud['ud_addr'],''); if($x['success']) { $j = json_decode($x['body'],true); + if($j) + $success = true; $y = import_xchan($j,0); } - else { + if(! $success) { $r = q("update updates set ud_last = '%s' where ud_addr = '%s'", dbesc(datetime_convert()), dbesc($ud['ud_addr']) -- cgit v1.2.3