1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-12-22 13:45:02 +00:00

Enforce day separator on recent changes page mroe strongly. Fixes #110.

This commit is contained in:
Starbeamrainbowlabs 2016-10-01 11:37:42 +01:00
parent 6476877c60
commit 6780ce18bb
3 changed files with 11 additions and 9 deletions

View file

@ -2008,10 +2008,11 @@ function render_recent_changes($recent_changes)
if(date("dmY", $recent_changes[$i]->timestamp) !== date("dmY", $recent_changes[$s]->timestamp))
break;
// If we have found a change that has been made on the same page as
// the one that we are scanning for, move it up next to the change
// we are scanning for.
if($recent_changes[$i]->page == $recent_changes[$s]->page)
// If we have found a change that has been made on the same page and
// on the same day as the one that we are scanning for, move it up
// next to the change we are scanning for.
if($recent_changes[$i]->page == $recent_changes[$s]->page &&
date("j", $recent_changes[$i]->timestamp) === date("j", $recent_changes[$s]->timestamp))
{
// FUTURE: We may need to remove and insert instead of swapping changes around if this causes some changes to appear out of order.
$temp = $recent_changes[$i + 1];

View file

@ -50,7 +50,7 @@
"author": "Starbeamrainbowlabs",
"description": "Adds recent changes. Access through the 'recent-changes' action.",
"id": "feature-recent-changes",
"lastupdate": 1476813264,
"lastupdate": 1476813444,
"optional": false
},
{

View file

@ -117,10 +117,11 @@ function render_recent_changes($recent_changes)
if(date("dmY", $recent_changes[$i]->timestamp) !== date("dmY", $recent_changes[$s]->timestamp))
break;
// If we have found a change that has been made on the same page as
// the one that we are scanning for, move it up next to the change
// we are scanning for.
if($recent_changes[$i]->page == $recent_changes[$s]->page)
// If we have found a change that has been made on the same page and
// on the same day as the one that we are scanning for, move it up
// next to the change we are scanning for.
if($recent_changes[$i]->page == $recent_changes[$s]->page &&
date("j", $recent_changes[$i]->timestamp) === date("j", $recent_changes[$s]->timestamp))
{
// FUTURE: We may need to remove and insert instead of swapping changes around if this causes some changes to appear out of order.
$temp = $recent_changes[$i + 1];