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
b823c64b
Commit
b823c64b
authored
Feb 27, 2014
by
Robert Lyon
Committed by
Gerrit Code Review
Feb 27, 2014
Browse files
Merge "Display the published day for RSS feeds (Bug #661602)"
parents
3a190471
ec625ec9
Changes
3
Hide whitespace changes
Inline
Side-by-side
htdocs/blocktype/externalfeed/lang/en.utf8/blocktype.externalfeed.php
View file @
b823c64b
...
...
@@ -29,5 +29,6 @@ $string['showfeeditemsinfulldesc'] = 'Whether to show a summary of the feed item
$string
[
'invalidurl'
]
=
'That URL is invalid. You can only view feeds for http and https URLs.'
;
$string
[
'invalidfeed'
]
=
'The feed appears to be invalid. The error reported was: %s'
;
$string
[
'lastupdatedon'
]
=
'Last updated on %s'
;
$string
[
'publishedon'
]
=
'Published on %s'
;
$string
[
'defaulttitledescription'
]
=
'If you leave this blank, the title of the feed will be used.'
;
$string
[
'reenterpassword'
]
=
'Because you have changed the URL of the feed, please re-enter (or delete) the password.'
;
htdocs/blocktype/externalfeed/lib.php
View file @
b823c64b
...
...
@@ -63,8 +63,9 @@ class PluginBlocktypeExternalfeed extends SystemBlocktype {
$chunks
=
array_chunk
(
$data
->
content
,
isset
(
$configdata
[
'count'
])
?
$configdata
[
'count'
]
:
10
);
$data
->
content
=
$chunks
[
0
];
foreach
(
$data
->
content
as
$k
=>
$c
)
{
$data
->
content
[
$k
]
->
link
=
sanitize_url
(
$c
->
link
);
foreach
(
$data
->
content
as
&
$c
)
{
$c
->
link
=
sanitize_url
(
$c
->
link
);
$c
->
pubdate
=
!
empty
(
$c
->
pubdate
)
?
format_date
(
$c
->
pubdate
)
:
null
;
}
}
...
...
@@ -434,7 +435,20 @@ class PluginBlocktypeExternalfeed extends SystemBlocktype {
$item
->
title
=
get_string
(
'notitle'
,
'view'
);
}
}
$data
->
content
[]
=
(
object
)
array
(
'title'
=>
$item
->
title
,
'link'
=>
$item
->
link
,
'description'
=>
$description
);
if
(
!
$pubdate
=
$item
->
pubDate
)
{
if
(
!
$pubdate
=
$item
->
date
)
{
if
(
!
$pubdate
=
$item
->
published
)
{
$pubdate
=
$item
->
updated
;
};
}
}
$data
->
content
[]
=
(
object
)
array
(
'title'
=>
$item
->
title
,
'link'
=>
$item
->
link
,
'description'
=>
$description
,
'pubdate'
=>
$pubdate
,
);
}
$cache
[
$source
]
=
$data
;
return
$data
;
...
...
htdocs/blocktype/externalfeed/theme/raw/feed.tpl
View file @
b823c64b
...
...
@@ -15,6 +15,9 @@
{
$entry
->
title
}
{
if
$entry
->
link
}
</a>
{/
if
}
</h3>
<span
class=
"postdetails"
>
{
if
$entry
->
pubdate
}{
str
tag
=
publishedon
section
=
blocktype
.
externalfeed
arg1
=
$entry
->
pubdate
}{/
if
}
</span>
<div
class=
"feedcontent"
>
{
$entry
->
description
|
clean_html
|
safe
}
</div>
{/
foreach
}
{
else
}
...
...
@@ -23,7 +26,10 @@
<li>
{
if
$entry
->
link
}
<a
href=
"
{
$entry
->
link
}
"
>
{/
if
}
{
$entry
->
title
}
{
if
$entry
->
link
}
</a>
{/
if
}
{
if
$entry
->
link
}
</a>
{/
if
}
<br
/>
<span
class=
"postdetails"
>
{
if
$entry
->
pubdate
}{
str
tag
=
publishedon
section
=
blocktype
.
externalfeed
arg1
=
$entry
->
pubdate
}{/
if
}
</span>
</li>
{/
foreach
}
</ol>
...
...
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