summaryrefslogtreecommitdiff
path: root/modules/blog
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-10-09 06:52:35 +0000
committerDries Buytaert <dries@buytaert.net>2004-10-09 06:52:35 +0000
commit48bcc19ca276fab09d9a6c28fe2316a0288a528e (patch)
treef056579eec183561f2832f0dd8889052e8e0ce96 /modules/blog
parentf8e532f714b1f3ff7aed8ad070fc5cabaea73893 (diff)
downloadbrdo-48bcc19ca276fab09d9a6c28fe2316a0288a528e.tar.gz
brdo-48bcc19ca276fab09d9a6c28fe2316a0288a528e.tar.bz2
- Patch #10613 by Gerhard: calling a non-existent username or user ID in the blog module URL now returns a 404 error instead of an empty blog page.
Diffstat (limited to 'modules/blog')
-rw-r--r--modules/blog/blog.module25
1 files changed, 15 insertions, 10 deletions
diff --git a/modules/blog/blog.module b/modules/blog/blog.module
index ed50575c7..50db6cb7a 100644
--- a/modules/blog/blog.module
+++ b/modules/blog/blog.module
@@ -138,18 +138,23 @@ function blog_page($uid = 0) {
function blog_page_user($uid) {
$account = user_load(array((is_numeric($uid) ? 'uid' : 'name') => $uid, 'status' => 1));
- $title = t("%name's blog", array('%name' => $account->name));
- $output = '';
+ if ($account->uid) {
+ $title = t("%name's blog", array('%name' => $account->name));
+ $output = '';
- $result = pager_query('SELECT DISTINCT(n.nid), n.sticky, n.created FROM {node} n '. node_access_join_sql() ." WHERE type = 'blog' AND n.uid = %d AND n.status = 1 AND ". node_access_where_sql() .' ORDER BY n.sticky DESC, n.created DESC', variable_get('default_nodes_main', 10), 0, NULL, $account->uid);
- while ($node = db_fetch_object($result)) {
- $output .= node_view(node_load(array('nid' => $node->nid)), 1);
- }
- $output .= theme('pager', NULL, variable_get('default_nodes_main', 10));
- $output .= theme('xml_icon', url("blog/feed/$account->uid"));
+ $result = pager_query('SELECT DISTINCT(n.nid), n.sticky, n.created FROM {node} n '. node_access_join_sql() ." WHERE type = 'blog' AND n.uid = %d AND n.status = 1 AND ". node_access_where_sql() .' ORDER BY n.sticky DESC, n.created DESC', variable_get('default_nodes_main', 10), 0, NULL, $account->uid);
+ while ($node = db_fetch_object($result)) {
+ $output .= node_view(node_load(array('nid' => $node->nid)), 1);
+ }
+ $output .= theme('pager', NULL, variable_get('default_nodes_main', 10));
+ $output .= theme('xml_icon', url("blog/feed/$account->uid"));
- drupal_set_html_head('<link rel="alternate" type="application/rss+xml" title="RSS - '. $title .'" href="'. url("blog/feed/$account->uid") .'" />');
- print theme('page', $output, $title);
+ drupal_set_html_head('<link rel="alternate" type="application/rss+xml" title="RSS - '. $title .'" href="'. url("blog/feed/$account->uid") .'" />');
+ print theme('page', $output, $title);
+ }
+ else {
+ drupal_not_found();
+ }
}
/**