diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-04-16 15:03:37 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-04-16 15:03:37 +0000 |
commit | dc62de56463104f553b51174c6266ccadcf260b3 (patch) | |
tree | f0709c02147a35f71e5d2025a800847c98c62e50 /mod | |
parent | 11f62409f3e96e36d1e0ff6907439e850ebb109f (diff) | |
download | elgg-dc62de56463104f553b51174c6266ccadcf260b3.tar.gz elgg-dc62de56463104f553b51174c6266ccadcf260b3.tar.bz2 |
URL handling for the blog plugin
git-svn-id: https://code.elgg.org/elgg/trunk@476 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod')
-rw-r--r-- | mod/blog/start.php | 9 | ||||
-rw-r--r-- | mod/blog/views/default/object/blog.php | 2 |
2 files changed, 10 insertions, 1 deletions
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');
diff --git a/mod/blog/views/default/object/blog.php b/mod/blog/views/default/object/blog.php index 52c03d23b..0317f952f 100644 --- a/mod/blog/views/default/object/blog.php +++ b/mod/blog/views/default/object/blog.php @@ -17,7 +17,7 @@ ?>
<div class="blog-post">
- <h3><a href="<?php echo $vars['url']; ?>blog/<?php echo $vars['entity_owner']->username; ?>/read/<?php echo $vars['entity']->getGUID(); ?>"><?php echo $vars['entity']->title; ?></a></h3>
+ <h3><a href="<?php echo $vars['entity']->getURL(); ?>"><?php echo $vars['entity']->title; ?></a></h3>
<p class="strapline">
<span style="float:right">
<?php
|