Example #1
0
 /**
  * Returns the link to image
  */
 public static function getImage($width, $height, $location = 'c')
 {
     global $blog_id;
     $image = get_the_image(array('format' => 'array'));
     if (isset($image['src']) && $image['src'] != '') {
         $image = $image['src'];
         $imageParts = explode('/files/', $image);
         $filehost = parse_url($image);
         $localhost = $_SERVER['HTTP_HOST'];
         if (isset($imageParts[1]) && $filehost['host'] == $localhost) {
             $image = '/blogs.dir/' . $blog_id . '/files/' . $imageParts[1];
         }
         $location = ui::getCropLocation($location);
         return get_template_directory_uri() . '/functions/theme/thumb.php?src=' . $image . '&w=' . $width . '&h=' . $height . '&zc=1' . '&a=' . $location;
     }
     return false;
 }