From 79603e31463eb143392c5d27a5b2c87687b2460c Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Thu, 17 Nov 2011 15:53:59 +0100 Subject: expire settings for items, notes and photos. show default privacy acl in popup --- include/items.php | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/items.php b/include/items.php index ecf19a86e..8c9a714cd 100644 --- a/include/items.php +++ b/include/items.php @@ -2723,15 +2723,33 @@ function item_expire($uid,$days) { if(! count($r)) return; + + $expire_items = get_pconfig($uid, 'expire','items'); + $expire_items = (($expire_items===false)?1:intval($expire_items)); // default if not set: 1 + + $expire_notes = get_pconfig($uid, 'expire','notes'); + $expire_notes = (($expire_notes===false)?1:intval($expire_notes)); // default if not set: 1 + + $expire_photos = get_pconfig($uid, 'expire','photos'); + $expire_photos = (($expire_photos===false)?0:intval($expire_photos)); // default if not set: 0 logger('expire: # items=' . count($r) ); + logger("expire: items: $expire_items, notes: $expire_notes, photos: $expire_photos"); foreach($r as $item) { // Only expire posts, not photos and photo comments - if(strlen($item['resource-id'])) + logger('expire: item '.$item['type'].' id '.intval($item['id']).' "'.$item['body'].'" '.$item['resource-id']); + + if($expire_photos==0 && strlen($item['resource-id'])) + continue; + if($expire_notes==0 && $item['type']=='note') continue; + if($expire_items==0 && $item['type']!='note') + continue; + + logger('expire'); $r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s' WHERE `id` = %d LIMIT 1", dbesc(datetime_convert()), @@ -2751,7 +2769,7 @@ function item_expire($uid,$days) { } proc_run('php',"include/notifier.php","expire","$uid"); - + } -- cgit v1.2.3 From 590f1d2b25c00fc7bea85cb5de1a4f667ea86af1 Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Thu, 17 Nov 2011 16:18:59 +0100 Subject: log less in expire items --- include/items.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'include') diff --git a/include/items.php b/include/items.php index 8c9a714cd..a008e4ac8 100644 --- a/include/items.php +++ b/include/items.php @@ -2733,15 +2733,12 @@ function item_expire($uid,$days) { $expire_photos = get_pconfig($uid, 'expire','photos'); $expire_photos = (($expire_photos===false)?0:intval($expire_photos)); // default if not set: 0 - logger('expire: # items=' . count($r) ); - logger("expire: items: $expire_items, notes: $expire_notes, photos: $expire_photos"); + logger('expire: # items=' . count($r). "; expire items: $expire_items, expire notes: $expire_notes, expire photos: $expire_photos"); foreach($r as $item) { // Only expire posts, not photos and photo comments - logger('expire: item '.$item['type'].' id '.intval($item['id']).' "'.$item['body'].'" '.$item['resource-id']); - if($expire_photos==0 && strlen($item['resource-id'])) continue; if($expire_notes==0 && $item['type']=='note') @@ -2749,8 +2746,6 @@ function item_expire($uid,$days) { if($expire_items==0 && $item['type']!='note') continue; - logger('expire'); - $r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s' WHERE `id` = %d LIMIT 1", dbesc(datetime_convert()), dbesc(datetime_convert()), -- cgit v1.2.3 From a86fd26bd86945fe75b7220e149b8986f88feb01 Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Mon, 21 Nov 2011 12:34:22 +0100 Subject: more work on quattro. remove html from php for groups and saved searches widgets. --- include/group.php | 66 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 38 insertions(+), 28 deletions(-) (limited to 'include') diff --git a/include/group.php b/include/group.php index 084cddcac..cae76eb6d 100644 --- a/include/group.php +++ b/include/group.php @@ -162,23 +162,20 @@ function group_side($every="contacts",$each="group",$edit = false, $group_id = 0 if(! local_user()) return ''; - $createtext = t('Create a new group'); - $linktext= t('Everybody'); - $selected = (($group_id == 0) ? ' group-selected' : ''); -$o .= <<< EOT - -
-

Groups

+ $groups = array(); + + $groups[] = array( + 'text' => t('Everybody'), + 'selected' => (($group_id == 0) ? 'group-selected' : ''), + 'href' => $every, + ); -"; - - $o .= <<< EOT - - -
-EOT; - + + $tpl = get_markup_template("group_side.tpl"); + $o = replace_macros($tpl, array( + '$title' => t('Groups'), + '$createtext' => t('Create a new group'), + '$groups' => $groups, + '$add' => t('add'), + )); + + return $o; } @@ -246,4 +256,4 @@ function groups_containing($uid,$c) { } return $ret; -} \ No newline at end of file +} -- cgit v1.2.3