From: Gary B. <ga...@in...> - 2001-09-10 23:16:42
|
Hi guys, Not sure if this will be useful or not (I'm not up to date with the CVS versions) but here is a patch to phpwiki-1.2.0 to remove empty slots on RecentChanges whenever a page is saved. Hope it's useful, Gary [ ga...@in... ][ GnuPG 85A8F78B ][ http://inauspicious.org/ ] --- phpwiki-1.2.0/lib/savepage.php Thu Jan 4 18:30:32 2001 +++ phpwiki/lib/savepage.php Tue Sep 11 00:00:22 2001 @@ -69,7 +69,19 @@ } } - $recentchanges['content'] = $newpage; + // copy the new page back into recentchanges, skipping empty days + $numlines = sizeof($newpage); + $recentchanges['content'] = array(); + $k = 0; + for ($i = 0; $i < $numlines; $i++) { + if ($i != $numlines-1 && + preg_match("/^____/", $newpage[$i]) && + preg_match("/^[\r\n]*$/", $newpage[$i+1])) { + $i++; + } else { + $recentchanges['content'][$k++] = $newpage[$i]; + } + } InsertPage($dbi, gettext ("RecentChanges"), $recentchanges); } |