-/cache/
-/templates_c/
-/webroot/config.php
-/webroot/geoip.php
-/webroot/glob.php
-/webroot/include/
-/webroot/mail_test.php
-/webroot/md5.php
-/webroot/smarty/
-/webroot/stats/
+/config.php
--- /dev/null
+This is the web portal for squasher
+
+= Requirements
+
+You need apache, php, mysql, php-myql, smarty
+
+= Web setup
+
+Create a webpage pointing at webroot/ at your httpd configuration
+
+= Temporary files
+
+Create a file config.php (using config.php.example as a base):
+
+
+templates_c is a directory for compiled templates, and cache is... a cache.
+Both these directories must be *writable by the web daemon*
+
+One possibility is:
+```
+mkdir -p /var/cache/squasher
+
+mkdir -m 775 /var/cache/squasher/templates_c
+chown root:www-data /var/cache/squasher/templates_c
+
+mkdir -m 775 /var/cache/squasher/cache
+chown root:www-data /var/cache/squasher/cache
+```
+and put these directories in config.php
+
+= Uploads directory
+
+Right now, in webroot/*php, the uploads directory is hardcoded to ../uploads. So you should create a symlink here to uploads.
+```
+ln -s /var/www/uploads .
+```
--- /dev/null
+<?php
+
+DEFINE('SQUASHER_DB_HOST', '127.0.0.1'); // Ip address of the mysql server
+DEFINE('SQUASHER_DB_USER', 'squasher'); // Username for the database
+DEFINE('SQUASHER_DB_PASSWORD', 'squasher'); // Password for the database
+DEFINE('SQUASHER_DB_DATABASE', 'squasher'); // Mysql database name
+
+// Location of the smarty php library
+// Use 'smarty/Smarty.class.php' for relative directory 'smarty/'
+// Use 'smarty3/Smarty.class.php' if you installed package smarty3
+DEFINE('SQUASHER_SMARTY_SOURCE', 'smarty3/Smarty.class.php');
+
+// Location of the smarty templates, relative to webroot
+DEFINE('SQUASHER_SMARTY_TEMPLATES', '../templates');
+
+// Location of the smarty compiled templates
+// If you create a 777 templates_c directory here, use '../templates_c'
+DEFINE('SQUASHER_SMARTY_TEMPLATES_C', '/var/cache/squasher/templates_c');
+
+// Location of the smarty cache
+// If you create a 777 cache directory here, use '../cache'
+DEFINE('SQUASHER_SMARTY_CACHE', '/var/cache/squasher/cache');
+
+
+// start session
+session_start();
+
+//connect to db
+$link_db = mysql_connect(SQUASHER_DB_HOST, SQUASHER_DB_USER, SQUASHER_DB_PASSWORD);
+mysql_select_db(SQUASHER_DB_DATABASE, $link_db);
+
+// vim: syntax=php ts=4 sw=4 sts=4 sr noet
+?>
+++ /dev/null
-<?php
-
-DEFINE('SQUASHER_DB_HOST', '127.0.0.1'); // Ip address of the mysql server
-DEFINE('SQUASHER_DB_USER', 'squasher'); // Username for the database
-DEFINE('SQUASHER_DB_PASSWORD', 'squasher'); // Password for the database
-DEFINE('SQUASHER_DB_DATABASE', 'squasher'); // Mysql database name
-
-// Location of the smarty library
-// Use 'smarty/Smarty.class.php' for relative directory 'smarty/'
-// Use 'smarty3/Smarty.class.php' if you installed package smarty3
-DEFINE('SQUASHER_SMARTY_SOURCE', 'smarty3/Smarty.class.php');
-
-// Location of the smarty templates
-DEFINE('SQUASHER_SMARTY_TEMPLATES', '../templates');
-
-// Location of the smarty compiled templates
-DEFINE('SQUASHER_SMARTY_TEMPLATES_C', '../templates_c');
-
-// Location of the smarty cache
-DEFINE('SQUASHER_SMARTY_CACHE', '../cache');
-
-
-// start session
-session_start();
-
-//connect to db
-$link_db = mysql_connect(SQUASHER_DB_HOST, SQUASHER_DB_USER, SQUASHER_DB_PASSWORD);
-mysql_select_db(SQUASHER_DB_DATABASE, $link_db);
-
-// vim: syntax=php ts=4 sw=4 sts=4 sr noet
-?>
<?php
-require_once("config.php");
+require_once("../config.php");
require_once("squasher.class.php");
<?php
-require_once("config.php");
+require_once("../config.php");
function zfill($n, $a) {
return str_repeat("0", max(0,$a-strlen($n))) . $n;
mail('jasper@netformatie.nl', $m_subject, $m_body, "From: support@netformatie.nl");
}
+/* unused debug function (echo / print_r)
function show_files() {
$path = "./uploads/";
print_r($files_merged);
echo "</pre>";
}
+*/
function set_mime($filename) {
$ext_arr = explode('.', $filename);