aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaZderMind2016-12-11 21:17:30 +0100
committerMaZderMind2016-12-11 21:17:30 +0100
commit6e0f7423769174b83d6b5618db7c33d54967099a (patch)
tree2e6dd38c4c1c3c718a2a0541deaf1dbbe1c42925
parent4c9cc1f8e6bcb8c68e5106437fcb41bbbc380885 (diff)
download files of forced-open conferences
Diffstat (limited to '')
-rw-r--r--command/download.php13
-rw-r--r--model/Conference.php6
2 files changed, 17 insertions, 2 deletions
diff --git a/command/download.php b/command/download.php
index cb0987d..d0999b4 100644
--- a/command/download.php
+++ b/command/download.php
@@ -23,8 +23,19 @@ if(isset($conf['MAX_CONFERENCE_AGE']))
$conferencesAfter = new DateTime();
$conferencesAfter->sub(new DateInterval('P'.$months.'D'));
- stdout('Filtering before %s', $conferencesAfter->format('Y-m-d'));
+ stdout('Skipping Conferences before %s', $conferencesAfter->format('Y-m-d'));
$conferences = array_filter($conferences, function($conference) use ($conferencesAfter) {
+ if($conference->isOpen())
+ {
+ stdout(
+ ' %s: %s',
+ '---open---',
+ $conference->getSlug()
+ );
+
+ return true;
+ }
+
$isBefore = $conference->endsAt() < $conferencesAfter;
if($isBefore) {
diff --git a/model/Conference.php b/model/Conference.php
index ae5ab41..be62fdb 100644
--- a/model/Conference.php
+++ b/model/Conference.php
@@ -19,7 +19,7 @@ class Conference extends ModelBase
}
public function isPreviewEnabled() {
- if($GLOBALS['forceopen'])
+ if(@$GLOBALS['forceopen'])
return true;
if($this->has('PREVIEW_DOMAIN') && ($this->get('PREVIEW_DOMAIN') == $_SERVER['SERVER_NAME']))
@@ -32,6 +32,10 @@ class Conference extends ModelBase
return !$this->hasBegun() || $this->hasEnded();
}
+ public function isOpen() {
+ return !$this->isClosed();
+ }
+
public function startsAt() {
if(!$this->has('CONFERENCE.STARTS_AT'))
return null;