From 964e461e092b15a66da891a0a4c155323e8391e1 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 15 Jul 2015 21:01:18 -0700 Subject: allow plugins to provide module handlers for arbitrary modules that haven't been installed on the system. --- include/widgets.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/widgets.php b/include/widgets.php index 888e56733..032b1c67e 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -381,6 +381,7 @@ function widget_categories($arr) { $srchurl = str_replace(array('?f=','&f='),array('',''),$srchurl); return categories_widget($srchurl, $cat); + } function widget_tagcloud_wall($arr) { @@ -409,6 +410,7 @@ function widget_catcloud_wall($arr) { $limit = ((array_key_exists('limit',$arr)) ? intval($arr['limit']) : 50); return catblock($a->profile['profile_uid'], $limit, $a->profile['channel_hash'], ITEM_WALL); + } -- cgit v1.2.3 From 39a09eb525df95a38c14bf3e6f9b8c74bda68314 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 16 Jul 2015 22:04:52 +0200 Subject: fix missing div and a regression introduced in ec23a94b6d7f6db1e1d34275b8143cbc947db802 which broke tag removal for photos --- include/items.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/items.php b/include/items.php index 73ed64116..054008d58 100755 --- a/include/items.php +++ b/include/items.php @@ -2657,11 +2657,12 @@ function item_store_update($arr,$allow_exec = false) { return $ret; } + $r = q("delete from term where oid = %d and otype = %d", + intval($orig_post_id), + intval(TERM_OBJ_POST) + ); + if(is_array($terms)) { - $r = q("delete from term where oid = %d and otype = %d", - intval($orig_post_id), - intval(TERM_OBJ_POST) - ); foreach($terms as $t) { q("insert into term (uid,oid,otype,type,term,url) values(%d,%d,%d,%d,'%s','%s') ", @@ -2673,7 +2674,6 @@ function item_store_update($arr,$allow_exec = false) { dbesc($t['url']) ); } - $arr['term'] = $terms; } -- cgit v1.2.3 From ec249d465b60407b2e7c64e7a99be8ccf4b95e64 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 16 Jul 2015 20:19:20 -0700 Subject: provide a way to export a single year of items (to potentially keep from exhausting resources either on export or import) --- include/identity.php | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/identity.php b/include/identity.php index 29d9ef022..3925c3537 100644 --- a/include/identity.php +++ b/include/identity.php @@ -583,7 +583,7 @@ function identity_basic_export($channel_id, $items = false) { /** @warning this may run into memory limits on smaller systems */ - $r = q("select * from item where (item_flags & %d)>0 and not (item_restrict & %d)>0 and uid = %d", + $r = q("select * from item where (item_flags & %d)>0 and not (item_restrict & %d)>0 and uid = %d order by created", intval(ITEM_WALL), intval(ITEM_DELETED), intval($channel_id) @@ -600,6 +600,35 @@ function identity_basic_export($channel_id, $items = false) { } + +function identity_export_year($channel_id,$year) { + + if(! $year) + return array(); + + $ret = array(); + $mindate = datetime_convert('UTC','UTC',$year . '-01-01 00:00:00'); + $maxdate = datetime_convert('UTC','UTC',$year+1 . '-01-01 00:00:00'); + $r = q("select * from item where (item_flags & %d) > 0 and (item_restrict & %d) = 0 and uid = %d and created >= '%s' and created < '%s' order by created ", + intval(ITEM_WALL), + intval(ITEM_DELETED), + intval($channel_id), + dbesc($mindate), + dbesc($maxdate) + ); + + if($r) { + $ret['item'] = array(); + xchan_query($r); + $r = fetch_post_tags($r,true); + foreach($r as $rr) + $ret['item'][] = encode_item($rr,true); + } + + return $ret; +} + + /** * @brief Loads a profile into the App structure. * -- cgit v1.2.3