From 580acc5445571a0405363807b8cf172262b365b4 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 13 Mar 2013 17:27:17 -0700 Subject: update modification time whenever a directory related attribute is changed --- include/zot.php | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/include/zot.php b/include/zot.php index abaa5c9ab..909c4a2e8 100644 --- a/include/zot.php +++ b/include/zot.php @@ -469,6 +469,7 @@ function import_xchan($arr) { dbesc($arr['url']), dbesc($xchan_hash) ); + update_modtime($xchan_hash); } } else { @@ -490,6 +491,7 @@ function import_xchan($arr) { dbesc($arr['photo_updated']), dbesc($arr['name_updated']) ); + update_modtime($xchan_hash); } @@ -544,6 +546,7 @@ function import_xchan($arr) { intval($r[0]['hubloc_id']) ); } + update_modtime($xchan_hash); continue; } @@ -570,7 +573,7 @@ function import_xchan($arr) { dbesc($location['callback']), dbesc($location['sitekey']) ); - + update_modtime($xchan_hash); } // get rid of any hubs we have for this channel which weren't reported. @@ -581,6 +584,7 @@ function import_xchan($arr) { $r = q("delete from hubloc where hubloc_id = %d limit 1", intval($x['hubloc_id']) ); + update_modtime($xchan_hash); } } } @@ -1152,6 +1156,7 @@ function import_directory_profile($hash,$profile) { ); } + update_modtime($arr['xprof_hash']); return; } @@ -1187,4 +1192,21 @@ function import_directory_keywords($hash,$keywords) { dbesc($x) ); } -} \ No newline at end of file +} + + +function update_modtime($hash) { + $r = q("select * from updates where ud_hash = '%s' limit 1", + dbesc($hash) + ); + if($r) + q("update updates set ud_date = '%s' where ud_hash = '%s' limit 1", + dbesc(datetime_convert()), + dbesc($hash) + ); + else + q("insert into updates (ud_hash, ud_date) values ( '%s', '%s' )", + dbesc($hash), + dbesc(datetime_convert()) + ); +} -- cgit v1.2.3