1882 posts YOU TOUCH IT YOU BUY IT
  • Has referred 200+ members
  • Has sold $500,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+6 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

1286 posts
  • Has been part of the Envato Community for over 4 years
  • Has sold $40,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 50+ items on Envato Market
+5 more
Smartik says

Multisite compatibility is a must.

final exams at my university
Good luck. :)
1882 posts YOU TOUCH IT YOU BUY IT
  • Has referred 200+ members
  • Has sold $500,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+6 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

1882 posts YOU TOUCH IT YOU BUY IT
  • Has referred 200+ members
  • Has sold $500,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+6 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
94 posts Be different!
  • Has referred 500+ members
  • Has sold $1M+ on Envato Market and is now a Power Elite Author
  • Has collected 10+ items on Envato Market
  • Power Elite Author: Sold more than $1M on Envato Market
+4 more
UnitedThemes says

Hi,

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

Cheers UT

3256 posts
  • Has referred 100+ members
  • Has sold $250,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+9 more
ParkerAndKent 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

673 posts
  • Won a competition
  • Had an item featured in an Envato Bundle
  • Has sold $10,000+ on Envato Market
  • Located in Australia
+7 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

1882 posts YOU TOUCH IT YOU BUY IT
  • Has referred 200+ members
  • Has sold $500,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+6 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
  • Has referred 100+ members
  • Has sold $250,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+9 more
ParkerAndKent 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
  • Has referred 100+ members
  • Has sold $250,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+9 more
ParkerAndKent 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 ;)

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by