Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
mahara
mahara
Commits
e3189ab4
Commit
e3189ab4
authored
Dec 05, 2007
by
Clare Lenihan
Committed by
Clare Lenihan
Dec 05, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added breadcrumbs to top of pages
parent
2972699b
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
231 additions
and
49 deletions
+231
-49
htdocs/interaction/forum/deletepost.php
htdocs/interaction/forum/deletepost.php
+22
-2
htdocs/interaction/forum/deletetopic.php
htdocs/interaction/forum/deletetopic.php
+30
-16
htdocs/interaction/forum/editpost.php
htdocs/interaction/forum/editpost.php
+42
-3
htdocs/interaction/forum/edittopic.php
htdocs/interaction/forum/edittopic.php
+41
-5
htdocs/interaction/forum/index.php
htdocs/interaction/forum/index.php
+8
-0
htdocs/interaction/forum/lang/en.utf8/interaction.forum.php
htdocs/interaction/forum/lang/en.utf8/interaction.forum.php
+4
-2
htdocs/interaction/forum/theme/default/deletepost.tpl
htdocs/interaction/forum/theme/default/deletepost.tpl
+6
-0
htdocs/interaction/forum/theme/default/deletetopic.tpl
htdocs/interaction/forum/theme/default/deletetopic.tpl
+6
-0
htdocs/interaction/forum/theme/default/editpost.tpl
htdocs/interaction/forum/theme/default/editpost.tpl
+6
-0
htdocs/interaction/forum/theme/default/edittopic.tpl
htdocs/interaction/forum/theme/default/edittopic.tpl
+6
-0
htdocs/interaction/forum/theme/default/index.tpl
htdocs/interaction/forum/theme/default/index.tpl
+5
-0
htdocs/interaction/forum/theme/default/topic.tpl
htdocs/interaction/forum/theme/default/topic.tpl
+7
-0
htdocs/interaction/forum/theme/default/view.tpl
htdocs/interaction/forum/theme/default/view.tpl
+7
-0
htdocs/interaction/forum/topic.php
htdocs/interaction/forum/topic.php
+16
-0
htdocs/interaction/forum/view.php
htdocs/interaction/forum/view.php
+25
-21
No files found.
htdocs/interaction/forum/deletepost.php
View file @
e3189ab4
...
...
@@ -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
'SELECT p.subject, p.topic, p.parent, t.forum, p2.subject as topicsubject, f.group
, f.title as forumtitle
FROM {interaction_forum_post} p
INNER JOIN {interaction_forum_topic} t
ON p.topic = t.id
...
...
@@ -62,7 +62,26 @@ if (!$moderator) {
throw
new
AccessDeniedException
(
get_string
(
'cantdeletepost'
,
'interaction.forum'
));
}
define
(
'TITLE'
,
get_string
(
'deletepost'
,
'interaction.forum'
,
$post
->
subject
));
define
(
'TITLE'
,
get_string
(
'deletepostvariable'
,
'interaction.forum'
,
$post
->
subject
));
$breadcrumbs
=
array
(
array
(
get_config
(
'wwwroot'
)
.
'interaction/forum/index.php?group='
.
$post
->
group
,
get_string
(
'nameplural'
,
'interaction.forum'
)
),
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'
)
)
);
require_once
(
'pieforms/pieform.php'
);
...
...
@@ -92,6 +111,7 @@ function deletepost_submit(Pieform $form, $values) {
}
$smarty
=
smarty
();
$smarty
->
assign
(
'breadcrumbs'
,
$breadcrumbs
);
$smarty
->
assign
(
'topicsubject'
,
$post
->
topicsubject
);
$smarty
->
assign
(
'heading'
,
TITLE
);
$smarty
->
assign
(
'deleteform'
,
$form
);
...
...
htdocs/interaction/forum/deletetopic.php
View file @
e3189ab4
...
...
@@ -31,40 +31,54 @@ safe_require('interaction' ,'forum');
require
(
'group.php'
);
$topicid
=
param_integer
(
'id'
);
$
forum
=
get_record_sql
(
'SELECT f."group", f.id
, f.title
$
topic
=
get_record_sql
(
'SELECT f."group", f.id
as forumid, f.title, p.subject, p.body
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
WHERE t.id = ?
AND t.deleted != 1'
,
array
(
$topicid
)
);
if
(
!
$
forum
)
{
if
(
!
$
topic
)
{
throw
new
NotFoundException
(
get_string
(
'cantfindtopic'
,
'interaction.forum'
,
$topicid
));
}
$membership
=
user_can_access_group
((
int
)
$
forum
->
group
);
$membership
=
user_can_access_group
((
int
)
$
topic
->
group
);
$admin
=
(
bool
)(
$membership
&
GROUP_MEMBERSHIP_OWNER
);
$moderator
=
$admin
||
is_forum_moderator
((
int
)
$forum
->
id
);
$moderator
=
$admin
||
is_forum_moderator
((
int
)
$
topic
->
forumid
);
if
(
!
$moderator
)
{
throw
new
AccessDeniedException
(
get_string
(
'cantdeletetopic'
,
'interaction.forum'
));
}
$post
=
get_record_sql
(
'SELECT p.subject, p.body
FROM {interaction_forum_post} p
WHERE p.topic = ?
AND p.parent IS NULL'
,
array
(
$topicid
)
);
define
(
'TITLE'
,
get_string
(
'deletetopicvariable'
,
'interaction.forum'
,
$topic
->
subject
));
define
(
'TITLE'
,
get_string
(
'deletetopic'
,
'interaction.forum'
,
$post
->
subject
));
$breadcrumbs
=
array
(
array
(
get_config
(
'wwwroot'
)
.
'interaction/forum/index.php?group='
.
$topic
->
group
,
get_string
(
'nameplural'
,
'interaction.forum'
)
),
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'
)
)
);
require_once
(
'pieforms/pieform.php'
);
...
...
@@ -94,13 +108,13 @@ function deletepost_submit(Pieform $form, $values) {
FROM interaction_forum_topic
WHERE id = ?'
,
array
(
$topicid
)
);
$forumid
=
$forumid
->
forum
;
)
->
forum
;
redirect
(
'/interaction/forum/view.php?id='
.
$forumid
);
}
$smarty
=
smarty
();
$smarty
->
assign
(
'forum'
,
$forum
->
title
);
$smarty
->
assign
(
'breadcrumbs'
,
$breadcrumbs
);
$smarty
->
assign
(
'forum'
,
$topic
->
title
);
$smarty
->
assign
(
'heading'
,
TITLE
);
$smarty
->
assign
(
'deleteform'
,
$form
);
$smarty
->
display
(
'interaction:forum:deletetopic.tpl'
);
...
...
htdocs/interaction/forum/editpost.php
View file @
e3189ab4
...
...
@@ -40,7 +40,7 @@ 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.group
'SELECT p.topic AS id, p2.subject, t.closed, f.id AS forum,
f.title AS forumtitle,
f.group
FROM {interaction_forum_post} p
INNER JOIN {interaction_forum_topic} t
ON p.topic = t.id
...
...
@@ -72,12 +72,31 @@ if ($postid==0) {
$topicid
=
$topic
->
id
;
$topicsubject
=
$topic
->
subject
;
$breadcrumbs
=
array
(
array
(
get_config
(
'wwwroot'
)
.
'interaction/forum/index.php?group='
.
$topic
->
group
,
get_string
(
'nameplural'
,
'interaction.forum'
)
),
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'
)
)
);
}
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.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
FROM {interaction_forum_post} p
INNER JOIN {interaction_forum_topic} t
ON p.topic = t.id
...
...
@@ -96,7 +115,7 @@ if (isset($postid)) {
if
(
!
$post
)
{
throw
new
NotFoundException
(
get_string
(
'cantfindpost'
,
'interaction.forum'
,
$postid
));
}
$topicid
=
$post
->
topic
;
$topicsubject
=
$post
->
topicsubject
;
...
...
@@ -111,6 +130,25 @@ if (isset($postid)) {
||
(
time
()
-
strtotime
(
$post
->
ctime
))
>
(
30
*
60
)))
{
throw
new
AccessDeniedException
(
get_string
(
'canteditpost'
,
'interaction.forum'
));
}
$breadcrumbs
=
array
(
array
(
get_config
(
'wwwroot'
)
.
'interaction/forum/index.php?group='
.
$post
->
group
,
get_string
(
'nameplural'
,
'interaction.forum'
)
),
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'
)
)
);
}
require_once
(
'pieforms/pieform.php'
);
...
...
@@ -202,6 +240,7 @@ function editpost_submit(Pieform $form, $values) {
}
$smarty
=
smarty
();
$smarty
->
assign
(
'breadcrumbs'
,
$breadcrumbs
);
$smarty
->
assign
(
'topicsubject'
,
$topicsubject
);
$smarty
->
assign
(
'heading'
,
TITLE
);
$smarty
->
assign
(
'topic'
,
$topicsubject
);
...
...
htdocs/interaction/forum/edittopic.php
View file @
e3189ab4
...
...
@@ -38,8 +38,8 @@ if ($topicid==0) {
define
(
'TITLE'
,
get_string
(
'addtopic'
,
'interaction.forum'
));
$forumid
=
param_integer
(
'forum'
);
$forum
=
get_record_sql
(
'SELECT
"
group
"
AS group
id
, title
FROM {interaction_instance}
'SELECT
f.
group AS group,
f.
title
FROM {interaction_instance}
f
WHERE id = ?
AND deleted != 1'
,
array
(
$forumid
)
...
...
@@ -50,7 +50,7 @@ if ($topicid==0) {
}
$forumtitle
=
$forum
->
title
;
$membership
=
user_can_access_group
((
int
)
$forum
->
group
id
);
$membership
=
user_can_access_group
((
int
)
$forum
->
group
);
$admin
=
(
bool
)(
$membership
&
GROUP_MEMBERSHIP_OWNER
);
...
...
@@ -59,12 +59,27 @@ if ($topicid==0) {
if
(
!
$membership
)
{
throw
new
AccessDeniedException
(
get_string
(
'cantaddtopic'
,
'interaction.forum'
));
}
$breadcrumbs
=
array
(
array
(
get_config
(
'wwwroot'
)
.
'interaction/forum/index.php?group='
.
$forum
->
group
,
get_string
(
'nameplural'
,
'interaction.forum'
)
),
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'
)
)
);
}
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
id
, 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
FROM {interaction_forum_post} p
INNER JOIN {interaction_forum_topic} t
ON p.topic = t.id
...
...
@@ -84,7 +99,7 @@ if (isset($topicid)) {
$forumid
=
$topic
->
forumid
;
$forumtitle
=
$topic
->
title
;
$membership
=
user_can_access_group
((
int
)
$topic
->
group
id
);
$membership
=
user_can_access_group
((
int
)
$topic
->
group
);
$admin
=
(
bool
)(
$membership
&
GROUP_MEMBERSHIP_OWNER
);
...
...
@@ -93,6 +108,26 @@ if (isset($topicid)) {
if
(
!
$moderator
)
{
throw
new
AccessDeniedException
(
get_string
(
'cantedittopic'
,
'interaction.forum'
));
}
$breadcrumbs
=
array
(
array
(
get_config
(
'wwwroot'
)
.
'interaction/forum/index.php?group='
.
$topic
->
group
,
get_string
(
'nameplural'
,
'interaction.forum'
)
),
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'
)
)
);
}
require_once
(
'pieforms/pieform.php'
);
...
...
@@ -216,6 +251,7 @@ function edittopic_submit(Pieform $form, $values) {
}
$smarty
=
smarty
();
$smarty
->
assign
(
'breadcrumbs'
,
$breadcrumbs
);
$smarty
->
assign
(
'heading'
,
TITLE
);
$smarty
->
assign
(
'forum'
,
$forumtitle
);
$smarty
->
assign
(
'editform'
,
$editform
);
...
...
htdocs/interaction/forum/index.php
View file @
e3189ab4
...
...
@@ -51,6 +51,13 @@ if (!$membership) {
$admin
=
(
bool
)(
$membership
&
GROUP_MEMBERSHIP_OWNER
);
$breadcrumbs
=
array
(
array
(
get_config
(
'wwwroot'
)
.
'interaction/forum/index.php?group='
.
$groupid
,
get_string
(
'nameplural'
,
'interaction.forum'
)
)
);
$forums
=
get_records_sql_array
(
'SELECT f.id, f.title, f.description, COUNT(t.*), s.forum AS subscribed
FROM {interaction_instance} f
...
...
@@ -125,6 +132,7 @@ function subscribe_submit(Pieform $form, $values) {
}
$smarty
=
smarty
();
$smarty
->
assign
(
'breadcrumbs'
,
$breadcrumbs
);
$smarty
->
assign
(
'groupid'
,
$groupid
);
$smarty
->
assign
(
'groupname'
,
$groupname
);
$smarty
->
assign
(
'admin'
,
$admin
);
...
...
htdocs/interaction/forum/lang/en.utf8/interaction.forum.php
View file @
e3189ab4
...
...
@@ -19,9 +19,11 @@ $string['count'] = 'Count';
$string
[
'currentmoderators'
]
=
'Current Moderators'
;
$string
[
'delete'
]
=
'Delete'
;
$string
[
'deletedpost'
]
=
'This post has been deleted'
;
$string
[
'deletepost'
]
=
'Delete post \'%s\''
;
$string
[
'deletepost'
]
=
'Delete post'
;
$string
[
'deletepostvariable'
]
=
'Delete post \'%s\''
;
$string
[
'deletepostsure'
]
=
'Are you sure you want to do this? It cannot be undone.'
;
$string
[
'deletetopic'
]
=
'Delete topic \'%s\''
;
$string
[
'deletetopic'
]
=
'Delete topic'
;
$string
[
'deletetopicvariable'
]
=
'Delete topic \'%s\''
;
$string
[
'deletetopicsure'
]
=
'Are you sure you want to do this? It cannot be undone.'
;
$string
[
'edited'
]
=
'Edited'
;
$string
[
'editpost'
]
=
'Edit post'
;
...
...
htdocs/interaction/forum/theme/default/deletepost.tpl
View file @
e3189ab4
...
...
@@ -3,6 +3,12 @@
{
include
file
=
"columnleftstart.tpl"
}
<p>
{
foreach
from
=
$breadcrumbs
item
=
item
}
<a
href=
"
{
$item
[
0
]
}
"
>
{
$item
[
1
]|
escape
}
</a>
{/
foreach
}
</p>
<h2>
{
$topicsubject
|
escape
}
</h2>
<h3>
{
$heading
|
escape
}
</h3>
{
$deleteform
}
...
...
htdocs/interaction/forum/theme/default/deletetopic.tpl
View file @
e3189ab4
...
...
@@ -3,6 +3,12 @@
{
include
file
=
"columnleftstart.tpl"
}
<p>
{
foreach
from
=
$breadcrumbs
item
=
item
}
<a
href=
"
{
$item
[
0
]
}
"
>
{
$item
[
1
]|
escape
}
</a>
{/
foreach
}
</p>
<h2>
{
$forum
|
escape
}
</h2>
<h3>
{
$heading
|
escape
}
</h3>
{
$deleteform
}
...
...
htdocs/interaction/forum/theme/default/editpost.tpl
View file @
e3189ab4
...
...
@@ -3,6 +3,12 @@
{
include
file
=
"columnleftstart.tpl"
}
<p>
{
foreach
from
=
$breadcrumbs
item
=
item
}
<a
href=
"
{
$item
[
0
]
}
"
>
{
$item
[
1
]|
escape
}
</a>
{/
foreach
}
</p>
<h2>
{
$topicsubject
|
escape
}
</h2>
<h3>
{
$heading
|
escape
}
</h3>
{
$editform
}
...
...
htdocs/interaction/forum/theme/default/edittopic.tpl
View file @
e3189ab4
...
...
@@ -3,6 +3,12 @@
{
include
file
=
"columnleftstart.tpl"
}
<p>
{
foreach
from
=
$breadcrumbs
item
=
item
}
<a
href=
"
{
$item
[
0
]
}
"
>
{
$item
[
1
]|
escape
}
</a>
{/
foreach
}
</p>
<h2>
{
$forum
|
escape
}
</h2>
<h3>
{
$heading
|
escape
}
</h3>
{
$editform
}
...
...
htdocs/interaction/forum/theme/default/index.tpl
View file @
e3189ab4
...
...
@@ -3,6 +3,11 @@
{
include
file
=
"columnleftstart.tpl"
}
<p>
{
foreach
from
=
$breadcrumbs
item
=
item
}
<a
href=
"
{
$item
[
0
]
}
"
>
{
$item
[
1
]|
escape
}
</a>
{/
foreach
}
</p>
<h2>
{
$groupname
|
escape
}
</h2>
<h3>
{
str
tag
=
nameplural
section
=
interaction
.
forum
}
</h3>
{
if
$admin
}
...
...
htdocs/interaction/forum/theme/default/topic.tpl
View file @
e3189ab4
...
...
@@ -2,6 +2,13 @@
{
include
file
=
"sidebar.tpl"
}
{
include
file
=
"columnleftstart.tpl"
}
<p>
{
foreach
from
=
$breadcrumbs
item
=
item
}
<a
href=
"
{
$item
[
0
]
}
"
>
{
$item
[
1
]|
escape
}
</a>
{/
foreach
}
</p>
<h2>
{
$topic
->
forumtitle
|
escape
}
</h2>
<h3>
{
$topic
->
subject
|
escape
}
</h3>
{
if
$moderator
}
...
...
htdocs/interaction/forum/theme/default/view.tpl
View file @
e3189ab4
...
...
@@ -2,6 +2,13 @@
{
include
file
=
"sidebar.tpl"
}
{
include
file
=
"columnleftstart.tpl"
}
<p>
{
foreach
from
=
$breadcrumbs
item
=
item
}
<a
href=
"
{
$item
[
0
]
}
"
>
{
$item
[
1
]|
escape
}
</a>
{/
foreach
}
</p>
<h2>
{
$groupname
|
escape
}
</h2>
<h3>
{
$forum
->
title
|
escape
}
</h3>
<p>
{
$forum
->
description
}
</p>
...
...
htdocs/interaction/forum/topic.php
View file @
e3189ab4
...
...
@@ -67,6 +67,21 @@ $admin = (bool)($membership & GROUP_MEMBERSHIP_OWNER);
$moderator
=
$admin
||
is_forum_moderator
((
int
)
$topic
->
forumid
);
$breadcrumbs
=
array
(
array
(
get_config
(
'wwwroot'
)
.
'interaction/forum/index.php?group='
.
$topic
->
group
,
get_string
(
'nameplural'
,
'interaction.forum'
)
),
array
(
get_config
(
'wwwroot'
)
.
'interaction/forum/view.php?id='
.
$topic
->
forumid
,
$topic
->
forumtitle
),
array
(
get_config
(
'wwwroot'
)
.
'interaction/forum/topic?id='
.
$topic
->
id
,
$topic
->
subject
)
);
require_once
(
'pieforms/pieform.php'
);
if
(
!
$topic
->
forumsubscribed
)
{
...
...
@@ -135,6 +150,7 @@ foreach ($posts as $post) {
$threadedposts
=
buildthread
(
0
,
''
,
$posts
);
$smarty
=
smarty
();
$smarty
->
assign
(
'breadcrumbs'
,
$breadcrumbs
);
$smarty
->
assign
(
'topic'
,
$topic
);
$smarty
->
assign
(
'moderator'
,
$moderator
);
$smarty
->
assign
(
'posts'
,
$threadedposts
);
...
...
htdocs/interaction/forum/view.php
View file @
e3189ab4
...
...
@@ -36,21 +36,29 @@ $offset = param_integer('offset', 0);
$userid
=
$USER
->
get
(
'id'
);
$topicsperpage
=
25
;
$
group
=
get_record_sql
(
'SELECT
g.id, g.
name
$
forum
=
get_record_sql
(
'SELECT
f.title, f.description, f.id, COUNT(t.*), s.forum AS subscribed, g.id as groupid, g.name as group
name
FROM {interaction_instance} f
INNER JOIN {group} g
ON g.id = f."group"
LEFT JOIN {interaction_forum_topic} t
ON t.forum = f.id
AND t.deleted != 1
AND t.sticky != 1
LEFT JOIN {interaction_forum_subscription_forum} s
ON s.forum = f.id
AND s."user" = ?
WHERE f.id = ?
AND f.deleted != 1'
,
array
(
$forumid
)
AND f.deleted != 1
GROUP BY 1, 2, 3, 5, 6, 7'
,
array
(
$userid
,
$forumid
)
);
if
(
!
$
group
)
{
if
(
!
$
forum
)
{
throw
new
InteractionInstanceNotFoundException
(
get_string
(
'cantfindforum'
,
'interaction.forum'
,
$forumid
));
}
$membership
=
user_can_access_group
((
int
)
$group
->
id
);
$membership
=
user_can_access_group
((
int
)
$
forum
->
groupid
);
if
(
!
$membership
)
{
throw
new
AccessDeniedException
(
get_string
(
'cantviewforums'
,
'interaction.forum'
));
...
...
@@ -99,20 +107,15 @@ if ($moderator && isset($_POST['update'])) {
updatetopics
(
$_POST
[
'prevclosed'
],
$_POST
[
'closed'
],
'closed = 0'
);
}
$forum
=
get_record_sql
(
'SELECT f.title, f.description, f.id, COUNT(t.*), s.forum AS subscribed
FROM {interaction_instance} f
LEFT JOIN {interaction_forum_topic} t
ON t.forum = f.id
AND t.deleted != 1
AND t.sticky != 1
LEFT JOIN {interaction_forum_subscription_forum} s
ON s.forum = f.id
AND s."user" = ?
WHERE f.id = ?
AND f.deleted != 1
GROUP BY 1, 2, 3, 5'
,
array
(
$userid
,
$forumid
)
$breadcrumbs
=
array
(
array
(
get_config
(
'wwwroot'
)
.
'interaction/forum/index.php?group='
.
$forum
->
groupid
,
get_string
(
'nameplural'
,
'interaction.forum'
)
),
array
(
get_config
(
'wwwroot'
)
.
'interaction/forum/view.php?id='
.
$forumid
,
$forum
->
title
)
);
require_once
(
'pieforms/pieform.php'
);
...
...
@@ -177,7 +180,8 @@ $pagination = build_pagination(array(
));
$smarty
=
smarty
();
$smarty
->
assign
(
'groupname'
,
$group
->
name
);
$smarty
->
assign
(
'breadcrumbs'
,
$breadcrumbs
);
$smarty
->
assign
(
'groupname'
,
$forum
->
groupname
);
$smarty
->
assign
(
'forum'
,
$forum
);
$smarty
->
assign
(
'moderator'
,
$moderator
);
$smarty
->
assign
(
'admin'
,
$admin
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment