Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
mahara
mahara
Commits
a18397f1
Commit
a18397f1
authored
Dec 19, 2007
by
Clare Lenihan
Committed by
Clare Lenihan
Dec 19, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor changes mostly around editing posts
parent
1c60426b
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
24 additions
and
19 deletions
+24
-19
htdocs/interaction/forum/editpost.php
htdocs/interaction/forum/editpost.php
+8
-5
htdocs/interaction/forum/lang/en.utf8/interaction.forum.php
htdocs/interaction/forum/lang/en.utf8/interaction.forum.php
+2
-1
htdocs/interaction/forum/theme/default/editpost.tpl
htdocs/interaction/forum/theme/default/editpost.tpl
+2
-2
htdocs/interaction/forum/theme/default/post.tpl
htdocs/interaction/forum/theme/default/post.tpl
+2
-2
htdocs/interaction/forum/theme/default/simplepost.tpl
htdocs/interaction/forum/theme/default/simplepost.tpl
+2
-2
htdocs/interaction/forum/theme/default/topics.tpl
htdocs/interaction/forum/theme/default/topics.tpl
+1
-1
htdocs/interaction/forum/theme/default/view.tpl
htdocs/interaction/forum/theme/default/view.tpl
+1
-1
htdocs/interaction/forum/topic.php
htdocs/interaction/forum/topic.php
+4
-3
htdocs/interaction/forum/view.php
htdocs/interaction/forum/view.php
+2
-2
No files found.
htdocs/interaction/forum/editpost.php
View file @
a18397f1
...
...
@@ -64,8 +64,11 @@ if ($postid == 0) { // post reply
$moderator
=
$admin
||
is_forum_moderator
((
int
)
$parent
->
forum
);
if
(
!
$membership
||
(
!
$moderator
&&
$parent
->
topicclosed
))
{
throw
new
AccessDeniedException
(
get_string
(
'cantaddpost'
,
'interaction.forum'
));
if
(
!
$membership
)
{
throw
new
AccessDeniedException
(
get_string
(
'cantaddposttoforum'
,
'interaction.forum'
));
}
if
(
!
$moderator
&&
$parent
->
topicclosed
)
{
throw
new
AccessDeniedException
(
get_string
(
'cantaddposttotopic'
,
'interaction.forum'
));
}
define
(
'TITLE'
,
$parent
->
topicsubject
.
' - '
.
get_string
(
'postreply'
,
'interaction.forum'
));
...
...
@@ -120,7 +123,8 @@ else { // edit post
$moderator
=
$admin
||
is_forum_moderator
((
int
)
$post
->
forum
);
if
(
$post
->
poster
==
$userid
&&
(
time
()
-
$post
->
ctime
)
<
(
30
*
60
))
{
// no record for edits to own posts with 30 minutes
if
(
$post
->
poster
==
$userid
&&
$post
->
ctime
>
(
time
()
-
30
*
60
))
{
$post
->
editrecord
=
false
;
}
else
if
(
$moderator
)
{
...
...
@@ -147,7 +151,7 @@ else { // edit post
),
array
(
get_config
(
'wwwroot'
)
.
'interaction/forum/topic.php?id='
.
$topicid
,
$topicsubject
$
post
->
topicsubject
),
array
(
get_config
(
'wwwroot'
)
.
'interaction/forum/editpost.php?id='
.
$postid
,
...
...
@@ -267,7 +271,6 @@ function addpost_submit(Pieform $form, $values) {
$smarty
=
smarty
();
$smarty
->
assign
(
'breadcrumbs'
,
$breadcrumbs
);
$smarty
->
assign
(
'heading'
,
TITLE
);
$smarty
->
assign
(
'topic'
,
$topicsubject
);
$smarty
->
assign
(
'editform'
,
$editform
);
if
(
isset
(
$parent
))
{
$smarty
->
assign
(
'parent'
,
$parent
);
...
...
htdocs/interaction/forum/lang/en.utf8/interaction.forum.php
View file @
a18397f1
...
...
@@ -30,7 +30,8 @@ $string['addtitle'] = 'Add forum';
$string
[
'addtopic'
]
=
'Add topic'
;
$string
[
'addtopicsuccess'
]
=
'Added topic successfully'
;
$string
[
'body'
]
=
'Body'
;
$string
[
'cantaddpost'
]
=
'You are not allowed to post in this forum'
;
$string
[
'cantaddposttoforum'
]
=
'You are not allowed to post in this forum'
;
$string
[
'cantaddposttotopic'
]
=
'You are not allowed to post in this topic'
;
$string
[
'cantaddtopic'
]
=
'You are not allowed to add topics to this forum'
;
$string
[
'cantdeletepost'
]
=
'You are not allowed to delete posts in this forum'
;
$string
[
'cantdeletetopic'
]
=
'You are not allowed to delete topics in this forum'
;
...
...
htdocs/interaction/forum/theme/default/editpost.tpl
View file @
a18397f1
...
...
@@ -6,12 +6,12 @@
<h2>
{
$heading
|
escape
}
</h2>
{
include
file
=
"interaction:forum:breadcrumbs.tpl"
breadcrumbs
=
$breadcrumbs
}
{
$editform
}
{
if
$parent
}
<h4>
{
str
tag
=
"replyto"
section
=
"interaction.forum"
}
</h4>
{
include
file
=
"interaction:forum:simplepost.tpl"
post
=
$parent
}
{/
if
}
{
$editform
}
{
include
file
=
"columnleftend.tpl"
}
{
include
file
=
"footer.tpl"
}
htdocs/interaction/forum/theme/default/post.tpl
View file @
a18397f1
...
...
@@ -4,8 +4,8 @@
{
include
file
=
"interaction:forum:simplepost.tpl"
post
=
$post
}
<div>
{
if
$moderator
||
!
$closed
}
<a
href=
"
{
$WWWROOT
}
interaction/forum/editpost.php?parent=
{
$post
->
id
|
escape
}
"
>
{
str
tag
=
"reply"
section
=
interaction
.
forum
}
</a>
{/
if
}
{
if
$moderator
||
(!
$closed
&&
$post
->
edit
or
)
}
|
{/
if
}
{
if
$moderator
||
$post
->
edit
or
}
<a
href=
"
{
$WWWROOT
}
interaction/forum/editpost.php?id=
{
$post
->
id
|
escape
}
"
>
{
str
tag
=
"edit"
}
</a>
{/
if
}
{
if
$moderator
||
(!
$closed
&&
$post
->
can
edit
)
}
|
{/
if
}
{
if
$moderator
||
$post
->
can
edit
}
<a
href=
"
{
$WWWROOT
}
interaction/forum/editpost.php?id=
{
$post
->
id
|
escape
}
"
>
{
str
tag
=
"edit"
}
</a>
{/
if
}
{
if
$moderator
}
|
<a
href=
"
{
$WWWROOT
}
interaction/forum/deletepost.php?id=
{
$post
->
id
|
escape
}
"
>
{
str
tag
=
"delete"
}
</a>
{/
if
}
</div>
{
if
$post
->
edit
}
...
...
htdocs/interaction/forum/theme/default/simplepost.tpl
View file @
a18397f1
...
...
@@ -2,5 +2,5 @@
{
$post
->
ctime
}
<h5><a
href=
"
{
$WWWROOT
}
user/view.php?id=
{
$post
->
poster
}
"
>
{
$post
->
poster
|
display_name
|
escape
}
</a></h5>
<div><img
src=
"
{
$WWWROOT
}
thumb.php?type=profileicon&maxsize=100&id=
{
$post
->
poster
}
"
alt=
""
></div>
<h5>
{
str
tag
=
"posts"
section
=
interaction
.
forum
}
{
$post
->
count
|
escape
}
</h5>
{
$post
->
body
}
\ No newline at end of file
<h5>
{
str
tag
=
"postsvariable"
section
=
interaction
.
forum
args
=
$post
->
count
}
</h5>
{
$post
->
body
}
htdocs/interaction/forum/theme/default/topics.tpl
View file @
a18397f1
...
...
@@ -20,7 +20,7 @@
</td>
<td>
<a
href=
"
{
$WWWROOT
}
user/view.php?id=
{
$topic
->
poster
}
"
>
<img
src=
"
{
$WWWROOT
}
thumb.php?type=profileicon&size=20
x20
&id=
{
$topic
->
poster
}
"
alt=
""
>
<img
src=
"
{
$WWWROOT
}
thumb.php?type=profileicon&
max
size=20&id=
{
$topic
->
poster
}
"
alt=
""
>
{
$topic
->
poster
|
display_name
|
escape
}
</a>
</td>
...
...
htdocs/interaction/forum/theme/default/view.tpl
View file @
a18397f1
...
...
@@ -37,7 +37,7 @@
{/
if
}
<table>
<tr>
<th>
</th>
<th></th>
{
if
!
$forum
->
subscribed
||
$moderator
}
<th></th>
{/
if
}
<th>
{
str
tag
=
"topic"
section
=
"interaction.forum"
}
</th>
<th>
{
str
tag
=
"poster"
section
=
"interaction.forum"
}
</th>
...
...
htdocs/interaction/forum/topic.php
View file @
a18397f1
...
...
@@ -111,8 +111,8 @@ $posts = get_records_sql_array(
INNER JOIN {interaction_instance} f ON (t.forum = f.id AND f.deleted != 1 AND f.group = ?)
LEFT JOIN {interaction_forum_edit} e ON e.post = p1.id
WHERE p1.topic = ?
GROUP BY 1, 2, 3, 4, 5, p1.ctime, 7, 9, 10
ORDER BY p1.ctime, p1.id'
,
GROUP BY 1, 2, 3, 4, 5, p1.ctime, 7, 9, 10
, e.ctime
ORDER BY p1.ctime, p1.id
, e.ctime
'
,
array
(
$topic
->
group
,
$topicid
)
);
// $posts has an object for every edit to a post
...
...
@@ -133,10 +133,11 @@ for ($i = 0; $i < $count; $i++) {
$posts
[
$temp
]
->
edit
=
$postedits
;
}
// works out if the logged in user can edit each post
// users can edit own posts within 30 minutes of making them
// and formats the post time
foreach
(
$posts
as
$post
)
{
if
(
$moderator
||
(
$post
->
poster
==
$USER
->
get
(
'id'
)
&&
(
time
()
-
$post
->
ctime
)
<
(
30
*
60
)))
{
(
$post
->
poster
==
$USER
->
get
(
'id'
)
&&
$post
->
ctime
>
(
time
()
-
30
*
60
)))
{
$post
->
canedit
=
true
;
}
else
{
...
...
htdocs/interaction/forum/view.php
View file @
a18397f1
...
...
@@ -184,7 +184,7 @@ $sql = 'SELECT t.id, p1.subject, p1.body, p1.poster, p1.deleted, COUNT(p2.*), t.
AND t.sticky = ?
AND t.deleted != 1
GROUP BY 1, 2, 3, 4, 5, 7, 8, p4.ctime, p4.poster, p4.deleted, p4.id
ORDER BY p4.ctime DESC,
t.id,
p4.id DESC'
;
ORDER BY p4.ctime DESC, p4.id DESC'
;
$stickytopics
=
get_records_sql_array
(
$sql
,
array
(
$userid
,
$forumid
,
1
));
...
...
@@ -237,7 +237,7 @@ function setup_topics(&$topics) {
}
if
(
!
$topic
->
lastpostdeleted
)
{
$topic
->
lastposttime
=
strftime
(
get_string
(
'strftimerecent'
),
$topic
->
lastposttime
);
}
}
}
}
}
...
...
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