diff options
author | Tobias Diekershoff <tobias.diekershoff@gmx.net> | 2011-06-03 16:16:27 +0200 |
---|---|---|
committer | Tobias Diekershoff <tobias.diekershoff@gmx.net> | 2011-06-03 16:16:27 +0200 |
commit | ebb8186191d46f6b264d09f886d5574761194685 (patch) | |
tree | e810c602bf72c387a2171a3cd03078bdda3d86d1 /include | |
parent | 9b93bd25218dc0b4a5e477c3a64d6f74a51a9d21 (diff) | |
parent | e591ed6b30808cabf1f0c80a356f3fa12ce4aa31 (diff) | |
download | volse-hubzilla-ebb8186191d46f6b264d09f886d5574761194685.tar.gz volse-hubzilla-ebb8186191d46f6b264d09f886d5574761194685.tar.bz2 volse-hubzilla-ebb8186191d46f6b264d09f886d5574761194685.zip |
Merge branch 'master' of git://github.com/friendika/friendika
Diffstat (limited to 'include')
-rw-r--r-- | include/auth.php | 13 | ||||
-rw-r--r-- | include/queue.php | 22 | ||||
-rw-r--r-- | include/queue_fn.php | 16 |
3 files changed, 35 insertions, 16 deletions
diff --git a/include/auth.php b/include/auth.php index fd80a63e2..d1eb9d131 100644 --- a/include/auth.php +++ b/include/auth.php @@ -63,6 +63,12 @@ if((isset($_SESSION)) && (x($_SESSION,'authenticated')) && ((! (x($_POST,'auth-p $_SESSION['theme'] = $a->user['theme']; $_SESSION['page_flags'] = $a->user['page-flags']; + $member_since = strtotime($a->user['register_date']); + if(time() < ($member_since + ( 60 * 60 * 24 * 14))) + $_SESSION['new_member'] = true; + else + $_SESSION['new_member'] = false; + if(strlen($a->user['timezone'])) { date_default_timezone_set($a->user['timezone']); $a->timezone = $a->user['timezone']; @@ -211,6 +217,13 @@ else { else info( t("Welcome back ") . $a->user['username'] . EOL); + + $member_since = strtotime($a->user['register_date']); + if(time() < ($member_since + ( 60 * 60 * 24 * 14))) + $_SESSION['new_member'] = true; + else + $_SESSION['new_member'] = false; + if(strlen($a->user['timezone'])) { date_default_timezone_set($a->user['timezone']); $a->timezone = $a->user['timezone']; diff --git a/include/queue.php b/include/queue.php index ff280cb53..cc36b2f62 100644 --- a/include/queue.php +++ b/include/queue.php @@ -1,20 +1,6 @@ <?php require_once("boot.php"); - -function update_queue_time($id) { - logger('queue: requeue item ' . $id); - q("UPDATE `queue` SET `last` = '%s' WHERE `id` = %d LIMIT 1", - dbesc(datetime_convert()), - intval($id) - ); -} - -function remove_queue_item($id) { - logger('queue: remove queue item ' . $id); - q("DELETE FROM `queue` WHERE `id` = %d LIMIT 1", - intval($id) - ); -} +require_once('include/queue_fn.php'); function queue_run($argv, $argc){ global $a, $db; @@ -58,6 +44,10 @@ function queue_run($argv, $argc){ if(! count($r)){ return; } + + call_hooks('queue_predeliver', $a, $r); + + // delivery loop require_once('include/salmon.php'); @@ -69,6 +59,7 @@ function queue_run($argv, $argc){ if(! count($qi)) continue; + $c = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1", intval($qi[0]['cid']) ); @@ -121,7 +112,6 @@ function queue_run($argv, $argc){ } break; default: - $a = get_app(); $params = array('owner' => $owner, 'contact' => $contact, 'queue' => $q_item, 'result' => false); call_hooks('queue_deliver', $a, $params); diff --git a/include/queue_fn.php b/include/queue_fn.php new file mode 100644 index 000000000..bc47ceffd --- /dev/null +++ b/include/queue_fn.php @@ -0,0 +1,16 @@ +<?php + +function update_queue_time($id) { + logger('queue: requeue item ' . $id); + q("UPDATE `queue` SET `last` = '%s' WHERE `id` = %d LIMIT 1", + dbesc(datetime_convert()), + intval($id) + ); +} + +function remove_queue_item($id) { + logger('queue: remove queue item ' . $id); + q("DELETE FROM `queue` WHERE `id` = %d LIMIT 1", + intval($id) + ); +} |