diff options
author | Sem <sembrestels@riseup.net> | 2012-12-13 04:02:11 +0100 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2012-12-13 04:02:11 +0100 |
commit | 3888e975e5038b7b96d0621d2e5eede446a700b2 (patch) | |
tree | 0aef70b166a693cedbf592fd9d936b5b6485513b | |
parent | 3bba832ec8b076067b794a959187c490dbf6a97f (diff) | |
parent | 4f01b88b9fc1fe476189d53df7a34303502ba17e (diff) | |
download | elgg-3888e975e5038b7b96d0621d2e5eede446a700b2.tar.gz elgg-3888e975e5038b7b96d0621d2e5eede446a700b2.tar.bz2 |
Merge branch 'group-blogs-rss' of github.com:sembrestels/Elgg into foxglove-1floxglove-1
-rw-r--r-- | mod/blog/lib/blog.php | 22 | ||||
-rw-r--r-- | mod/blog/start.php | 3 |
2 files changed, 20 insertions, 5 deletions
diff --git a/mod/blog/lib/blog.php b/mod/blog/lib/blog.php index 4622a9e7e..4dcc7d56e 100644 --- a/mod/blog/lib/blog.php +++ b/mod/blog/lib/blog.php @@ -396,6 +396,14 @@ function blog_prepare_form_vars($post = NULL, $revision = NULL) { /** * Forward to the new style of URLs + * + * Pre-1.7.5 + * Group blogs page: /blog/group:<container_guid>/ + * Group blog view: /blog/group:<container_guid>/read/<guid>/<title> + * 1.7.5-1.8 + * Group blogs page: /blog/owner/group:<container_guid>/ + * Group blog view: /blog/read/<guid> + * * * @param string $page */ @@ -403,17 +411,25 @@ function blog_url_forwarder($page) { global $CONFIG; // group usernames - if (substr_count($page[0], 'group:')) { - preg_match('/group\:([0-9]+)/i', $page[0], $matches); + if (substr_count(implode('/', $page), 'group:')) { + preg_match('/group\:([0-9]+)/i', implode('/', $page), $matches); $guid = $matches[1]; $entity = get_entity($guid); if ($entity) { - $url = "{$CONFIG->wwwroot}blog/group/$guid/all"; + if (isset($page[2])) { + $url = "{$CONFIG->wwwroot}blog/view/$page[2]/?view=" . elgg_get_viewtype(); + } else { + $url = "{$CONFIG->wwwroot}blog/group/$guid/all?view=" . elgg_get_viewtype(); + } register_error(elgg_echo("changebookmark")); forward($url); } } + if (!isset($page[0])) { + return; + } + // user usernames $user = get_user_by_username($page[0]); if (!$user) { diff --git a/mod/blog/start.php b/mod/blog/start.php index 9faf1794e..8cbaf5cca 100644 --- a/mod/blog/start.php +++ b/mod/blog/start.php @@ -99,8 +99,7 @@ function blog_page_handler($page) { elgg_load_library('elgg:blog'); - // @todo remove the forwarder in 1.9 - // forward to correct URL for blog pages pre-1.7.5 + // forward to correct URL for blog pages pre-1.8 blog_url_forwarder($page); // push all blogs breadcrumb |