Hi!,
I'm trying yapb on WpMu. This plugins uses wp_handle_upload() to know where is located an image.
The function actually return "/files/2007/1/filename.jpg"
but ".../blogs.dir/xx/" is missing.
So... how can I know the blog's upload directory?
thnaks!
$uploadedFileInfo = wp_handle_upload($_FILES['yapb_imageupload'], array('action' => $_POST['action']));
$url = $uploadedFileInfo['url'];
$siteUrl = get_option('siteurl');
if (substr($siteUrl, -1) != '/') $siteUrl .= '/';
$uri = substr($url, strpos($siteUrl, '/', strpos($url, '//')+2));
I solved partialy with
if (true) {
$uri=str_replace("files/",UPLOADS,$uri);
}
It works for my instalation, but it's not good idea for a general plugin.
fransimo, could you tell us what works and what doesn't with this hack?
I tried integrating yapb on my wpmu install a while back, but gave up when it wasn't working out of hte box.
thanks.
Fransimo, could you be more specific? which files have you changed in the end? I am also interested in this solution..