- Patch #122824 by PMunn: fixed SQL query to be compatible with PostgreSQL.
parent
972d4f8de7
commit
7f4e49016a
|
@ -263,7 +263,7 @@ function forum_block($op = 'list', $delta = 0, $edit = array()) {
|
|||
switch ($delta) {
|
||||
case 0:
|
||||
$title = t('Active forum topics');
|
||||
$sql = db_rewrite_sql("SELECT n.nid, n.title, l.comment_count FROM {node} n INNER JOIN {node_comment_statistics} l ON n.nid = l.nid WHERE n.status = 1 AND n.type = 'forum' ORDER BY l.last_comment_timestamp DESC");
|
||||
$sql = db_rewrite_sql("SELECT n.nid, n.title, l.comment_count, l.last_comment_timestamp FROM {node} n INNER JOIN {node_comment_statistics} l ON n.nid = l.nid WHERE n.status = 1 AND n.type = 'forum' ORDER BY l.last_comment_timestamp DESC");
|
||||
$result = db_query_range($sql, 0, variable_get('forum_block_num_0', '5'));
|
||||
if (db_num_rows($result)) {
|
||||
$content = node_title_list($result);
|
||||
|
|
Loading…
Reference in New Issue