diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-09-02 20:07:15 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-09-02 20:07:15 -0700 |
commit | 470915a55b9125d4dd361dcba3c5dbe013f3d4e0 (patch) | |
tree | 250a514cd73b0572f85be3f874bdf26c05f61428 /mod/thing.php | |
parent | d9a67d64b1275257e51c0754d2f76ce7883affcc (diff) | |
download | volse-hubzilla-470915a55b9125d4dd361dcba3c5dbe013f3d4e0.tar.gz volse-hubzilla-470915a55b9125d4dd361dcba3c5dbe013f3d4e0.tar.bz2 volse-hubzilla-470915a55b9125d4dd361dcba3c5dbe013f3d4e0.zip |
sync "things" (obj elements)
Diffstat (limited to 'mod/thing.php')
-rw-r--r-- | mod/thing.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/mod/thing.php b/mod/thing.php index c6b70fbb4..842832d16 100644 --- a/mod/thing.php +++ b/mod/thing.php @@ -92,6 +92,20 @@ function thing_init(&$a) { ); info( t('Thing updated') . EOL); + + $datestamp = datetime_convert(); + + $r = q("select obj.*, term.term as obj_term, term.url as obj_url, term.imgurl as obj_imgurl, '%s' as obj_created, '%s' as obj_edited, '%s' as obj_baseurl from obj left join term on obj_obj = term.term_hash where obj_channel = %d and term.term_hash = '%s'", + dbesc($datestamp), + dbesc($datestamp), + dbesc(z_root()), + intval(local_channel()), + dbesc($term_hash) + ); + + if($r) + build_sync_packet(0,array('obj' => $r)); + return; } @@ -156,6 +170,20 @@ function thing_init(&$a) { info( t('Thing added')); + $datestamp = datetime_convert(); + + $r = q("select obj.*, term.term as obj_term, term.url as obj_url, term.imgurl as obj_imgurl, '%s' as obj_created, '%s' as obj_edited, '%s' as obj_baseurl from obj left join term on obj_obj = term.term_hash where obj_channel = %d and term.term_hash = '%s' ", + dbesc($datestamp), + dbesc($datestamp), + dbesc(z_root()), + intval(local_channel()), + dbesc($term['term_hash']) + ); + + if($r) + build_sync_packet(0,array('obj' => $r)); + + if($activity) { $arr = array(); $links = array(array('rel' => 'alternate','type' => 'text/html', 'href' => $term['url'])); |