}
-function wfImageArchiveUrl( $name, $subdir="archive" )
+function wfImageThumbUrl( $name, $subdir="thumb" )
{
global $wgUploadPath;
return wfUrlencode($url);
}
+function wfImageArchiveUrl( $name )
+{
+ global $wgUploadPath;
+
+ $hash = md5( substr( $name, 15) );
+ $url = "{$wgUploadPath}/archive/" . $hash{0} . "/" .
+ substr( $hash, 0, 2 ) . "/{$name}";
+ return wfUrlencode($url);
+}
+
function wfUrlencode ( $s )
{
$ulink = urlencode( $s );
return $dest;
}
+function wfImageThumbDir( $fname , $subdir="thumb")
+{
+ return wfImageArchiveDir( $fname, $subdir );
+}
+
function wfImageArchiveDir( $fname , $subdir="archive")
{
global $wgUploadDirectory;
global $wgUseImageMagick;
$imgPath = wfImagePath( $name );
$thumbName = $width."px-".$icon.$name;
- $thumbPath = wfImageArchiveDir( $thumbName, "thumb" )."/".$thumbName;
- $thumbUrl = wfImageArchiveUrl( $thumbName, "thumb" );
+ $thumbPath = wfImageThumbDir( $thumbName )."/".$thumbName;
+ $thumbUrl = wfImageThumbUrl( $thumbName );
if ( (! file_exists( $thumbPath ) && file_exists( $imgPath ))
|| ( filemtime($thumbPath) < filemtime($imgPath) ) ) {