<?php
/*-----------------------------------------------------------------------
| Phoenix FS v. 1.0.1 |
| Created by Gian_PHP |
| Based on PHP & MySQL |
-------------------------------------------------------------------------
| This program is free software: you can redistribute it and/or modify |
| it under the terms of the GNU General Public License as published by |
| the Free Software Foundation, either version 3 of the License, or |
| any later version. |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU General Public License for more details. |
| |
| GNU GPL License: http://www.gnu.org/licenses/gpl.txt |
-------------------------------------------------------------------------
| index.php |
-----------------------------------------------------------------------*/
define('ACCESS', true);
define('SCRIPT_BASE_PATH', dirname(__FILE__));
// controlling install files
$install_files = array(SCRIPT_BASE_PATH.'/install/index.php',
SCRIPT_BASE_PATH.'/install/insert_db.php', SCRIPT_BASE_PATH.'/install/update_db.php',
SCRIPT_BASE_PATH.'/install/finish.php');
$install_files_num = 0;
foreach($install_files as $value) {
if(file_exists($value)) {
$install_files_num++;
}
}
if($install_files_num != 0) {
die("Please remove install files. ".$install_files_num." left.");
} elseif(file_exists('./install/')) {
die('Please remove the <b>install</b> folder.');
}
// config files and database connection
require_once './includes/config.inc.php';
require_once SCRIPT_INC_DIR.'functions.inc.php';
DB_Connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
// module fields
$fields_query = "SELECT * FROM ".DB_PREF."module_fields";
$fields_result = mysql_query($fields_query);
define('MODULE_FIELDS_NUM', mysql_num_rows($fields_result));
if(MODULE_FIELDS_NUM == 0) {
die('No fields in the module.');
}
// $options array
$options = array();
$options_required = array('module_name', 'module_style', 'module_url',
'script_name', 'script_url', 'script_version');
$options_query = "SELECT * FROM ".DB_PREF."options";
$options_result = mysql_query($options_query);
while($opt_array = mysql_fetch_array($options_result)) {
@$options[$opt_array[opt_name]] = $opt_array[opt_content];
}
// module colors and style
@require_once SCRIPT_STYLES_DIR.$options[module_style].'/colors.inc.php';
@$options[module_css] = 'styles/'.$options[module_style].'/style.css';
// completing module and closing application
eval("Print_Module(\"".Get_HTML(SCRIPT_INC_DIR."module_header.inc.html")."\");");
while($fields = mysql_fetch_array($fields_result)) {
echo "<p>
".@$fields[field_display_name]."<br />
<input type=\"".@$fields[field_type]."\" name=\"".@$fields[field_name]."\" size=\"".@$fields[field_size]."\">
</p>";
}
eval("Print_Module(\"".Get_HTML(SCRIPT_INC_DIR."module_footer.inc.html")."\");");
DB_Close();
?>