Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • you will need:
    $base_url = get_option('siteurl') . "/" . "wp-uploads";
    also so as to strip and re-add the position of the wp-uploads part

    the single is ABSPATH/wp-uploads/{premalink>
    the multi is VirtualDocumentRoot/wp-uploads/<domain>/{permalink>

    so you will need to strip the wp-upload part as it is in the get_option(‘upload_path’) for you.

    i know this is true on ubuntu / debian for the multi instance
    i have no single instance running to check this in the mysql entry

    hope this is helpful

    and it works well in 3.0.1
    thanks

    the problem is in myfilters.inc.php
    function mpdf_speedUpLocaleImages($content)
    you look up ‘siteurl’ and substitute ABSPATH

    this might not work for single but it does for multi:
    do it for the single ‘ below it also

    $base_url = get_option('siteurl') . "/" . "wp-uploads";
    $upload_path = get_option('upload_path') . "/";
    
    if(preg_match_all('#<img.*src="(.*)".*>#iU', $content, $matches)) {
        foreach($matches[1] as $ikey => $img) {
            if(strpos($img, $base_url) === 0 ) {
                $local_img_path = str_replace($base_url, '', $img);
                //$new_img = ABSPATH . (substr($local_img_path, 0, 1) === '/' ? substr($local_img_path, 1) : $local_img_path);
                $new_img = $upload_path . (substr($local_img_path, 0, 1) === '/' ? substr($local_img_path, 1) : $local_img_path);
                $content = str_replace('src="'.$img.'"', 'src="file://'.$new_img.'"', $content);
            } else {
                if(substr($img, 0, 1) === '/') {
                    //$new_img = ABSPATH . $img;
                    $new_img = $upload_path . $img;
                    $content = str_replace('src="'.$img.'"', 'src="file://'.$new_img.'"', $content);
                }
            }
        }
    }

Viewing 3 replies - 1 through 3 (of 3 total)