Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -132,7 +132,7 @@ |
133 | 133 | } |
134 | 134 | |
135 | 135 | |
136 | | -function wfImageArchiveUrl( $name, $subdir="archive" ) |
| 136 | +function wfImageThumbUrl( $name, $subdir="thumb" ) |
137 | 137 | { |
138 | 138 | global $wgUploadPath; |
139 | 139 | |
— | — | @@ -142,6 +142,16 @@ |
143 | 143 | return wfUrlencode($url); |
144 | 144 | } |
145 | 145 | |
| 146 | +function wfImageArchiveUrl( $name ) |
| 147 | +{ |
| 148 | + global $wgUploadPath; |
| 149 | + |
| 150 | + $hash = md5( substr( $name, 15) ); |
| 151 | + $url = "{$wgUploadPath}/archive/" . $hash{0} . "/" . |
| 152 | + substr( $hash, 0, 2 ) . "/{$name}"; |
| 153 | + return wfUrlencode($url); |
| 154 | +} |
| 155 | + |
146 | 156 | function wfUrlencode ( $s ) |
147 | 157 | { |
148 | 158 | $ulink = urlencode( $s ); |
— | — | @@ -462,6 +472,11 @@ |
463 | 473 | return $dest; |
464 | 474 | } |
465 | 475 | |
| 476 | +function wfImageThumbDir( $fname , $subdir="thumb") |
| 477 | +{ |
| 478 | + return wfImageArchiveDir( $fname, $subdir ); |
| 479 | +} |
| 480 | + |
466 | 481 | function wfImageArchiveDir( $fname , $subdir="archive") |
467 | 482 | { |
468 | 483 | global $wgUploadDirectory; |
Index: trunk/phase3/includes/Skin.php |
— | — | @@ -1519,8 +1519,8 @@ |
1520 | 1520 | global $wgUseImageMagick; |
1521 | 1521 | $imgPath = wfImagePath( $name ); |
1522 | 1522 | $thumbName = $width."px-".$icon.$name; |
1523 | | - $thumbPath = wfImageArchiveDir( $thumbName, "thumb" )."/".$thumbName; |
1524 | | - $thumbUrl = wfImageArchiveUrl( $thumbName, "thumb" ); |
| 1523 | + $thumbPath = wfImageThumbDir( $thumbName )."/".$thumbName; |
| 1524 | + $thumbUrl = wfImageThumbUrl( $thumbName ); |
1525 | 1525 | |
1526 | 1526 | if ( (! file_exists( $thumbPath ) && file_exists( $imgPath )) |
1527 | 1527 | || ( filemtime($thumbPath) < filemtime($imgPath) ) ) { |