summaryrefslogtreecommitdiff
path: root/inc/html.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2005-09-18 14:10:08 +0200
committerAndreas Gohr <andi@splitbrain.org>2005-09-18 14:10:08 +0200
commitd437bcc4a25f62fad65e625f4bc13cab8873f994 (patch)
tree8036cb2794b499b87ff9d3a193148e181e9a8914 /inc/html.php
parentb7af031cf80338a83187f1fb75cfacf0bb24c103 (diff)
downloadrpg-d437bcc4a25f62fad65e625f4bc13cab8873f994.tar.gz
rpg-d437bcc4a25f62fad65e625f4bc13cab8873f994.tar.bz2
more efficient changelog reading for recent changes
getRecents now reads the changelog backwards in 4KB chunks instead of loading the whole file into an array and rsort it. This should be more memory efficient (and probably faster) for large change logs. Note: the format of the array returned by getRecents changed slightly plugins relying on it need to be adjusted. Sorry. darcs-hash:20050918121008-7ad00-1fdba47d29b0c038c6e4e4edc1d4c93e5ba769e9.gz
Diffstat (limited to 'inc/html.php')
-rw-r--r--inc/html.php20
1 files changed, 9 insertions, 11 deletions
diff --git a/inc/html.php b/inc/html.php
index 7c4e62cda..1e48b548c 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -469,15 +469,13 @@ function html_recent($first=0){
print p_locale_xhtml('recent');
print '<ul>';
- $keys = array_keys($recents);
- for ($n=0; $n < $cnt; $n++){
- $id = $keys[$n];
- $date = date($conf['dformat'],$recents[$id]['date']);
+ foreach($recents as $recent){
+ $date = date($conf['dformat'],$recent['date']);
print '<li>';
print $date.' ';
- print '<a href="'.wl($id,"do=diff").'">';
+ print '<a href="'.wl($recent['id'],"do=diff").'">';
$p = array();
$p['src'] = DOKU_BASE.'lib/images/diff.png';
$p['border'] = 0;
@@ -489,7 +487,7 @@ function html_recent($first=0){
print "<img $att />";
print '</a> ';
- print '<a href="'.wl($id,"do=revisions").'">';
+ print '<a href="'.wl($recent['id'],"do=revisions").'">';
$p = array();
$p['src'] = DOKU_BASE.'lib/images/history.png';
$p['border'] = 0;
@@ -501,14 +499,14 @@ function html_recent($first=0){
print "<img $att />";
print '</a> ';
- print html_wikilink(":$id",$conf['useheading']?NULL:$id);
+ print html_wikilink(':'.$recent['id'],$conf['useheading']?NULL:$recent['id']);
- print ' '.htmlspecialchars($recents[$id]['sum']);
+ print ' '.htmlspecialchars($recent['sum']);
print ' <span class="user">';
- if($recents[$id]['user']){
- print $recents[$id]['user'];
+ if($recent['user']){
+ print $recent['user'];
}else{
- print $recents[$id]['ip'];
+ print $recent['ip'];
}
print '</span>';