From e3b10414305b181aa4e39e211cf6b0e9bf992518 Mon Sep 17 00:00:00 2001
From: xue <>
Date: Wed, 31 May 2006 00:33:26 +0000
Subject: Added sticky feature for published posts.
---
demos/blog/protected/Pages/Posts/EditPost.page | 1 +
demos/blog/protected/Pages/Posts/EditPost.php | 2 +-
demos/blog/protected/Pages/Posts/ListPost.php | 4 ++--
3 files changed, 4 insertions(+), 3 deletions(-)
(limited to 'demos/blog/protected/Pages/Posts')
diff --git a/demos/blog/protected/Pages/Posts/EditPost.page b/demos/blog/protected/Pages/Posts/EditPost.page
index 97702848..eb55102a 100644
--- a/demos/blog/protected/Pages/Posts/EditPost.page
+++ b/demos/blog/protected/Pages/Posts/EditPost.page
@@ -34,6 +34,7 @@ Display="Dynamic"
+
diff --git a/demos/blog/protected/Pages/Posts/EditPost.php b/demos/blog/protected/Pages/Posts/EditPost.php
index 24b58529..2638293d 100644
--- a/demos/blog/protected/Pages/Posts/EditPost.php
+++ b/demos/blog/protected/Pages/Posts/EditPost.php
@@ -41,7 +41,7 @@ class EditPost extends BlogPage
$postRecord=$this->_postRecord;
$this->Title->Text=$postRecord->Title;
$this->Content->Text=$postRecord->Content;
- $this->DraftMode->Checked=$postRecord->Status!==PostRecord::STATUS_PUBLISHED;
+ $this->DraftMode->Checked=$postRecord->Status===PostRecord::STATUS_DRAFT;
$this->Categories->DataSource=$this->DataAccess->queryCategories();
$this->Categories->dataBind();
$cats=$this->DataAccess->queryCategoriesByPostID($postRecord->ID);
diff --git a/demos/blog/protected/Pages/Posts/ListPost.php b/demos/blog/protected/Pages/Posts/ListPost.php
index bed18222..8c51546f 100644
--- a/demos/blog/protected/Pages/Posts/ListPost.php
+++ b/demos/blog/protected/Pages/Posts/ListPost.php
@@ -28,7 +28,7 @@ class ListPost extends BlogPage
$this->_posts=$this->DataAccess->queryPosts(
$this->getPostFilter(),
$this->getCategoryFilter(),
- 'ORDER BY create_time DESC',
+ 'ORDER BY a.status DESC, create_time DESC',
'LIMIT '.$this->getPageOffset().','.$this->getPageSize());
if($this->Request['cat']!==null)
{
@@ -73,7 +73,7 @@ class ListPost extends BlogPage
private function getPostFilter()
{
- $filter='a.status=0';
+ $filter='(a.status=0 OR a.status=3)';
if(($timeFilter=$this->getTimeFilter())!=='')
return "$filter AND $timeFilter";
else
--
cgit v1.2.3