From 52cac1b8f3d7ead701dbf8d30fddb015cba69f85 Mon Sep 17 00:00:00 2001 From: ben Date: Fri, 4 Apr 2008 11:01:52 +0000 Subject: Further blog enhancements git-svn-id: https://code.elgg.org/elgg/trunk@400 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/blog/read.php | 16 ++++++++++++++-- mod/blog/views/default/blog/notfound.php | 21 +++++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 mod/blog/views/default/blog/notfound.php (limited to 'mod/blog') diff --git a/mod/blog/read.php b/mod/blog/read.php index 35ee0c997..84e29d0ea 100644 --- a/mod/blog/read.php +++ b/mod/blog/read.php @@ -14,7 +14,9 @@ require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); // Get the specified blog post - $post = (int) get_input('blogpost'); + $post = (int) get_input('blogpost'); + + // If we can get out the blog post ... if ($blogpost = get_entity($post)) { // Get any comments @@ -31,10 +33,20 @@ 'comments' => $comments, 'full' => true )); + + // Set the title appropriately + $title = sprintf(elgg_echo("blog:posttitle"),$page_owner->name,$blogpost->title); + + // If we're not allowed to see the blog post + } else { + + // Display the 'post not found' page instead + $body = elgg_view("blog/notfound"); + $title = elgg_echo("blog:notfound"); } // Display page - page_draw(sprintf(elgg_echo("blog:posttitle"),$page_owner->name,$blogpost->title),$body); + page_draw($title,$body); ?> \ No newline at end of file diff --git a/mod/blog/views/default/blog/notfound.php b/mod/blog/views/default/blog/notfound.php new file mode 100644 index 000000000..ae716df89 --- /dev/null +++ b/mod/blog/views/default/blog/notfound.php @@ -0,0 +1,21 @@ + + * @copyright Curverider Ltd 2008 + * @link http://elgg.com/ + */ + +?> + +

+ +

\ No newline at end of file -- cgit v1.2.3