$thumb = false;
$size = 1024;
$sizetype = "";
- $basepath = App::get_basepath();
+ $basepath = $a->get_basepath();
// If the cache path isn't there, try to create it
if (!is_dir($basepath."/proxy"))
// Only continue if it isn't a local image and the isn't deactivated
if (proxy_is_local_image($url)) {
- $url = str_replace(normalise_link($a->get_baseurl()) . '/', $a->get_baseurl() . '/', $url);
+ $url = str_replace(normalise_link(App::get_baseurl()) . '/', App::get_baseurl() . '/', $url);
return $url;
}
$url = html_entity_decode($url, ENT_NOQUOTES, 'utf-8');
// Creating a sub directory to reduce the amount of files in the cache directory
- $basepath = App::get_basepath() . '/proxy';
+ $basepath = $a->get_basepath() . '/proxy';
$shortpath = hash('md5', $url);
$longpath = substr($shortpath, 0, 2);
$longpath .= '.' . $extension;
}
- $proxypath = $a->get_baseurl() . '/proxy/' . $longpath;
+ $proxypath = App::get_baseurl() . '/proxy/' . $longpath;
if ($size != '') {
$size = ':' . $size;
if ((strlen($proxypath) > 250) AND $writemode) {
return $shortpath;
} elseif (strlen($proxypath) > 250) {
- return $a->get_baseurl() . '/proxy/' . $shortpath . '?url=' . urlencode($url);
+ return App::get_baseurl() . '/proxy/' . $shortpath . '?url=' . urlencode($url);
} elseif ($writemode) {
return $longpath;
} else {
function proxy_parse_html($html) {
$a = get_app();
- $html = str_replace(normalise_link($a->get_baseurl())."/", $a->get_baseurl()."/", $html);
+ $html = str_replace(normalise_link(App::get_baseurl())."/", App::get_baseurl()."/", $html);
return preg_replace_callback("/(<img [^>]*src *= *[\"'])([^\"']+)([\"'][^>]*>)/siU", "proxy_img_cb", $html);
}