/** * Returns a URL for a resized image. * * If direct mode is enabled (which it is by * default) and the image is already cached to the file system then a URL for that * file will be returned. * * In all other cases a Shopp Image Server URL will be returned. * * @param $width * @param $height * @param $scale * @param $sharpen * @param $quality * @param $fill * @return string */ public function url($width = null, $height = null, $scale = null, $sharpen = null, $quality = null, $fill = null) { $request = array(); $url = Shopp::url('' != get_option('permalink_structure') ? trailingslashit($this->id) . $this->filename : $this->id, 'images'); // Get the current URI $uri = $this->uri; // Handle resize requests $params = func_get_args(); if (count($params) > 0) { list($width, $height, $scale, $sharpen, $quality, $fill) = $params; $request = $this->resizing($width, $height, $scale, $sharpen, $quality, $fill); // Build the path to the cached copy of the file (if it exists) $size = $this->cachefile($request); $uri = "cache_{$size}_{$this->filename}"; // Override the URI for the request } // Ask the engine if we have a direct URL $direct_url = $this->engine()->direct($uri); if (false !== $direct_url) { return $direct_url; } if (empty($request)) { return $url; } else { return Shopp::add_query_string($request, $url); } }
/** * @deprecated Use Shopp::add_query_string() **/ function add_query_string($string, $url) { return Shopp::add_query_string($string, $url); }