mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-11-25 05:22:59 +00:00
Group recent changes entries by day. Fixes #56.
This commit is contained in:
parent
187c45ee6a
commit
0f288aa195
4 changed files with 15 additions and 3 deletions
|
@ -5,7 +5,7 @@ $start_time = time(true);
|
|||
/*
|
||||
* Pepperminty Wiki
|
||||
* ================
|
||||
* Inspired by Minty Wiki by am2064:
|
||||
* Inspired by Minty Wiki by am2064
|
||||
* Link: https://github.com/am2064/Minty-Wiki
|
||||
*
|
||||
* Credits:
|
||||
|
@ -1693,9 +1693,15 @@ function add_recent_change($rchange)
|
|||
function render_recent_changes($recentchanges)
|
||||
{
|
||||
$content = "<ul class='page-list'>\n";
|
||||
$last_time = 0;
|
||||
foreach($recentchanges as $rchange)
|
||||
{
|
||||
if($last_time !== date("dmY", $rchange->timestamp))
|
||||
$content .= "<li><h2>" . date("jS F", $rchange->timestamp) . "</h2></li>\n";
|
||||
|
||||
$content .= render_recent_change($rchange);
|
||||
|
||||
$last_time = date("dmY", $rchange->timestamp);
|
||||
}
|
||||
$content .= "\t\t</ul>";
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
"author": "Starbeamrainbowlabs",
|
||||
"description": "Adds recent changes. Access through the 'recent-changes' action.",
|
||||
"id": "feature-recent-changes",
|
||||
"lastupdate": 1459695897,
|
||||
"lastupdate": 1459703430,
|
||||
"optional": false
|
||||
},
|
||||
{
|
||||
|
|
|
@ -97,9 +97,15 @@ function add_recent_change($rchange)
|
|||
function render_recent_changes($recentchanges)
|
||||
{
|
||||
$content = "<ul class='page-list'>\n";
|
||||
$last_time = 0;
|
||||
foreach($recentchanges as $rchange)
|
||||
{
|
||||
if($last_time !== date("dmY", $rchange->timestamp))
|
||||
$content .= "<li><h2>" . date("jS F", $rchange->timestamp) . "</h2></li>\n";
|
||||
|
||||
$content .= render_recent_change($rchange);
|
||||
|
||||
$last_time = date("dmY", $rchange->timestamp);
|
||||
}
|
||||
$content .= "\t\t</ul>";
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
/*
|
||||
* Pepperminty Wiki
|
||||
* ================
|
||||
* Inspired by Minty Wiki by am2064:
|
||||
* Inspired by Minty Wiki by am2064
|
||||
* Link: https://github.com/am2064/Minty-Wiki
|
||||
*
|
||||
* Credits:
|
||||
|
|
Loading…
Reference in a new issue