aboutsummaryrefslogtreecommitdiff
path: root/app/models/Entry.php
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-03-14 19:05:22 +0100
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-03-14 19:05:22 +0100
commitd2c20395c0aa74f2e1c039b56dfda618415be617 (patch)
treec604917a9aebe82d588377eed492b755bfa5bfee /app/models/Entry.php
parent0df314fcb48aef6c885d2573a1e90b8cb5d0ee10 (diff)
Ajout d'indicateur de jour dans le flux d'articles + correction de bugs js liés à cet ajout et code mort
Diffstat (limited to 'app/models/Entry.php')
-rwxr-xr-xapp/models/Entry.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/models/Entry.php b/app/models/Entry.php
index 2725d265d..0e1d69921 100755
--- a/app/models/Entry.php
+++ b/app/models/Entry.php
@@ -1,6 +1,7 @@
<?php
class Entry extends Model {
+
private $id = null;
private $guid;
private $title;
@@ -99,6 +100,24 @@ class Entry extends Model {
public function _feed ($value) {
$this->feed = $value;
}
+
+ public function isDay ($day) {
+ $date = getdate ();
+ $today = mktime (0, 0, 0, $date['mon'], $date['mday'], $date['year']);
+ $yesterday = $today - 86400;
+
+ if ($day == Days::TODAY &&
+ $this->date >= $today && $this->date < $today + 86400) {
+ return true;
+ } elseif ($day == Days::YESTERDAY &&
+ $this->date >= $yesterday && $this->date < $yesterday + 86400) {
+ return true;
+ } elseif ($day == Days::BEFORE_YESTERDAY && $this->date < $yesterday) {
+ return true;
+ } else {
+ return false;
+ }
+ }
}
class EntryDAO extends Model_pdo {