summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-01-04 20:54:23 +0000
committerDries Buytaert <dries@buytaert.net>2005-01-04 20:54:23 +0000
commitfc143ca3aff2ed6fdff2be424730507a7312ef36 (patch)
treecd6130f105870b6cc94411b0ed7722ba131a5537
parentfe58724f25c8c94087f4c541d8e306e6fae25d02 (diff)
downloadbrdo-fc143ca3aff2ed6fdff2be424730507a7312ef36.tar.gz
brdo-fc143ca3aff2ed6fdff2be424730507a7312ef36.tar.bz2
- Modified patch #15122 by killes: fixed some PHP5 problems.
-rw-r--r--modules/forum.module5
-rw-r--r--modules/forum/forum.module5
2 files changed, 10 insertions, 0 deletions
diff --git a/modules/forum.module b/modules/forum.module
index ef1f44e8c..de2edde3c 100644
--- a/modules/forum.module
+++ b/modules/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;
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;