summaryrefslogtreecommitdiff
path: root/demos/blog/protected/Pages/Posts/ViewPost.php
diff options
context:
space:
mode:
authorxue <>2006-05-31 03:12:35 +0000
committerxue <>2006-05-31 03:12:35 +0000
commit067ab51fbd9b2f18f63fc80895476e5b0e2f9bfb (patch)
tree4025d5e8379bef9de6bb4d251c2796c00e8503a2 /demos/blog/protected/Pages/Posts/ViewPost.php
parentb87fd00a62994d24a3708cec5f5613ed2e9a67ed (diff)
Merge from 3.0 branch till 1115.
Diffstat (limited to 'demos/blog/protected/Pages/Posts/ViewPost.php')
-rw-r--r--demos/blog/protected/Pages/Posts/ViewPost.php4
1 files changed, 2 insertions, 2 deletions
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);