I would love to just change themes to one that works, but unfortunately I’m stuck with trying to figure out how to change a theme just enough to make it work in an MU environment.
On the backend, users are allowed to upload a logo. Unfortunately, all these logo files go into a shared folder so if by some weird chance blog 5 decides to upload “header_image.png” but blog 1 is using that same filename, BOOM! Both blogs now have the same header. Blog 5 is happy, but blog 1 is cranky.
Here’s the troublesome code:
$directory = dirname(__FILE__)."/uploads/"; move_uploaded_file($_FILES[$file]["tmp_name"], $directory.$_FILES[$file]["name"]);
I’m going insane on trying to figure out how to get $directory to point to the proper blogs.dir/blog_id/files/ directory. I have used the get_option(‘upload_path’) which gets me almost everything I need. I just can’t figure out how to find the absolute path of the installation directory of WordPress. I’m going nuts trying to figure this out, any help would be greatly appreciated.
- The topic ‘How to find the upload path for a blog? MU 2.9.2’ is closed to new replies.