From fc143ca3aff2ed6fdff2be424730507a7312ef36 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 4 Jan 2005 20:54:23 +0000 Subject: - Modified patch #15122 by killes: fixed some PHP5 problems. --- modules/forum/forum.module | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules/forum/forum.module') diff --git a/modules/forum/forum.module b/modules/forum/forum.module index ef1f44e8c..de2edde3c 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -175,6 +175,7 @@ function forum_link($type, $node = 0, $main = 0) { $stop = 1; } else { + $prev = new StdClass(); $prev->nid = $topic->nid; $prev->title = $topic->title; } @@ -343,6 +344,7 @@ function _forum_format($topic) { * Array of object containing the forum information. */ function forum_get_forums($tid = 0) { + if (!$tid) { $tid = 0; } @@ -378,6 +380,8 @@ function forum_get_forums($tid = 0) { // table1 INNER JOIN table2 INNER JOIN table3 ON table2_criteria ON table3_criteria // used to join node_comment_statistics to users. $topic = db_fetch_object(db_query_range('SELECT DISTINCT(n.nid), l.last_comment_timestamp, IF(l.last_comment_uid, cu.name, l.last_comment_name) as last_comment_name, l.last_comment_uid FROM {node} n ' . node_access_join_sql() . ", {node_comment_statistics} l /*! USE INDEX (node_comment_timestamp) */, {users} cu, {term_node} r WHERE n.nid = r.nid AND r.tid = %d AND n.status = 1 AND n.type = 'forum' AND l.last_comment_uid = cu.uid AND n.nid = l.nid AND " . node_access_where_sql() . ' ORDER BY l.last_comment_timestamp DESC', $forum->tid, 0, 1)); + + $last_post = new StdClass(); $last_post->timestamp = $topic->last_comment_timestamp; $last_post->name = $topic->last_comment_name; $last_post->uid = $topic->last_comment_uid; @@ -446,6 +450,7 @@ function forum_get_topics($tid, $sortby, $forum_per_page) { } if ($topic->num_comments > 0) { + $last_reply = new StdClass(); $last_reply->timestamp = $topic->last_comment_timestamp; $last_reply->name = $topic->last_comment_name; $last_reply->uid = $topic->last_comment_uid; -- cgit v1.2.3