PageRenderTime 57ms CodeModel.GetById 28ms RepoModel.GetById 1ms app.codeStats 0ms

/InstallDatabase.php

https://bitbucket.org/PHPSocial/phpsocial
PHP | 621 lines | 409 code | 180 blank | 32 comment | 0 complexity | 0d3f0d8add8558d381be09f78ba4c251 MD5 | raw file
  1. <?php
  2. // clear database
  3. mysql_query("DROP TABLE IF EXISTS phps_actions");
  4. mysql_query("DROP TABLE IF EXISTS phps_actiontypes");
  5. mysql_query("DROP TABLE IF EXISTS phps_admins");
  6. mysql_query("DROP TABLE IF EXISTS phps_ads");
  7. mysql_query("DROP TABLE IF EXISTS phps_announcements");
  8. mysql_query("DROP TABLE IF EXISTS phps_fields");
  9. mysql_query("DROP TABLE IF EXISTS phps_friendexplains");
  10. mysql_query("DROP TABLE IF EXISTS phps_friends");
  11. mysql_query("DROP TABLE IF EXISTS phps_invites");
  12. mysql_query("DROP TABLE IF EXISTS phps_levels");
  13. mysql_query("DROP TABLE IF EXISTS phps_logins");
  14. mysql_query("DROP TABLE IF EXISTS phps_plugins");
  15. mysql_query("DROP TABLE IF EXISTS phps_pms");
  16. mysql_query("DROP TABLE IF EXISTS phps_profilecomments");
  17. mysql_query("DROP TABLE IF EXISTS phps_profiles");
  18. mysql_query("DROP TABLE IF EXISTS phps_profilestyles");
  19. mysql_query("DROP TABLE IF EXISTS phps_reports");
  20. mysql_query("DROP TABLE IF EXISTS phps_settings");
  21. mysql_query("DROP TABLE IF EXISTS phps_statrefs");
  22. mysql_query("DROP TABLE IF EXISTS phps_stats");
  23. mysql_query("DROP TABLE IF EXISTS phps_subnets");
  24. mysql_query("DROP TABLE IF EXISTS phps_tabs");
  25. mysql_query("DROP TABLE IF EXISTS phps_urls");
  26. mysql_query("DROP TABLE IF EXISTS phps_users");
  27. mysql_query("DROP TABLE IF EXISTS phps_usersettings");
  28. // create table phps_actions
  29. mysql_query("CREATE TABLE `phps_actions` (
  30. `action_id` int(9) NOT NULL auto_increment,
  31. `action_actiontype_id` int(9) NOT NULL default '0',
  32. `action_date` int(14) NOT NULL default '0',
  33. `action_user_id` int(9) NOT NULL default '0',
  34. `action_subnet_id` int(9) NOT NULL default '0',
  35. `action_icon` varchar(50) NOT NULL default '',
  36. `action_text` text NOT NULL,
  37. PRIMARY KEY (`action_id`),
  38. KEY `action_user_id` (`action_user_id`),
  39. KEY `action_subnet_id` (`action_subnet_id`)
  40. ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci") or die("Create: phps_actions<br>Error: ".mysql_error());
  41. // create table phps_actiontypes
  42. mysql_query("CREATE TABLE `phps_actiontypes` (
  43. `actiontype_id` int(9) NOT NULL auto_increment,
  44. `actiontype_name` varchar(50) NOT NULL default '',
  45. `actiontype_icon` varchar(50) NOT NULL default '',
  46. `actiontype_desc` varchar(250) NOT NULL default '',
  47. `actiontype_desc_other` varchar(250) default '',
  48. `actiontype_enabled` int(1) NOT NULL default '0',
  49. `actiontype_text` text NOT NULL,
  50. PRIMARY KEY (`actiontype_id`),
  51. UNIQUE KEY `actiontype_name` (`actiontype_name`)
  52. ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci") or die("Create: phps_actiontypes<br>Error: ".mysql_error());
  53. //inserting data into phps_actiontypes
  54. mysql_query("INSERT INTO `phps_actiontypes` (`actiontype_id`, `actiontype_name`, `actiontype_icon`, `actiontype_desc`, `actiontype_desc_other`, `actiontype_enabled`, `actiontype_text`) VALUES
  55. (1, 'login', 'action_login.gif', 'When I log in.', 'Logins', 1, '&lt;a href=&#039;Profile.php?user=[username]&#039;&gt;[username]&lt;/a&gt; logged in.'),
  56. (2, 'editphoto', 'action_editphoto.gif', 'When I update my profile photo.', 'Avatar updates', 1, '&lt;a href=&#039;Profile.php?user=[username]&#039;&gt;[username]&lt;/a&gt; updated their profile photo.&lt;div style=&#039;padding: 10px 10px 10px 20px;&#039;&gt;&lt;a href=&#039;Profile.php?user=[username]&#039;&gt;&lt;img src=&#039;[photo]&#039; border=&#039;0&#039;&gt;&lt;/a&gt;&lt;/div&gt;'),
  57. (3, 'editprofile', 'action_editprofile.gif', 'When I update my profile.', 'Profile updates', 1, '&lt;a href=&#039;Profile.php?user=[username]&#039;&gt;[username]&lt;/a&gt; updated their profile.'),
  58. (4, 'postcomment', 'action_postcomment.gif', 'When I post a comment on someone&#039;s profile.', 'Profile comments', 1, '&lt;a href=&#039;Profile.php?user=[username1]&#039;&gt;[username1]&lt;/a&gt; posted a comment on &lt;a href=&#039;Profile.php?user=[username2]&#039;&gt;[username2]&lt;/a&gt;&#039;s profile:&lt;div style=&#039;padding: 10px 20px 10px 20px;&#039;&gt;[comment]&lt;/div&gt;'),
  59. (5, 'addfriend', 'action_addfriend.gif', 'When I add a friend.', 'Adding a friend.', 1, '&lt;a href=&#039;Profile.php?user=[username1]&#039;&gt;[username1]&lt;/a&gt; and &lt;a href=&#039;Profile.php?user=[username2]&#039;&gt;[username2]&lt;/a&gt; are now friends.'),
  60. (6, 'signup', 'action_signup.gif', '', 'Signups', 1, '&lt;a href=&#039;Profile.php?user=[username]&#039;&gt;[username]&lt;/a&gt; signed up.'),
  61. (7, 'editstatus', 'action_editstatus.gif', 'When I update my status.', 'Status updates', 1, '&lt;a href=&#039;Profile.php?user=[username]&#039;&gt;[username]&lt;/a&gt; is [status]')");
  62. // create table phps_admins
  63. mysql_query("CREATE TABLE `phps_admins` (
  64. `admin_id` int(9) NOT NULL auto_increment,
  65. `admin_username` varchar(50) NOT NULL default '',
  66. `admin_password` varchar(50) NOT NULL default '',
  67. `admin_name` varchar(50) NOT NULL default '',
  68. `admin_email` varchar(70) NOT NULL default '',
  69. `admin_lostpassword_code` varchar(15) NOT NULL default '',
  70. `admin_lostpassword_time` int(14) NOT NULL default '0',
  71. PRIMARY KEY (`admin_id`),
  72. UNIQUE KEY `UNIQUE` (`admin_username`)
  73. ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci") or die("Create: phps_admins<br>Error: ".mysql_error());
  74. //inserting data into DEFAULTS INTO phps_admins
  75. mysql_query("INSERT INTO `phps_admins` (`admin_username`, `admin_password`, `admin_name`, `admin_email`) VALUES ('admin', '$adminPasswordHash', 'Administrator', 'email@domain.com')") or die("Insert: phps_admins<br>Error: ".mysql_error());
  76. // create table phps_ads
  77. mysql_query("CREATE TABLE `phps_ads` (
  78. `ad_id` int(9) NOT NULL auto_increment,
  79. `ad_name` varchar(250) NOT NULL default '',
  80. `ad_date_start` varchar(15) NOT NULL default '',
  81. `ad_date_end` varchar(15) NOT NULL default '',
  82. `ad_paused` int(1) NOT NULL default '0',
  83. `ad_limit_views` int(10) NOT NULL default '0',
  84. `ad_limit_clicks` int(10) NOT NULL default '0',
  85. `ad_limit_ctr` varchar(8) NOT NULL default '0',
  86. `ad_public` int(1) NOT NULL default '0',
  87. `ad_position` varchar(15) NOT NULL default '',
  88. `ad_levels` text NOT NULL,
  89. `ad_subnets` text NOT NULL,
  90. `ad_html` text NOT NULL,
  91. `ad_total_views` int(10) NOT NULL default '0',
  92. `ad_total_clicks` int(10) NOT NULL default '0',
  93. `ad_filename` varchar(20) NOT NULL default '',
  94. PRIMARY KEY (`ad_id`)
  95. ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci") or die("Create: phps_ads<br>Error: ".mysql_error());
  96. // create table phps_announcements
  97. mysql_query("CREATE TABLE `phps_announcements` (
  98. `announcement_id` int(9) NOT NULL auto_increment,
  99. `announcement_order` int(9) NOT NULL default '0',
  100. `announcement_date` varchar(255) NOT NULL default '0',
  101. `announcement_subject` varchar(255) NOT NULL default '',
  102. `announcement_body` text NULL,
  103. PRIMARY KEY (`announcement_id`)
  104. ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci") or die("Create: phps_announcements<br>Error: ".mysql_error());
  105. // create table phps_fields
  106. mysql_query("CREATE TABLE `phps_fields` (
  107. `field_id` int(9) NOT NULL auto_increment,
  108. `field_tab_id` int(9) NOT NULL default '0',
  109. `field_order` int(3) NOT NULL default '0',
  110. `field_dependency` int(9) NOT NULL default '0',
  111. `field_title` varchar(100) NOT NULL default '',
  112. `field_desc` text,
  113. `field_error` varchar(250) NOT NULL default '',
  114. `field_type` int(1) NOT NULL default '0',
  115. `field_signup` int(1) NOT NULL default '0',
  116. `field_style` varchar(200) NOT NULL default '',
  117. `field_maxlength` int(3) NOT NULL default '0',
  118. `field_link` varchar(250) NOT NULL default '',
  119. `field_options` text,
  120. `field_browsable` int(1) NOT NULL default '0',
  121. `field_required` int(1) NOT NULL default '0',
  122. `field_regex` varchar(250) NOT NULL default '',
  123. `field_birthday` int(1) NOT NULL default '0',
  124. `field_html` varchar(250) NOT NULL default '',
  125. PRIMARY KEY (`field_id`),
  126. KEY `INDEX` (`field_tab_id`)
  127. ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci") or die("Create: phps_fields<br>Error: ".mysql_error());
  128. //inserting data into DEFAULTS INTO phps_fields
  129. mysql_query("INSERT INTO `phps_fields` (`field_id`, `field_tab_id`, `field_order`, `field_dependency`, `field_title`, `field_desc`, `field_error`, `field_type`, `field_signup`, `field_style`, `field_maxlength`, `field_link`, `field_options`, `field_browsable`, `field_required`, `field_regex`, `field_birthday`, `field_html`) VALUES
  130. (1, 2, 7, 0, 'Country', '', '', 1, 1, '', 50, '', '', 2, 0, '', 0, ''),
  131. (2, 2, 8, 0, 'Phone Number', 'Ex: (888) 555-1234', '', 1, 1, '', 50, '', '', 2, 0, '', 0, ''),
  132. (3, 2, 9, 0, 'Website URL', 'Ex: http://www.yoursite.com', '', 1, 1, '', 50, '[field_value]', '', 2, 0, '', 0, ''),
  133. (4, 2, 6, 0, 'State/Province', '', '', 1, 1, '', 50, '', '', 2, 0, '', 0, ''),
  134. (5, 2, 5, 0, 'City', '', '', 1, 1, '', 50, '', '', 2, 0, '', 0, ''),
  135. (6, 1, 3, 0, 'Gender', '', '', 3, 1, '', 50, '', '0<!>Male<!>0<!><~!~>1<!>Female<!>0<!><~!~>', 2, 0, '', 0, ''),
  136. (7, 2, 4, 0, 'Street Address', '', '', 1, 1, '', 50, '', '', 2, 0, '', 0, ''),
  137. (8, 1, 1, 0, 'Name', '', '', 1, 1, '', 50, '', '', 2, 0, '', 0, ''),
  138. (9, 1, 2, 0, 'Birthday', '', '', 5, 1, '', 50, '', '', 2, 0, '', 1, '')") or die("Insert: phps_fields<br>Error: ".mysql_error());
  139. // create table phps_friendexplains
  140. mysql_query("CREATE TABLE `phps_friendexplains` (
  141. `friendexplain_id` int(9) NOT NULL auto_increment,
  142. `friendexplain_friend_id` int(9) NOT NULL default '0',
  143. `friendexplain_body` text NULL,
  144. PRIMARY KEY (`friendexplain_id`),
  145. KEY `friend_id` (`friendexplain_friend_id`)
  146. ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci") or die("Create: phps_friendexplains<br>Error: ".mysql_error());
  147. // create table phps_friends
  148. mysql_query("CREATE TABLE `phps_friends` (
  149. `friend_id` int(9) NOT NULL auto_increment,
  150. `friend_user_id1` int(9) NOT NULL default '0',
  151. `friend_user_id2` int(9) NOT NULL default '0',
  152. `friend_status` int(1) NOT NULL default '0',
  153. `friend_type` varchar(50) NOT NULL default '',
  154. PRIMARY KEY (`friend_id`),
  155. KEY `INDEX` (`friend_user_id1`,`friend_user_id2`)
  156. ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci") or die("Create: phps_friends<br>Error: ".mysql_error());
  157. // create table phps_invites
  158. mysql_query("CREATE TABLE `phps_invites` (
  159. `invite_id` int(9) NOT NULL auto_increment,
  160. `invite_user_id` int(9) NOT NULL default '0',
  161. `invite_date` int(14) NOT NULL default '0',
  162. `invite_email` varchar(70) NOT NULL default '',
  163. `invite_code` varchar(10) NOT NULL default '',
  164. PRIMARY KEY (`invite_id`)
  165. ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci") or die("Create: phps_invites<br>Error: ".mysql_error());
  166. // create table phps_levels
  167. mysql_query("CREATE TABLE `phps_levels` (
  168. `level_id` int(9) NOT NULL auto_increment,
  169. `level_name` varchar(50) NOT NULL default '',
  170. `level_desc` text NOT NULL,
  171. `level_default` int(1) NOT NULL default '0',
  172. `level_signup` int(1) NOT NULL default '0',
  173. `level_message_allow` int(1) NOT NULL default '0',
  174. `level_message_inbox` int(3) NOT NULL default '0',
  175. `level_message_outbox` int(3) NOT NULL default '0',
  176. `level_profile_style` int(1) NOT NULL default '0',
  177. `level_profile_block` int(1) NOT NULL default '0',
  178. `level_profile_search` int(1) NOT NULL default '0',
  179. `level_profile_privacy` varchar(10) NOT NULL default '',
  180. `level_profile_comments` varchar(10) NOT NULL default '',
  181. `level_profile_status` int(1) NOT NULL default '0',
  182. `level_photo_allow` int(1) NOT NULL default '0',
  183. `level_photo_width` varchar(3) NOT NULL default '',
  184. `level_photo_height` varchar(3) NOT NULL default '',
  185. `level_photo_exts` varchar(50) NOT NULL default '',
  186. PRIMARY KEY (`level_id`)
  187. ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci") or die("Create: phps_levels<br>Error: ".mysql_error());
  188. //inserting data into DEFAULTS INTO phps_levels
  189. mysql_query("INSERT INTO `phps_levels` (`level_name`, `level_desc`, `level_default`, `level_signup`, `level_message_allow`, `level_message_inbox`, `level_message_outbox`, `level_profile_style`, `level_profile_block`, `level_profile_search`, `level_profile_privacy`, `level_profile_comments`, `level_profile_status`, `level_photo_allow`, `level_photo_width`, `level_photo_height`, `level_photo_exts`) VALUES ('Default Level', '', 1, 0, 1, 100, 50, 1, 1, 1, '012345', '0123456', 1, 1, 200, 200, 'jpg,jpeg,gif,png')") or die("Insert: phps_levels<br>Error: ".mysql_error());
  190. // create table phps_logins
  191. mysql_query("CREATE TABLE `phps_logins` (
  192. `login_id` int(9) NOT NULL auto_increment,
  193. `login_email` varchar(70) NOT NULL default '',
  194. `login_password` varchar(50) NOT NULL default '',
  195. `login_date` int(14) NOT NULL default '0',
  196. `login_ip` varchar(15) NOT NULL default '',
  197. `login_result` int(1) NOT NULL default '0',
  198. PRIMARY KEY (`login_id`)
  199. ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci") or die("Create: phps_logins<br>Error: ".mysql_error());
  200. // create table phps_plugins
  201. mysql_query("CREATE TABLE `phps_plugins` (
  202. `plugin_id` int(9) NOT NULL auto_increment,
  203. `plugin_name` varchar(100) NOT NULL default '',
  204. `plugin_version` varchar(4) NOT NULL default '',
  205. `plugin_type` varchar(30) NOT NULL default '',
  206. `plugin_desc` text NOT NULL,
  207. `plugin_icon` varchar(50) NOT NULL default '',
  208. `plugin_pages_main` text NOT NULL,
  209. `plugin_pages_level` text NOT NULL,
  210. `plugin_url_htaccess` text NOT NULL,
  211. `plugin_search` int(1) DEFAULT 0,
  212. PRIMARY KEY (`plugin_id`),
  213. UNIQUE KEY `plugin_type` (`plugin_type`)
  214. ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci") or die("Create: phps_plugins<br>Error: ".mysql_error());
  215. // create table phps_pms
  216. mysql_query("CREATE TABLE `phps_pms` (
  217. `pm_id` int(9) NOT NULL auto_increment,
  218. `pm_user_id` int(9) NOT NULL default '0',
  219. `pm_authoruser_id` int(9) NOT NULL default '0',
  220. `pm_convo_id` int(9) NOT NULL default '0',
  221. `pm_date` int(14) NOT NULL default '0',
  222. `pm_subject` varchar(50) NOT NULL default '',
  223. `pm_body` text NULL,
  224. `pm_status` int(1) NOT NULL default '0',
  225. `pm_outbox` int(1) NOT NULL default '0',
  226. PRIMARY KEY (`pm_id`),
  227. KEY `INDEX` (`pm_user_id`)
  228. ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci") or die("Create: phps_pms<br>Error: ".mysql_error());
  229. // create table phps_profilecomments
  230. mysql_query("CREATE TABLE `phps_profilecomments` (
  231. `profilecomment_id` int(9) NOT NULL auto_increment,
  232. `profilecomment_user_id` int(9) NOT NULL default '0',
  233. `profilecomment_authoruser_id` int(9) NOT NULL default '0',
  234. `profilecomment_date` int(14) NOT NULL default '0',
  235. `profilecomment_body` text NULL,
  236. PRIMARY KEY (`profilecomment_id`),
  237. KEY `profilecomment_user_id` (`profilecomment_user_id`,`profilecomment_authoruser_id`)
  238. ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci") or die("Create: phps_profilecomments<br>Error: ".mysql_error());
  239. // create table phps_profiles
  240. mysql_query("CREATE TABLE `phps_profiles` (
  241. `profile_id` int(9) NOT NULL auto_increment,
  242. `profile_user_id` int(9) NOT NULL default '0',
  243. `profile_1` varchar(250) NOT NULL default '',
  244. `profile_2` varchar(250) NOT NULL default '',
  245. `profile_3` varchar(250) NOT NULL default '',
  246. `profile_4` varchar(250) NOT NULL default '',
  247. `profile_5` varchar(250) NOT NULL default '',
  248. `profile_6` int(2) NOT NULL default '0',
  249. `profile_7` varchar(250) NOT NULL default '',
  250. `profile_8` varchar(250) NOT NULL default '',
  251. `profile_9` int(14) NOT NULL default '0',
  252. PRIMARY KEY (`profile_id`),
  253. KEY `INDEX` (`profile_user_id`)
  254. ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci") or die("Create: phps_profiles<br>Error: ".mysql_error());
  255. // create table phps_profilestyles
  256. mysql_query("CREATE TABLE `phps_profilestyles` (
  257. `profilestyle_id` int(9) NOT NULL auto_increment,
  258. `profilestyle_user_id` int(9) NOT NULL default '0',
  259. `profilestyle_css` text,
  260. PRIMARY KEY (`profilestyle_id`),
  261. KEY `profilestyle_user_id` (`profilestyle_user_id`)
  262. ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci") or die("Create: phps_profilestyles<br>Error: ".mysql_error());
  263. // create table phps_reports
  264. mysql_query("CREATE TABLE `phps_reports` (
  265. `report_id` int(9) NOT NULL auto_increment,
  266. `report_user_id` int(9) NOT NULL default '0',
  267. `report_url` varchar(250) NOT NULL default '',
  268. `report_reason` int(1) NOT NULL default '0',
  269. `report_details` text NULL,
  270. PRIMARY KEY (`report_id`),
  271. KEY `INDEX` (`report_user_id`)
  272. ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci") or die("Create: phps_reports<br>Error: ".mysql_error());
  273. // create table phps_settings
  274. mysql_query("CREATE TABLE `phps_settings` (
  275. `setting_id` int(9) NOT NULL auto_increment,
  276. `setting_key` varchar(20) NOT NULL default '',
  277. `setting_url` int(1) NOT NULL default '1',
  278. `setting_lang_default` varchar(50) NOT NULL default '',
  279. `setting_lang_allow` int(1) NOT NULL default '0',
  280. `setting_timezone` varchar(5) NOT NULL default '',
  281. `setting_dateformat` varchar(20) NOT NULL default '',
  282. `setting_timeformat` varchar(20) NOT NULL default '',
  283. `setting_permission_profile` int(1) NOT NULL default '0',
  284. `setting_permission_invite` int(1) NOT NULL default '0',
  285. `setting_permission_search` int(1) NOT NULL default '0',
  286. `setting_permission_portal` int(1) NOT NULL default '0',
  287. `setting_banned_ips` text NULL,
  288. `setting_banned_emails` text NULL,
  289. `setting_banned_usernames` text NULL,
  290. `setting_banned_words` text NULL,
  291. `setting_comment_code` int(1) NOT NULL default '0',
  292. `setting_connection_allow` int(1) NOT NULL default '0',
  293. `setting_connection_framework` int(1) NOT NULL default '0',
  294. `setting_connection_types` text NULL,
  295. `setting_connection_other` int(1) NOT NULL default '0',
  296. `setting_connection_explain` int(1) NOT NULL default '0',
  297. `setting_signup_photo` int(1) NOT NULL default '0',
  298. `setting_signup_phone` int(1) NOT NULL default '1',
  299. `setting_signup_enable` int(1) NOT NULL default '0',
  300. `setting_signup_welcome` int(1) NOT NULL default '0',
  301. `setting_signup_invite` int(1) NOT NULL default '0',
  302. `setting_signup_invite_checkemail` int(1) NOT NULL default '0',
  303. `setting_signup_invite_numgiven` int(3) NOT NULL default '0',
  304. `setting_signup_invitepage` int(1) NOT NULL default '0',
  305. `setting_signup_verify` int(1) NOT NULL default '0',
  306. `setting_signup_code` int(1) NOT NULL default '0',
  307. `setting_signup_randpass` int(1) NOT NULL default '0',
  308. `setting_signup_tos` int(1) NOT NULL default '0',
  309. `setting_signup_tostext` text NULL,
  310. `setting_invite_code` int(1) NOT NULL default '0',
  311. `setting_actions_showlength` int(14) NOT NULL default '0',
  312. `setting_actions_actionsperuser` int(2) NOT NULL default '0',
  313. `setting_actions_selfdelete` int(2) NOT NULL default '0',
  314. `setting_actions_privacy` int(1) NOT NULL default '0',
  315. `setting_actions_actionsonprofile` int(2) NOT NULL default '0',
  316. `setting_actions_actionsinlist` int(2) NOT NULL default '0',
  317. `setting_actions_visibility` int(1) NOT NULL default '0',
  318. `setting_subnet_field1_id` int(9) NOT NULL default '0',
  319. `setting_subnet_field2_id` int(9) NOT NULL default '0',
  320. `setting_email_fromname` varchar(70) NOT NULL default '',
  321. `setting_email_fromemail` varchar(70) NOT NULL default '',
  322. `setting_email_invitecode_subject` varchar(200) NOT NULL default '',
  323. `setting_email_invitecode_message` text NULL,
  324. `setting_email_invite_subject` varchar(200) NOT NULL default '',
  325. `setting_email_invite_message` text NULL,
  326. `setting_email_verify_subject` varchar(200) NOT NULL default '',
  327. `setting_email_verify_message` text NULL,
  328. `setting_email_newpass_subject` varchar(200) NOT NULL default '',
  329. `setting_email_newpass_message` text NULL,
  330. `setting_email_welcome_subject` varchar(200) NOT NULL default '',
  331. `setting_email_welcome_message` text NULL,
  332. `setting_email_lostpassword_subject` varchar(200) NOT NULL default '',
  333. `setting_email_lostpassword_message` text NULL,
  334. `setting_email_friendrequest_subject` varchar(200) NOT NULL default '',
  335. `setting_email_friendrequest_message` text NULL,
  336. `setting_email_message_subject` varchar(200) NOT NULL default '',
  337. `setting_email_message_message` text NULL,
  338. `setting_email_profilecomment_subject` varchar(200) NOT NULL default '',
  339. `setting_email_profilecomment_message` text NULL,
  340. `homepage_blocks` text NOT NULL,
  341. `setting_news_page` int(1) NOT NULL default '0',
  342. PRIMARY KEY (`setting_id`)
  343. ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci") or die("Create: phps_settings<br>Error: ".mysql_error());
  344. //inserting data into DEFAULTS INTO phps_settings
  345. mysql_query("INSERT INTO `phps_settings` (`setting_id`, `setting_key`, `setting_url`, `setting_lang_default`, `setting_lang_allow`, `setting_timezone`, `setting_dateformat`, `setting_timeformat`, `setting_permission_profile`, `setting_permission_invite`, `setting_permission_search`, `setting_permission_portal`, `setting_banned_ips`, `setting_banned_emails`, `setting_banned_usernames`, `setting_banned_words`, `setting_comment_code`, `setting_connection_allow`, `setting_connection_framework`, `setting_connection_types`, `setting_connection_other`, `setting_connection_explain`, `setting_signup_photo`, `setting_signup_enable`, `setting_signup_welcome`, `setting_signup_invite`, `setting_signup_invite_checkemail`, `setting_signup_invite_numgiven`, `setting_signup_invitepage`, `setting_signup_verify`, `setting_signup_code`, `setting_signup_randpass`, `setting_signup_tos`, `setting_signup_tostext`, `setting_invite_code`, `setting_actions_showlength`, `setting_actions_actionsperuser`, `setting_actions_selfdelete`, `setting_actions_privacy`, `setting_actions_actionsonprofile`, `setting_actions_actionsinlist`, `setting_actions_visibility`, `setting_subnet_field1_id`, `setting_subnet_field2_id`, `setting_email_fromname`, `setting_email_fromemail`, `setting_email_invitecode_subject`, `setting_email_invitecode_message`, `setting_email_invite_subject`, `setting_email_invite_message`, `setting_email_verify_subject`, `setting_email_verify_message`, `setting_email_newpass_subject`, `setting_email_newpass_message`, `setting_email_welcome_subject`, `setting_email_welcome_message`, `setting_email_lostpassword_subject`, `setting_email_lostpassword_message`, `setting_email_friendrequest_subject`, `setting_email_friendrequest_message`, `setting_email_message_subject`, `setting_email_message_message`, `setting_email_profilecomment_subject`, `setting_email_profilecomment_message`, `homepage_blocks`, `setting_news_page`) VALUES (1, '$license', 0, 'english', 0, '-8', 'M. j, Y', 'g:i A', 1, 1, 1, 1, '', '', '', '', 1, 3, 0, 'Friend<!>Co-Worker<!>Family', 1, 1, 1, 1, 1, 0, 0, 5, 1, 0, 1, 0, 1, 'This is the terms of service agreement.', 1, 3600, 3, 1, 1, 7, 15, 1, 0, 8, 'PHPSocial Admin', 'email@domain.com', 'You have received an invitation to join our social network!', 'Hello,\r\n\r\nYou have been invited by [username] to join our social network. To join, please follow the link below and enter your invite code.\r\n\r\n[link]\r\nInvite Code: [code]\r\n\r\nBest Regards,\r\nSocial Network Administration\r\n\r\n----------------------------------------\r\n\r\n[message]', 'You have received an invitation to join our social network.', 'Hello,\r\n\r\nYou have been invited by [username] to join our social network. To join, please follow the link below:\r\n\r\n[link]\r\n\r\nBest Regards,\r\nSocial Network Administration\r\n\r\n----------------------------------------\r\n\r\n[message]', 'Social Network - Email Verification', 'Hello [username],\r\n\r\nThank you for joining our social network. To verify your email address and continue, please click the following link:\r\n\r\n[link]\r\n\r\nBest Regards,\r\nSocial Network Administration', 'Social Network - Login Details', 'Hello [username],\r\n\r\nThank you for joining our social network. Click the following link and enter your information below to login:\r\n\r\n[link]\r\n\r\nEmail: [email]\r\nPassword: [password]\r\n\r\nBest Regards,\r\nSocial Network Administration', 'Welcome to the social network!', 'Hello [username],\r\n\r\nThank you for joining our social network. Click the following link and enter your information below to login:\r\n\r\n[link]\r\n\r\nEmail: [email]\r\nPassword: [password]\r\n\r\nBest Regards,\r\nSocial Network Administration\r\n', 'Social Network - Lost Password', 'Hello [username],\r\n\r\nYou have requested to reset your password because you have forgotten your password. If you did not request this, please ignore it. It will expire in 24 hours.\r\n\r\nTo reset your password, please click the following link:\r\n\r\n[link]\r\n\r\nBest Regards,\r\nSocial Network Administration', '[friendname] has added you as a friend.', 'Hello [username],\r\n\r\n[friendname] has added you as a friend. Please click the following link to login and confirm this friendship request:\r\n\r\n[link]\r\n\r\nBest Regards,\r\nSocial Network Administration', 'You have received a new message.', 'Hello [username],\r\n\r\nYou have just received a new message from [sender]. Please click the following link to login and view it:\r\n\r\n[link]\r\n\r\nBest Regards,\r\nSocial Network Administration', 'New Profile Comment', 'Hello [username],\r\n\r\nA new comment has been posted on your profile by [commenter]. Please click the following link to view it:\r\n\r\n[link]\r\n\r\nBest Regards,\r\nSocial Network Administration', 'a:7:{i:0;s:17:\"Network statistic\";i:1;s:14:\"Newest members\";i:2;s:20:\"Most popular members\";i:3;s:22:\"Members last logged in\";i:4;s:14:\"Members online\";i:5;s:11:\"Recent news\";i:6;s:13:\"Hello message\";}', '0')") or die("Insert: phps_settings<br>Error: ".mysql_error());
  346. // create table phps_statrefs
  347. mysql_query("CREATE TABLE `phps_statrefs` (
  348. `statref_id` int(9) NOT NULL auto_increment,
  349. `statref_hits` int(9) NOT NULL default '0',
  350. `statref_url` varchar(255) NOT NULL default '',
  351. PRIMARY KEY (`statref_id`),
  352. UNIQUE KEY `statref_url` (`statref_url`)
  353. ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci") or die("Create: phps_statrefs<br>Error: ".mysql_error());
  354. // create table phps_stats
  355. mysql_query("CREATE TABLE `phps_stats` (
  356. `stat_id` int(9) NOT NULL auto_increment,
  357. `stat_date` int(9) NOT NULL default '0',
  358. `stat_views` int(9) NOT NULL default '0',
  359. `stat_visits` int(9) NOT NULL default '0',
  360. `stat_logins` int(9) NOT NULL default '0',
  361. `stat_signups` int(9) NOT NULL default '0',
  362. `stat_friends` int(9) NOT NULL default '0',
  363. PRIMARY KEY (`stat_id`),
  364. UNIQUE KEY `stat_date` (`stat_date`)
  365. ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci") or die("Create: phps_stats<br>Error: ".mysql_error());
  366. // create table phps_subnets
  367. mysql_query("CREATE TABLE `phps_subnets` (
  368. `subnet_id` int(9) NOT NULL auto_increment,
  369. `subnet_name` varchar(50) NOT NULL default '',
  370. `subnet_field1_qual` varchar(2) NOT NULL default '',
  371. `subnet_field1_value` varchar(250) NOT NULL default '',
  372. `subnet_field2_qual` varchar(2) NOT NULL default '',
  373. `subnet_field2_value` varchar(250) NOT NULL default '',
  374. PRIMARY KEY (`subnet_id`)
  375. ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci") or die("Create: phps_subnets<br>Error: ".mysql_error());
  376. // create table phps_tabs
  377. mysql_query("CREATE TABLE `phps_tabs` (
  378. `tab_id` int(9) NOT NULL auto_increment,
  379. `tab_name` varchar(50) NOT NULL default '',
  380. `tab_order` int(2) NOT NULL default '0',
  381. PRIMARY KEY (`tab_id`)
  382. ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci") or die("Create: phps_tabs<br>Error: ".mysql_error());
  383. //inserting data into DEFAULTS INTO phps_tabs
  384. mysql_query("INSERT INTO `phps_tabs` (`tab_id`, `tab_name`, `tab_order`) VALUES
  385. ('1', 'Personal Information', 1),
  386. ('2', 'Contact Information', 2)") or die("Insert: phps_tabs<br>Error: ".mysql_error());
  387. // create table phps_urls
  388. mysql_query("CREATE TABLE `phps_urls` (
  389. `url_id` int(9) NOT NULL auto_increment,
  390. `url_title` varchar(100) NOT NULL default '',
  391. `url_file` varchar(50) NOT NULL default '',
  392. `url_regular` varchar(200) NOT NULL default '',
  393. `url_subdirectory` varchar(200) NOT NULL default '',
  394. PRIMARY KEY (`url_id`)
  395. ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci") or die("Create: phps_urls<br>Error: ".mysql_error());
  396. // create table phps_users
  397. mysql_query("CREATE TABLE `phps_users` (
  398. `user_id` int(9) NOT NULL auto_increment,
  399. `user_level_id` int(9) NOT NULL default '0',
  400. `user_subnet_id` int(9) NOT NULL default '0',
  401. `user_email` varchar(70) NOT NULL default '',
  402. `user_newemail` varchar(70) NOT NULL default '',
  403. `user_username` varchar(50) NOT NULL default '',
  404. `user_password` varchar(50) NOT NULL default '',
  405. `user_code` varchar(8) NOT NULL default '',
  406. `user_enabled` int(1) NOT NULL default '0',
  407. `user_verified` int(1) NOT NULL default '0',
  408. `user_lang` varchar(20) NOT NULL default '',
  409. `user_signupdate` int(14) NOT NULL default '0',
  410. `user_lastlogindate` int(14) NOT NULL default '0',
  411. `user_lastactive` int(14) NOT NULL default '0',
  412. `user_status` varchar(100) NOT NULL default '',
  413. `user_logins` int(9) NOT NULL default '0',
  414. `user_invitesleft` int(3) NOT NULL default '0',
  415. `user_timezone` varchar(5) NOT NULL default '',
  416. `user_views_profile` int(9) NOT NULL default '0',
  417. `user_dateupdated` int(14) NOT NULL default '0',
  418. `user_blocklist` text NULL,
  419. `user_photo` varchar(10) NOT NULL default '',
  420. `user_phone` varchar(100) NOT NULL default '',
  421. `user_privacy_search` int(1) NOT NULL default '0',
  422. `user_privacy_profile` int(1) NOT NULL default '0',
  423. `user_privacy_comments` int(1) NOT NULL default '0',
  424. `user_allowed_actions` varchar(255) character set utf8 collate utf8_unicode_ci default '1,2,3,4,5,7',
  425. PRIMARY KEY (`user_id`),
  426. UNIQUE KEY `UNIQUE` (`user_email`,`user_username`),
  427. KEY `INDEX` (`user_username`)
  428. ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci") or die("Create: phps_users<br>Error: ".mysql_error());
  429. // create table phps_usersettings
  430. mysql_query("CREATE TABLE `phps_usersettings` (
  431. `usersetting_id` int(9) NOT NULL auto_increment,
  432. `usersetting_user_id` int(9) NOT NULL default '0',
  433. `usersetting_lostpassword_code` varchar(15) NOT NULL default '',
  434. `usersetting_lostpassword_time` int(14) NOT NULL default '0',
  435. `usersetting_notify_friendrequest` int(1) NOT NULL default '0',
  436. `usersetting_notify_message` int(1) NOT NULL default '0',
  437. `usersetting_notify_profilecomment` int(1) NOT NULL default '0',
  438. `usersetting_actions_dontpublish` varchar(40) NOT NULL default '',
  439. PRIMARY KEY (`usersetting_id`)
  440. ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci") or die("Create: phps_usersettings<br>Error: ".mysql_error());
  441. ?>