<?php
// +----------------------------------------------------------------------+
// | Fantastic File Database |
// +----------------------------------------------------------------------+
// | By Tony Baird |
// | Copyright (c) 2003 Fantastic Scripts |
// | http://fscripts.com |
// +----------------------------------------------------------------------+
// | Fantastic File Database Can be modified freely as long as copyright |
// | is intact and this is left at the top of every source file |
// +----------------------------------------------------------------------+
// | installl.php |
// | Date Started: March 29, 2003 |
// | Last Modified: March 29, 2003 |
// +----------------------------------------------------------------------+
require("config.php");
require("functions.php");
$ffdb=new Ffdb;
$ffdb->StartTimer();
$tpl=new Templates;
$mysql=new Mysql;
$mysql->Connect();
set_magic_quotes_runtime(0);
error_reporting (E_ERROR | E_WARNING | E_PARSE);
// Ok Time to do some HTML fun!
?>
<html>
<head>
<title>Fantastic File Database</title>
<style>
body {font-family:Verdana; color:#FFFFFF;font-size: 10px;}
h1, h2, h3, h4, h5, h6 {font-family:Verdana;}
blockquote {font-family:Verdana;}
INPUT { color: #FFFFFF; background: #008080; border: 1px solid #FFFFFF;}
SELECT { color: #FFFFFF; background: #008080; border: 1px solid #FFFFFF;}
TEXTAREA { color: #FFFFFF; background: #008080; border: 1px solid #FFFFFF;}
a: {font-family:Verdana; color:#00BBBB;text-decoration:none;}
a:link {font-family:Verdana; color:#00BBBB;text-decoration:none;}
a:active {font-family:Verdana; color:#00BBBB;text-decoration:none;}
a:visited {font-family:Verdana; size:2; color:#00BBBB;text-decoration:none;}
a:hover {font-family:Verdana; size:2; color:#FFFFFF;text-decoration:underline;}
BODY
{
SCROLLBAR-FACE-COLOR: #006262;
SCROLLBAR-HIGHLIGHT-COLOR: #000000;
SCROLLBAR-SHADOW-COLOR: #006262;
SCROLLBAR-3DLIGHT-COLOR: #00A6A6;
SCROLLBAR-ARROW-COLOR: #FFFFFF;
SCROLLBAR-TRACK-COLOR: #00A6A6;
SCROLLBAR-DARKSHADOW-COLOR: #008080
}
</style>
</head>
<body text="#FFFFFF" bgcolor="#008080">
<?php
echo "Fantastic File Database Installer Starting...<br>";
echo "Creating ffdb_categorys table...<br>";
$mysql->Query("CREATE TABLE ffdb_categorys (
category_id int(11) NOT NULL auto_increment,
category_name varchar(255) NOT NULL default '',
category_description mediumtext NOT NULL,
num_sub_categorys int(11) NOT NULL default '0',
num_files int(11) NOT NULL default '0',
display_order int(11) NOT NULL default '0',
active enum('Yes','No') NOT NULL default 'Yes',
PRIMARY KEY (category_id))");
echo "ffdb_categorys table created<br>";
echo "Creating ffdb_comments table...<br>";
$mysql->Query("CREATE TABLE ffdb_comments (
comment_id int(11) NOT NULL auto_increment,
file_id int(11) NOT NULL default '0',
user_id int(11) NOT NULL default '0',
comments_title varchar(255) NOT NULL default '',
comments longtext NOT NULL,
date int(11) NOT NULL default '0',
last_modified int(11) NOT NULL default '0',
PRIMARY KEY (comment_id))");
echo "ffdb_comments table created<br>";
echo "Creating ffdb_files table...<br>";
$mysql->Query("CREATE TABLE ffdb_files (
file_id int(11) NOT NULL auto_increment,
category_id int(11) NOT NULL default '0',
sub_category_id int(11) NOT NULL default '0',
license_id int(11) NOT NULL default '0',
author varchar(255) NOT NULL default '',
author_email varchar(255) NOT NULL default '',
author_site varchar(255) NOT NULL default '',
author_site_url varchar(255) NOT NULL default '',
file_name varchar(255) NOT NULL default '',
file_description mediumtext NOT NULL,
file_long_description longtext NOT NULL,
version varchar(255) NOT NULL default '',
upload_file enum('Yes','No') NOT NULL default 'Yes',
file_size int(11) NOT NULL default '0',
file_filename varchar(255) NOT NULL default '',
file_url varchar(255) NOT NULL default '',
upload_image enum('Yes','No') NOT NULL default 'Yes',
image_size int(11) NOT NULL default '0',
image_filename varchar(255) NOT NULL default '',
image_url varchar(255) NOT NULL default '',
downloads int(11) NOT NULL default '0',
num_comments int(11) NOT NULL default '0',
num_ratings int(11) NOT NULL default '0',
total_ratings int(11) NOT NULL default '0',
last_download int(11) NOT NULL default '0',
date_added int(11) NOT NULL default '0',
added_by int(11) NOT NULL default '0',
PRIMARY KEY (file_id,file_id))");
echo "ffdb_files table created<br>";
echo "Creating ffdb_licenses table...<br>";
$mysql->Query("CREATE TABLE ffdb_licenses (
license_id int(11) NOT NULL auto_increment,
license_name varchar(255) NOT NULL default '',
license_text longtext NOT NULL,
PRIMARY KEY (license_id)
)");
echo "ffdb_licenses table created<br>";
echo "Creating ffdb_ratings table...<br>";
$mysql->Query("CREATE TABLE ffdb_ratings (
file_id int(11) NOT NULL default '0',
user_id int(11) NOT NULL default '0',
rating int(11) NOT NULL default '0',
ip varchar(255) NOT NULL default '',
time int(11) NOT NULL default '0'
)");
echo "ffdb_ratings table created<br>";
echo "Creating ffdb_sessions table...<br>";
$mysql->Query("CREATE TABLE ffdb_sessions (
session varchar(255) NOT NULL default '',
user_id int(11) NOT NULL default '0',
ip varchar(255) NOT NULL default '',
browser varchar(255) NOT NULL default '',
last_seen int(11) NOT NULL default '0',
page_location varchar(255) NOT NULL default '',
in_category int(11) NOT NULL default '0',
in_sub_category int(11) NOT NULL default '0',
in_file int(11) NOT NULL default '0'
)");
echo "ffdb_sessions table created<br>";
echo "Creating ffdb_skins table...<br>";
$mysql->Query("CREATE TABLE ffdb_skins (
skin_id int(11) NOT NULL auto_increment,
skin_name varchar(255) NOT NULL default '',
skin_directory varchar(255) NOT NULL default '',
PRIMARY KEY (skin_id))");
echo "ffdb_skins table created<br>";
echo "Creating ffdb_stats table...<br>";
$mysql->Query("CREATE TABLE ffdb_stats (
most_users_online int(11) NOT NULL default '0',
most_users_online_time int(11) NOT NULL default '0',
num_files int(11) NOT NULL default '0',
num_categorys int(11) NOT NULL default '0',
num_sub_categorys int(11) NOT NULL default '0',
num_users int(11) NOT NULL default '0',
num_comments int(11) NOT NULL default '0',
num_ratings int(11) NOT NULL default '0'
)");
echo "ffdb_stats table created<br>";
echo "Creating ffdb_sub_categorys table...<br>";
$mysql->Query("CREATE TABLE ffdb_sub_categorys (
sub_category_id int(11) NOT NULL auto_increment,
category_id int(11) NOT NULL default '0',
sub_category_name varchar(255) NOT NULL default '',
sub_category_description mediumtext NOT NULL,
num_files int(11) NOT NULL default '0',
display_order int(11) NOT NULL default '0',
active enum('Yes','No') NOT NULL default 'Yes',
PRIMARY KEY (sub_category_id)
)");
echo "ffdb_sub_categorys table created<br>";
echo "Creating ffdb_users table...<br>";
$mysql->Query("CREATE TABLE ffdb_users (
user_id int(11) NOT NULL auto_increment,
username varchar(255) NOT NULL default '',
password varchar(255) NOT NULL default '',
email varchar(255) NOT NULL default '',
user_level varchar(255) NOT NULL default '',
user_title varchar(255) NOT NULL default '',
icq int(11) NOT NULL default '0',
aim varchar(255) NOT NULL default '',
msn varchar(255) NOT NULL default '',
location varchar(255) NOT NULL default '',
site_name varchar(255) NOT NULL default '',
site_url varchar(255) NOT NULL default '',
interests varchar(255) NOT NULL default '',
date_joined int(11) NOT NULL default '0',
last_visit int(11) NOT NULL default '0',
num_comments int(11) NOT NULL default '0',
num_ratings int(11) NOT NULL default '0',
num_downloads int(11) NOT NULL default '0',
skin_id int(11) NOT NULL default '0',
last_ip varchar(255) NOT NULL default '',
PRIMARY KEY (user_id)
)");
echo "ffdb_users table created<br>";
echo "Creating tables completed now moving onto inserting data<br>";
echo "Inserting value to Licenses table...<br>";
$mysql->Query("INSERT INTO ffdb_licenses VALUES (0, 'None', 'None')");
echo "License data inserted successfully<br>";
echo "Inserting stats data...<br>";
$mysql->Query("INSERT INTO `ffdb_stats` ( `most_users_online` , `most_users_online_time` , `num_files` , `num_categorys` , `num_sub_categorys` , `num_users` , `num_comments` , `num_ratings` ) VALUES ('0', '0', '0', '0', '0', '0', '0', '0')");
echo "Stats data inserted successfully";
echo "Inserting default skin...<br>";
$mysql->Query("INSERT INTO ffdb_skins VALUES (1, 'default', 'default')");
echo "Default skin added<br>";
echo "Inserting default users...<br>";
$mysql->Query("INSERT INTO ffdb_users VALUES (1, 'Guest', '9dsa0kXZopsdak92130ka', '[email protected]', '', 'Guest', 0, '', '', '', '', '', '', 0, 0, 0, 0, 0, 0, '')");
$mysql->Query("INSERT INTO ffdb_users VALUES (2, 'admin', '21232f297a57a5a743894a0e4a801fc3', '[email protected]', '@1@2@3@4@5@6@7@8', 'Mighty Admin', 0, '', '', '', '', 'http://', '', 1048975088, 1048975088, 0, 0, 0, 1, '127.0.0.1')");
echo "default users added<br>";
echo "<br>The installation is now complete you can access the admin area by going to admin.php the account details are as follows<br>
Username: admin <br>
Password: admin <br>
You can change is by going into the user area or making your own account then adding powers to that account<br>
You can now delete this file it is no longer needed and only poses a security risk";
?>