Quantcast
Channel: Rein Aris - Blog » Wordpress
Viewing all articles
Browse latest Browse all 10

Verve Meta Boxes – WordPress Multi Site Timthumb fix

$
0
0

Timthumb doens’t work with a WordPress multi site (MU), fortunately there is a fix for this problem on the Binarymoon blog (developer of Timthumb).

Update: This fix is now included in the new version of Verve Meta Boxes!

But I also had this problem with Verve Meta Boxes. I didn’t generate thumbnails within my multi site installation. That’s because Verve is using Timthumb too.

Based on the solution by Binarymoon I managed to fix the Verve timthumb problem to by editing the plugin.

I’m using Verve meta boxes 1.2.6

On line 435 of verve-meta-boxes.php you will find the following code:

echo '<div><img src="'.plugins_url().'/verve-meta-boxes/tools/timthumb.php?src='.$meta_box_value.'&w=180&zc=1&q=95" alt="" />';

Change this to:

$theImageSrc = $meta_box_value;
global $blog_id;
if (isset($blog_id) && $blog_id > 0) {
$imageParts = explode('/files/', $theImageSrc);
    if (isset($imageParts[1])) {
        $theImageSrc = '/blogs.dir/' . $blog_id . '/files/' . $imageParts[1];
    }
}
echo '<div class="verve-img"><img src="'.plugins_url().'/verve-meta-boxes/tools/timthumb.php?src='.$theImageSrc.'&w=180&zc=1&q=95" alt="" />';

And your Verve meta boxes will generate thumbnails again within your WordPress multi site!

Update: This fix is now included in the new version of Verve Meta Boxes!


Viewing all articles
Browse latest Browse all 10

Trending Articles