aboutsummaryrefslogtreecommitdiff
path: root/app/models/Entry.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/Entry.php')
-rwxr-xr-xapp/models/Entry.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/models/Entry.php b/app/models/Entry.php
index d97cad408..3e90db289 100755
--- a/app/models/Entry.php
+++ b/app/models/Entry.php
@@ -442,6 +442,23 @@ class EntryDAO extends Model_pdo {
return HelperEntry::daoToEntry ($stm->fetchAll (PDO::FETCH_ASSOC));
}
+ public function listPublic ($order = 'high_to_low') {
+ $where = ' WHERE is_public=1';
+
+ if ($order == 'low_to_high') {
+ $order = ' DESC';
+ } else {
+ $order = '';
+ }
+
+ $sql = 'SELECT * FROM entry' . $where . ' ORDER BY date' . $order;
+
+ $stm = $this->bd->prepare ($sql);
+ $stm->execute ();
+
+ return HelperEntry::daoToEntry ($stm->fetchAll (PDO::FETCH_ASSOC));
+ }
+
public function listByCategory ($cat, $mode, $search = false, $order = 'high_to_low') {
$where = ' WHERE category=?';
if ($mode == 'not_read') {