diff --git a/modules/blog.module b/modules/blog.module index 84ece24a5eff606664c0fea1a89d8b8f3ad6a6a0..62ffcadb500ed5bc4e5d39a17dc6117ea1543214 100644 --- a/modules/blog.module +++ b/modules/blog.module @@ -64,18 +64,6 @@ function blog_help($section) { } } -/** - * Menu callback; displays an RSS feed containing recent blog entries. - */ -function blog_feed($uid = 0) { - if ($uid) { - blog_feed_user($uid); - } - else { - blog_feed_last(); - } -} - /** * Displays an RSS feed containing recent blog entries of a given user. */ @@ -110,9 +98,18 @@ function blog_feed_last() { /** * Menu callback; displays a Drupal page containing recent blog entries. */ -function blog_page($uid = 0) { - if ($uid) { - blog_page_user($uid); +function blog_page($a = NULL, $b = NULL) { + + if (is_numeric($a)) { // $a is a user ID + if ($b == 'feed') { + blog_feed_user($a); + } + else { + blog_page_user($a); + } + } + else if ($a == 'feed') { + blog_feed_last(); } else { blog_page_last(); @@ -255,13 +252,6 @@ function blog_menu($may_cache) { 'callback' => 'blog_page', 'access' => user_access('access content'), 'type' => MENU_SUGGESTED_ITEM); - $items[] = array('path' => 'blog/feed', 'title' => t('RSS feed'), - 'callback' => 'blog_feed', - 'access' => user_access('access content'), - 'type' => MENU_CALLBACK); - $items[] = array('path' => 'blog/'. $user->uid, 'title' => t('my blog'), - 'access' => user_access('edit own blog'), - 'type' => MENU_DYNAMIC_ITEM); } return $items; diff --git a/modules/blog/blog.module b/modules/blog/blog.module index 84ece24a5eff606664c0fea1a89d8b8f3ad6a6a0..62ffcadb500ed5bc4e5d39a17dc6117ea1543214 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -64,18 +64,6 @@ function blog_help($section) { } } -/** - * Menu callback; displays an RSS feed containing recent blog entries. - */ -function blog_feed($uid = 0) { - if ($uid) { - blog_feed_user($uid); - } - else { - blog_feed_last(); - } -} - /** * Displays an RSS feed containing recent blog entries of a given user. */ @@ -110,9 +98,18 @@ function blog_feed_last() { /** * Menu callback; displays a Drupal page containing recent blog entries. */ -function blog_page($uid = 0) { - if ($uid) { - blog_page_user($uid); +function blog_page($a = NULL, $b = NULL) { + + if (is_numeric($a)) { // $a is a user ID + if ($b == 'feed') { + blog_feed_user($a); + } + else { + blog_page_user($a); + } + } + else if ($a == 'feed') { + blog_feed_last(); } else { blog_page_last(); @@ -255,13 +252,6 @@ function blog_menu($may_cache) { 'callback' => 'blog_page', 'access' => user_access('access content'), 'type' => MENU_SUGGESTED_ITEM); - $items[] = array('path' => 'blog/feed', 'title' => t('RSS feed'), - 'callback' => 'blog_feed', - 'access' => user_access('access content'), - 'type' => MENU_CALLBACK); - $items[] = array('path' => 'blog/'. $user->uid, 'title' => t('my blog'), - 'access' => user_access('edit own blog'), - 'type' => MENU_DYNAMIC_ITEM); } return $items; diff --git a/modules/legacy.module b/modules/legacy.module index 882298fa48b994d4f0af799bbc3f990a3d1cbfb2..3fe53da3a4d398b4cabcad970b92d98c878b6c9c 100644 --- a/modules/legacy.module +++ b/modules/legacy.module @@ -88,10 +88,13 @@ function legacy_taxonomy_feed($operation = 'or', $str_tids = '') { */ function legacy_blog_feed($str_uid = '') { // if URL is of form blog/feed/52 redirect - // if URL is of form blog/feed no need to redirect + // if URL is of form blog/feed we have to call blog_feed_last(). if (is_numeric($str_uid)) { drupal_goto('blog/'. $str_uid .'/feed'); } + else { + module_invoke('blog', 'feed_last'); + } } /** diff --git a/modules/legacy/legacy.module b/modules/legacy/legacy.module index 882298fa48b994d4f0af799bbc3f990a3d1cbfb2..3fe53da3a4d398b4cabcad970b92d98c878b6c9c 100644 --- a/modules/legacy/legacy.module +++ b/modules/legacy/legacy.module @@ -88,10 +88,13 @@ function legacy_taxonomy_feed($operation = 'or', $str_tids = '') { */ function legacy_blog_feed($str_uid = '') { // if URL is of form blog/feed/52 redirect - // if URL is of form blog/feed no need to redirect + // if URL is of form blog/feed we have to call blog_feed_last(). if (is_numeric($str_uid)) { drupal_goto('blog/'. $str_uid .'/feed'); } + else { + module_invoke('blog', 'feed_last'); + } } /**