Commit d7cf0086 authored by Clare Lenihan's avatar Clare Lenihan Committed by Clare Lenihan
Browse files

Fixed breadcrumbs, titles + minor stuff

parent 76e681b7
......@@ -32,30 +32,18 @@ require_once('group.php');
$postid = param_integer('id');
$post = get_record_sql(
'SELECT p.subject, p.body, p.topic, p.parent, p.poster, t.forum, p2.subject as topicsubject, f.group, f.title as forumtitle, COUNT(p3.*)
'SELECT p.subject, p.body, p.topic, p.parent, p.poster, t.forum, p2.subject as topicsubject, f.group, f.title as forumtitle, g.name as groupname, COUNT(p3.*)
FROM {interaction_forum_post} p
INNER JOIN {interaction_forum_topic} t
ON p.topic = t.id
AND t.deleted != 1
INNER JOIN {interaction_forum_post} p2
ON p2.topic = t.id
AND p2.parent IS NULL
INNER JOIN {interaction_instance} f
ON t.forum = f.id
AND f.deleted != 1
INNER JOIN {interaction_forum_post} p3
ON p.poster = p3.poster
AND p3.deleted != 1
INNER JOIN {interaction_forum_topic} t2
ON t2.deleted != 1
AND p3.topic = t2.id
INNER JOIN {interaction_instance} f2
ON t2.forum = f2.id
AND f2.deleted != 1
AND f2.group = f.group
INNER JOIN {interaction_forum_topic} t ON (p.topic = t.id AND t.deleted != 1)
INNER JOIN {interaction_forum_post} p2 ON (p2.topic = t.id AND p2.parent IS NULL)
INNER JOIN {interaction_instance} f ON (t.forum = f.id AND f.deleted != 1)
INNER JOIN {group} g ON g.id = f.group
INNER JOIN {interaction_forum_post} p3 ON (p.poster = p3.poster AND p3.deleted) != 1
INNER JOIN {interaction_forum_topic} t2 ON (t2.deleted != 1 AND p3.topic = t2.id)
INNER JOIN {interaction_instance} f2 ON (t2.forum = f2.id AND f2.deleted != 1 AND f2.group = f.group)
WHERE p.id = ?
AND p.deleted != 1
GROUP BY 1, 2, 3, 4, 5, 6, 7, 8, 9',
GROUP BY 1, 2, 3, 4, 5, 6, 7, 8, 9, 10',
array($postid)
);
......@@ -76,23 +64,25 @@ if (!$moderator) {
define('TITLE', get_string('deletepostvariable', 'interaction.forum', $post->subject));
$breadcrumbs = array(
array(
get_config('wwwroot') . 'group/view.php?id=' . $post->group,
$post->groupname,
),
array(
get_config('wwwroot') . 'interaction/forum/index.php?group=' . $post->group,
get_string('nameplural', 'interaction.forum')
),
array(
array(
get_config('wwwroot') . 'interaction/forum/view.php?id=' . $post->forum,
$post->forumtitle
),
array(
get_config('wwwroot') . 'interaction/forum/topic.php?id=' . $post->topic,
$post->topicsubject
),
array(
get_config('wwwroot') . 'interaction/forum/deletepost.php?id=' . $postid,
get_string('deletepost', 'interaction.forum')
)
get_config('wwwroot') . 'interaction/forum/view.php?id=' . $post->forum,
$post->forumtitle
),
array(
get_config('wwwroot') . 'interaction/forum/topic.php?id=' . $post->topic,
$post->topicsubject
),
array(
get_config('wwwroot') . 'interaction/forum/deletepost.php?id=' . $postid,
get_string('deletepost', 'interaction.forum')
)
);
......
......@@ -32,27 +32,17 @@ require('group.php');
$topicid = param_integer('id');
$topic = get_record_sql(
'SELECT f."group", f.id as forumid, f.title, p.poster, p.subject, p.body, COUNT(p2.*), t.closed
'SELECT f."group", f.id as forumid, f.title, g.name as groupname, p.poster, p.subject, p.body, COUNT(p2.*), t.closed
FROM {interaction_forum_topic} t
INNER JOIN {interaction_instance} f
ON f.id = t.forum
AND f.deleted != 1
INNER JOIN {interaction_forum_post} p
ON p.topic = t.id
AND p.parent IS NULL
INNER JOIN {interaction_forum_post} p2
ON p.poster = p2.poster
AND p2.deleted != 1
INNER JOIN {interaction_forum_topic} t2
ON t2.deleted != 1
AND p2.topic = t2.id
INNER JOIN {interaction_instance} f2
ON t2.forum = f2.id
AND f2.deleted != 1
AND f2.group = f.group
INNER JOIN {interaction_instance} f ON (f.id = t.forum AND f.deleted != 1)
INNER JOIN {group} g ON g.id = f.group
INNER JOIN {interaction_forum_post} p ON (p.topic = t.id AND p.parent IS NULL)
INNER JOIN {interaction_forum_post} p2 ON (p.poster = p2.poster AND p2.deleted != 1)
INNER JOIN {interaction_forum_topic} t2 ON (t2.deleted != 1 AND p2.topic = t2.id)
INNER JOIN {interaction_instance} f2 ON (t2.forum = f2.id AND f2.deleted != 1 AND f2.group = f.group)
WHERE t.id = ?
AND t.deleted != 1
GROUP BY 1, 2, 3, 4, 5, 6, 8',
GROUP BY 1, 2, 3, 4, 5, 6, 7, 9',
array($topicid)
);
......@@ -73,23 +63,25 @@ if (!$moderator) {
define('TITLE', get_string('deletetopicvariable', 'interaction.forum', $topic->subject));
$breadcrumbs = array(
array(
get_config('wwwroot') . 'group/view.php?id=' . $topic->group,
$topic->groupname,
),
array(
get_config('wwwroot') . 'interaction/forum/index.php?group=' . $topic->group,
get_string('nameplural', 'interaction.forum')
),
array(
array(
get_config('wwwroot') . 'interaction/forum/view.php?id=' . $topic->forumid,
$topic->title
),
array(
get_config('wwwroot') . 'interaction/forum/topic.php?id=' . $topicid,
$topic->subject
),
array(
get_config('wwwroot') . 'interaction/forum/deletetopic.php?id=' . $topicid,
get_string('deletetopic', 'interaction.forum')
)
get_config('wwwroot') . 'interaction/forum/view.php?id=' . $topic->forumid,
$topic->title
),
array(
get_config('wwwroot') . 'interaction/forum/topic.php?id=' . $topicid,
$topic->subject
),
array(
get_config('wwwroot') . 'interaction/forum/deletetopic.php?id=' . $topicid,
get_string('deletetopic', 'interaction.forum')
)
);
......@@ -116,12 +108,12 @@ function deletepost_submit(Pieform $form, $values) {
array('deleted' => 1),
array('id' => $topicid)
);
$forumid = get_record_sql(
$forumid = get_field_sql(
'SELECT forum
FROM interaction_forum_topic
WHERE id = ?',
array($topicid)
)->forum;
);
redirect('/interaction/forum/view.php?id=' . $forumid);
}
......
......@@ -40,17 +40,12 @@ if ($postid==0) {
define('TITLE', get_string('postreply','interaction.forum'));
$parentid = param_integer('parent');
$topic = get_record_sql(
'SELECT p.topic AS id, p2.subject, t.closed, f.id AS forum, f.title AS forumtitle, f.group
'SELECT p.topic AS id, p2.subject, t.closed, f.id AS forum, f.title AS forumtitle, f.group, g.name AS groupname
FROM {interaction_forum_post} p
INNER JOIN {interaction_forum_topic} t
ON p.topic = t.id
AND t.deleted != 1
INNER JOIN {interaction_forum_post} p2
ON p2.topic = t.id
AND p2.parent IS NULL
INNER JOIN {interaction_instance} f
ON t.forum = f.id
AND f.deleted != 1
INNER JOIN {interaction_forum_topic} t ON (p.topic = t.id AND t.deleted != 1)
INNER JOIN {interaction_forum_post} p2 ON (p2.topic = t.id AND p2.parent IS NULL)
INNER JOIN {interaction_instance} f ON (t.forum = f.id AND f.deleted != 1)
INNER JOIN {group} g ON g.id = f.group
WHERE p.id = ?
AND p.deleted != 1',
array($parentid)
......@@ -74,23 +69,25 @@ if ($postid==0) {
$topicsubject = $topic->subject;
$breadcrumbs = array(
array(
get_config('wwwroot') . 'group/view.php?id=' . $topic->group,
$topic->groupname
),
array(
get_config('wwwroot') . 'interaction/forum/index.php?group=' . $topic->group,
get_string('nameplural', 'interaction.forum')
),
array(
array(
get_config('wwwroot') . 'interaction/forum/view.php?id=' . $topic->forum,
$topic->forumtitle
),
array(
get_config('wwwroot') . 'interaction/forum/topic.php?id=' . $topicid,
$topic->subject
),
array(
get_config('wwwroot') . 'interaction/forum/editpost.php?parent=' . $parentid,
get_string('postreply', 'interaction.forum')
)
get_config('wwwroot') . 'interaction/forum/view.php?id=' . $topic->forum,
$topic->forumtitle
),
array(
get_config('wwwroot') . 'interaction/forum/topic.php?id=' . $topicid,
$topic->subject
),
array(
get_config('wwwroot') . 'interaction/forum/editpost.php?parent=' . $parentid,
get_string('postreply', 'interaction.forum')
)
);
}
......@@ -98,17 +95,12 @@ if ($postid==0) {
if (isset($postid)) {
define('TITLE', get_string('editpost','interaction.forum'));
$post = get_record_sql(
'SELECT p.subject, p.body, p.parent, p.topic, p.poster, p.ctime, t.forum, p2.subject AS topicsubject, f.title AS forumtitle, f.group
'SELECT p.subject, p.body, p.parent, p.topic, p.poster, p.ctime, t.forum, p2.subject AS topicsubject, f.title AS forumtitle, f.group, g.name AS groupname
FROM {interaction_forum_post} p
INNER JOIN {interaction_forum_topic} t
ON p.topic = t.id
AND t.deleted != 1
INNER JOIN {interaction_forum_post} p2
ON p2.topic = t.id
AND p2.parent IS NULL
INNER JOIN {interaction_instance} f
ON t.forum = f.id
AND f.deleted != 1
INNER JOIN {interaction_forum_topic} t ON (p.topic = t.id AND t.deleted != 1)
INNER JOIN {interaction_forum_post} p2 ON (p2.topic = t.id AND p2.parent IS NULL)
INNER JOIN {interaction_instance} f ON (t.forum = f.id AND f.deleted != 1)
INNER JOIN {group} g ON g.id = f.group
WHERE p.id = ?
AND p.deleted != 1',
array($postid)
......@@ -134,23 +126,25 @@ if (isset($postid)) {
}
$breadcrumbs = array(
array(
get_config('wwwroot') . 'group/view.php?id=' . $post->group,
$post->groupname
),
array(
get_config('wwwroot') . 'interaction/forum/index.php?group=' . $post->group,
get_string('nameplural', 'interaction.forum')
),
array(
array(
get_config('wwwroot') . 'interaction/forum/view.php?id=' . $post->forum,
$post->forumtitle
),
array(
get_config('wwwroot') . 'interaction/forum/topic.php?id=' . $topicid,
$topicsubject
),
array(
get_config('wwwroot') . 'interaction/forum/editpost.php?id=' . $postid,
get_string('editpost', 'interaction.forum')
)
get_config('wwwroot') . 'interaction/forum/view.php?id=' . $post->forum,
$post->forumtitle
),
array(
get_config('wwwroot') . 'interaction/forum/topic.php?id=' . $topicid,
$topicsubject
),
array(
get_config('wwwroot') . 'interaction/forum/editpost.php?id=' . $postid,
get_string('editpost', 'interaction.forum')
)
);
}
......
......@@ -38,10 +38,11 @@ if ($topicid==0) {
define('TITLE', get_string('addtopic','interaction.forum'));
$forumid = param_integer('forum');
$forum = get_record_sql(
'SELECT f.group AS group, f.title
'SELECT f.group AS group, f.title, g.name as groupname
FROM {interaction_instance} f
WHERE id = ?
AND deleted != 1',
INNER JOIN {group} g ON g.id = f.group
WHERE f.id = ?
AND f.deleted != 1',
array($forumid)
);
......@@ -61,19 +62,21 @@ if ($topicid==0) {
}
$breadcrumbs = array(
array(
get_config('wwwroot') . 'group/view.php?id=' . $forum->group,
$forum->groupname
),
array(
get_config('wwwroot') . 'interaction/forum/index.php?group=' . $forum->group,
get_string('nameplural', 'interaction.forum')
),
array(
array(
get_config('wwwroot') . 'interaction/forum/view.php?id=' . $forumid,
$forum->title
),
array(
get_config('wwwroot') . 'interaction/forum/edittopic.php?forum=' . $forumid,
get_string('addtopic', 'interaction.forum')
)
get_config('wwwroot') . 'interaction/forum/view.php?id=' . $forumid,
$forum->title
),
array(
get_config('wwwroot') . 'interaction/forum/edittopic.php?forum=' . $forumid,
get_string('addtopic', 'interaction.forum')
)
);
}
......@@ -81,14 +84,11 @@ if ($topicid==0) {
if (isset($topicid)) {
define('TITLE', get_string('edittopic','interaction.forum'));
$topic = get_record_sql(
'SELECT p.subject, p.body, p.topic AS id, t.sticky, t.closed, f.id as forumid, f.group as group, f.title
'SELECT p.subject, p.body, p.topic AS id, t.sticky, t.closed, f.id as forumid, f.group AS group, f.title, g.name AS groupname
FROM {interaction_forum_post} p
INNER JOIN {interaction_forum_topic} t
ON p.topic = t.id
AND t.deleted != 1
INNER JOIN {interaction_instance} f
ON f.id = t.forum
AND f.deleted != 1
INNER JOIN {interaction_forum_topic} t ON (p.topic = t.id AND t.deleted != 1)
INNER JOIN {interaction_instance} f ON (f.id = t.forum AND f.deleted != 1)
INNER JOIN {group} g ON g.id = f.group
WHERE p.parent IS NULL
AND p.topic = ?',
array($topicid)
......@@ -112,23 +112,25 @@ if (isset($topicid)) {
}
$breadcrumbs = array(
array(
get_config('wwwroot') . 'group/view.php?id=' . $topic->group,
$topic->groupname
),
array(
get_config('wwwroot') . 'interaction/forum/index.php?group=' . $topic->group,
get_string('nameplural', 'interaction.forum')
),
array(
array(
get_config('wwwroot') . 'interaction/forum/view.php?id=' . $topic->forumid,
$topic->title
),
array(
get_config('wwwroot') . 'interaction/forum/topic.php?id=' . $topicid,
$topic->subject
),
array(
get_config('wwwroot') . 'interaction/forum/edittopic.php?id=' . $topicid,
get_string('edittopic', 'interaction.forum')
)
get_config('wwwroot') . 'interaction/forum/view.php?id=' . $topic->forumid,
$topic->title
),
array(
get_config('wwwroot') . 'interaction/forum/topic.php?id=' . $topicid,
$topic->subject
),
array(
get_config('wwwroot') . 'interaction/forum/edittopic.php?id=' . $topicid,
get_string('edittopic', 'interaction.forum')
)
);
......
<?php
/**
* This program is part of Mahara
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* @package mahara
* @subpackage interaction-forum
* @author Clare Lenihan <clare@catalyst.net.nz>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 2006,2007 Catalyst IT Ltd http://catalyst.net.nz
*
*/
$string['addtitle'] = 'Add forum';
$string['addtopic'] = 'Add topic';
$string['body'] = 'Body';
......@@ -18,6 +43,7 @@ $string['closed'] = 'Closed';
$string['count'] = 'Count';
$string['currentmoderators'] = 'Current Moderators';
$string['delete'] = 'Delete';
$string['deleteforum'] = 'Delete forum';
$string['deletedpost'] = 'This post has been deleted';
$string['deletepost'] = 'Delete post';
$string['deletepostvariable'] = 'Delete post \'%s\'';
......@@ -32,6 +58,7 @@ $string['edittopic'] = 'Edit topic';
$string['forumsuccessfulsubscribe'] = 'Forum subscribed successfully';
$string['forumsuccessfulunsubscribe'] = 'Forum unsubscribed successfully';
$string['moderators'] = 'Moderators';
$string['moderatorsdescription'] = 'Moderators can edit and delete topics and posts. They can also open, close, set and unset topics as sticky';
$string['name'] = 'Forum';
$string['nameplural'] = 'Forums';
$string['newforum'] = 'New forum';
......@@ -45,7 +72,8 @@ $string['post'] = 'Post';
$string['postedin'] = '%s posted in %s';
$string['poster'] = 'Poster';
$string['postreply'] = 'Post reply';
$string['posts'] = 'Posts: %s';
$string['posts'] = 'Posts';
$string['postsvariable'] = 'Posts: %s';
$string['potentialmoderators'] = 'Potential Moderators';
$string['re'] ='Re: %s';
$string['regulartopics'] = 'Regular topics';
......@@ -55,9 +83,16 @@ $string['stickytopics'] = 'Sticky topics';
$string['subscribe'] = 'Subscribe';
$string['subject'] = 'Subject';
$string['topic'] = 'Topic';
$string['topiclower'] = 'topic';
$string['topics'] = 'Topics: %s';
$string['topicslower'] = 'topics';
$string['topicclosedsuccess'] = 'Topics were closed successfully';
$string['topicstickysuccess'] = 'Topics were set as sticky successfully';
$string['topicsubscribesuccess'] = 'Topics subscribed successfully';
$string['topicupdatefailed'] = 'Topics update failed';
$string['typenewpost'] = 'New post';
$string['unsubscribe'] = 'Unsubscribe';
$string['weight'] = 'Weight';
$string['weightdescription'] = 'The weight controls the order of forums. Forums with lower weights appear above forums with higher weights';
?>
......@@ -138,14 +138,8 @@ class PluginInteractionForum extends PluginInteraction {
'forum'
);
}
execute_sql(
'UPDATE {interaction_forum_post}
SET sent = 1
WHERE ctime < ?
AND deleted != 1
AND sent = 0',
array(db_format_timestamp($currenttime - 30 * 60))
);
set_field_select('interaction_forum_post', 'sent', 1,
'ctime < ? AND deleted = 0 AND sent = 0', array(db_format_timestamp($currenttime - 30 * 60)));
}
}
}
......
......@@ -3,20 +3,14 @@
{include file="columnleftstart.tpl"}
<p>
<a href="{$breadcrumbs[0][0]|escape}">{$breadcrumbs[0][1]|escape}</a>
{foreach from=$breadcrumbs[1] item=item}
&raquo <a href="{$item[0]|escape}">{$item[1]|escape}</a>
{/foreach}
</p>
<h2>{$topicsubject|escape} - {$heading|escape}</h2>
<h2>{$topicsubject|escape}</h2>
<h3>{$heading|escape}</h3>
{include file="interaction:forum:breadcrumbs.tpl" breadcrumbs=$breadcrumbs}
<h4>{$post->subject|escape}</h4>
<h5>{$post->poster|display_name|escape}</h5>
<h5>{str tag="posts" section=interaction.forum} {$post->count|escape}</h5>
<div><img src="{$WWWROOT}thumb.php?type=profileicon&maxsize=100&id={$post->poster}" alt=""></div>
<div><img src="{$WWWROOT}thumb.php?type=profileicon&amp;maxsize=100&amp;id={$post->poster}" alt=""></div>
<p>{$post->body}</p>
{$deleteform}
......
......@@ -3,20 +3,14 @@
{include file="columnleftstart.tpl"}
<p>
<a href="{$breadcrumbs[0][0]|escape}">{$breadcrumbs[0][1]|escape}</a>
{foreach from=$breadcrumbs[1] item=item}
&raquo <a href="{$item[0]|escape}">{$item[1]|escape}</a>
{/foreach}
</p>
<h2>{$forum|escape} - {$heading|escape}</h2>
<h2>{$forum|escape}</h2>
<h3>{$heading|escape}</h3>
{include file="interaction:forum:breadcrumbs.tpl" breadcrumbs=$breadcrumbs}
<h4>{$topic->subject|escape}</h4>
<h5>{$topic->poster|display_name|escape}</h5>
<h5>{str tag="posts" section=interaction.forum} {$topic->count|escape}</h5>
<div><img src="{$WWWROOT}thumb.php?type=profileicon&maxsize=100&id={$topic->poster}" alt=""></div>
<div><img src="{$WWWROOT}thumb.php?type=profileicon&amp;maxsize=100&amp;id={$topic->poster}" alt=""></div>
<p>{$topic->body}</p>
{$deleteform}
......
......@@ -3,15 +3,8 @@
{include file="columnleftstart.tpl"}
<p>
<a href="{$breadcrumbs[0][0]|escape}">{$breadcrumbs[0][1]|escape}</a>
{foreach from=$breadcrumbs[1] item=item}
&raquo <a href="{$item[0]|escape}">{$item[1]|escape}</a>
{/foreach}
</p>
<h2>{$topicsubject|escape}</h2>
<h3>{$heading|escape}</h3>
<h2>{$topicsubject|escape} - {$heading|escape}</h2>
{include file="interaction:forum:breadcrumbs.tpl" breadcrumbs=$breadcrumbs}
{$editform}
{include file="columnleftend.tpl"}
......
......@@ -3,15 +3,8 @@
{include file="columnleftstart.tpl"}
<p>
<a href="{$breadcrumbs[0][0]|escape}">{$breadcrumbs[0][1]|escape}</a>
{foreach from=$breadcrumbs[1] item=item}
&raquo <a href="{$item[0]|escape}">{$item[1]|escape}</a>
{/foreach}
</p>
<h2>{$forum|escape}</h2>
<h3>{$heading|escape}</h3>
<h2>{$forum|escape} - {$heading|escape}</h2>
{include file="interaction:forum:breadcrumbs.tpl" breadcrumbs=$breadcrumbs}
{$editform}
{include file="columnleftend.tpl"}
......
......@@ -4,7 +4,7 @@
<h4>{$post->subject|escape}</h4>
<h5>{$post->poster|display_name|escape}</h5>
<h5>{str tag="posts" section=interaction.forum} {$post->count|escape}</h5>
<div><img src="{$WWWROOT}thumb.php?type=profileicon&maxsize=100&id={$post->poster}" alt=""></div>
<div><img src="{$WWWROOT}thumb.php?type=profileicon&amp;maxsize=100&amp;id={$post->poster}" alt=""></div>
<p>{$post->body}</p>
{if $moderator || !$closed}<a href="{$WWWROOT}interaction/forum/editpost.php?parent={$post->id|escape}">{str tag="reply" section=interaction.forum}</a>{/if}
{if $moderator || $post->editor}<a href="{$WWWROOT}interaction/forum/editpost.php?id={$post->id|escape}"> {str tag="edit"}</a>{/if}
......
......@@ -3,15 +3,8 @@
{include file="columnleftstart.tpl"}
<p>
<a href="{$breadcrumbs[0][0]|escape}">{$breadcrumbs[0][1]|escape}</a>
{foreach from=$breadcrumbs[1] item=item}
&raquo <a href="{$item[0]|escape}">{$item[1]|escape}</a>
{/foreach}
</p>
<h2>{$topic->forumtitle|escape}</h2>
<h3>{$topic->subject|escape}</h3>
<h2>{$topic->forumtitle|escape} - {$topic->subject|escape}</h2>
{include file="interaction:forum:breadcrumbs.tpl" breadcrumbs=$breadcrumbs}
{if $moderator}
<a href="{$WWWROOT}interaction/forum/edittopic.php?id={$topic->id|escape}">{str tag="edit"}</a>
<a href="{$WWWROOT}interaction/forum/deletetopic.php?id={$topic->id|escape}">{str tag="delete"}</a>
......
......@@ -34,20 +34,13 @@ define('TITLE', get_string('topic','interaction.forum'));
$topicid = param_integer('id');
$topic = get_record_sql(
'SELECT p.subject, f.group, f.id AS forumid, f.title as forumtitle, t.closed, t.id, sf.forum AS forumsubscribed, st.topic AS topicsubscribed
'SELECT p.subject, f.group, g.name AS groupname, f.id AS forumid, f.title as forumtitle, t.closed, t.id, sf.forum AS forumsubscribed, st.topic AS topicsubscribed