diff options
-rw-r--r-- | include/Contact.php | 4 | ||||
-rwxr-xr-x | include/items.php | 5 | ||||
-rw-r--r-- | include/poller.php | 29 | ||||
-rw-r--r-- | mod/import.php | 8 | ||||
-rwxr-xr-x | view/tpl/channel_import.tpl | 2 |
5 files changed, 25 insertions, 23 deletions
diff --git a/include/Contact.php b/include/Contact.php index 992ed27e2..bf536ccd5 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -295,8 +295,8 @@ function contact_remove($channel_id, $abook_id) { $archive = get_pconfig($channel_id, 'system','archive_removed_contacts'); if($archive) { - q("update abook set abook_flags = abook_flags | %d where abook_id = %d and abook_channel = %d limit 1", - intval(ABOOK_FLAG_ARCHIVE), + q("update abook set abook_flags = ( abook_flags | %d ) where abook_id = %d and abook_channel = %d limit 1", + intval(ABOOK_FLAG_ARCHIVED), intval($abook_id), intval($channel_id) ); diff --git a/include/items.php b/include/items.php index 6d853323f..df49ba5c7 100755 --- a/include/items.php +++ b/include/items.php @@ -31,10 +31,11 @@ function collect_recipients($item,&$private) { } else { $recipients = array(); - $r = q("select * from abook where abook_channel = %d and not (abook_flags & %d) and not (abook_flags & %d)", + $r = q("select * from abook where abook_channel = %d and not (abook_flags & %d) and not (abook_flags & %d) and not (abook_flags & %d)", intval($item['uid']), intval(ABOOK_FLAG_SELF), - intval(ABOOK_FLAG_PENDING) + intval(ABOOK_FLAG_PENDING), + intval(ABOOK_FLAG_ARCHIVED) ); if($r) { foreach($r as $rr) { diff --git a/include/poller.php b/include/poller.php index 7f76750b4..7a6aaeb22 100644 --- a/include/poller.php +++ b/include/poller.php @@ -118,18 +118,18 @@ function poller_run($argv, $argc){ $force = false; $restart = false; - if((argc() > 1) && (argv(1) == 'force')) + if(($argc > 1) && ($argv[1] == 'force')) $force = true; - if((argc() > 1) && (argv(1) == 'restart')) { + if(($argc > 1) && ($argv[1] == 'restart')) { $restart = true; - $generation = intval(argv(2)); + $generation = intval($argv[2]); if(! $generation) killme(); } - if((argc() > 1) && intval(argv(1))) { - $manual_id = intval(argv(1)); + if(($argc > 1) && intval($argv[1])) { + $manual_id = intval($argv[1]); $force = true; } @@ -157,7 +157,8 @@ function poller_run($argv, $argc){ : '' ); - $contacts = q("SELECT abook_id, abook_updated, abook_closeness, abook_channel + + $contacts = q("SELECT abook_id, abook_updated, abook_connected, abook_closeness, abook_channel FROM abook LEFT JOIN account on abook_account = account_id where 1 $sql_extra AND (( abook_flags = %d ) OR ( abook_flags = %d )) @@ -189,10 +190,10 @@ function poller_run($argv, $argc){ else { // if we've never connected with them, start the mark for death countdown from now - if($c === '0000-00-00 00:00:00') { + if($c == '0000-00-00 00:00:00') { $r = q("update abook set abook_connected = '%s' where abook_id = %d limit 1", dbesc(datetime_convert()), - intval($abook['abook_id']) + intval($contact['abook_id']) ); $c = datetime_convert(); $update = true; @@ -200,8 +201,8 @@ function poller_run($argv, $argc){ // He's dead, Jim - if(datetime_convert('UTC','UTC', 'now') > datetime_convert('UTC','UTC', $c . " + 30 day")) { - $r = q("update abook set abook_flags = (abook_flags & %d) where abook_id = %d limit 1", + if(strcmp(datetime_convert('UTC','UTC', 'now'),datetime_convert('UTC','UTC', $c . " + 30 day")) > 0) { + $r = q("update abook set abook_flags = (abook_flags | %d) where abook_id = %d limit 1", intval(ABOOK_FLAG_ARCHIVED), intval($contact['abook_id']) ); @@ -213,17 +214,17 @@ function poller_run($argv, $argc){ // recently deceased, so keep up the regular schedule for 3 days - if((datetime_convert('UTC','UTC', 'now') > datetime_convert('UTC','UTC', $c . " + 3 day")) - && (datetime_convert('UTC','UTC', 'now') > datetime_convert('UTC','UTC', $t . " + 1 day"))) + if((strcmp(datetime_convert('UTC','UTC', 'now'),datetime_convert('UTC','UTC', $c . " + 3 day")) > 0) + && (strcmp(datetime_convert('UTC','UTC', 'now'),datetime_convert('UTC','UTC', $t . " + 1 day")) > 0)) $update = true; // After that back off and put them on a morphine drip - if(datetime_convert('UTC','UTC', 'now') > datetime_convert('UTC','UTC', $t . " + 2 day")) { + if(strcmp(datetime_convert('UTC','UTC', 'now'),datetime_convert('UTC','UTC', $t . " + 2 day")) > 0) { $update = true; } } - +dbg(0); if((! $update) && (! $force)) continue; diff --git a/mod/import.php b/mod/import.php index 4c878f5c6..c98f4d2eb 100644 --- a/mod/import.php +++ b/mod/import.php @@ -16,10 +16,10 @@ function import_post(&$a) { $data = null; $seize = ((x($_REQUEST,'make_primary')) ? intval($_REQUEST['make_primary']) : 0); - $src = $_FILES['userfile']['tmp_name']; - $filename = basename($_FILES['userfile']['name']); - $filesize = intval($_FILES['userfile']['size']); - $filetype = $_FILES['userfile']['type']; + $src = $_FILES['filename']['tmp_name']; + $filename = basename($_FILES['filename']['name']); + $filesize = intval($_FILES['filename']['size']); + $filetype = $_FILES['filename']['type']; if($src) { diff --git a/view/tpl/channel_import.tpl b/view/tpl/channel_import.tpl index 4804e34d6..f7635ea52 100755 --- a/view/tpl/channel_import.tpl +++ b/view/tpl/channel_import.tpl @@ -1,6 +1,6 @@ <h2>{{$title}}</h2> -<form action="import" method="post" id="import-channel-form"> +<form action="import" method="post" enctype="multipart/form-data" id="import-channel-form"> <div id="import-desc" class="descriptive-paragraph">{{$desc}}</div> |