summaryrefslogtreecommitdiff
path: root/fetch.php
diff options
context:
space:
mode:
authorandi <andi@splitbrain.org>2005-04-15 22:47:35 +0200
committerandi <andi@splitbrain.org>2005-04-15 22:47:35 +0200
commitb625487d2258a6f1f875813206adc9a5857dab24 (patch)
treed58871efbfeb198ad4634add0e496b5cb890b655 /fetch.php
parent4826ab45befb9eb1c664b5d8c8a0f03a7b750b8b (diff)
downloadrpg-b625487d2258a6f1f875813206adc9a5857dab24.tar.gz
rpg-b625487d2258a6f1f875813206adc9a5857dab24.tar.bz2
new parser: more hacking, RSS readded
darcs-hash:20050415204735-9977f-613d9b007452d538dcb8fce4ade5cbec389c4415.gz
Diffstat (limited to 'fetch.php')
-rw-r--r--fetch.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/fetch.php b/fetch.php
index b991f14ec..4f3381bbb 100644
--- a/fetch.php
+++ b/fetch.php
@@ -9,7 +9,8 @@
if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__)).'/');
require_once(DOKU_INC.'inc/init.php');
require_once(DOKU_INC.'inc/common.php');
- require_once(DOKU_INC.'inc/utils.php');
+ require_once(DOKU_INC.'inc/pageutils.php');
+ require_once(DOKU_INC.'inc/confutils.php');
require_once(DOKU_INC.'inc/auth.php');
$mimetypes = getMimeTypes();
@@ -59,7 +60,6 @@
exit;
}
-
//handle image resizing
if((substr($MIME,0,5) == 'image') && $WIDTH){
$FILE = get_resized($FILE,$EXT,$WIDTH,$HEIGHT);
@@ -93,6 +93,7 @@ function get_resized($file, $ext, $w, $h=0){
$info = getimagesize($file);
if(!$h) $h = round(($w * $info[1]) / $info[0]);
+
//cache
$local = $conf['mediadir'].'/_cache/'.$md5.'.'.$w.'x'.$h.'.'.$ext;
$mtime = @filemtime($local); // 0 if not exists
@@ -140,7 +141,7 @@ function get_from_URL($url,$ext,$cache){
// never cache exists but no endless cache not exists or expired
if( $cache == 0 || ($mtime != 0 && $cache != -1) || $mtime < time()-$cache ){
- if(download($url,$local)){
+ if(io_download($url,$local)){
return $local;
}else{
return false;
@@ -167,7 +168,7 @@ function resize_image($ext,$from,$from_w,$from_h,$to,$to_w,$to_h){
// create an image of the given filetype
if ($ext == 'jpg' || $ext == 'jpeg'){
if(!function_exists("imagecreatefromjpeg")) return false;
- $image = @imagecreateFromjpeg($from);
+ $image = @imagecreatefromjpeg($from);
}elseif($ext == 'png') {
if(!function_exists("imagecreatefrompng")) return false;
$image = @imagecreatefrompng($from);