From: Geoffrey T. D. <da...@us...> - 2001-09-21 19:59:20
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv31426/lib Modified Files: Tag: release-1_2-branch savepage.php Log Message: Patch by Gary Benson <ga...@in...>: Remove empty date headers when updating RecentChanges. Index: savepage.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/savepage.php,v retrieving revision 1.7.2.1 retrieving revision 1.7.2.2 diff -C2 -r1.7.2.1 -r1.7.2.2 *** savepage.php 2001/02/08 18:28:31 1.7.2.1 --- savepage.php 2001/09/21 19:59:13 1.7.2.2 *************** *** 70,74 **** } ! $recentchanges['content'] = $newpage; InsertPage($dbi, gettext ("RecentChanges"), $recentchanges); --- 70,86 ---- } ! // 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); |