Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
27614413
Commit
27614413
authored
Dec 05, 2008
by
Nigel McNie
Browse files
[UPSTREAM] Format blog post dates using format_date. Thanks to Heinz.
parent
d899c17a
Changes
1
Show whitespace changes
Inline
Side-by-side
htdocs/artefact/blog/lib.php
View file @
27614413
...
...
@@ -548,7 +548,7 @@ class ArtefactTypeBlogPost extends ArtefactType {
*/
public
static
function
get_posts
(
User
$user
,
$id
,
$limit
=
self
::
pagination
,
$offset
=
0
)
{
(
$result
=
get_records_sql_assoc
(
"
SELECT a.id, a.title, a.description,
a.ctime, a.mtime
, bp.published
SELECT a.id, a.title, a.description,
"
.
db_format_tsfield
(
'a.ctime'
,
'ctime'
)
.
', '
.
db_format_tsfield
(
'a.mtime'
,
'mtime'
)
.
"
, bp.published
FROM
{
artefact
}
a
LEFT OUTER JOIN
{
artefact_blog_blogpost
}
bp
ON a.id = bp.blogpost
...
...
@@ -567,8 +567,8 @@ class ArtefactTypeBlogPost extends ArtefactType {
$count
=
(
int
)
get_field
(
'artefact'
,
'COUNT(*)'
,
'owner'
,
$user
->
get
(
'id'
),
'artefacttype'
,
'blogpost'
,
'parent'
,
$id
);
// Get the attached files.
if
(
count
(
$result
)
>
0
)
{
// Get the attached files.
$idlist
=
implode
(
', '
,
array_map
(
create_function
(
'$a'
,
'return $a->id;'
),
$result
));
$files
=
get_records_sql_array
(
'
SELECT
...
...
@@ -581,6 +581,12 @@ class ArtefactTypeBlogPost extends ArtefactType {
$result
[
$file
->
blogpost
]
->
files
[]
=
$file
;
}
}
// Format dates properly
foreach
(
$result
as
&
$post
)
{
$post
->
ctime
=
format_date
(
$post
->
ctime
,
'strftimedaydatetime'
);
$post
->
mtime
=
format_date
(
$post
->
mtime
);
}
}
return
array
(
$count
,
array_values
(
$result
));
...
...
Write
Preview
Supports
Markdown
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