• I’ve used com-resize and it is great.

    However, on one of my blogs I keep al the WP files in
    a /wp subdirectory, I specify this alternate “WordPress
    address (URL)” on the General Settings page. It seems
    that com-resize is not able to handle this situation.
    More specifically, I believe that the code assumes that
    the server’s DOCUMENT_ROOT is the same as ABSPATH
    in WordPress.

    Any help in fixing this would be appreciated.

    Thank you,
    Robert

    http://wordpress.org/extend/plugins/com-resize/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Try this :

    1/ Replace the line begining with define('SITE_URL', ... By

    define('SITE_URL', get_settings('siteurl'));

    2/ For the two lines begining with $new_src = "/wp-content/plugins ...

    Add the site url this way :

    $new_src = get_settings('siteurl')."/wp-content/plugins ...

    Worked for me 😉

    Thread Starter debenedictis

    (@debenedictis)

    bbertrand,
    Thank you for your reply. My wordpress is in a /wp directory.
    But, get_settings(‘siteurl’) did not work for me with the $new_src
    variables because of the ‘http:’ that it starts with.

    Instead, I modified phpThumb.config.php. I changed these lines:

    require_once(“../../../../wp-config.php”);
    $PHPTHUMB_CONFIG[‘document_root’] = ABSPATH;
    $PHPTHUMB_CONFIG[‘cache_directory’] = $PHPTHUMB_CONFIG[‘document_root’] . “wp-content/cache/com_resize”;

    to this:

    require_once(“../../../../../wp/wp-config.php”);
    $PHPTHUMB_CONFIG[‘document_root’] = @$_SERVER[“DOCUMENT_ROOT”];
    $PHPTHUMB_CONFIG[‘cache_directory’] = $PHPTHUMB_CONFIG[‘document_root’] . “/wp/wp-content/cache/com_resize”;

    Robert DeBenedictis, PRX.org

    Thread Starter debenedictis

    (@debenedictis)

    Thanks debenedictis. I’ll try to fix it tonight so it works in both cases: in documentroot and in a subdirectory. Expect a 0.1.4 release this evening.

    I did two updates. One for fixing some caching issues with a brand new installation.
    The second update (0.1.5) would fix the mentioned problem here.

    I think the real problems was when you have installed wordpress in a subdirectorie AND use an img src in the form of: /wordpress/images/test.jpg. images/test.jpg would have worked in that case.

    Thread Starter debenedictis

    (@debenedictis)

    Hi Leon,
    For me 0.1.5 wasn’t working when WP was in /wp and img src was like:
    http://example.org/shows/photo.jpg

    That would generate a new link like this:
    http://example.org/wp-content/plugins/com-resize/phpthumb/phpThumb.php?src=http%3A%2F%2F example.org%2Fshows%2Fphoto.jpg&w=80

    But, my wp-content is in http://example.org/wp/wp-content.

    To fix this I added these lines after you assign new_src when remote:

    $url_parts = parse_url(get_bloginfo('wpurl'));
    $new_src = trim($url_parts['path'],"/") . "/" . $new_src;

    But, that’s just a work-around. I don’t think it’s the best fix.

    Robert

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: com_resize] WordPress address (URL) Trouble’ is closed to new replies.