aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-09-15 03:48:43 -0700
committerfriendica <info@friendica.com>2013-09-15 03:48:43 -0700
commit129a119c84d87bffe099cea7ac5b0ed511c26f80 (patch)
tree831b0d681e2748aded17bc59ee4580a72ecd5cd5 /mod
parentaefb0f823353d15a281d3c94ec6fc044e1b62580 (diff)
downloadvolse-hubzilla-129a119c84d87bffe099cea7ac5b0ed511c26f80.tar.gz
volse-hubzilla-129a119c84d87bffe099cea7ac5b0ed511c26f80.tar.bz2
volse-hubzilla-129a119c84d87bffe099cea7ac5b0ed511c26f80.zip
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.
Diffstat (limited to 'mod')
-rw-r--r--mod/dirsearch.php19
1 files changed, 15 insertions, 4 deletions
diff --git a/mod/dirsearch.php b/mod/dirsearch.php
index 6034fdc12..04d77a298 100644
--- a/mod/dirsearch.php
+++ b/mod/dirsearch.php
@@ -41,6 +41,7 @@ function dirsearch_content(&$a) {
$agege = ((x($_REQUEST,'agege')) ? intval($_REQUEST['agege']) : 0 );
$agele = ((x($_REQUEST,'agele')) ? intval($_REQUEST['agele']) : 0 );
+ $sync = ((x($_REQUEST,'sync')) ? datetime_convert('UTC','UTC',$_REQUEST['sync']) : '');
$sort_order = ((x($_REQUEST,'order')) ? $_REQUEST['order'] : '');
// TODO - a meta search which joins all of these things to one search string
@@ -82,6 +83,7 @@ function dirsearch_content(&$a) {
$limit = (($_REQUEST['limit']) ? intval($_REQUEST['limit']) : 0);
$return_total = ((x($_REQUEST,'return_total')) ? intval($_REQUEST['return_total']) : 0);
+ // mtime is not currently working
$mtime = ((x($_REQUEST,'mtime')) ? datetime_convert('UTC','UTC',$_REQUEST['mtime']) : '');
@@ -124,11 +126,19 @@ function dirsearch_content(&$a) {
$order = " order by xchan_name asc ";
+ if($sync) {
- $r = q("SELECT xchan.*, xprof.* from xchan left join xprof on xchan_hash = xprof_hash where $logic $sql_extra and not ( xchan_flags & %d ) and not ( xchan_flags & %d ) $order $qlimit ",
- intval(XCHAN_FLAGS_HIDDEN),
- intval(XCHAN_FLAGS_ORPHAN)
- );
+ $r = q("select xchan.*, updates.* from xchan left join updates on ud_hash = xchan_hash where ud_date >= '%s' and ud_guid != '' order by ud_date desc",
+ dbesc($sync)
+ );
+
+ }
+ else {
+ $r = q("SELECT xchan.*, xprof.* from xchan left join xprof on xchan_hash = xprof_hash where $logic $sql_extra and not ( xchan_flags & %d ) and not ( xchan_flags & %d ) $order $qlimit ",
+ intval(XCHAN_FLAGS_HIDDEN),
+ intval(XCHAN_FLAGS_ORPHAN)
+ );
+ }
$ret['page'] = $page + 1;
$ret['records'] = count($r);
@@ -145,6 +155,7 @@ function dirsearch_content(&$a) {
$entry['hash'] = $rr['xchan_hash'];
$entry['updated'] = (($rr['ud_date']) ? $rr['ud_date'] : '0000-00-00 00:00:00');
+ $entry['update_guid'] = (($rr['ud_guid']) ? $rr['ud_guid'] : '');
$entry['url'] = $rr['xchan_url'];
$entry['photo'] = $rr['xchan_photo_m'];
$entry['address'] = $rr['xchan_addr'];