From dc62de56463104f553b51174c6266ccadcf260b3 Mon Sep 17 00:00:00 2001 From: ben Date: Wed, 16 Apr 2008 15:03:37 +0000 Subject: URL handling for the blog plugin git-svn-id: https://code.elgg.org/elgg/trunk@476 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/blog/start.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'mod/blog/start.php') diff --git a/mod/blog/start.php b/mod/blog/start.php index f8af95e17..d7157c40b 100644 --- a/mod/blog/start.php +++ b/mod/blog/start.php @@ -48,6 +48,8 @@ // Register a page handler, so we can have nice URLs register_page_handler('blog','blog_page_handler'); + // Register a URL handler for blog posts + register_entity_url_handler('blog_url','object','blog'); } /** @@ -82,6 +84,13 @@ } + function blog_url($blogpost) { + + global $CONFIG; + return $CONFIG->url . "blog/" . $blogpost->getOwnerUser()->username . "/read/" . $blogpost->getGUID(); + + } + // Make sure the blog initialisation function is called on initialisation register_event_handler('init','system','blog_init'); -- cgit v1.2.3