//create directories structure
$dirs = array('article', 'award', 'category', 'data', 'league', 'league/logo_small', 'league/logo_big', 'media', 'media/demos', 'media/screen', 'player', 'team', 'team/logo', 'temp', 'temp/cache', 'user', 'user/avatar');
foreach($dirs as $dir){
//create directory
$dir = $path.'files/'.$dir;
if(!file_exists($dir)) mkdir($dir, KML_CHMOD);
//copy blank index file
if(!file_exists($dir.'/index.php')){
copy($path.'files/index.php', $dir.'/index.php');
// chmod($dir.'/index.php', KML_CHMOD);TODO I think that we dont need this one
}
}
$q[] ='INSERT INTO `'.KML_PREFIX.'_category` VALUES (1, 0, "news", "News", "", "article", "1", 5, "A"), (2, 0, "interview", "Interview", "", "article", "2", 10, "A")';
###### USER
$q[] = "INSERT INTO `".KML_PREFIX."_field` ( `db_table` , `field_name` , `field_type` , `visible` , `header` , `header_lang` , `order_row` , `order_section` , `answer` , `answer_lang` , `value_unique` , `value_required` , `value_change` , `value_log`, value_default, field_search, field_list, field_important, field_auto_display, `extra1` , `extra2`, `value_create` )
VALUES
('user', 'id_user', 'system', 'S', 'id_user', '', '0', '0', '', '', 'N', 'N', 'N', 'N', '', '', 'Y', 'Y', 'N', '', '', ''),
('user', 'ip', 'system', 'S', 'ip', '', '0', '0', '', '', 'N', 'N', 'N', 'N', '', '', 'N', 'N', 'N', 'text', '', ''),
('user', 'login', 'text', 'S', '', 'login', '1', '1', '', '', 'G', 'Y', 'N', 'N', '', 'U', 'Y', 'Y', 'N', '3', '15', ''),
('user', 'user_name', 'text', 'S', '', 'name_surn', '9', '1', '', '', 'N', 'N', 'Y', 'N', '', 'U', 'Y', 'Y', 'N', '', '50', ''),
('user', 'pass', 'password', 'S', '', 'password', '2', '1', '', '', 'N', 'Y', 'Y', 'N', '', '', '', '', 'N', '', 'approve', ''),
('user', 'permission', 'select', 'S', '', 'grants', '3', '1', '', '0=blocked_account;1=user;2=admin;3=webmaster', 'N', 'N', 'N', 'Y', '1', '', 'Y', 'Y', 'Y', '5', '100', ''),
('user', 'mail', 'mail', 'S', '', 'mail', '4', '1', '', '', 'G', 'Y', 'N', 'N', '', 'W', 'Y', '', 'Y', '5', '100', ''),
('user', 'send_pm_mail', 'radio', 'S', '', 'send_pm_mail', '6', '1', '', 'Y=yes;N=no', 'N', 'N', 'Y', 'N', 'N', '', '', '', 'N', '', '1', ''),
('user', 'mail_show', 'radio', 'S', '', 'show_mail', '7', '1', '', 'Y=mail_all;R=mail_reg;N=mail_hide', 'N', 'N', 'Y', 'N', 'N', '', 'Y', '', 'N', '', '1', ''),
('user', 'timezone', 'timezone', 'S', '', 'timezone', '8', '1', '', '', 'N', 'N', 'Y', 'N', '0', '', '', '', 'N', '', '', ''),
('user', 'user_country', 'country', 'S', '', 'country', '10', '1', '', '', 'N', 'N', 'Y', 'N', 'unknown', 'U', 'Y', 'Y', 'Y', '', '30', ''),
('user', 'city', 'text', 'Y', '', 'city', '11', '1', '', '', 'N', 'N', 'Y', 'N', '', 'U', 'Y', '', 'Y', '', '40', ''),
('user', 'birth', 'date', 'S', '', 'birth', '12', '1', '', '', 'N', 'N', 'Y', 'N', '', '', '', '', 'Y', '', '1940', ''),
('user', 'team', 'text', 'Y', '', 'prof_team', '13', '1', '', '', 'N', 'N', 'Y', 'N', '', 'U', 'Y', '', 'N', '', '30', ''),
('user', 'team_www', 'url', 'Y', '', 'team_site', '14', '1', '', '', 'N', 'N', 'Y', 'N', '', '', 'Y', '', 'N', '', '50', ''),
('user', 'home_www', 'url', 'Y', '', 'website', '15', '1', '', '', 'N', 'N', 'Y', 'N', '', '', 'Y', 'N', 'N', '', '50', ''),
('user', 'comm_icq', 'text', 'Y', 'ICQ', '', '16', '1', '', '', 'N', 'N', 'Y', 'N', '', '', 'Y', 'N', 'N', '', '30', ''),
('user', 'comm_msn', 'text', 'Y', 'MSN', '', '17', '1', '', '', 'N', 'N', 'Y', 'N', '', '', 'Y', 'N', 'N', '', '30', ''),
('user', 'info', 'text', 'Y', '', 'other_info', '18', '1', '', '', 'N', 'N', 'Y', 'N', '', '', '', '', 'Y', '', '250', ''),
('user', 'avatar', 'file', 'Y', 'Avatar', '', '19', '1', '', 'gif;jpg;jpeg;png', 'N', 'N', 'Y', 'N', '', '', 'Y', 'Y', 'N', '20', '60:60', ''),
('user', 'added', 'system', 'S', '', 'reg_date', '20', '1', '', '', 'N', 'N', 'N', 'N', '', '', 'N', 'N', 'Y', 'timestamp', '', ''),
('user', 'lastlog', 'system', 'S', '', 'last_log', '21', '1', '', '', 'N', 'N', 'N', 'N', '', '', 'N', 'N', 'Y', 'timestamp', '', '')
";
### PLAYER
$q[] = "INSERT INTO `".KML_PREFIX."_field` ( `db_table` , `field_name` , `field_type` , `visible` , `header` , `header_lang` , `order_row` , `order_section` , `answer` , `answer_lang` , `value_unique` , `value_required` , `value_change` , `value_log`, value_default, field_search, field_list, field_important, field_auto_display, `extra1` , `extra2`, `value_create`)
VALUES
('player', 'id_player', 'system', 'S', 'id_player', '', '0', '0', '', '', 'N', 'N', 'N', 'N', '', '', 'Y', 'Y', 'N', '', '', ''),
('player', 'id_team', 'system', 'S', 'id_team', '', '0', '0', '', '', 'N', 'N', 'N', 'N', '', '', 'Y', 'Y', 'N', '', '', ''),
('player', 'id_user', 'system', 'S', 'id_user', '', '0', '0', '', '', 'N', 'N', 'N', 'N', '', '', 'Y', 'Y', 'N', '', '', ''),
('player', 'player_name', 'text', 'S', '', 'nick', '1', '1', '', '', 'N', 'Y', 'Y', 'Y', '', 'U', 'Y', 'Y', 'Y', '3', '15', ''),
('player', 'grade', 'select', 'S', '', 'function', '2', '1', '', 'A=func_cl;B=func_war;C=team_member;D=team_recruit', 'N', 'N', 'Y', 'Y', 'D', 'U', 'Y', 'Y', 'Y', '', '1', ''),
('player', 'contact', 'text', 'S', '', 'contact', '3', '1', '', '', 'N', 'N', 'Y', 'N', '', 'U', '', '', 'Y', '', '60', 'Y'),
('player', 'ident', 'text', 'Y', 'ID', '', '4', '1', '', '', 'N', 'N', 'Y', 'Y', '', 'A', '', '', 'Y', '', '30', 'Y'),
('player', 'other', 'text', 'Y', '', 'ply_other', '5', '1', '', '', 'N', 'N', 'Y', 'N', '', '', '', '', 'Y', '', '20', 'Y')";
### TEAM
$q[] = "INSERT INTO `".KML_PREFIX."_field` ( `db_table` , `field_name` , `field_type` , `visible` , `header` , `header_lang` , `order_row` , `order_section` , `answer` , `answer_lang` , `value_unique` , `value_required` , `value_change` , `value_log`, value_default, field_search, field_list, field_important, field_auto_display, `extra1` , `extra2`, `value_create`)
VALUES
('team', 'id_team', 'system', 'S', 'id_team', '', '0', '0', '', '', 'N', 'N', 'N', 'N', '', '', 'Y', 'Y', 'N', '', '', ''),
('team', 'tag', 'text', 'S', '', 'tag', '1', '1', '', '', 'G', 'Y', 'N', 'N', '', 'U', 'Y', 'Y', 'Y', '', '15', ''),
('team', 'team_name', 'text', 'S', '', 'name', '2', '1', '', '', 'G', 'Y', 'N', 'N', '', 'U', 'Y', 'Y', 'Y', '', '30', ''),
('team', 'team_country', 'country', 'S', '', 'country', '3', '1', '', '', 'N', 'N', 'Y', 'N', 'unknown', 'U', 'Y', 'Y', 'Y', '', '', ''),
('team', 'active', 'radio', 'S', '', 'active', '4', '1', '', 'Y=yes;N=no', 'N', 'N', 'Y', 'N', 'Y', '', 'Y', '', 'N', '', '1', ''),
('team', 'www', 'url', 'Y', '', 'team_site', '5', '1', '', '', 'N', 'N', 'Y', 'N', '', '', 'Y', '', 'Y', '', '50', ''),
('team', 'info', 'text', 'Y', '', 'other_info', '6', '1', '', '', 'N', 'N', 'Y', 'N', '', '', '', '', 'Y', '', '200', ''),
('team', 'irc_channel', 'text', 'Y', '', 'irc_channel', '7', '1', '', '', 'N', 'N', 'Y', 'N', '', '', '', '', 'Y', '', '50', ''),
('team', 'team_pass', 'password', 'S', '', 'team_join_passw', '8', '1', '', '', 'N', 'N', 'Y', 'N', '', '', '', '', 'N', '', '', ''),
('team', 'logo', 'file', 'Y', '', 'team_logo', '9', '2', '', 'gif;jpg;jpeg;png', 'N', 'N', 'Y', 'N', '', '', '', '', 'N', '200', '', '')";
$q[] = 'INSERT INTO '.KML_PREFIX.'_field_league(id_field, league) SELECT id_field, "1" FROM '.KML_PREFIX.'_field';
foreach($q as $k=>$qry){
if(!mysql_query($qry)){
$critical = 1;
echo $qry.':'.mysql_error() .'<br/>'."\n";
}
}
if($critical == 1) print($lang['step_er3']);
else print($lang['step_ok3']);
break;
}