Location: PHPKode > projects > ZompLog > install/install.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Zomplog - Install</title>

<link href="../admin/images/docsstyle.css" rel="stylesheet" type="text/css" />

</head>

<body>
<a name="top"></a>

<div id="header">
<div class="headercontent">
</div>
</div>
<div id="mainbox">
<div class="maincontent">

<div class="title">Step One of Two  - Create Database Tables </div>
<br />

<?php

include("../admin/functions.php");
include("../admin/config.php");

$query = "CREATE TABLE $table (
     id int (10 )  NOT NULL auto_increment ,
     title varchar (100)  NOT NULL ,
     text text NOT NULL ,
     extended text NOT NULL ,
     image int (10) NOT NULL ,
	 align text NOT NULL ,
	 fullwidth int (10) NOT NULL ,
	 mediafile varchar (100)  NOT NULL ,
	 mediatype int (10) NOT NULL ,
	 catid int (10) NOT NULL ,
	 date varchar(25) NOT NULL default '',
	 username text NOT NULL ,
	 userid int (10 ) NOT NULL ,
	 
	 teaser int (15) NOT NULL default 0 ,
	 
	 podcast int (15) NOT NULL default 1 ,
	 expirydate varchar(25) NOT NULL default '',
     PRIMARY KEY  (id )
)";


$q = mysql_query($query) or die ("Zomplog has already been installed, or you forgot to rename config.php.default to config.php.<br /><br />"); 
echo "<div class='text'><img src='images/check.gif'> $table created</div>";


$query2 = "CREATE TABLE $table_comments (
     id int (10 )  NOT NULL auto_increment ,
     entry_id int (10 )  NOT NULL ,
     name varchar (100 )  NOT NULL ,
     comment text NOT NULL ,
	 date varchar(25) NOT NULL default '',
	 ip varchar(25) NOT NULL,
     PRIMARY KEY  (id )
)";


$q2 = mysql_query($query2) or die (mysql_error()); 
echo "<div class='text'><img src='images/check.gif'> $table_comments created</div>";


$query3 = "CREATE TABLE $table_users (
  id int(5) NOT NULL auto_increment,
  login varchar(15) default 0,
  password varchar(150) default 0,
  admin int(10) NOT NULL default 0,
  name text NOT NULL,
  email text NOT NULL,
  about text NOT NULL,
  
  adress text NOT NULL,
  zip text NOT NULL,
  country text NOT NULL,
   birthday text NOT NULL,
  gender text NOT NULL,
  interests text NOT NULL,
   image text NOT NULL,
   movie text NOT NULL,
   url text NOT NULL,
   
  PRIMARY KEY  (id)
)";


$q3 = mysql_query($query3) or die (mysql_error()); 
echo "<div class='text'><img src='images/check.gif'> $table_users created</div>";


$query4 = "CREATE TABLE $table_cat (
  id int(5) NOT NULL auto_increment,
  name text NOT NULL,
  permissions text NOT NULL,
  
  catorder int (15) NOT NULL default 0 ,
  PRIMARY KEY  (id)
)";

$q4 = mysql_query($query4) or die (mysql_error()); 
echo "<div class='text'><img src='images/check.gif'> $table_cat created</div>";



$query5 = "CREATE TABLE $table_settings (
  name text NOT NULL,
  weblog_title text NOT NULL,  
  image int(11) NOT NULL default 0,
  comments int(11) NOT NULL default 0,
  categories int(11) NOT NULL default 0,
  pages int(11) NOT NULL default 0,
  max int(11) NOT NULL default 0,
  scroll int(15) NOT NULL default 0,
  date text NOT NULL,
  skin text NOT NULL,
  language text NOT NULL,
  use_upload int(15) NOT NULL default 0,
  max_upload int(50) NOT NULL default 0,
  
  use_mediafile int(50) NOT NULL default 0,
  admin_welcome text NOT NULL,
  site_welcome text NOT NULL,
  img_width text NOT NULL,
  img_fullwidth text NOT NULL,
  use_join int(50) NOT NULL default 0,

  weblog_subtitle text NOT NULL,
  use_tinymce int(50) NOT NULL default 0,
  pages_admin int(50) NOT NULL default 0,
  search int(50) NOT NULL default 0,
  archive int(50) NOT NULL default 0,
  teasers int(50) NOT NULL default 0,
  authors int(50) NOT NULL default 0,
  latestentries int(50) NOT NULL default 0,
  latestcomments int(50) NOT NULL default 0,
  users int(50) NOT NULL default 0,
  meta int(50) NOT NULL default 0,
  login int(50) NOT NULL default 0,
  powered int(50) NOT NULL default 0,
  customfield text NOT NULL,
  about text NOT NULL,
  
  rss_description text NOT NULL,
  rss_category text NOT NULL,
  rss_language text NOT NULL,
  rss_email text NOT NULL,
  rss_url text NOT NULL,

  nr_entries int(10) NOT NULL default 10,
  nr_comments int(10) NOT NULL default 10,
  
  PRIMARY KEY  (image)
)";

$query6 = "INSERT INTO $table_settings (name, image, comments, categories, max, scroll, date, skin, language, use_upload, max_upload, use_mediafile, admin_welcome, rss_description, img_width, img_fullwidth, use_tinymce, search, archive, authors, meta, powered, login, pages, pages_admin, weblog_title) VALUES ('default', '1', '1', '1', '5', '5', 'm d Y, G:i', 'default', 'english', '1', '300000', '1', 'Welcome to the Zomplog Dashboard!', 'RSS site description', '150', '450', '1', '1', '1', '1', '1', '1', '1', '1', '1', 'weblog title')";

$q5 = mysql_query($query5) or die (mysql_error()); 
$q6 = mysql_query($query6) or die (mysql_error()); 
echo "<div class='text'><img src='images/check.gif'> $table_settings created</div>";

$query7 = "CREATE TABLE $table_moblog (
  id int(11) NOT NULL auto_increment,
  email varchar(50) NOT NULL default 0,
  server varchar(150) NOT NULL default 0,
  user varchar(50) NOT NULL default 0,
  password varchar(50) NOT NULL default 0,
  shared text NOT NULL,
  use_moblog int(15) NOT NULL default 0,
  PRIMARY KEY  (id)
)";

$query8 = "INSERT INTO $table_moblog (id, email, server, user, password, shared, use_moblog) VALUES ('1', 'hide@address.com', 'localhost', 'name', 'password', 'FALSE', '0')";


$q7 = mysql_query($query7) or die (mysql_error());
$q8 = mysql_query($query8) or die (mysql_error());
echo "<div class='text'><img src='images/check.gif'> $table_moblog created</div>";

$query9 = "CREATE TABLE $table_pages (
     id int (10 )  NOT NULL auto_increment ,
     title varchar (100 )  NOT NULL ,
     text text NOT NULL ,
	 image text NOT NULL ,
	 imagewidth text NOT NULL ,
	 imageheight text NOT NULL ,
	 align text NOT NULL ,
	 use_form int(15) NOT NULL default 0,
	 form_email varchar (100 )  NOT NULL ,
	 
	 mainpage int(15) NOT NULL default 0,
	 
	 pageorder int (15) NOT NULL default 0 ,
     PRIMARY KEY  (id )
)";


$q9 = mysql_query($query9) or die (mysql_error());
echo "<div class='text'><img src='images/check.gif'> $table_pages created</div>";

$query10 = "CREATE TABLE $table_banned (
     id int (10 )  NOT NULL auto_increment ,
     ip varchar (100 )  NOT NULL ,
     PRIMARY KEY  (id )
)";


$q10 = mysql_query($query10) or die (mysql_error());
echo "<div class='text'><img src='images/check.gif'> $table_banned created</div>";

$query11 = "CREATE TABLE $table_themes (
  id int(11) NOT NULL auto_increment,
  name text NOT NULL,
  
  options int(50) NOT NULL default 0,
  headerimage text NOT NULL,
  color1 text NOT NULL,
  color2 text NOT NULL,
  color3 text NOT NULL,
  color4 text NOT NULL,
  color5 text NOT NULL,
  color6 text NOT NULL,
  font1 text NOT NULL,
  font1color text NOT NULL,
  font2 text NOT NULL,
  font2color text NOT NULL,
    font3 text NOT NULL,
  font3color text NOT NULL,
      font4 text NOT NULL,
  font4color text NOT NULL,
  
  PRIMARY KEY  (id)
)";

$q11 = mysql_query($query11) or die (mysql_error());

echo "<div class='text'><img src='images/check.gif'> $table_themes created</div>";


$query12 = "CREATE TABLE $table_plugins (
     id int (10 )  NOT NULL auto_increment ,
     name varchar (100)  NOT NULL ,
	installed int (10) NOT NULL ,
 	 active int (10) NOT NULL ,
     PRIMARY KEY  (id )
)";


$q12 = mysql_query($query12) or die ("Unable to create $table_plugins.<br /><br />"); 
echo "<div class='text'><img src='images/check.gif'> $table_plugins created</div>";


$query13 = "CREATE TABLE $table_files (
     id int (10 )  NOT NULL auto_increment ,
	 entry_id int (10 )  NOT NULL ,
	 page_id int (10) NOT NULL ,
     name varchar (200)  NOT NULL ,
	 type text NOT NULL ,
	 width int (100) NOT NULL ,
	 height int (100) NOT NULL ,
	 full_url text NOT NULL ,
	 
	 fileorder int (15) NOT NULL default 0,
     PRIMARY KEY  (id )
)";


$q13 = mysql_query($query13) or die ("Unable to create $table_files.<br /><br />"); 
echo "<div class='text'><img src='images/check.gif'> $table_files created</div>";


// activate lightbox plugin by default

   $q14 = "INSERT INTO $table_plugins (name,active,installed) VALUES ('lightbox','1','1')";

   mysql_query($q14) or die (mysql_error());

?>
<br />
All set! Let's move on to the <a href="newuser.php">last step</a>. 
<br />
<br />
<br />
</div>
</div>
</body>
</html>
Return current item: ZompLog