Almaftuchin

Flarum PHP Install

Feb 18th, 2018 (edited)
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 17.97 KB | None | 0 0
  1. <?php
  2. if(isset($_POST['install'])){
  3.     if(isset($_POST['forumTitle']) && isset($_POST['mysqlDatabase']) && isset($_POST['mysqlUsername']) && isset($_POST['mysqlPassword']) && isset($_POST['adminUsername']) && isset($_POST['adminEmail'])){
  4.         $ftitle = $_POST['forumTitle'];
  5.         $fdbname = $_POST['mysqlDatabase'];
  6.         $fdbuser = $_POST['mysqlUsername'];
  7.         $fdbpass = $_POST['mysqlPassword'];
  8.         $fadmin = $_POST['adminUsername'];
  9.         $femail = $_POST['adminEmail'];
  10.         if( $_SERVER['HTTPS']){
  11.             $flink = "https://".$_SERVER['HTTP_HOST'];
  12.         }else{
  13.             $flink = "http://".$_SERVER['HTTP_HOST'];
  14.         }
  15.         $conn = mysqli_connect('localhost',$fdbuser,$fdbpass);
  16.         $dbcon = mysqli_select_db($conn,$fdbname);
  17.         if(!$conn){
  18.             die("Connection failed : " . mysqli_error());
  19.         }else if(!$dbcon){
  20.             die("Database Connection failed : " . mysqli_error());
  21.         }else{
  22.             $query = mysqli_query($conn,"CREATE TABLE `dscsalmt_access_tokens` (
  23. `id` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL,
  24. `user_id` int(10) unsigned NOT NULL,
  25. `last_activity` int(11) NOT NULL,
  26. `lifetime` int(11) NOT NULL,
  27. PRIMARY KEY (`id`)
  28. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci");
  29. $query = mysqli_query($conn,"CREATE TABLE `dscsalmt_api_keys` (
  30. `id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  31. PRIMARY KEY (`id`)
  32. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;");
  33. $query = mysqli_query($conn,"CREATE TABLE `dscsalmt_cksoftwares` (
  34. `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  35. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;");
  36. $query = mysqli_query($conn,"INSERT INTO `dscsalmt_cksoftwares` (`name`) VALUES('Created by Almaftuchin! https://www.almaftuch.in')");
  37. $query = mysqli_query($conn,"CREATE TABLE `dscsalmt_auth_tokens` (
  38. `id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  39. `payload` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
  40. `created_at` timestamp NOT NULL,
  41. PRIMARY KEY (`id`)
  42. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci");
  43. $query = mysqli_query($conn,"CREATE TABLE `dscsalmt_discussions` (
  44. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  45. `title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  46. `comments_count` int(10) unsigned NOT NULL DEFAULT '0',
  47. `participants_count` int(10) unsigned NOT NULL DEFAULT '0',
  48. `number_index` int(10) unsigned NOT NULL DEFAULT '0',
  49. `start_time` datetime NOT NULL,
  50. `start_user_id` int(10) unsigned DEFAULT NULL,
  51. `start_post_id` int(10) unsigned DEFAULT NULL,
  52. `last_time` datetime DEFAULT NULL,
  53. `last_user_id` int(10) unsigned DEFAULT NULL,
  54. `last_post_id` int(10) unsigned DEFAULT NULL,
  55. `last_post_number` int(10) unsigned DEFAULT NULL,
  56. `hide_time` datetime DEFAULT NULL,
  57. `hide_user_id` int(10) unsigned DEFAULT NULL,
  58. `slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  59. `is_private` tinyint(1) NOT NULL DEFAULT '0',
  60. `is_approved` tinyint(1) NOT NULL DEFAULT '1',
  61. `is_locked` tinyint(1) NOT NULL DEFAULT '0',
  62. `is_sticky` tinyint(1) NOT NULL DEFAULT '0',
  63. PRIMARY KEY (`id`)
  64. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci");
  65. $query = mysqli_query($conn,"CREATE TABLE `dscsalmt_discussions_tags` (
  66. `discussion_id` int(10) unsigned NOT NULL,
  67. `tag_id` int(10) unsigned NOT NULL,
  68. PRIMARY KEY (`discussion_id`,`tag_id`)
  69. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci");
  70. $query = mysqli_query($conn,"CREATE TABLE `dscsalmt_email_tokens` (
  71. `id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  72. `email` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
  73. `user_id` int(10) unsigned NOT NULL,
  74. `created_at` timestamp NOT NULL,
  75. PRIMARY KEY (`id`)
  76. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci");
  77. $query = mysqli_query($conn,"CREATE TABLE `dscsalmt_flags` (
  78. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  79. `post_id` int(10) unsigned NOT NULL,
  80. `type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  81. `user_id` int(10) unsigned DEFAULT NULL,
  82. `reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  83. `reason_detail` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  84. `time` datetime NOT NULL,
  85. PRIMARY KEY (`id`)
  86. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci");
  87. $query = mysqli_query($conn,"CREATE TABLE `dscsalmt_groups` (
  88. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  89. `name_singular` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  90. `name_plural` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  91. `color` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  92. `icon` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  93. PRIMARY KEY (`id`)
  94. ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci");
  95. $query = mysqli_query($conn,"CREATE TABLE `dscsalmt_mentions_posts` (
  96. `post_id` int(10) unsigned NOT NULL,
  97. `mentions_id` int(10) unsigned NOT NULL,
  98. PRIMARY KEY (`post_id`,`mentions_id`)
  99. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci");
  100. $query = mysqli_query($conn,"CREATE TABLE `dscsalmt_mentions_users` (
  101. `post_id` int(10) unsigned NOT NULL,
  102. `mentions_id` int(10) unsigned NOT NULL,
  103. PRIMARY KEY (`post_id`,`mentions_id`)
  104. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci");
  105. $query = mysqli_query($conn,"CREATE TABLE `dscsalmt_migrations` (
  106. `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  107. `extension` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL
  108. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci");
  109. $query = mysqli_query($conn,"CREATE TABLE `dscsalmt_notifications` (
  110. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  111. `user_id` int(10) unsigned NOT NULL,
  112. `sender_id` int(10) unsigned DEFAULT NULL,
  113. `type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  114. `subject_type` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  115. `subject_id` int(10) unsigned DEFAULT NULL,
  116. `data` blob,
  117. `time` datetime NOT NULL,
  118. `is_read` tinyint(1) NOT NULL DEFAULT '0',
  119. `is_deleted` tinyint(1) NOT NULL DEFAULT '0',
  120. PRIMARY KEY (`id`)
  121. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci");
  122. $query = mysqli_query($conn,"CREATE TABLE `dscsalmt_password_tokens` (
  123. `id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  124. `user_id` int(10) unsigned NOT NULL,
  125. `created_at` timestamp NOT NULL,
  126. PRIMARY KEY (`id`)
  127. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci");
  128. $query = mysqli_query($conn,"CREATE TABLE `dscsalmt_permissions` (
  129. `group_id` int(10) unsigned NOT NULL,
  130. `permission` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  131. PRIMARY KEY (`group_id`,`permission`)
  132. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci");
  133. $query = mysqli_query($conn,"CREATE TABLE `dscsalmt_posts` (
  134. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  135. `discussion_id` int(10) unsigned NOT NULL,
  136. `number` int(10) unsigned DEFAULT NULL,
  137. `time` datetime NOT NULL,
  138. `user_id` int(10) unsigned DEFAULT NULL,
  139. `type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  140. `content` text COLLATE utf8mb4_unicode_ci,
  141. `edit_time` datetime DEFAULT NULL,
  142. `edit_user_id` int(10) unsigned DEFAULT NULL,
  143. `hide_time` datetime DEFAULT NULL,
  144. `hide_user_id` int(10) unsigned DEFAULT NULL,
  145. `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  146. `is_private` tinyint(1) NOT NULL DEFAULT '0',
  147. `is_approved` tinyint(1) NOT NULL DEFAULT '1',
  148. PRIMARY KEY (`id`),
  149. UNIQUE KEY `posts_discussion_id_number_unique` (`discussion_id`,`number`),
  150. FULLTEXT KEY `content` (`content`)
  151. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci");
  152. $query = mysqli_query($conn,"CREATE TABLE `dscsalmt_posts_likes` (
  153. `post_id` int(10) unsigned NOT NULL,
  154. `user_id` int(10) unsigned NOT NULL,
  155. PRIMARY KEY (`post_id`,`user_id`)
  156. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci");
  157. $query = mysqli_query($conn,"CREATE TABLE `dscsalmt_settings` (
  158. `key` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  159. `value` text COLLATE utf8mb4_unicode_ci,
  160. PRIMARY KEY (`key`)
  161. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci");
  162. $query = mysqli_query($conn,"CREATE TABLE `dscsalmt_tags` (
  163. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  164. `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  165. `slug` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  166. `description` text COLLATE utf8mb4_unicode_ci,
  167. `color` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  168. `background_path` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  169. `background_mode` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  170. `position` int(11) DEFAULT NULL,
  171. `parent_id` int(10) unsigned DEFAULT NULL,
  172. `default_sort` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  173. `is_restricted` tinyint(1) NOT NULL DEFAULT '0',
  174. `is_hidden` tinyint(1) NOT NULL DEFAULT '0',
  175. `discussions_count` int(10) unsigned NOT NULL DEFAULT '0',
  176. `last_time` datetime DEFAULT NULL,
  177. `last_discussion_id` int(10) unsigned DEFAULT NULL,
  178. PRIMARY KEY (`id`),
  179. UNIQUE KEY `tags_slug_unique` (`slug`)
  180. ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci");
  181. $query = mysqli_query($conn,"CREATE TABLE `dscsalmt_users` (
  182. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  183. `username` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  184. `email` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
  185. `is_activated` tinyint(1) NOT NULL DEFAULT '0',
  186. `password` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  187. `bio` text COLLATE utf8mb4_unicode_ci,
  188. `avatar_path` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  189. `preferences` blob,
  190. `join_time` datetime DEFAULT NULL,
  191. `last_seen_time` datetime DEFAULT NULL,
  192. `read_time` datetime DEFAULT NULL,
  193. `notifications_read_time` datetime DEFAULT NULL,
  194. `discussions_count` int(10) unsigned NOT NULL DEFAULT '0',
  195. `comments_count` int(10) unsigned NOT NULL DEFAULT '0',
  196. `flags_read_time` datetime DEFAULT NULL,
  197. `suspend_until` datetime DEFAULT NULL,
  198. PRIMARY KEY (`id`),
  199. UNIQUE KEY `users_username_unique` (`username`),
  200. UNIQUE KEY `users_email_unique` (`email`)
  201. ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci");
  202. $query = mysqli_query($conn,"CREATE TABLE `dscsalmt_users_discussions` (
  203. `user_id` int(10) unsigned NOT NULL,
  204. `discussion_id` int(10) unsigned NOT NULL,
  205. `read_time` datetime DEFAULT NULL,
  206. `read_number` int(10) unsigned DEFAULT NULL,
  207. `subscription` enum('follow','ignore') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  208. PRIMARY KEY (`user_id`,`discussion_id`)
  209. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci");
  210. $query = mysqli_query($conn,"CREATE TABLE `dscsalmt_users_groups` (
  211. `user_id` int(10) unsigned NOT NULL,
  212. `group_id` int(10) unsigned NOT NULL,
  213. PRIMARY KEY (`user_id`,`group_id`)
  214. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci");
  215. $query = mysqli_query($conn,"CREATE TABLE `dscsalmt_users_tags` (
  216. `user_id` int(10) unsigned NOT NULL,
  217. `tag_id` int(10) unsigned NOT NULL,
  218. `read_time` datetime DEFAULT NULL,
  219. `is_hidden` tinyint(1) NOT NULL DEFAULT '0',
  220. PRIMARY KEY (`user_id`,`tag_id`)
  221. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci");
  222.                 $fpass = '$2y$10$gmKe2WP50D2n7eL92DSrLeEVpwMLYvier5BACjwCh/wYX/YkzlrUS';
  223.                 $query2 = mysqli_multi_query($conn,"INSERT INTO `dscsalmt_groups`(`id`,`name_singular`, `name_plural`, `color`, `icon`) VALUES ('1','Admin','Admins','#B72A2A','wrench'), ('2','Guest','Guests','',''), ('3','Member','Members','',''),  ('4','Moderator','Moderators','#80349E','bolt')");
  224.                 $query3 = mysqli_multi_query($conn,"INSERT INTO `dscsalmt_migrations` (`migration`,`extension`) VALUES('2015_02_24_000dscsalmt_create_access_tokens_table',NULL), ('2015_02_24_000dscsalmt_create_api_keys_table',NULL), ('2015_02_24_000dscsalmt_create_config_table',NULL), ('2015_02_24_000dscsalmt_create_discussions_table',NULL), ('2015_02_24_000dscsalmt_create_email_tokens_table',NULL), ('2015_02_24_000dscsalmt_create_groups_table',NULL), ('2015_02_24_000dscsalmt_create_notifications_table',NULL), ('2015_02_24_000dscsalmt_create_password_tokens_table',NULL), ('2015_02_24_000dscsalmt_create_permissions_table',NULL), ('2015_02_24_000dscsalmt_create_posts_table',NULL), ('2015_02_24_000dscsalmt_create_users_discussions_table',NULL), ('2015_02_24_000dscsalmt_create_users_groups_table',NULL), ('2015_02_24_000dscsalmt_create_users_table',NULL), ('2015_09_15_000dscsalmt_create_auth_tokens_table',NULL), ('2015_09_20_224327_add_hide_to_discussions',NULL), ('2015_09_22_030432_rename_notification_read_time',NULL), ('2015_10_07_130531_rename_config_to_settings',NULL), ('2015_10_24_194dscsalmt_add_ip_address_to_posts',NULL), ('2015_12_05_042721_change_access_tokens_columns',NULL), ('2015_12_17_194247_change_settings_value_column_to_text',NULL), ('2016_02_04_095452_add_slug_to_discussions',NULL), ('2017_04_07_114138_add_is_private_to_discussions',NULL), ('2017_04_07_114138_add_is_private_to_posts',NULL), ('2017_04_09_152230_change_posts_content_column_to_mediumtext',NULL), ('2015_09_21_011527_add_is_approved_to_discussions',NULL)");
  225.                 $query4 = mysqli_multi_query($conn,"INSERT INTO `dscsalmt_migrations` (`migration`,`extension`) VALUES('2015_09_21_011706_add_is_approved_to_posts',NULL), ('2017_07_22_000dscsalmt_add_default_permissions',NULL), ('2015_09_02_000dscsalmt_add_flags_read_time_to_users_table',NULL), ('2015_09_02_000dscsalmt_create_flags_table',NULL), ('2017_07_22_000dscsalmt_add_default_permissions',NULL), ('2015_05_11_000dscsalmt_create_posts_likes_table',NULL), ('2015_09_04_000dscsalmt_add_default_like_permissions',NULL), ('2015_02_24_000dscsalmt_add_locked_to_discussions',NULL), ('2017_07_22_000dscsalmt_add_default_permissions',NULL), ('2015_05_11_000dscsalmt_create_mentions_posts_table',NULL), ('2015_05_11_000dscsalmt_create_mentions_users_table',NULL), ('2015_02_24_000dscsalmt_add_sticky_to_discussions',NULL), ('2017_07_22_000dscsalmt_add_default_permissions',NULL), ('2015_05_11_000dscsalmt_add_subscription_to_users_discussions_table',NULL), ('2015_05_11_000dscsalmt_add_suspended_until_to_users_table',NULL), ('2015_09_14_000dscsalmt_rename_suspended_until_column',NULL), ('2017_07_22_000dscsalmt_add_default_permissions',NULL), ('2015_02_24_000dscsalmt_create_discussions_tags_table',NULL), ('2015_02_24_000dscsalmt_create_tags_table',NULL), ('2015_02_24_000dscsalmt_create_users_tags_table',NULL), ('2015_02_24_000dscsalmt_set_default_settings',NULL), ('2015_10_19_061223_make_slug_unique',NULL), ('2017_07_22_000dscsalmt_add_default_permissions','flarum-approval')");
  226.                 $query5 = mysqli_multi_query($conn,"INSERT INTO `dscsalmt_permissions` (`group_id`,`permission`) VALUES('2','viewDiscussions'), ('3','discussion.flagPosts'), ('3','discussion.likePosts'), ('3','discussion.reply'), ('3','discussion.replyWithoutApproval'), ('3','discussion.startWithoutApproval'), ('3','startDiscussion'), ('3','viewUserList'), ('4','discussion.approvePosts'), ('4','discussion.editPosts'), ('4','discussion.hide'), ('4','discussion.lock'), ('4','discussion.rename'), ('4','discussion.sticky'), ('4','discussion.tag'), ('4','discussion.viewFlags'), ('4','discussion.viewIpsPosts'), ('4','user.suspend')");
  227.                 $query6 = mysqli_multi_query($conn,"INSERT INTO `dscsalmt_settings` (`key`,`value`) VALUES('version','0.1.0-beta.7'), ('allow_post_editing','reply'), ('allow_renaming','10'), ('allow_sign_up','1'), ('custom_less',''), ('default_locale','en'), ('default_route','/all'), ('extensions_enabled','[".'"flarum-approval","flarum-bbcode","flarum-emoji","flarum-english","flarum-flags","flarum-likes","flarum-lock","flarum-markdown","flarum-mentions","flarum-sticky","flarum-subscriptions","flarum-suspend","flarum-tags"]'."'), ('forum_title','".$ftitle."'), ('forum_description',''), ('mail_driver','mail'), ('mail_from','noreply@localhost'), ('theme_colored_header','0'), ('theme_dark_mode','0'), ('theme_primary_color','#FF0000'), ('theme_secondary_color','#FFFFFF'), ('welcome_message','This is beta software and you should not use it in production, the installer was made by CKHAWAND from 000webhost!'), ('welcome_title','Welcome to 000webhost flarum installation'), ('flarum-tags.max_primary_tags','1'), ('flarum-tags.min_primary_tags','1'), ('flarum-tags.max_secondary_tags','3'), ('flarum-tags.min_secondary_tags','0')");
  228.                 $query7 = mysqli_multi_query($conn,"INSERT INTO `dscsalmt_tags`(`id`, `name`, `slug`, `description`, `color`, `background_path`, `background_mode`, `position`, `parent_id`, `default_sort`, `is_restricted`, `is_hidden`, `discussions_count`, `last_time`, `last_discussion_id`) VALUES ('1','General','general',NULL,'#888',NULL,NULL,'0',NULL,NULL,'0','0','0',NULL,NULL)");
  229.                 $query8 = mysqli_multi_query($conn,"INSERT INTO `dscsalmt_users`(`id`, `username`, `email`, `is_activated`, `password`, `bio`, `avatar_path`, `preferences`, `join_time`, `last_seen_time`, `read_time`, `notifications_read_time`, `discussions_count`, `comments_count`, `flags_read_time`, `suspend_until`) VALUES ('1','".$fadmin."','".$femail."','1','".$fpass."',NULL,NULL,NULL,'".date("Y-m-d h:i:sa")."','".date("Y-m-d h:i:sa")."',NULL,NULL,'0','0',NULL,NULL)");
  230.                 $query9 = mysqli_multi_query($conn,"INSERT INTO `dscsalmt_users_groups`(`user_id`, `group_id`) VALUES ('1','1')");
  231.                 file_put_contents("installer.zip", fopen("http://000webhost.ml/000flarum.zip", 'r'));
  232.                 $zip = new ZipArchive;
  233.                 $zip->open('installer.zip');
  234.                 $zip->extractTo('./');
  235.                 $zip->close();
  236.                 $myFile = "installer.zip";
  237.                 $installerFile = "install.php";
  238.                 unlink($myFile);
  239.                 unlink(basename(__FILE__));
  240.                 $config = "<?php" . " return array (
  241.                   'debug' => false,
  242.                   'database' =>
  243.                   array (
  244.                     'driver' => 'mysql',
  245.                     'host' => 'sql300.epizy.com',
  246.                     'database' => '".$fdbname."',
  247.                     'username' => '".$fdbuser."',
  248.                     'password' => '".$fdbpass."',
  249.                     'charset' => 'utf8mb4',
  250.                     'collation' => 'utf8mb4_unicode_ci',
  251.                     'prefix' => 'dscsalmt_',
  252.                     'port' => '3306',
  253.                   ),
  254.                   'url' => '".$flink."',
  255.                   'paths' =>
  256.                   array (
  257.                     'api' => 'api',
  258.                     'admin' => 'admin',
  259.                   ),
  260.                 );";
  261.                 file_put_contents("config.php", "");
  262.                 file_put_contents("config.php", $config);
  263.                 header('Location: '.$flink);
  264.         }
  265.     }
  266. }
  267. ?>
Add Comment
Please, Sign In to add comment