1908 posts YOU TOUCH IT YOU BUY IT
  • Copyright Ninja
  • Most Wanted Winner
  • Top Monthly Author
  • Community Superstar
+12 more
FRESHFACE
says

Hi guys!

thank you for your interest. I will fix the multisite bug when I will have a time :) Anyway I’m now heading to final exams at my university, so I will not be available about a week or so :)

cheers, freshface

1368 posts
  • Copyright Ninja
  • Trendsetter
  • Weekly Top Seller
  • 5 Years of Membership
+7 more
Smartik
says

Multisite compatibility is a must.

final exams at my university
Good luck. :)
1908 posts YOU TOUCH IT YOU BUY IT
  • Copyright Ninja
  • Most Wanted Winner
  • Top Monthly Author
  • Community Superstar
+12 more
FRESHFACE
says

New version added( 1.1 ) .

This version is wordpress independent, so you can use it in your HTML demo previews.

Still missing:

1.) resizing images to be bigger than the original

2.) WP Multi Site testing

cheers, freshface

1908 posts YOU TOUCH IT YOU BUY IT
  • Copyright Ninja
  • Most Wanted Winner
  • Top Monthly Author
  • Community Superstar
+12 more
FRESHFACE
says

VERSION 1 .2

Features:

  • - completely independent at WordPress
  • - allowed to zoom images
  • - correct cropping

Bugs:

  • - when you are using WPMU and use /wordpress/something/something/ structure, it won’t work, minor bug

Testing:

  • - we just added it to all our demo servers. Is there some volunteer who can help us to test this script ?

LINK

https://github.com/boobslover/freshizer
97 posts Be different!
  • Power Elite Author
  • Author Level 12
  • 4 Years of Membership
  • Exclusive Author
+6 more
UnitedThemes
says

Hi,

will start testing soon and get back to you then :)

Cheers UT

3256 posts
  • Affiliate Level 4
  • Author Level 9
  • Collector Level 2
  • Top Monthly Author
+11 more
nepbits
says

VERSION 1 .2

Features:

  • - completely independent at WordPress
  • - allowed to zoom images
  • - correct cropping

Bugs:

  • - when you are using WPMU and use /wordpress/something/something/ structure, it won’t work, minor bug

Testing:

  • - we just added it to all our demo servers. Is there some volunteer who can help us to test this script ?

LINK

https://github.com/boobslover/freshizer

Hi,

regarding the MU bug, if the problem is to retrive the real url of the files i do something like this on the file path that WP returns:

global $blog_id;
//$url = image url returned by WP

    if (is_multisite() && isset($blog_id) && $blog_id > 0) {

        $url = explode('/files/', $url);

        if (isset($url[1])) {

            $url = '/blogs.dir/' . $blog_id . '/files/' . $url[1];

        }

    }

Now i didn’t look into your code, so not sure how you should implement this, but I guess this might help.

Kudos for your work ;)

Parker

723 posts
  • Featured Author
  • Trendsetter
  • Winner
  • Bundle Boss
+9 more
simonswiss
says

Looks great!

Could you please explain how to use this in the Loop to display a post’s featured image?

Cheers!

Simon

1908 posts YOU TOUCH IT YOU BUY IT
  • Copyright Ninja
  • Most Wanted Winner
  • Top Monthly Author
  • Community Superstar
+12 more
FRESHFACE
says


VERSION 1 .2

Features:

  • - completely independent at WordPress
  • - allowed to zoom images
  • - correct cropping

Bugs:

  • - when you are using WPMU and use /wordpress/something/something/ structure, it won’t work, minor bug

Testing:

  • - we just added it to all our demo servers. Is there some volunteer who can help us to test this script ?

LINK

https://github.com/boobslover/freshizer

Hi,

regarding the MU bug, if the problem is to retrive the real url of the files i do something like this on the file path that WP returns:

global $blog_id;
//$url = image url returned by WP

    if (is_multisite() && isset($blog_id) && $blog_id > 0) {

        $url = explode('/files/', $url);

        if (isset($url[1])) {

            $url = '/blogs.dir/' . $blog_id . '/files/' . $url[1];

        }

    }

Now i didn’t look into your code, so not sure how you should implement this, but I guess this might help.

Kudos for your work ;)

Parker
Ahh, I didnt know that “is_multisite()” function exists :) Anyway the final problem is, that I need to retrieve the original wordpress path, explanation
localhost/wp/ -> ORIGINAL
localhost/wp/aaa/bbb -> MU1
localhost/wp/bbb/ccc -> MU2

could you please tell me how to do it ? :) get_bloginfo(‘wpurl’); returns the MU, and I need the original for correctly build url of the image :)

3256 posts
  • Affiliate Level 4
  • Author Level 9
  • Collector Level 2
  • Top Monthly Author
+11 more
nepbits
says

Why do you need the original blog URL to build the images?

In sub blogs the images are stored in a different folder, not within the main blog uploads, that’s why I do this:
$url = '/blogs.dir/' . $blog_id . '/files/' . $url[1];
Additionally this url is safe, because it baypasses any rewrite rule on server.

The only thing I’m not sure about, is what happens when sub blogs are not in sub folders, but in sub domains… it should work, because I think that when you select sub domains for blogs the only thing that changes is the rewrite rule in the .htaccess file, so the files are always in the same folders.

I used this system with timthumb and it worked…

3256 posts
  • Affiliate Level 4
  • Author Level 9
  • Collector Level 2
  • Top Monthly Author
+11 more
nepbits
says

To make it clearer, this is how I use my functions to use timthumb with mu installation:

This function builds the image URL , if is a sub blog it changes the URL to the correct one, otherwise if it’s the main blog ($blog_id == 0) it doesn’t do anything.
function pk_build_image($url = '', $width = 0, $height = 0, $zc = 1, $amp = '&') {

    if ($url == '') {

        return '';    

    }

    global $blog_id;

    if (is_multisite() && isset($blog_id) && $blog_id > 0) {

        $url = explode('/files/', $url);

        if (isset($url[1])) {

            $url = '/blogs.dir/' . $blog_id . '/files/' . $url[1];

        }

    }

    $final_image_path = '';

    $width_string = ($width <= 0 || $width == '') ? '' : $amp.'w='.$width;
    $height_string = ($height <= 0 || $height == '') ? '' : $amp.'h='.$height;
    $zc_string = ($width_string == '' && $height_string == '') ? '' : $amp.'zc='.$zc;

    if ($zc_string == '') {

        return esc_url($url);

    }

    $final_image_path = PK_THEME_DIR.'/timthumb/timthumb.php?src='.$url.$width_string.$height_string.$zc_string;

    return esc_url($final_image_path);

}

How I use this function:

<?php
$image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full')
?>
<img src="<?php echo pk_build_image($image[0], 600, 450, 1); ?>" />

Let me know ;)

by
by
by
by
by
by