From 7b716e8e770faa6c85a4123db729505bb251df27 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 8 Sep 2004 15:38:26 +0000 Subject: - Patch #10622 by Adrian: fixes various PostgreSQL related problems. 1) Menu problems with Postgres (this is a highly critical 1 line fix) 2) Archive module fails with Postgres 3) Postgres setup problems - changes to database.pgsql (although i made these changes myself before finding this patch) 4) Book module fails with Postgres 5) Postgres problems following creation of a new type of user - which is actually about a taxonomy.module bug. 6) Creating accregator_item_table in PostgreSQL 7) Postgres - Polls not displayed on Poll Page 8) Blog module has sql errors with postgres This should not affect MySQL users (hopefully). --- modules/blog.module | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules/blog.module') diff --git a/modules/blog.module b/modules/blog.module index 5711bd7b5..d1a97da32 100644 --- a/modules/blog.module +++ b/modules/blog.module @@ -141,7 +141,7 @@ function blog_page_user($uid) { $title = t("%name's blog", array('%name' => $account->name)); $output = ''; - $result = pager_query('SELECT DISTINCT(n.nid) 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); + $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); } @@ -160,7 +160,7 @@ function blog_page_last() { $output = ''; - $result = pager_query('SELECT DISTINCT(n.nid) FROM {node} n '. node_access_join_sql() ." WHERE n.type = 'blog' AND n.status = 1 AND ". node_access_where_sql() .' ORDER BY n.created DESC', variable_get('default_nodes_main', 10)); + $result = pager_query('SELECT DISTINCT(n.nid), n.created FROM {node} n '. node_access_join_sql() ." WHERE n.type = 'blog' AND n.status = 1 AND ". node_access_where_sql() .' ORDER BY n.created DESC', variable_get('default_nodes_main', 10)); while ($node = db_fetch_object($result)) { $output .= node_view(node_load(array('nid' => $node->nid)), 1); @@ -292,7 +292,7 @@ function blog_block($op = 'list', $delta = 0) { } else { if (user_access('access content')) { - $block['content'] = node_title_list(db_query_range('SELECT DISTINCT(n.nid), n.title FROM {node} n '. node_access_join_sql() ." WHERE n.type = 'blog' AND n.status = 1 AND ". node_access_where_sql() .' ORDER BY n.created DESC', 0, 10)); + $block['content'] = node_title_list(db_query_range('SELECT DISTINCT(n.nid), n.title, n.created FROM {node} n '. node_access_join_sql() ." WHERE n.type = 'blog' AND n.status = 1 AND ". node_access_where_sql() .' ORDER BY n.created DESC', 0, 10)); $block['content'] .= ''; $block['subject'] = t('Recent blog posts'); } -- cgit v1.2.3