Commit fc143ca3 authored by Dries's avatar Dries

- Modified patch #15122 by killes: fixed some PHP5 problems.

parent fe58724f
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment