remove old readme
[atutor.git] / docs / mods / _standard / farchive / send_zip_archive.php
1 <?php
2
3 define('AT_INCLUDE_PATH', '../../../include/');
4 require (AT_INCLUDE_PATH.'vitals.inc.php');
5 //require (AT_INCLUDE_PATH.'header.inc.php');
6
7 $forum_id = $_GET['fid'];
8 $forum_title = $_GET['title'];
9
10 require('forum_post.php');
11 require(AT_INCLUDE_PATH.'classes/zipfile.class.php');
12
13
14
15 $zipfile = new zipfile();
16 $zipfile->add_file(file_get_contents(AT_CONTENT_DIR.'/exported_forum.html'), 'exported_forum.html');
17
18 foreach($filearr as $val) {
19     $zipfile->add_file(file_get_contents(AT_CONTENT_DIR.'/'.$val), $val);
20     unlink(AT_CONTENT_DIR.'/'.$val);
21 }
22
23 $zipfile->add_file(file_get_contents(AT_CONTENT_DIR.'/styles.css'), 'styles.css');
24 unlink(AT_CONTENT_DIR.'/styles.css');
25
26 // replaces spaces with underscores
27 if (strpos($forum_title, chr(32)) != false) {
28     $forum_title = str_replace(chr(32), chr(95), $forum_title);
29 }
30 $zipfile->send_file($forum_title);
31 exit;
32
33 ?>
34
35 <?php //require (AT_INCLUDE_PATH.'footer.inc.php'); ?>