From 69dc1b03c3ce8ee7199f337e50402d98679cb6bf Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 31 Aug 2015 21:01:47 -0700 Subject: typo in sql --- include/identity.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/identity.php') diff --git a/include/identity.php b/include/identity.php index c892a4b55..2535e1e1d 100644 --- a/include/identity.php +++ b/include/identity.php @@ -565,7 +565,7 @@ function identity_basic_export($channel_id, $items = false) { if(! $items) return $ret; - $r = q("select * likes where channel_id = %d", + $r = q("select * from likes where channel_id = %d", intval($channel_id) ); -- cgit v1.2.3 From 3c29b46c4266a62bbd0c61f8663911434fbb7989 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 1 Sep 2015 20:57:53 -0700 Subject: use different obj export output format for hubzilla compatibility --- include/identity.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'include/identity.php') diff --git a/include/identity.php b/include/identity.php index 2535e1e1d..561a69cd5 100644 --- a/include/identity.php +++ b/include/identity.php @@ -555,7 +555,14 @@ function identity_basic_export($channel_id, $items = false) { if($r) $ret['term'] = $r; - $r = q("select * from obj where obj_channel = %d", + + // make the obj output match the hubzilla file format + + $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 from obj left join term on obj_obj = term.term_hash where obj_channel = %d", + dbesc($datestamp), + dbesc($datestamp), intval($channel_id) ); -- cgit v1.2.3 From f72a3113f5a42808e41b8eef19cc7ea6c6b199b8 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 1 Sep 2015 21:03:55 -0700 Subject: add the baseurl so we can easily relocate objects --- include/identity.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/identity.php') diff --git a/include/identity.php b/include/identity.php index 561a69cd5..d9a0d1818 100644 --- a/include/identity.php +++ b/include/identity.php @@ -560,9 +560,10 @@ function identity_basic_export($channel_id, $items = false) { $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 from obj left join term on obj_obj = term.term_hash where obj_channel = %d", + $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", dbesc($datestamp), dbesc($datestamp), + dbesc(z_root()), intval($channel_id) ); -- cgit v1.2.3 From c5578d79643bbdde8f49baae2fa6890fc9bf9a53 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 1 Sep 2015 21:08:02 -0700 Subject: match the redmatrix output format for objects (which is the hubzilla table format) --- include/identity.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'include/identity.php') diff --git a/include/identity.php b/include/identity.php index 6cfa38f19..1bea5d790 100644 --- a/include/identity.php +++ b/include/identity.php @@ -556,13 +556,9 @@ function identity_basic_export($channel_id, $items = false) { $ret['term'] = $r; - // make the obj output match the hubzilla file format + // add psuedo-column obj_baseurl to aid in relocations - $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", - dbesc($datestamp), - dbesc($datestamp), + $r = q("select obj.*, '%s' as obj_baseurl from obj where obj_channel = %d", dbesc(z_root()), intval($channel_id) ); -- cgit v1.2.3 From 184c544a24144baecf986f3b5627c55e520d0b4a Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 1 Sep 2015 22:26:21 -0700 Subject: export apps --- include/identity.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/identity.php') diff --git a/include/identity.php b/include/identity.php index d9a0d1818..e236b5a90 100644 --- a/include/identity.php +++ b/include/identity.php @@ -570,6 +570,13 @@ function identity_basic_export($channel_id, $items = false) { if($r) $ret['obj'] = $r; + + $r = q("select * from app where app_channel = %d", + intval($channel_id) + ); + if($r) + $ret['app'] = $r; + if(! $items) return $ret; -- cgit v1.2.3