<?
include("../includes/site_config.php");
ini_set("display_errors", 1);
##################################

# Option table update and Insert

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

$ins= mysql_query("INSERT INTO optionsgroup (Name, Title) VALUES (
('approval', 'DB_OPTION_APPROVE'),
('activate', 'DB_OPTION_ACTIVATE')") or die(mysql_error);


mysql_query("UPDATE members set OptionsGroup_ID ='1' where Name='1month' or Name='3month' or Name='6month' or Name='12month'") or die(mysql_error());

mysql_query("UPDATE members set OptionsGroup_ID ='2' where Name='maxpicsize' or Name='maxvidsize' or Name='maxaudsize'") or die(mysql_error());

mysql_query("UPDATE members set OptionsGroup_ID ='3' where Name='initialreferal' or Name='subsequentreferal'") or die(mysql_error());


mysql_query("UPDATE members set OptionsGroup_ID ='5' where Name='freetime' or Name='default_language' or Name='currency' or Name='currency_symbol' or Name='image_count' or Name='format_date_short' or Name='format_time_short' or Name='page_size' or Name='trial_gender' or Name='skin' or Name='video_count' or Name='audio_count' or Name='youtube_count' or Name='session_exptime'") or die(mysql_error());

mysql_query("UPDATE members set OptionsGroup_ID ='8' where Name='company' or Name='affmail' or Name='mail' or Name='suppmail' or Name='url' or Name='flirtmail'") or die(mysql_error());

mysql_query("UPDATE members set OptionsGroup_ID ='9' where Name='userplane_chat' or Name='userplane_im' or Name='userplane_domain' or Name='userplane_domain_full'") or die(mysql_error());

mysql_query("UPDATE members set OptionsGroup_ID ='10' where Name='table_width' or Name='table_cellpadding' or Name='table_cellspacing' or Name='memimage_height' or Name='memimage_width' or Name='subtable_cellspacing' or Name='subtable_cellpadding' or Name='table_align' or Name='story_image_height' or Name='story_image_width' or Name='story_image_weight' or Name='comment_width'") or die(mysql_error());

mysql_query("UPDATE members set OptionsGroup_ID ='11' where Name='userplane_freechat_domainid'") or die(mysql_error());

mysql_query("UPDATE members set OptionsGroup_ID ='12' where Name='snetwork' or Name='snetwork_depth'") or die(mysql_error());

mysql_query("UPDATE members set OptionsGroup_ID ='13' where Name='spam' or Name='spam_tolerange' or Name='spam_limit'") or die(mysql_error());

mysql_query("UPDATE members set OptionsGroup_ID ='14' where Name='authorisead' or Name='authorisegal' or Name='authorisecomment' or Name='authorisead_image' or Name='authorisead_blog' or Name='authorisead_article' or Name='authorisead_audio' or Name='authorisead_video' or Name='authorisead_youtube'") or die(mysql_error());

mysql_query("UPDATE members set OptionsGroup_ID ='15' where Name='free' or Name='security_registration' or Name='zipcodes' or Name='geography_javascript' or Name='videos' or Name='audios' or Name='flirt' or Name='thumbs' or Name='email_confirm' or Name='avatars_gallery' or Name='my_blogs' or Name='skype' or Name='video' or Name='youtube_enable' or Name='my_friends' or Name='my_articles' or Name='crop'") or die(mysql_error());


$t='$t';

$insOp = "INSERT IGNORE INTO  options(`Name`, `Value`, `Label`, `Config`, `OptionsGroup_ID`, `Type`, `Comments`, `Order`) VALUES ('my_friends', '1', 'DB_OPTION_MYFRIEND_LABEL', '$t = array(
\"0\"=>\"Off\",
\"1\"=>\"On\",
);
return $t;', 15, 'list', 'DB_OPTION_MYFRIEND', 0), ('authorisead_blog', '0', 'DB_OPTION_AUTHORISEBLOG_LABEL', '$t = array(
\"0\"=>\"Off\",
\"1\"=>\"On\",
);
return $t;', 14, 'list', 'DB_OPTION_AUTHORISEBLOG', 0), ('authorisead_article', '0', 'DB_OPTION_AUTHORISEART_LABEL', '$t = array(
\"0\"=>\"Off\",
\"1\"=>\"On\",
);
return $t;', 14, 'list', 'DB_OPTION_AUTHORISE_ART', 0), ('authorisegal', 'Pending', 'DB_OPTION_AUTHORISEGAL_LABEL', '$t = array(
\"Pending\"=>\"Off\",
\"Approved\"=>\"On\",
);
return $t;', 14, 'list', 'DB_OPTION_AUTHORISEGAL', 0), ('my_blogs', '0', 'DB_OPTION_MYBLOGS_ENABLE_LABEL', '$t = array(
\"0\"=>\"Off\",
\"1\"=>\"On\",
);
return $t;', 15, 'list', 'DB_OPTION_MYBLOGS', 0), ('my_articles', '1', 'DB_OPTION_MYARTICLES_ENABLE_LABEL', '$t = array(
\"0\"=>\"Off\",
\"1\"=>\"On\",
);
return $t;', 15, 'list', 'DB_OPTION_MYARTICLES', 0), ('crop', '1', 'DB_OPTION_CROP_ENABLE_LABEL', '$t = array(
\"0\"=>\"Off\",
\"1\"=>\"On\",
);
return $t;', 15, 'list', 'DB_OPTION_CROP', 0), ('authorisead_audio', '0', 'DB_OPTION_AUTHORISEAD_AUDIO_LABEL', '$t = array(
\"0\"=>\"Off\",
\"1\"=>\"On\",
);
return $t;', 14, 'list', 'DB_OPTION_AUTHORISEAD_AUDIO', 0), ('authorisead_video', '0', 'DB_OPTION_AUTHORISEAD_VIDEO_LABEL', '$t = array(
\"0\"=>\"Off\",
\"1\"=>\"On\",
);
return $t;', 14, 'list', 'DB_OPTION_AUTHORISEAD_VIDEO', 0), ('authorisead_youtube', '0', 'DB_OPTION_AUTHORISEAD_YOU_LABEL', '$t = array(
\"0\"=>\"Off\",
\"1\"=>\"On\",
);
return $t;', 14, 'list', 'DB_OPTION_AUTHORISEAD_YOU', 0)";


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

############################]

#####New Tables to Be created

mysql_query("CREATE TABLE `articles` (
  `art_id` int(11) NOT NULL auto_increment,
  `art_userid` int(11) NOT NULL default '0',
  `art_datetime` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
  `art_title` varchar(200) NOT NULL default '',
  `art_message` text NOT NULL,
  `art_tags` text NOT NULL,
  `art_approved` enum('Y','N') NOT NULL default 'N',
  `art_private` enum('Y','N') NOT NULL default 'N',
  PRIMARY KEY  (`art_id`)
)") or die(mysql_error());


mysql_query("CREATE TABLE `blacklist` (
  `black_id` int(11) NOT NULL auto_increment,
  `blacklist_ip` varchar(255) NOT NULL default '',
  `black_date` date NOT NULL default '0000-00-00',
  PRIMARY KEY  (`black_id`)
)") or die(mysql_error());



###### Modification required

# Need to Drop first

mysql_query("DROP TABLE `my_friends`") or die(mysql_error());

mysql_query("CREATE TABLE `my_friends` (
  `uid` varchar(25) NOT NULL default '',
  `friend_uid` varchar(25) NOT NULL default '',
  `status` char(1) NOT NULL default 'A',
  `is_deleted` char(1) NOT NULL default 'F',
  `approved` enum('0','1') NOT NULL default '0'
)") or die(mysql_error());


# Need to Drop first

mysql_query("DROP TABLE `blogs`") or die(mysql_error());

mysql_query("CREATE TABLE `blogs` (
  `blg_id` int(11) NOT NULL auto_increment,
  `blg_userid` int(11) NOT NULL default '0',
  `blg_datetime` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
  `blg_title` varchar(200) NOT NULL default '',
  `blg_message` text NOT NULL,
  `blg_tags` text NOT NULL,
  `blg_approved` enum('Y','N') NOT NULL default 'N',
  `blg_private` enum('Y','N') NOT NULL default 'N',
  PRIMARY KEY  (`blg_id`),
  KEY `blg_userid` (`blg_userid`)
)") or die(mysql_error());



mysql_query("CREATE TABLE `member_stats` (
  `stat_id` int(11) NOT NULL auto_increment,
  `statDate` date NOT NULL default '0000-00-00',
  `counter` int(11) NOT NULL default '0',
  `counter_sign` int(11) NOT NULL default '0',
  PRIMARY KEY  (`stat_id`)
)") or die(mysql_error());


mysql_query("ALTER TABLE `adverts` ADD `adv_phone` VARCHAR( 15 ) NOT NULL AFTER `adv_bio` ,
ADD `phn_provider` VARCHAR( 50 ) NOT NULL AFTER `adv_phone`") or die(mysql_error());


mysql_query("CREATE TABLE `sms` (
  `sms_id` int(11) NOT NULL auto_increment,
  `title` varchar(50) NOT NULL default '',
  `address` varchar(50) NOT NULL default '',
  PRIMARY KEY  (`sms_id`)
)")  or die(mysql_error());


mysql_query("INSERT INTO `sms` (`title`, `address`) VALUES (3, 'Boost Mobile', '@myboostmobile.com'),
('AT&T', '@txt.att.net'),
('Nextel', '@messaging.nextel.com'),
('Sprint', '@messaging.sprintpcs.com'),
('Tmobile', '@tmomail.net'),
('Virizon', '@vtext.com'),
('Virgin Mobile', '@vmobl.com'),
('AllTel', '@message.alltel.com')") or die(mysql_error());



#active_dropdown(Auto Generated)

?>
