Support » Plugin: WP-Cycle » [Plugin: WP-Cycle] Missing images on server change

  • I’ve had to move server a few times recently and wp-cycle seems to be the only plugin that doesn’t remember things! I always have to go back into the settings and re-upload the images that were once there. Is there any way around this as it’s a bit tricky to remember when I’m dealing with more than one site.

Viewing 5 replies - 1 through 5 (of 5 total)
  • i just had this problem too.

    problem is that uploads are saving the full URL (with domain) to the database — you can see this in DB table wp_options:
    SELECT * FROM xxx.wp_options WHERE option_name LIKE '%wp_cycle%';

    this occurs in file \wp-content\plugins\wp-cycle\wp-cycle.php, method wp_cycle_handle_upload — where it sets $upload_dir_url.

    i had some success changing it to:

    $upload_dir_url = wp_upload_dir();	//str_replace(basename($file), '', $url);
    $upload_dir_url = str_replace( get_bloginfo('url'), '', $upload_dir_url['url'] ) . '/';

    you could also just perform a replace in the database field, since it’s a serialized array.

    UPDATE meant to use [‘url’], not [‘baseurl’] — need the folder dates too, per wp_upload_dir() reference

    gaah…

    UPDATE

    just noticed that the $url only gets fixed if the image is resized. otherwise it retains the original $url.

    add the following around line 151:

    else {
    	$url = $upload_dir_url . basename($url);
    }

    Thanks for this – due to the lack of support I’ve decided to ditch this plugin anyway. But, I’m glad you managed to find a solution.

    Thanks! You saved my night!

    @abtincjeremys do you have an example of how you took care of the folder dates?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: WP-Cycle] Missing images on server change’ is closed to new replies.