Kleiner Hack...
Mich hat es auch seh geärgert, dass ich nicht mehr wie gewohnt meine Bilder hochladen konnte. Dazu habe ich auch die Probleme mit den Rechten. Da mein Provider sich ausser Standes sah hieran etwas zu ändern, habe ich selbst Hand angelegt und die Funktion wp_upload_dir() in functions-post-php etwas verändert, so dass es wie vorher unter 1.5 funktioniert.
functions-post.php ab Zeile 838:
function wp_upload_dir() {
if ( defined('UPLOADS') )
$dir = UPLOADS;
else
$dir = 'wp-content/uploads';
$path = ABSPATH . $dir;
// Ab hier auskommentieren
/*
// Give the new dirs the same perms as wp-content.
$stat = stat(ABSPATH . 'wp-content');
$dir_perms = $stat['mode'] & 0000777; // Get the permission bits.
// Make sure we have an uploads dir
if ( ! file_exists( $path ) ) {
if ( ! @ mkdir( $path ) )
return array('error' => "Unable to create directory $path. Is its parent directory writable by the server?");
@ chmod( $path, $dir_perms );
}
// Generate the yearly and monthly dirs
$time = current_time( 'mysql' );
$y = substr( $time, 0, 4 );
$m = substr( $time, 5, 2 );
$pathy = "$path/$y";
$pathym = "$path/$y/$m";
// Make sure we have a yearly dir
if ( ! file_exists( $pathy ) ) {
if ( ! @ mkdir( $pathy ) )
return array('error' => "Unable to create directory $pathy. Is $path writable?");
@ chmod( $pathy, $dir_perms );
}
// Make sure we have a monthly dir
if ( ! file_exists( $pathym ) ) {
if ( ! @ mkdir( $pathym ) )
return array('error' => "Unable to create directory $pathym. Is $pathy writable?");
@ chmod( $pathym, $dir_perms );
}
$uploads = array('path' => $pathym, 'url' => get_option('siteurl') . "/$dir/$y/$m", 'error' => false);
*/
// HIER IST DER HACK!!!
$uploads = array('path' => $path, 'url' => get_option('siteurl') . "/$dir", 'error' => false);
return apply_filters('upload_dir', $uploads);
}
Alles anzeigen
Das Auskommentieren unterdrückt das Erstellen von Ordnern, die Zeile
bewirkt, dass die Dateien in /uploads oder dem in der Variable UPLOADS definiertem Verzeichnis abgelegt werden.
[UPDATE]
Ich bin der Meinung, dass man diese kleine Änderung in der functions-post.php einfach per Option aktivieren oder deaktivieren könnte, so dass User mit Problemen bei den Rechten alles wie bei der alten Version handhaben könnten. Ausserdem sollte der User die Wahl haben, wie er seine Dateien uploaden will.
Viel Spaß
Stahlmut