Buongiorno a tutti,
premetto che sono un brocco, ma mi diletto e per lo meno cerco di applicarmi
ho installato wp e ho inserito un theme che ha una Display Featured Slider, quando vado ad uplodare un immagine tuto va a buonfine, dopodiche apro un articolo e inserisco un campo personalizzato per fare un thumbbnail e visualizzarlo nello slider ma wp mi da un errore cioe:
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/var/www/html/wp-content/uploads/2011/08/35HD-NAS-E-213x213.png) is not within the allowed path(s): (/membri) in /membri/jonweb/wp-content/themes/Envisioned/epanel/custom_functions.php on line 562
35HD-NAS-E
le ho provate tutte permessi cartella, spulcio nella funzione ma non ce la faccio.
vi posto il file custom_function-php del tema per vedere se qualche buon anima riesce a modificarmi il percoso di output del resize nella cartella /var/www/html/wp-content/uploads
ecco
function et_resize_image( $thumb, $new_width, $new_height, $crop ){
$info = pathinfo($thumb);
$dir = $info['dirname'];
$ext = $info['extension'];
$name = wp_basename($thumb, ".$ext");
$suffix = "{$new_width}x{$new_height}";
$destfilename = "{$dir}/{$name}-{$suffix}.{$ext}";
#get local name for use in file_exists() and get_imagesize() functions
$localfile = preg_replace('#https?://.+?/#', et_get_document_root(), et_multisite_thumbnail($thumb));
$checkfilename = str_replace( $name, $name . '-' . $new_width . 'x' . $new_height, $localfile );
#check if we have an image with specified width and height
if ( file_exists( $checkfilename ) ) return $destfilename;
$size = @getimagesize( $localfile );
if ( !$size ) return new WP_Error('invalid_image_path', __('Image doesn\'t exist'), $thumb);
list($orig_width, $orig_height, $orig_type) = $size;
if ( $orig_width > $new_width || $orig_height > $new_height ){
if ( $orig_width < $new_width ) $new_width = $orig_width;
if ( $orig_height < $new_height ) $new_height = $orig_height;
$suffix = "{$new_width}x{$new_height}";
$destfilename = "{$dir}/{$name}-{$suffix}.{$ext}";
$checkfilename = preg_replace('#https?://.+?/#', et_get_document_root(), $destfilename);
#check if we have an image with new calculated width and height parameters
if ( file_exists($checkfilename) ) return $destfilename;
else {
$result = image_resize( $localfile, $new_width, $new_height, $crop );
#extract the correct filename and replace it in $thumb
if ( !is_wp_error( $result ) )
$result = str_replace( $name, wp_basename($result, ".$ext"), $thumb );
#returns resized image path or WP_Error ( if something went wrong during resizing )
return $result;
}
}
return $thumb;
}
Grazie in anticipo
Jonweb