diff options
Diffstat (limited to 'download.inc')
-rwxr-xr-x | download.inc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/download.inc b/download.inc index 2320f06..3ba603e 100755 --- a/download.inc +++ b/download.inc @@ -120,7 +120,8 @@ function textbook_companion_download_chapter() { $chapter_id = arg(3); //var_dump($chapter_id);die; - $root_temp_path = textbook_companion_path(); + global $root_path; + $root_path = textbook_companion_path(); /* get example data */ /*$chapter_q = db_query("SELECT * FROM {textbook_companion_chapter} WHERE id = %d", $chapter_id); $chapter_data = db_fetch_object($chapter_q);*/ @@ -131,9 +132,9 @@ function textbook_companion_download_chapter() $chapter_data = $result->fetchObject(); $CH_PATH = 'CH' . $chapter_data->number . '/'; /* zip filename */ -if (!is_dir($root_temp_path . 'tbc_download_temp')) - mkdir($root_temp_path . 'tbc_download_temp'); - $zip_filename = $root_temp_path .'tbc_download_temp/' . 'zip-' . time() . '-' . rand(0, 999999) . '.zip'; +if (!is_dir($root_path . 'tbc_download_temp')) + mkdir($root_path . 'tbc_download_temp'); + $zip_filename = $root_path .'tbc_download_temp/' . 'zip-' . time() . '-' . rand(0, 999999) . '.zip'; /* creating zip archive on the server */ $zip = new ZipArchive; |