Make makeThumb() function aware if it's in the ajax folder
This commit is contained in:
parent
eb6fc55f3a
commit
c2e9053476
|
@ -7,6 +7,7 @@ function microtime_float() {
|
|||
|
||||
function makeThumb($item = "") {
|
||||
if ( $item == "" ) { return false; }
|
||||
$prefix = (substr(getcwd(), -4) == "ajax") ? "../" : "";
|
||||
if ( is_dir($item) ) {
|
||||
$isfolder = true;
|
||||
$folder = $item;
|
||||
|
@ -23,12 +24,12 @@ function makeThumb($item = "") {
|
|||
if ( count($files) == 0 ) { return false; }
|
||||
reset($files);
|
||||
$comic = $folder . "/" . current($files);
|
||||
$outfile = THUMBSDIR . substr($folder, strlen(COMICSDIR)) . "_oem";
|
||||
$outfile = $prefix . THUMBSDIR . substr($folder, strlen(COMICSDIR)) . "_oem";
|
||||
} elseif ( is_file($item) ) {
|
||||
$isfolder = false;
|
||||
$file = $item;
|
||||
$comic = $file;
|
||||
$targetdir = THUMBSDIR . substr(dirname($file), strlen(COMICSDIR)) . "/";
|
||||
$targetdir = $prefix . THUMBSDIR . substr(dirname($file), strlen(COMICSDIR)) . "/";
|
||||
if ( !is_dir($targetdir) ) {
|
||||
mkdir($targetdir, 0755, true);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user