<?
if (!defined('INSTALL_MODULES')) {
	die ("You can't access this file directly...");
}

if ((!is_god($admin)) && (!is_user($user)) && (!is_admin($admin))) { 
redirect_url("".$admin_file.".php?op=modules"); }


$numbertables = 3;


$result1 = $db2->sql_query("CREATE TABLE ".$prefix_install."_nsnml_config(
  `config_name` varchar(255) NOT NULL default '',
  `config_value` tinytext NOT NULL,
  PRIMARY KEY  (`config_name`))");

$db2->sql_query("INSERT INTO ".$prefix_install."_nsnml_config VALUES ('date_format', 'Y-m-d H:i:s')");
$db2->sql_query("INSERT INTO ".$prefix_install."_nsnml_config VALUES ('version_number', '1.0.1')");

################################################################################

$result2 = $db2->sql_query("CREATE TABLE ".$prefix_install."_nsnml_issues(
  `nid` int(11) NOT NULL auto_increment,
  `lid` int(11) NOT NULL default '0',
  `subject` varchar(255) default NULL,
  `text_plain` mediumtext,
  `text_html` mediumtext,
  `sent` int(20) NOT NULL default '0',
  PRIMARY KEY  (`nid`))");

################################################################################

$result3 = $db2->sql_query("CREATE TABLE ".$prefix_install."_nsnml_lists(
  `lid` int(11) NOT NULL auto_increment,
  `title` varchar(30) default NULL,
  `description` text,
  PRIMARY KEY  (`lid`))");

$db2->sql_query("INSERT INTO ".$prefix_install."_nsnml_lists VALUES (1, 'demo', 'demo')");
################################################################################

$result4 = $db2->sql_query("CREATE TABLE ".$prefix_install."_nsnml_tracked(
  `tid` int(11) NOT NULL auto_increment,
  `mid` int(11) NOT NULL default '0',
  `nid` int(11) NOT NULL default '0',
  `lid` int(11) NOT NULL default '0',
  `sent` int(20) NOT NULL default '0',
  PRIMARY KEY  (`tid`))");

################################################################################

$result5 = $db2->sql_query("CREATE TABLE ".$prefix_install."_nsnml_users(
  `mid` int(11) NOT NULL auto_increment,
  `lid` int(11) NOT NULL default '0',
  `email` varchar(100) NOT NULL default '',
  `active` int(2) NOT NULL default '0',
  `html` int(2) NOT NULL default '0',
  `act_key` int(11) NOT NULL default '0',
  `joined` int(20) NOT NULL default '0',
  PRIMARY KEY  (`mid`))");

?>