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

Added post infomation

parent f25abe07
......@@ -32,7 +32,7 @@ require_once('group.php');
$postid = param_integer('id');
$post = get_record_sql(
'SELECT p.subject, p.topic, p.parent, t.forum, p2.subject as topicsubject, f.group, f.title as forumtitle
'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.*)
FROM {interaction_forum_post} p
INNER JOIN {interaction_forum_topic} t
ON p.topic = t.id
......@@ -43,8 +43,19 @@ $post = get_record_sql(
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
WHERE p.id = ?
AND p.deleted != 1',
AND p.deleted != 1
GROUP BY 1, 2, 3, 4, 5, 6, 7, 8, 9',
array($postid)
);
......@@ -116,6 +127,7 @@ $smarty = smarty();
$smarty->assign('breadcrumbs', $breadcrumbs);
$smarty->assign('topicsubject', $post->topicsubject);
$smarty->assign('heading', TITLE);
$smarty->assign('post', $post);
$smarty->assign('deleteform', $form);
$smarty->display('interaction:forum:deletepost.tpl');
......
......@@ -32,7 +32,7 @@ require('group.php');
$topicid = param_integer('id');
$topic = get_record_sql(
'SELECT f."group", f.id as forumid, f.title, p.subject, p.body
'SELECT f."group", f.id as forumid, f.title, 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
......@@ -40,8 +40,19 @@ $topic = get_record_sql(
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',
AND t.deleted != 1
GROUP BY 1, 2, 3, 4, 5, 6, 8',
array($topicid)
);
......@@ -118,6 +129,7 @@ $smarty = smarty();
$smarty->assign('breadcrumbs', $breadcrumbs);
$smarty->assign('forum', $topic->title);
$smarty->assign('heading', TITLE);
$smarty->assign('topic', $topic);
$smarty->assign('deleteform', $form);
$smarty->display('interaction:forum:deletetopic.tpl');
......
......@@ -12,6 +12,13 @@
<h2>{$topicsubject|escape}</h2>
<h3>{$heading|escape}</h3>
<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>
<p>{$post->body}</p>
{$deleteform}
{include file="columnleftend.tpl"}
......
......@@ -12,6 +12,13 @@
<h2>{$forum|escape}</h2>
<h3>{$heading|escape}</h3>
<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>
<p>{$topic->body}</p>
{$deleteform}
{include file="columnleftend.tpl"}
......
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