Commit aee07961 authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files

Show latest forum posts on the group homepage.

parent 2106da31
......@@ -51,12 +51,34 @@ $offset = param_integer('offset', 0);
$limit = param_integer('limit', 5);
list($html, $pagination, $count, $offset) = group_get_membersearch_data($id, $query, $offset, $limit);
// Latest forums posts
// NOTE: it would be nicer if there was some generic way to get information
// from any installed interaction. But the only interaction plugin is forum,
// and group info pages might be replaced with views anyway...
$foruminfo = get_records_sql_array('
SELECT, p.subject, p.body, p.poster, p.topic,, pt.subject AS topicname
{interaction_forum_post} p
INNER JOIN {interaction_forum_topic} t ON ( = p.topic)
INNER JOIN {interaction_instance} i ON ( =
INNER JOIN {interaction_forum_post} pt ON (pt.topic = p.topic AND pt.parent IS NULL)
AND i.deleted = 0
AND t.deleted = 0
AND p.deleted = 0
p.ctime DESC
', array($id));
$smarty = smarty(array('paginator', 'groupmembersearch'), array(), array(), array('sideblocks' => array(interaction_sideblock($id, $role))));
$smarty->assign('group', $group);
$smarty->assign('query', $query);
$smarty->assign('results', $html);
$smarty->assign('pagination', $pagination['html']);
$smarty->assign('pagination_js', $pagination['javascript']);
$smarty->assign('foruminfo', $foruminfo);
......@@ -42,17 +42,15 @@
<h3>Latest Forum Posts</h3>
<th>Thread/Thread Starter</th>
<th>Latest Post</th>
<td><a href="">Whatever</a><br><a href="">Mike</a></td>
<td>This is some content of some post...</td>
<h3>{str tag=latestforumposts section=group}</h3>
{foreach from=$foruminfo item=postinfo}
<h4><a href="{$WWWROOT}interaction/forum/topic.php?id={$postinfo->topic|escape}#post{$postinfo->id|escape}">{$postinfo->topicname|escape}</a></h4>
<div><a href="{$WWWROOT}user/view.php?id={$postinfo->poster|escape}">{$postinfo->poster|display_name|escape}</a></div>
<p><a href="{$WWWROOT}interaction/forum/?group={$group->id|escape}">{str tag=gotoforums} &raquo;</a></p>
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