sync "things" (obj elements)

This commit is contained in:
redmatrix 2015-09-02 20:07:15 -07:00
parent d9a67d64b1
commit 470915a55b

View File

@ -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']));