diff options
Diffstat (limited to 'demos/blog/protected/Pages')
-rw-r--r-- | demos/blog/protected/Pages/Admin/PostMan.page | 2 | ||||
-rw-r--r-- | demos/blog/protected/Pages/Admin/PostMan.php | 2 | ||||
-rw-r--r-- | demos/blog/protected/Pages/Posts/NewPost.php | 1 | ||||
-rw-r--r-- | demos/blog/protected/Pages/Posts/ViewPost.php | 4 |
4 files changed, 5 insertions, 4 deletions
diff --git a/demos/blog/protected/Pages/Admin/PostMan.page b/demos/blog/protected/Pages/Admin/PostMan.page index 8c78574c..68ac44f8 100644 --- a/demos/blog/protected/Pages/Admin/PostMan.page +++ b/demos/blog/protected/Pages/Admin/PostMan.page @@ -60,7 +60,7 @@ <com:TBoundColumn
HeaderText="Time"
ReadOnly="true"
- DataField="CreateTime"
+ DataField="ModifyTime"
DataFormatString="#date('M j, Y',{0})"
ItemStyle.Wrap="false"
ItemStyle.Width="90px"
diff --git a/demos/blog/protected/Pages/Admin/PostMan.php b/demos/blog/protected/Pages/Admin/PostMan.php index 349278fc..09c1809c 100644 --- a/demos/blog/protected/Pages/Admin/PostMan.php +++ b/demos/blog/protected/Pages/Admin/PostMan.php @@ -23,7 +23,7 @@ class PostMan extends BlogPage {
$offset=$this->PostGrid->CurrentPageIndex*$this->PostGrid->PageSize;
$limit=$this->PostGrid->PageSize;
- $this->PostGrid->DataSource=$this->DataAccess->queryPosts('','','ORDER BY a.status DESC, create_time DESC',"LIMIT $offset,$limit");
+ $this->PostGrid->DataSource=$this->DataAccess->queryPosts('','','ORDER BY a.status DESC, modify_time DESC',"LIMIT $offset,$limit");
$this->PostGrid->VirtualItemCount=$this->DataAccess->queryPostCount('','');
$this->PostGrid->dataBind();
}
diff --git a/demos/blog/protected/Pages/Posts/NewPost.php b/demos/blog/protected/Pages/Posts/NewPost.php index 7d02557d..bba09975 100644 --- a/demos/blog/protected/Pages/Posts/NewPost.php +++ b/demos/blog/protected/Pages/Posts/NewPost.php @@ -43,6 +43,7 @@ class NewPost extends BlogPage else
$postRecord->Status=PostRecord::STATUS_PUBLISHED;
$postRecord->CreateTime=time();
+ $postRecord->ModifyTime=$postRecord->CreateTime;
$postRecord->AuthorID=$this->User->ID;
$cats=array();
foreach($this->Categories->SelectedValues as $value)
diff --git a/demos/blog/protected/Pages/Posts/ViewPost.php b/demos/blog/protected/Pages/Posts/ViewPost.php index 8d0a7124..e45fd505 100644 --- a/demos/blog/protected/Pages/Posts/ViewPost.php +++ b/demos/blog/protected/Pages/Posts/ViewPost.php @@ -29,7 +29,7 @@ class ViewPost extends BlogPage if($this->_post===null)
throw new BlogException(500,'post_id_invalid',$id);
// if post is not published, only the author and admin can view it
- if($this->_post->Status!==PostRecord::STATUS_PUBLISHED && !$this->User->IsAdmin && $this->User->ID!==$this->_post->AuthorID)
+ if($this->_post->Status!==PostRecord::STATUS_PUBLISHED && $this->_post->Status!==PostRecord::STATUS_STICKY && !$this->User->IsAdmin && $this->User->ID!==$this->_post->AuthorID)
throw new BlogException(500,'post_view_disallowed',$id);
$this->Title=htmlentities($this->_post->Title,ENT_QUOTES,'UTF-8');
}
@@ -48,7 +48,7 @@ class ViewPost extends BlogPage public function onLoad($param)
{
parent::onLoad($param);
- $this->Status->Visible=$this->_post->Status!==PostRecord::STATUS_PUBLISHED;
+ $this->Status->Visible=$this->_post->Status!==PostRecord::STATUS_PUBLISHED && $this->_post->Status!==PostRecord::STATUS_STICKY;
$this->CategoryList->DataSource=$this->DataAccess->queryCategoriesByPostID($this->_post->ID);
$this->CategoryList->dataBind();
$this->CommentList->DataSource=$this->DataAccess->queryCommentsByPostID($this->_post->ID);
|