diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-04-04 11:01:52 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-04-04 11:01:52 +0000 |
commit | 52cac1b8f3d7ead701dbf8d30fddb015cba69f85 (patch) | |
tree | ae82c9765c0e1ec31b302d9dbd68d6b7c74b73aa /mod | |
parent | e5d8c5584d8bad625dc52b08f5556e7f6b06fa77 (diff) | |
download | elgg-52cac1b8f3d7ead701dbf8d30fddb015cba69f85.tar.gz elgg-52cac1b8f3d7ead701dbf8d30fddb015cba69f85.tar.bz2 |
Further blog enhancements
git-svn-id: https://code.elgg.org/elgg/trunk@400 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod')
-rw-r--r-- | mod/blog/read.php | 16 | ||||
-rw-r--r-- | mod/blog/views/default/blog/notfound.php | 21 |
2 files changed, 35 insertions, 2 deletions
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 @@ +<?php
+
+ /**
+ * Elgg blog not found page
+ *
+ * @package ElggBlog
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Ben Werdmuller <ben@curverider.co.uk>
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ */
+
+?>
+
+ <p>
+ <?php
+
+ echo elgg_echo("blog:notfound");
+
+ ?>
+ </p>
\ No newline at end of file |