Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 67.92 KB | None | 0 0
  1. <?php
  2. /*
  3. * Made by Samerton
  4. * http://worldscapemc.co.uk
  5. *
  6. * License: MIT
  7. */
  8.  
  9. require('core/includes/password.php'); // Require password compatibility
  10. require('core/integration/uuid.php'); // Require UUID integration
  11.  
  12. if(isset($_GET["step"])){
  13. $step = strtolower(htmlspecialchars($_GET["step"]));
  14. } else {
  15. $step = "start";
  16. }
  17. ini_set('display_startup_errors',1);
  18. ini_set('display_errors',1);
  19. error_reporting(-1);
  20. ?>
  21.  
  22. <!DOCTYPE html>
  23. <html lang="en">
  24. <head>
  25. <meta charset="utf-8">
  26. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  27. <meta name="viewport" content="width=device-width, initial-scale=1">
  28. <meta name="description" content="NamelessMC installer">
  29. <meta name="author" content="NamelessMC installer">
  30. <meta name="robots" content="noindex">
  31.  
  32. <title>NamelessMC &bull; Install</title>
  33.  
  34. <!-- Bootstrap core CSS -->
  35. <link href="./core/assets/css/bootstrap.min.css" rel="stylesheet">
  36. <style type="text/css">
  37. .small-margin {
  38. margin-top: 10px;
  39. margin-bottom: 10px;
  40. }
  41. .page-header {
  42. margin: 12px 0px;
  43. }
  44. </style>
  45.  
  46. </head>
  47.  
  48. <body>
  49. <div class="container">
  50. <br />
  51. <ul class="nav nav-tabs">
  52. <li <?php if($step == "start"){ ?>class="active"<?php } else { ?>class="disabled"<?php } ?>><a>Start</a></li>
  53. <li <?php if($step == "requirements" || $step == "upgrade_requirements"){ ?>class="active"<?php } else { ?>class="disabled"<?php } ?>><a>Requirements</a></li>
  54. <li <?php if($step == "upgrade"){ ?>class="active"<?php } else { ?>class="disabled"<?php } ?>><a>Upgrade</a></li>
  55. <li <?php if($step == "configuration"){ ?>class="active"<?php } else { ?>class="disabled"<?php } ?>><a>Configuration</a></li>
  56. <li <?php if($step == "database"){ ?>class="active"<?php } else { ?>class="disabled"<?php } ?>><a>Database</a></li>
  57. <li <?php if($step == "settings" || $step == "settings_extra"){ ?>class="active"<?php } else { ?>class="disabled"<?php } ?>><a>Settings</a></li>
  58. <li <?php if($step == "account"){ ?>class="active"<?php } else { ?>class="disabled"<?php } ?>><a>Account</a></li>
  59. <li <?php if($step == "convert"){ ?>class="active"<?php } else { ?>class="disabled"<?php } ?>><a>Convert</a></li>
  60. <li <?php if($step == "finish"){ ?>class="active"<?php } else { ?>class="disabled"<?php } ?>><a>Finish</a></li>
  61. </ul>
  62.  
  63. <?php
  64. if($step === "start"){
  65. ?>
  66. <div class="row page-header">
  67. <h3>Welcome to NamelessMC <small>BETA</small></h3>
  68. <hr class="small-margin">
  69. <p>This installer will guide you through the process of installing the NamelessMC website package.</p>
  70. </div>
  71.  
  72. <h4>Are you upgrading from 0.4.1?</h4>
  73.  
  74. <p>
  75. <button type="button" onclick="location.href='./install?step=upgrade_requirements'" class="btn btn-success">Yes, upgrade from 0.4.1 &raquo;</button>
  76. <button type="button" onclick="location.href='./install?step=requirements'" class="btn btn-primary">No, this is a new install &raquo;</button>
  77. </p>
  78.  
  79. <div class="alert alert-info">Note: if you're upgrading from a 1.x version to another 1.x version, you will need to follow the instructions from within the AdminCP's Update tab, rather than running through the installer again.</div>
  80.  
  81. <hr>
  82.  
  83. <div class="panel-group">
  84. <div class="panel panel-default">
  85. <div class="panel-heading">
  86. <h4 class="panel-title">
  87. <a data-toggle="collapse" href="#requirements">Requirements</a>
  88. </h4>
  89. </div>
  90. <div id="requirements" class="panel-collapse collapse">
  91. <div class="panel-body">
  92. You will need the following:
  93. <ul>
  94. <li>A MySQL database on the webserver</li>
  95. <li>PHP version 5.3+</li>
  96. </ul>
  97. The following are not required, but are recommended:
  98. <ul>
  99. <li>A MySQL database for a Bungee instance <a data-toggle="modal" href="#bungee_plugins">(Supported Plugins)</a></li>
  100. <li>A MySQL database for your Minecraft servers <a data-toggle="modal" href="#mc_plugins">(Supported Plugins)</a></li>
  101. </ul>
  102. </div>
  103. </div>
  104. </div>
  105. <div class="panel panel-default">
  106. <div class="panel-heading">
  107. <h4 class="panel-title">
  108. <a data-toggle="collapse" href="#conversion">Converting from other software</a>
  109. </h4>
  110. </div>
  111. <div id="conversion" class="panel-collapse collapse">
  112. <div class="panel-body">
  113. Currently data may be imported from:
  114. <ul>
  115. <li>XenForo</li>
  116. </ul>
  117. Support for the following is planned:
  118. <ul>
  119. <li>phpBB</li>
  120. <li>IPBoard</li>
  121. <li>MyBB</li>
  122. <li>Vanilla</li>
  123. <li>ModernBB</li>
  124. <li>Wordpress (with optional support for bbPress)</li>
  125. </ul>
  126. </div>
  127. </div>
  128. </div>
  129. </div>
  130.  
  131. <?php
  132. } else if($step === "requirements" || $step === "upgrade_requirements") {
  133. $error = '<p style="display: inline;" class="text-danger"><span class="glyphicon glyphicon-remove-sign"></span></p><br />';
  134. $success = '<p style="display: inline;" class="text-success"><span class="glyphicon glyphicon-ok-sign"></span></p><br />';
  135. $warning = '<p style="display: inline;" class="text-warning"><span class="glyphicon glyphicon-remove-sign"></span></p><br />';
  136. ?>
  137. <div class="row page-header">
  138. <h3>Requirements</h3>
  139. <hr class="small-margin">
  140. <p>Before you begin with the installation, the installer will verify your current setup is compatible.</p>
  141. </div>
  142. <?php
  143. if(version_compare(phpversion(), '5.3', '<')){
  144. echo 'PHP 5.3 - ' . $error;
  145. $php_error = true;
  146. } else {
  147. echo 'PHP 5.3 - ' . $success;
  148. }
  149. if(!extension_loaded('gd')){
  150. echo 'PHP GD Extension - ' . $error;
  151. $php_error = true;
  152. } else {
  153. echo 'PHP GD Extension - ' . $success;
  154. }
  155. if(!extension_loaded('PDO')){
  156. echo 'PHP PDO Extension - ' . $error;
  157. $php_error = true;
  158. } else {
  159. echo 'PHP PDO Extension - ' . $success;
  160. }
  161. if(!extension_loaded('mysqlnd')){
  162. echo 'PHP mysqlnd Extension - ' . $warning;
  163. echo 'You may experience issues without the mysqlnd extension.<br />';
  164. // Remove error temporarily
  165. //$php_error = true;
  166. } else {
  167. echo 'PHP mysqlnd Extension - ' . $success;
  168. }
  169.  
  170. if(!function_exists("mcrypt_encrypt")) {
  171. echo 'PHP mcrypt Extension - ' . $error;
  172. $php_error = true;
  173. } else {
  174. echo 'PHP mcrypt Extension - ' . $success;
  175. }
  176. if(!function_exists('curl_version')){
  177. echo 'PHP cURL Extension - ' . $error;
  178. $php_error = true;
  179. } else {
  180. echo 'PHP cURL Extension - ' . $success;
  181. }
  182. if(!class_exists("DOMDocument")){ // if there is a fatal error on the Requirements step, this is missing
  183. echo 'PHP DOMDocument Class - ' . $error;
  184. $php_error = true;
  185. } else {
  186. echo 'PHP DOMDocument Class - ' . $success;
  187. }
  188. ?>
  189. <br />
  190. <?php
  191. if(isset($php_error)){
  192. ?>
  193. <div class="alert alert-danger">You must be running at least PHP version 5.3 with the required extensions enabled in order to proceed with installation.</div>
  194. <?php
  195. } else {
  196. if($step === "requirements") {
  197. ?>
  198. <button type="button" onclick="location.href='./install?step=configuration'" class="btn btn-primary">Proceed &raquo;</button>
  199. <?php
  200. } else {
  201. ?>
  202. <button type="button" onclick="location.href='./install?step=upgrade'" class="btn btn-primary">Proceed &raquo;</button>
  203. <?php
  204. }
  205. }
  206. } else if($step === "upgrade"){
  207. if(Input::exists()){
  208. if(isset($_POST['submitted'])){
  209. $validate = new Validate();
  210. $validation = $validate->check($_POST, array(
  211. 'db_address' => array(
  212. 'required' => true
  213. ),
  214. 'db_username' => array(
  215. 'required' => true
  216. ),
  217. 'db_name' => array(
  218. 'required' => true
  219. )
  220. ));
  221.  
  222. if($validation->passed()) {
  223. $db_password = Input::get('db_password');
  224. if(!empty($db_password)){
  225. $db_password = Input::get('db_password');
  226. } else {
  227. $db_password = '';
  228. }
  229.  
  230. $prefix = Input::get('prefix');
  231. if(empty($prefix)){
  232. $prefix = '';
  233. }
  234.  
  235. $prefix = htmlspecialchars($prefix);
  236.  
  237. $db_prefix = "nl1_";
  238. $cookie_name = "nlmc";
  239.  
  240. /*
  241. * Test connection - use MySQLi here, as the config for PDO is not written
  242. */
  243. $mysqli = new mysqli(Input::get('db_address'), Input::get('db_username'), $db_password, Input::get('db_name'));
  244. if($mysqli->connect_errno) {
  245. $mysql_error = $mysqli->connect_errno . ' - ' . $mysqli->connect_error;
  246. } else {
  247. /*
  248. * Write to config file
  249. */
  250. $insert = '<?php' . PHP_EOL .
  251. '$GLOBALS[\'config\'] = array(' . PHP_EOL .
  252. ' "mysql" => array(' . PHP_EOL .
  253. ' "host" => "' . Input::get('db_address') . '", // Web server database IP (Likely to be 127.0.0.1)' . PHP_EOL .
  254. ' "username" => "' . Input::get('db_username') . '", // Web server database username' . PHP_EOL .
  255. ' "password" => \'' . $db_password . '\', // Web server database password' . PHP_EOL .
  256. ' "db" => "' . Input::get('db_name') . '", // Web server database name' . PHP_EOL .
  257. ' "prefix" => "' . $db_prefix . '" // Web server table prefix' . PHP_EOL .
  258. ' ),' . PHP_EOL .
  259. ' "remember" => array(' . PHP_EOL .
  260. ' "cookie_name" => "' . $cookie_name . '", // Name for website cookies' . PHP_EOL .
  261. ' "cookie_expiry" => 604800' . PHP_EOL .
  262. ' ),' . PHP_EOL .
  263. ' "session" => array(' . PHP_EOL .
  264. ' "session_name" => "user",' . PHP_EOL .
  265. ' "admin_name" => "admin",' . PHP_EOL .
  266. ' "token_name" => "token"' . PHP_EOL .
  267. ' )' . PHP_EOL .
  268. ');';
  269.  
  270. if(is_writable('core/config.php')){
  271. $file = fopen('core/config.php','w');
  272. fwrite($file, $insert);
  273. fclose($file);
  274.  
  275. $queries = new Queries();
  276. $queries->dbInitialise($db_prefix); // Initialise the database
  277.  
  278. $query = $mysqli->query("SELECT * FROM {$prefix}custom_pages");
  279. while($row = $query->fetch_assoc()){
  280. $queries->create('custom_pages', array(
  281. 'url' => $row['url'],
  282. 'title' => $row['title'],
  283. 'content' => $row['content'],
  284. 'link_location' => 1
  285. ));
  286. }
  287.  
  288. $query = $mysqli->query("INSERT nl1_forums SELECT * FROM {$prefix}forums");
  289.  
  290. $query = $mysqli->query("INSERT nl1_forums_permissions SELECT * FROM {$prefix}forums_permissions");
  291.  
  292. $query = $mysqli->query("INSERT nl1_friends SELECT * FROM {$prefix}friends");
  293.  
  294. $query = $mysqli->query("SELECT * FROM {$prefix}groups");
  295. while($row = $query->fetch_assoc()){
  296. $mod_cp = 0;
  297. $admin_cp = 0;
  298. $staff = 0;
  299.  
  300. if($row['id'] == 2){
  301. $mod_cp = 1;
  302. $admin_cp = 1;
  303. $staff = 1;
  304. } else if($row['id'] == 3){
  305. $mod_cp = 1;
  306. $staff = 1;
  307. }
  308.  
  309. $queries->create('groups', array(
  310. 'id' => $row['id'],
  311. 'name' => $row['name'],
  312. 'buycraft_id' => $row['buycraft_id'],
  313. 'group_html' => $row['group_html'],
  314. 'group_html_lg' => $row['group_html_lg'],
  315. 'mod_cp' => $mod_cp,
  316. 'admin_cp' => $admin_cp,
  317. 'staff' => $staff
  318. ));
  319. }
  320.  
  321. $query = $mysqli->query("INSERT nl1_infractions SELECT * FROM {$prefix}infractions");
  322.  
  323. $query = $mysqli->query("SELECT * FROM {$prefix}mc_servers");
  324. while($row = $query->fetch_assoc()){
  325. if(isset($row['pre'])){
  326. $pre = $row['pre'];
  327. } else {
  328. $pre = 0;
  329. }
  330.  
  331. if(isset($row['player_list'])){
  332. $player_list = $row['player_list'];
  333. } else {
  334. $player_list = 0;
  335. }
  336.  
  337. $queries->create('mc_servers', array(
  338. 'ip' => $row['ip'],
  339. 'name' => $row['name'],
  340. 'is_default' => $row['is_default'],
  341. 'display' => $row['display'],
  342. 'pre' => $pre,
  343. 'player_list' => $player_list
  344. ));
  345. }
  346.  
  347. $query = $mysqli->query("INSERT nl1_posts SELECT * FROM {$prefix}posts");
  348.  
  349. $query = $mysqli->query("INSERT nl1_private_messages SELECT * FROM {$prefix}private_messages");
  350.  
  351. $query = $mysqli->query("INSERT nl1_private_messages_users SELECT * FROM {$prefix}private_messages_users");
  352.  
  353. $query = $mysqli->query("INSERT nl1_reports SELECT * FROM {$prefix}reports");
  354.  
  355. $query = $mysqli->query("INSERT nl1_reports_comments SELECT * FROM {$prefix}reports_comments");
  356.  
  357. $query = $mysqli->query("INSERT nl1_reputation SELECT * FROM {$prefix}reputation");
  358.  
  359. $query = $mysqli->query("INSERT nl1_settings SELECT * FROM {$prefix}settings");
  360.  
  361. $query = $mysqli->query("SELECT * FROM {$prefix}topics");
  362. while($row = $query->fetch_assoc()){
  363. $queries->create('topics', array(
  364. 'id' => $row['id'],
  365. 'forum_id' => $row['forum_id'],
  366. 'topic_title' => $row['topic_title'],
  367. 'topic_creator' => $row['topic_creator'],
  368. 'topic_last_user' => $row['topic_last_user'],
  369. 'topic_date' => $row['topic_date'],
  370. 'topic_reply_date' => $row['topic_reply_date'],
  371. 'topic_views' => $row['topic_views'],
  372. 'locked' => $row['locked'],
  373. 'sticky' => $row['sticky'],
  374. 'label' => null
  375. ));
  376. }
  377.  
  378. $query = $mysqli->query("INSERT nl1_users SELECT * FROM {$prefix}users");
  379.  
  380. $query = $mysqli->query("INSERT nl1_users_admin_session SELECT * FROM {$prefix}users_admin_session");
  381.  
  382. $query = $mysqli->query("INSERT nl1_users_session SELECT * FROM {$prefix}users_session");
  383.  
  384. $query = $mysqli->query("INSERT nl1_uuid_cache SELECT * FROM {$prefix}uuid_cache");
  385.  
  386. // Core Modules
  387. $modules_initialised = $queries->getWhere('core_modules', array('id', '<>', 0));
  388.  
  389. if(!count($modules_initialised)){
  390. $queries->create('core_modules', array(
  391. 'name' => 'Google_Analytics',
  392. 'enabled' => 0
  393. ));
  394. $queries->create('core_modules', array(
  395. 'name' => 'Social_Media',
  396. 'enabled' => 1
  397. ));
  398. $queries->create('core_modules', array(
  399. 'name' => 'Registration',
  400. 'enabled' => 1
  401. ));
  402. $queries->create('core_modules', array(
  403. 'name' => 'Voice_Server_Module',
  404. 'enabled' => 0
  405. ));
  406. $queries->create('core_modules', array(
  407. 'name' => 'Staff_Applications',
  408. 'enabled' => 0
  409. ));
  410. }
  411.  
  412. // Themes
  413. $themes_initialised = $queries->getWhere('themes', array('id', '<>', 0));
  414.  
  415. if(!count($themes_initialised)){
  416. $themes = array(
  417. 1 => array(
  418. 'name' => 'Bootstrap',
  419. 'enabled' => 1
  420. ),
  421. 2 => array(
  422. 'name' => 'Cerulean',
  423. 'enabled' => 0
  424. ),
  425. 3 => array(
  426. 'name' => 'Cosmo',
  427. 'enabled' => 0
  428. ),
  429. 4 => array(
  430. 'name' => 'Cyborg',
  431. 'enabled' => 0
  432. ),
  433. 5 => array(
  434. 'name' => 'Darkly',
  435. 'enabled' => 0
  436. ),
  437. 6 => array(
  438. 'name' => 'Flatly',
  439. 'enabled' => 0
  440. ),
  441. 7 => array(
  442. 'name' => 'Journal',
  443. 'enabled' => 0
  444. ),
  445. 8 => array(
  446. 'name' => 'Lumen',
  447. 'enabled' => 0
  448. ),
  449. 9 => array(
  450. 'name' => 'Paper',
  451. 'enabled' => 0
  452. ),
  453. 10 => array(
  454. 'name' => 'Readable',
  455. 'enabled' => 0
  456. ),
  457. 11 => array(
  458. 'name' => 'Sandstone',
  459. 'enabled' => 0
  460. ),
  461. 12 => array(
  462. 'name' => 'Simplex',
  463. 'enabled' => 0
  464. ),
  465. 13 => array(
  466. 'name' => 'Slate',
  467. 'enabled' => 0
  468. ),
  469. 14 => array(
  470. 'name' => 'Spacelab',
  471. 'enabled' => 0
  472. ),
  473. 15 => array(
  474. 'name' => 'Superhero',
  475. 'enabled' => 0
  476. ),
  477. 16 => array(
  478. 'name' => 'United',
  479. 'enabled' => 0
  480. ),
  481. 17 => array(
  482. 'name' => 'Yeti',
  483. 'enabled' => 0
  484. )
  485. );
  486.  
  487. foreach($themes as $theme){
  488. $queries->create('themes', array(
  489. 'enabled' => $theme['enabled'],
  490. 'name' => $theme['name']
  491. ));
  492. }
  493. }
  494.  
  495. // Templates
  496. $queries->create('templates', array(
  497. 'enabled' => 1,
  498. 'name' => 'Default'
  499. ));
  500.  
  501. // Cache
  502. $c = new Cache();
  503. $c->setCache('themecache');
  504. $c->store('theme', 'Bootstrap');
  505. $c->store('inverse_navbar', '0');
  506.  
  507. // Todo: update site name
  508. //$c->setCache('sitenamecache');
  509. //$c->store('sitename', htmlspecialchars(Input::get('sitename')));
  510.  
  511. $c->setCache('templatecache');
  512. $c->store('template', 'Default');
  513.  
  514. $c->setCache('languagecache');
  515. $c->store('language', 'EnglishUK');
  516.  
  517. $c->setCache('page_load_cache');
  518. $c->store('page_load', 0);
  519.  
  520. $plugin_key = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 32);
  521.  
  522. // New settings
  523. $queries->update('settings', 13, array(
  524. 'value' => 'By registering on our website, you agree to the following:<p>This website uses "Nameless" website software. The "Nameless" software creators will not be held responsible for any content that may be experienced whilst browsing this site, nor are they responsible for any loss of data which may come about, for example a hacking attempt. The website is run independently from the software creators, and any content is the responsibility of the website administration.</p>'
  525. ));
  526.  
  527. $queries->create('settings', array(
  528. 'name' => 'mc_api_key',
  529. 'value' => $plugin_key
  530. ));
  531.  
  532. $queries->create('settings', array(
  533. 'name' => 'phpmailer',
  534. 'value' => '0'
  535. ));
  536.  
  537. $queries->create('settings', array(
  538. 'name' => 'phpmailer_type',
  539. 'value' => 'smtp'
  540. ));
  541.  
  542. $external_query = $queries->getWhere('settings', array('name', '=', 'external_query'));
  543. if(!count($external_query)){
  544. $queries->create('settings', array(
  545. 'name' => 'external_query',
  546. 'value' => 'false'
  547. ));
  548. }
  549.  
  550. $queries->create('settings', array(
  551. 'name' => 'use_plugin',
  552. 'value' => '0'
  553. ));
  554.  
  555. $queries->create('settings', array(
  556. 'name' => 'uuid_linking',
  557. 'value' => '1'
  558. ));
  559.  
  560. $queries->create('settings', array(
  561. 'name' => 'inverse_navbar',
  562. 'value' => '0'
  563. ));
  564.  
  565. $queries->create('settings', array(
  566. 'name' => 'error_reporting',
  567. 'value' => '0'
  568. ));
  569.  
  570. $queries->create('settings', array(
  571. 'name' => 'ga_script',
  572. 'value' => 'null'
  573. ));
  574.  
  575. $queries->create('settings', array(
  576. 'name' => 'avatar_api',
  577. 'value' => 'cravatar'
  578. ));
  579.  
  580. // Languages
  581. $queries->create('settings', array(
  582. 'name' => 'language',
  583. 'value' => 'EnglishUK'
  584. ));
  585.  
  586. $queries->create('settings', array(
  587. 'name' => 't_and_c_site',
  588. 'value' => '<p>You agree to be bound by our website rules and any laws which may apply to this website and your participation.</p><p>The website administration have the right to terminate your account at any time, delete any content you may have posted, and your IP address and any data you input to the website is recorded to assist the site staff with their moderation duties.</p><p>The site administration have the right to change these terms and conditions, and any site rules, at any point without warning. Whilst you may be informed of any changes, it is your responsibility to check these terms and the rules at any point.</p>'
  589. ));
  590.  
  591. $queries->create('settings', array(
  592. 'name' => 'incoming_email',
  593. 'value' => ''
  594. ));
  595.  
  596. $queries->create('settings', array(
  597. 'name' => 'query_update',
  598. 'value' => 'false'
  599. ));
  600.  
  601. $queries->create('settings', array(
  602. 'name' => 'mc_status_module',
  603. 'value' => 'false'
  604. ));
  605.  
  606. $queries->create('settings', array(
  607. 'name' => 'recaptcha_secret',
  608. 'value' => 'null'
  609. ));
  610.  
  611. $queries->create('settings', array(
  612. 'name' => 'email_verification',
  613. 'value' => '1'
  614. ));
  615.  
  616. $queries->create('settings', array(
  617. 'name' => 'play_page_enabled',
  618. 'value' => '1'
  619. ));
  620.  
  621. $queries->create('settings', array(
  622. 'name' => 'followers',
  623. 'value' => '0'
  624. ));
  625.  
  626. $queries->create('settings', array(
  627. 'name' => 'discord',
  628. 'value' => '0'
  629. ));
  630.  
  631. $queries->create('settings', array(
  632. 'name' => 'avatar_type',
  633. 'value' => 'helmavatar'
  634. ));
  635.  
  636. $queries->create('settings', array(
  637. 'name' => 'use_mcassoc',
  638. 'value' => '0'
  639. ));
  640.  
  641. $queries->create('settings', array(
  642. 'name' => 'mcassoc_key',
  643. 'value' => ''
  644. ));
  645.  
  646. $queries->create('settings', array(
  647. 'name' => 'mcassoc_instance',
  648. 'value' => ''
  649. ));
  650.  
  651. $queries->create('settings', array(
  652. 'name' => 'twitter_style',
  653. 'value' => 'light'
  654. ));
  655.  
  656. // Version update
  657. $version_id = $queries->getWhere('settings', array('name', '=', 'version'));
  658. $queries->update('settings', $version_id[0]->id, array(
  659. 'value' => '1.0.15'
  660. ));
  661.  
  662.  
  663. // Close connections
  664. $mysqli->close();
  665.  
  666. echo '<script>window.location.replace("./install?step=finish&from=upgrade");</script>';
  667. die();
  668.  
  669. } else {
  670. /*
  671. * File not writeable
  672. */
  673. ?>
  674. <div class="alert alert-danger">Your <b>core/config.php</b> file is not writeable. Please check your file permissions.</div>
  675. <?php
  676. die();
  677. }
  678. }
  679. } else {
  680. $mysql_error = 'Please input correct details';
  681. }
  682. }
  683. }
  684. ?>
  685. <div class="row page-header">
  686. <h3>Upgrade</h3>
  687. <hr class="small-margin">
  688. <p>The data of your old installation will now be retrieved and converted.</p>
  689. </div>
  690. <?php if(isset($mysql_error)){ ?>
  691. <div class="alert alert-danger">
  692. <?php echo $mysql_error; ?>
  693. </div>
  694. <?php } ?>
  695. <form action="" method="post">
  696. <div class="form-group">
  697. <label for="InputDBIP">Database Address</label>
  698. <input type="text" class="form-control" name="db_address" id="InputDBIP" value="<?php echo Input::get('db_address'); ?>" placeholder="Database Address">
  699. </div>
  700. <div class="form-group">
  701. <label for="InputDBUser">Database Username</label>
  702. <input type="text" class="form-control" name="db_username" id="InputDBUser" value="<?php echo Input::get('db_username'); ?>" placeholder="Database Username">
  703. </div>
  704. <div class="form-group">
  705. <label for="InputDBPass">Database Password</label>
  706. <input type="password" class="form-control" name="db_password" id="InputDBPass" placeholder="Database Password">
  707. </div>
  708. <div class="form-group">
  709. <label for="InputDBName">Database Name</label>
  710. <input type="text" class="form-control" name="db_name" id="InputDBName" value="<?php echo Input::get('db_name'); ?>" placeholder="Database Name">
  711. </div>
  712. <div class="form-group">
  713. <label for="InputPrefix">Previous Table Prefix with following '_' <em>(can be left empty)</em></label>
  714. <input id="InputPrefix" name="prefix" class="form-control" placeholder="Previous table prefix">
  715. </div>
  716. <input type="hidden" name="submitted" value="1">
  717. <hr>
  718. <input type="submit" class="btn btn-primary" value="Submit">
  719. </form>
  720. <?php
  721. } else if($step === "configuration"){
  722. if(Input::exists()){
  723. $validate = new Validate();
  724. $validation = $validate->check($_POST, array(
  725. 'db_address' => array(
  726. 'required' => true
  727. ),
  728. 'db_username' => array(
  729. 'required' => true
  730. ),
  731. 'db_name' => array(
  732. 'required' => true
  733. )
  734. ));
  735.  
  736. if($validation->passed()) {
  737. $db_password = "";
  738. $db_prefix = "nl1_";
  739. $cookie_name = "nlmc";
  740.  
  741. $db_password = Input::get('db_password');
  742.  
  743. if(!empty($db_password)){
  744. $db_password = Input::get('db_password');
  745. }
  746.  
  747. /*
  748. * Test connection - use MySQLi here, as the config for PDO is not written
  749. */
  750. $mysqli = new mysqli(Input::get('db_address'), Input::get('db_username'), $db_password, Input::get('db_name'));
  751. if($mysqli->connect_errno) {
  752. $mysql_error = $mysqli->connect_errno . ' - ' . $mysqli->connect_error;
  753. } else {
  754. /*
  755. * Write to config file
  756. */
  757. $insert = '<?php' . PHP_EOL .
  758. '$GLOBALS[\'config\'] = array(' . PHP_EOL .
  759. ' "mysql" => array(' . PHP_EOL .
  760. ' "host" => "' . Input::get('db_address') . '", // Web server database IP (Likely to be 127.0.0.1)' . PHP_EOL .
  761. ' "username" => "' . Input::get('db_username') . '", // Web server database username' . PHP_EOL .
  762. ' "password" => \'' . $db_password . '\', // Web server database password' . PHP_EOL .
  763. ' "db" => "' . Input::get('db_name') . '", // Web server database name' . PHP_EOL .
  764. ' "prefix" => "' . $db_prefix . '" // Web server table prefix' . PHP_EOL .
  765. ' ),' . PHP_EOL .
  766. ' "remember" => array(' . PHP_EOL .
  767. ' "cookie_name" => "' . $cookie_name . '", // Name for website cookies' . PHP_EOL .
  768. ' "cookie_expiry" => 604800' . PHP_EOL .
  769. ' ),' . PHP_EOL .
  770. ' "session" => array(' . PHP_EOL .
  771. ' "session_name" => "user",' . PHP_EOL .
  772. ' "admin_name" => "admin",' . PHP_EOL .
  773. ' "token_name" => "token"' . PHP_EOL .
  774. ' )' . PHP_EOL .
  775. ');';
  776.  
  777. if(is_writable('core/config.php')){
  778. $file = fopen('core/config.php','w');
  779. fwrite($file, $insert);
  780. fclose($file);
  781.  
  782. echo '<script>window.location.replace("./install?step=database");</script>';
  783. die();
  784.  
  785. } else {
  786. /*
  787. * File not writeable
  788. */
  789. ?>
  790. <br><div class="alert alert-danger">Your <b>core/config.php</b> file is not writeable. Please check your file permissions.</div>
  791. <?php
  792. die();
  793. }
  794. }
  795. } else {
  796. $errors = "";
  797.  
  798. foreach($validation->errors() as $error){
  799. if(strstr($error, 'db_address')){
  800. $errors .= "Please input a database address<br />";
  801. }
  802. if(strstr($error, "db_username")){
  803. $errors .= "Please input a database username<br />";
  804. }
  805. if(strstr($error, "db_name")){
  806. $errors .= "Please input a database name<br />";
  807. }
  808. }
  809. }
  810. }
  811. ?>
  812. <div class="row page-header">
  813. <h3>Configuration</h3>
  814. <hr class="small-margin">
  815. <p>Please provide your database details that NamelessMC may connect to. Please ensure the database has already been created.</p>
  816. </div>
  817. <?php
  818. if(isset($errors)){
  819. ?>
  820. <div class="alert alert-danger">
  821. <?php
  822. echo $errors;
  823. ?>
  824. </div>
  825. <?php
  826. }
  827. if(isset($mysql_error)){
  828. ?>
  829. <div class="alert alert-danger">
  830. <?php
  831. echo $mysql_error;
  832. ?>
  833. </div>
  834. <?php
  835. }
  836. ?>
  837. <form action="" method="post">
  838. <div class="form-group">
  839. <label for="InputDBIP">Database Address <strong class="text-danger">*</strong></label>
  840. <input type="text" class="form-control" name="db_address" id="InputDBIP" value="<?php echo Input::get('db_address'); ?>" placeholder="Database Address">
  841. </div>
  842. <div class="form-group">
  843. <label for="InputDBUser">Database Username <strong class="text-danger">*</strong></label>
  844. <input type="text" class="form-control" name="db_username" id="InputDBUser" value="<?php echo Input::get('db_username'); ?>" placeholder="Database Username">
  845. </div>
  846. <div class="form-group">
  847. <label for="InputDBPass">Database Password</label>
  848. <input type="password" class="form-control" name="db_password" id="InputDBPass" placeholder="Database Password">
  849. </div>
  850. <div class="form-group">
  851. <label for="InputDBName">Database Name <strong class="text-danger">*</strong></label>
  852. <input type="text" class="form-control" name="db_name" id="InputDBName" value="<?php echo Input::get('db_name'); ?>" placeholder="Database Name">
  853. </div>
  854. <small><em>Fields marked <strong class="text-danger">*</strong> are required</em></small>
  855. <hr>
  856. <input type="submit" class="btn btn-default" value="Submit">
  857. </form>
  858. <?php
  859. } else if($step === "database"){
  860. ?>
  861. <div class="row page-header">
  862. <h3>Database initialisation</h3>
  863. <hr class="small-margin">
  864. <p>The installer is now attempting to create the necessary tables in the database.</p>
  865. </div>
  866. <?php
  867. if(!isset($queries)){
  868. $queries = new Queries(); // Initialise queries
  869. }
  870. $prefix = Config::get('mysql/prefix');
  871.  
  872. if($queries->dbInitialise($prefix)) {
  873. ?>
  874. <div class="alert alert-success">The database was initialised successfully, and you may now progress with the installation.</div>
  875. <button type='button' onclick="location.href='./install?step=settings'" class='btn btn-primary'>Continue &raquo;</button>
  876. <?php
  877. } else {
  878. echo '<div class="alert alert-danger">Database initialisation failed.</div>';
  879. }
  880. } else if($step === "settings"){
  881. if(Input::exists()){
  882. $validate = new Validate();
  883. $validation = $validate->check($_POST, array(
  884. 'site_name' => array(
  885. 'required' => true,
  886. 'min' => 2,
  887. 'max' => 1024
  888. ),
  889. 'outgoing_email' => array(
  890. 'required' => true,
  891. 'min' => 2,
  892. 'max' => 1024
  893. ),
  894. 'incoming_email' => array(
  895. 'required' => true,
  896. 'min' => 2,
  897. 'max' => 1024
  898. )
  899. ));
  900.  
  901. if($validation->passed()) {
  902.  
  903. if(!isset($queries)){
  904. $queries = new Queries(); // Initialise queries
  905. }
  906.  
  907. $plugin_key = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 32);
  908. $uid = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 62);
  909. // Get current unix time
  910. $date = new DateTime();
  911. $date = $date->getTimestamp();
  912.  
  913. $data = array(
  914. 0 => array(
  915. 'name' => 'sitename',
  916. 'value' => htmlspecialchars(Input::get('site_name'))
  917. ),
  918. 1 => array(
  919. 'name' => 'maintenance',
  920. 'value' => 'false'
  921. ),
  922. 2 => array(
  923. 'name' => 'outgoing_email',
  924. 'value' => htmlspecialchars(Input::get('outgoing_email'))
  925. ),
  926. 3 => array(
  927. 'name' => 'incoming_email',
  928. 'value' => htmlspecialchars(Input::get('incoming_email'))
  929. ),
  930. 4 => array(
  931. 'name' => 'youtube_url',
  932. 'value' => 'null'
  933. ),
  934. 5 => array(
  935. 'name' => 'twitter_url',
  936. 'value' => 'null'
  937. ),
  938. 6 => array(
  939. 'name' => 'gplus_url',
  940. 'value' => 'null'
  941. ),
  942. 7 => array(
  943. 'name' => 'fb_url',
  944. 'value' => 'null'
  945. ),
  946. 8 => array(
  947. 'name' => 'twitter_feed_id',
  948. 'value' => 'null'
  949. ),
  950. 9 => array(
  951. 'name' => 'recaptcha',
  952. 'value' => 'false'
  953. ),
  954. 10 => array(
  955. 'name' => 'recaptcha_key',
  956. 'value' => 'null'
  957. ),
  958. 11 => array(
  959. 'name' => 't_and_c',
  960. 'value' => 'By registering on our website, you agree to the following:<p>This website uses "Nameless" website software. The "Nameless" software creators will not be held responsible for any content that may be experienced whilst browsing this site, nor are they responsible for any loss of data which may come about, for example a hacking attempt. The website is run independently from the software creators, and any content is the responsibility of the website administration.</p>'
  961. ),
  962. 12 => array(
  963. 'name' => 't_and_c_site',
  964. 'value' => '<p>You agree to be bound by our website rules and any laws which may apply to this website and your participation.</p><p>The website administration have the right to terminate your account at any time, delete any content you may have posted, and your IP address and any data you input to the website is recorded to assist the site staff with their moderation duties.</p><p>The site administration have the right to change these terms and conditions, and any site rules, at any point without warning. Whilst you may be informed of any changes, it is your responsibility to check these terms and the rules at any point.</p>'
  965. ),
  966. 13 => array(
  967. 'name' => 'displaynames',
  968. 'value' => 'false'
  969. ),
  970. 14 => array(
  971. 'name' => 'ga_script',
  972. 'value' => 'null'
  973. ),
  974. 15 => array(
  975. 'name' => 'avatar_api',
  976. 'value' => 'cravatar'
  977. ),
  978. 16 => array(
  979. 'name' => 'language',
  980. 'value' => 'EnglishUK'
  981. ),
  982. 17 => array(
  983. 'name' => 'forum_layout',
  984. 'value' => '1'
  985. ),
  986. 18 => array(
  987. 'name' => 'error_reporting',
  988. 'value' => '0'
  989. ),
  990. 19 => array(
  991. 'name' => 'inverse_navbar',
  992. 'value' => '0'
  993. ),
  994. 20 => array(
  995. 'name' => 'unique_id',
  996. 'value' => $uid
  997. ),
  998. 21 => array(
  999. 'name' => 'uuid_linking',
  1000. 'value' => '1'
  1001. ),
  1002. 22 => array(
  1003. 'name' => 'user_avatars',
  1004. 'value' => '0'
  1005. ),
  1006. 23 => array(
  1007. 'name' => 'use_plugin',
  1008. 'value' => '0'
  1009. ),
  1010. 24 => array(
  1011. 'name' => 'external_query',
  1012. 'value' => 'false'
  1013. ),
  1014. 25 => array(
  1015. 'name' => 'phpmailer',
  1016. 'value' => '0'
  1017. ),
  1018. 26 => array(
  1019. 'name' => 'phpmailer_type',
  1020. 'value' => 'smtp'
  1021. ),
  1022. 27 => array(
  1023. 'name' => 'mc_api_key',
  1024. 'value' => $plugin_key
  1025. ),
  1026. 28 => array(
  1027. 'name' => 'version',
  1028. 'value' => '1.0.15'
  1029. ),
  1030. 29 => array(
  1031. 'name' => 'version_checked',
  1032. 'value' => $date
  1033. ),
  1034. 30 => array(
  1035. 'name' => 'version_update',
  1036. 'value' => 'false'
  1037. ),
  1038. 31 => array(
  1039. 'name' => 'query_update',
  1040. 'value' => 'false'
  1041. ),
  1042. 32 => array(
  1043. 'name' => 'mc_status_module',
  1044. 'value' => 'false'
  1045. ),
  1046. 33 => array(
  1047. 'name' => 'recaptcha_secret',
  1048. 'value' => 'null'
  1049. ),
  1050. 34 => array(
  1051. 'name' => 'email_verification',
  1052. 'value' => '1'
  1053. ),
  1054. 35 => array(
  1055. 'name' => 'play_page_enabled',
  1056. 'value' => '1'
  1057. ),
  1058. 36 => array(
  1059. 'name' => 'followers',
  1060. 'value' => '0'
  1061. ),
  1062. 37 => array(
  1063. 'name' => 'discord',
  1064. 'value' => '0'
  1065. ),
  1066. 38 => array(
  1067. 'name' => 'avatar_type',
  1068. 'value' => 'helmavatar'
  1069. ),
  1070. 39 => array(
  1071. 'name' => 'use_mcassoc',
  1072. 'value' => '0'
  1073. ),
  1074. 40 => array(
  1075. 'name' => 'mcassoc_key',
  1076. 'value' => ''
  1077. ),
  1078. 41 => array(
  1079. 'name' => 'mcassoc_instance',
  1080. 'value' => ''
  1081. ),
  1082. 42 => array(
  1083. 'name' => 'twitter_style',
  1084. 'value' => 'light'
  1085. )
  1086. );
  1087.  
  1088. $youtube_url = Input::get('youtube_url');
  1089. if(!empty($youtube_url)){
  1090. $data[4]["value"] = htmlspecialchars($youtube_url);
  1091. }
  1092. $twitter_url = Input::get('twitter_url');
  1093. if(!empty($twitter_url)){
  1094. $data[5]["value"] = htmlspecialchars($twitter_url);
  1095. }
  1096. $twitter_feed = Input::get('twitter_feed');
  1097. if(!empty($twitter_feed)){
  1098. $data[8]["value"] = htmlspecialchars($twitter_feed);
  1099. }
  1100. $gplus_url = Input::get('gplus_url');
  1101. if(!empty($gplus_url)){
  1102. $data[6]["value"] = htmlspecialchars($gplus_url);
  1103. }
  1104. $fb_url = Input::get('fb_url');
  1105. if(!empty($fb_url)){
  1106. $data[7]["value"] = htmlspecialchars($fb_url);
  1107. }
  1108. if(Input::get('user_usernames') == 1){
  1109. $data[13]["value"] = "true";
  1110. }
  1111. if(Input::get('user_avatars') == 1){
  1112. $data[22]["value"] = "1";
  1113. }
  1114.  
  1115. try {
  1116. foreach($data as $setting){
  1117. $queries->create("settings", array(
  1118. 'name' => $setting["name"],
  1119. 'value' => $setting["value"]
  1120. ));
  1121. }
  1122.  
  1123. $queries->create('custom_pages', array(
  1124. 'url' => '/help/',
  1125. 'title' => 'Help',
  1126. 'content' => 'Default help page. Customise in the admin panel.',
  1127. 'link_location' => 3
  1128. ));
  1129.  
  1130. // Core Modules
  1131. $modules_initialised = $queries->getWhere('core_modules', array('id', '<>', 0));
  1132.  
  1133. if(!count($modules_initialised)){
  1134. $queries->create('core_modules', array(
  1135. 'name' => 'Google_Analytics',
  1136. 'enabled' => 0
  1137. ));
  1138. $queries->create('core_modules', array(
  1139. 'name' => 'Social_Media',
  1140. 'enabled' => 1
  1141. ));
  1142. $queries->create('core_modules', array(
  1143. 'name' => 'Registration',
  1144. 'enabled' => 1
  1145. ));
  1146. $queries->create('core_modules', array(
  1147. 'name' => 'Voice_Server_Module',
  1148. 'enabled' => 0
  1149. ));
  1150. $queries->create('core_modules', array(
  1151. 'name' => 'Staff_Applications',
  1152. 'enabled' => 0
  1153. ));
  1154. }
  1155.  
  1156. // Themes
  1157. $themes_initialised = $queries->getWhere('themes', array('id', '<>', 0));
  1158.  
  1159. if(!count($themes_initialised)){
  1160. $themes = array(
  1161. 1 => array(
  1162. 'name' => 'Bootstrap',
  1163. 'enabled' => 1
  1164. ),
  1165. 2 => array(
  1166. 'name' => 'Cerulean',
  1167. 'enabled' => 0
  1168. ),
  1169. 3 => array(
  1170. 'name' => 'Cosmo',
  1171. 'enabled' => 0
  1172. ),
  1173. 4 => array(
  1174. 'name' => 'Cyborg',
  1175. 'enabled' => 0
  1176. ),
  1177. 5 => array(
  1178. 'name' => 'Darkly',
  1179. 'enabled' => 0
  1180. ),
  1181. 6 => array(
  1182. 'name' => 'Flatly',
  1183. 'enabled' => 0
  1184. ),
  1185. 7 => array(
  1186. 'name' => 'Journal',
  1187. 'enabled' => 0
  1188. ),
  1189. 8 => array(
  1190. 'name' => 'Lumen',
  1191. 'enabled' => 0
  1192. ),
  1193. 9 => array(
  1194. 'name' => 'Paper',
  1195. 'enabled' => 0
  1196. ),
  1197. 10 => array(
  1198. 'name' => 'Readable',
  1199. 'enabled' => 0
  1200. ),
  1201. 11 => array(
  1202. 'name' => 'Sandstone',
  1203. 'enabled' => 0
  1204. ),
  1205. 12 => array(
  1206. 'name' => 'Simplex',
  1207. 'enabled' => 0
  1208. ),
  1209. 13 => array(
  1210. 'name' => 'Slate',
  1211. 'enabled' => 0
  1212. ),
  1213. 14 => array(
  1214. 'name' => 'Spacelab',
  1215. 'enabled' => 0
  1216. ),
  1217. 15 => array(
  1218. 'name' => 'Superhero',
  1219. 'enabled' => 0
  1220. ),
  1221. 16 => array(
  1222. 'name' => 'United',
  1223. 'enabled' => 0
  1224. ),
  1225. 17 => array(
  1226. 'name' => 'Yeti',
  1227. 'enabled' => 0
  1228. )
  1229. );
  1230.  
  1231. foreach($themes as $theme){
  1232. $queries->create('themes', array(
  1233. 'enabled' => $theme['enabled'],
  1234. 'name' => $theme['name']
  1235. ));
  1236. }
  1237. }
  1238.  
  1239. // Templates
  1240. $queries->create('templates', array(
  1241. 'enabled' => 1,
  1242. 'name' => 'Default'
  1243. ));
  1244.  
  1245. // Cache
  1246. $c = new Cache();
  1247. $c->setCache('themecache');
  1248. $c->store('theme', 'Bootstrap');
  1249. $c->store('inverse_navbar', '0');
  1250.  
  1251. $c->setCache('sitenamecache');
  1252. $c->store('sitename', htmlspecialchars(Input::get('site_name')));
  1253.  
  1254. $c->setCache('templatecache');
  1255. $c->store('template', 'Default');
  1256.  
  1257. $c->setCache('languagecache');
  1258. $c->store('language', 'EnglishUK');
  1259.  
  1260. $c->setCache('page_load_cache');
  1261. $c->store('page_load', 0);
  1262.  
  1263. echo '<script>window.location.replace("./install?step=account");</script>';
  1264. die();
  1265.  
  1266. } catch(Exception $e){
  1267. echo "<br><div class='alert alert-danger'>".$e->getMessage()."</div>";
  1268. die();
  1269. }
  1270.  
  1271. } else {
  1272. $errors = "";
  1273.  
  1274. foreach($validation->errors() as $error){
  1275. if(strstr($error, 'site_name')){
  1276. $errors .= "Please input a site name<br />";
  1277. }
  1278. if(strstr($error, "outgoing_email")){
  1279. $errors .= "Please input an outgoing email address<br />";
  1280. }
  1281. if(strstr($error, "incoming_email")){
  1282. $errors .= "Please input an incoming email address<br />";
  1283. }
  1284. }
  1285. }
  1286. }
  1287. ?>
  1288. <div class="row page-header">
  1289. <h3>Settings</h3>
  1290. <hr class="small-margin">
  1291. <p>Please fill out the form below to set your basic settings, these can be changed later.</p>
  1292. </div>
  1293. <?php
  1294. if(isset($errors)){
  1295. ?>
  1296. <div class="alert alert-danger">
  1297. <?php
  1298. echo $errors;
  1299. ?>
  1300. </div>
  1301. <?php
  1302. }
  1303. ?>
  1304. <form action="?step=settings" method="post">
  1305. <h4>General</h4>
  1306. <div class="form-group">
  1307. <label for="InputSiteName">Site Name <strong class="text-danger">*</strong></label>
  1308. <input type="text" class="form-control" name="site_name" id="InputSiteName" value="<?php echo Input::get('site_name'); ?>" placeholder="Site Name">
  1309. </div>
  1310. <div class="form-group">
  1311. <label for="InputICEmail">Incoming Email Address <strong class="text-danger">*</strong></label>
  1312. <input type="email" class="form-control" name="incoming_email" id="InputICEmail" value="<?php echo Input::get('incoming_email'); ?>" placeholder="Incoming Email">
  1313. </div>
  1314. <div class="form-group">
  1315. <label for="InputOGEmail">Outgoing Email Address <strong class="text-danger">*</strong></label>
  1316. <input type="email" class="form-control" name="outgoing_email" id="InputOGEmail" value="<?php echo Input::get('outgoing_email'); ?>" placeholder="Outgoing Email">
  1317. </div>
  1318. <div class="form-group">
  1319. <label for="InputYT">Youtube URL</label>
  1320. <input type="text" class="form-control" name="youtube_url" id="InputYT" value="<?php echo Input::get('youtube_url'); ?>" placeholder="Youtube URL">
  1321. </div>
  1322. <div class="form-group">
  1323. <label for="InputTwitter">Twitter URL</label>
  1324. <input type="text" class="form-control" name="twitter_url" id="InputTwitter" value="<?php echo Input::get('twitter_url'); ?>" placeholder="Twitter URL">
  1325. </div>
  1326. <div class="form-group">
  1327. <label for="InputTwitterFeed">Twitter Feed ID <a data-toggle="modal" href="#twitter_id"><span class="label label-info">?</span></a></label>
  1328. <input type="text" class="form-control" name="twitter_feed" id="InputTwitterFeed" value="<?php echo Input::get('twitter_feed'); ?>" placeholder="Twitter Feed ID">
  1329. </div>
  1330. <div class="form-group">
  1331. <label for="InputGPlus">Google+ URL</label>
  1332. <input type="text" class="form-control" name="gplus_url" id="InputGPlus" value="<?php echo Input::get('gplus_url'); ?>" placeholder="Google+ URL">
  1333. </div>
  1334. <div class="form-group">
  1335. <label for="InputFB">Facebook URL</label>
  1336. <input type="text" class="form-control" name="fb_url" id="InputFB" value="<?php echo Input::get('fb_url'); ?>" placeholder="Facebook URL">
  1337. </div>
  1338. <small><em>Fields marked <strong class="text-danger">*</strong> are required</em></small>
  1339. <hr>
  1340. <h4>User Accounts</h4>
  1341. <input type="hidden" name="user_usernames" value="0" />
  1342. <div class="checkbox">
  1343. <label>
  1344. <input type="checkbox" name="user_usernames" value="1"> Allow registering with non-Minecraft display names
  1345. </label>
  1346. </div>
  1347. <input type="hidden" name="user_avatars" value="0" />
  1348. <div class="checkbox">
  1349. <label>
  1350. <input type="checkbox" name="user_avatars" value="1"> Allow custom user avatars
  1351. </label>
  1352. </div>
  1353. <hr>
  1354. <input type="submit" class="btn btn-primary" value="Submit">
  1355. </form>
  1356. <?php
  1357. } else if($step === "account"){
  1358. if(!isset($queries)){
  1359. $queries = new Queries(); // Initialise queries
  1360. }
  1361. $allow_mcnames = $queries->getWhere("settings", array("name", "=", "displaynames"));
  1362. $allow_mcnames = $allow_mcnames[0]->value; // Can the user register with a non-Minecraft username?
  1363.  
  1364. if(Input::exists()){
  1365. $validate = new Validate();
  1366.  
  1367. $data = array(
  1368. 'email' => array(
  1369. 'required' => true,
  1370. 'min' => 2,
  1371. 'max' => 64
  1372. ),
  1373. 'password' => array(
  1374. 'required' => true,
  1375. 'min' => 6,
  1376. 'max' => 64
  1377. ),
  1378. 'password_again' => array(
  1379. 'required' => true,
  1380. 'matches' => 'password'
  1381. )
  1382. );
  1383.  
  1384. if($allow_mcnames === "false"){ // Custom usernames are disabled
  1385. $data['username'] = array(
  1386. 'min' => 2,
  1387. 'max' => 20
  1388. );
  1389. } else { // Custom usernames are enabled
  1390. $data['username'] = array(
  1391. 'min' => 2,
  1392. 'max' => 20
  1393. );
  1394. $data['mcname'] = array(
  1395. 'min' => 2,
  1396. 'max' => 20
  1397. );
  1398. }
  1399.  
  1400. $validation = $validate->check($_POST, $data); // validate
  1401.  
  1402. if($validation->passed()){
  1403. $user = new User();
  1404.  
  1405. // Get Minecraft UUID of user
  1406. if($allow_mcnames !== "false"){
  1407. $mcname = Input::get('mcname');
  1408. $profile = ProfileUtils::getProfile($mcname);
  1409. } else {
  1410. $mcname = Input::get('username');
  1411. $profile = ProfileUtils::getProfile(Input::get('username'));
  1412. }
  1413.  
  1414. if(!empty($profile)){
  1415. $uuid = $profile->getProfileAsArray();
  1416. $uuid = $uuid['uuid'];
  1417. if(empty($uuid)){
  1418. $uuid = '';
  1419. }
  1420. } else {
  1421. $uuid = '';
  1422. }
  1423.  
  1424. if($uuid == ''){
  1425. // Error getting UUID, display an error asking user to update manually
  1426. $uuid_error = true;
  1427. }
  1428.  
  1429. // Hash password
  1430. $password = password_hash(Input::get('password'), PASSWORD_BCRYPT, array("cost" => 13));
  1431.  
  1432. // Get current unix time
  1433. $date = new DateTime();
  1434. $date = $date->getTimestamp();
  1435.  
  1436. try {
  1437. // Create groups
  1438. // Only create if they don't already exist for some reason
  1439. $group_exists = $queries->getWhere("groups", array("id", "=", 1));
  1440. if(!count($group_exists)){
  1441. $queries->create("groups", array(
  1442. 'id' => 1,
  1443. 'name' => 'Standard',
  1444. 'group_html' => '<span class="label label-success">Member</span>',
  1445. 'group_html_lg' => '<span class="label label-success">Member</span>'
  1446. ));
  1447. }
  1448.  
  1449. $group_exists = $queries->getWhere("groups", array("id", "=", 2));
  1450. if(!count($group_exists)){
  1451. $queries->create("groups", array(
  1452. 'id' => 2,
  1453. 'name' => 'Admin',
  1454. 'group_html' => '<span class="label label-danger">Admin</span>',
  1455. 'group_html_lg' => '<span class="label label-danger">Admin</span>',
  1456. 'mod_cp' => 1,
  1457. 'admin_cp' => 1,
  1458. 'staff' => 1
  1459. ));
  1460. }
  1461.  
  1462. $group_exists = $queries->getWhere("groups", array("id", "=", 3));
  1463. if(!count($group_exists)){
  1464. $queries->create("groups", array(
  1465. 'id' => 3,
  1466. 'name' => 'Moderator',
  1467. 'group_html' => '<span class="label label-info">Moderator</span>',
  1468. 'group_html_lg' => '<span class="label label-info">Moderator</span>',
  1469. 'mod_cp' => 1,
  1470. 'staff' => 1
  1471. ));
  1472. }
  1473.  
  1474. // Create admin account
  1475. $user->create(array(
  1476. 'username' => Input::get('username'),
  1477. 'password' => $password,
  1478. 'pass_method' => 'default',
  1479. 'mcname' => $mcname,
  1480. 'uuid' => $uuid,
  1481. 'joined' => $date,
  1482. 'group_id' => 2,
  1483. 'email' => Input::get('email'),
  1484. 'lastip' => "",
  1485. 'active' => 1
  1486. ));
  1487.  
  1488. $login = $user->login(Input::get('username'), Input::get('password'), true);
  1489. if($login) {
  1490. if(!isset($uuid_error)){
  1491. echo '<script>window.location.replace("./install?step=convert");</script>';
  1492. } else {
  1493. echo '<script>window.location.replace("./install?step=convert&error=uuid");</script>';
  1494. }
  1495. die();
  1496. } else {
  1497. echo '<p>Sorry, there was an unknown error logging you in. <a href="/install/?step=account">Try again</a></p>';
  1498. die();
  1499. }
  1500.  
  1501. } catch(Exception $e){
  1502. echo "<br><div class='alert alert-danger'>".$e->getMessage()."</div>";
  1503. die();
  1504. }
  1505.  
  1506.  
  1507. } else {
  1508. Session::flash('admin-acc-error', '
  1509. <div class="alert alert-danger">
  1510. Unable to create account. Please check:<br />
  1511. - You have entered a username between 4 and 20 characters long<br />
  1512. - Your Minecraft username is a valid account<br />
  1513. - Your passwords are at between 6 and 64 characters long and they match<br />
  1514. - Your email address is between 4 and 64 characters<br />
  1515. </div>');
  1516. }
  1517. }
  1518. ?>
  1519. <div class="row page-header">
  1520. <h3>Admin Account</h3>
  1521. <hr class="small-margin">
  1522. <p>Time to create the first account, this user will be an admin.</p>
  1523. </div>
  1524. <?php
  1525. if(Session::exists('admin-acc-error')){
  1526. echo Session::flash('admin-acc-error');
  1527. }
  1528. ?>
  1529. <form role="form" action="?step=account" method="post">
  1530. <div class="form-group">
  1531. <label for="InputUsername">Username <strong class="text-danger">*</strong></label>
  1532. <input type="text" class="form-control" id="InputUsername" name="username" placeholder="Username" tabindex="1">
  1533. </div>
  1534. <?php
  1535. if($allow_mcnames !== "false"){
  1536. ?>
  1537. <div class="form-group">
  1538. <label for="InputMCUsername">Minecraft Username <strong class="text-danger">*</strong></label>
  1539. <input type="text" class="form-control" id="InputMCUsername" name="mcname" placeholder="Minecraft Username" tabindex="2">
  1540. </div>
  1541. <?php
  1542. }
  1543. ?>
  1544. <div class="form-group">
  1545. <label for="InputEmail">Email <strong class="text-danger">*</strong></label>
  1546. <input type="email" name="email" id="InputEmail" class="form-control" placeholder="Email Address" tabindex="3">
  1547. </div>
  1548. <div class="row">
  1549. <div class="col-xs-12 col-sm-6 col-md-6">
  1550. <div class="form-group">
  1551. <label for="InputPassword">Password <strong class="text-danger">*</strong></label>
  1552. <input type="password" class="form-control" id="InputPassword" name="password" placeholder="Password" tabindex="4">
  1553. </div>
  1554. </div>
  1555. <div class="col-xs-12 col-sm-6 col-md-6">
  1556. <div class="form-group">
  1557. <label for="InputConfirmPassword">Confirm Password <strong class="text-danger">*</strong></label>
  1558. <input type="password" class="form-control" id="InputConfirmPassword" name="password_again" placeholder="Confirm Password" tabindex="5">
  1559. </div>
  1560. </div>
  1561. </div>
  1562. <small><em>Fields marked <strong class="text-danger">*</strong> are required</em></small>
  1563. <hr>
  1564. <button type="submit" class="btn btn-default">Submit</button>
  1565. </form>
  1566. <?php
  1567. } else if($_GET['step'] === "convert"){
  1568. if(!isset($user)){
  1569. $user = new User();
  1570. }
  1571. if(!$user->isLoggedIn() || $user->data()->group_id != 2){
  1572. echo '<script>window.location.replace("/install/?step=account");</script>';
  1573. die();
  1574. }
  1575. if(isset($_GET["convert"]) && !isset($_GET["from"])){
  1576. ?>
  1577. <div class="well">
  1578. <h4>Which forum software are you converting from?</h4>
  1579. <!--<a href="#" onclick="location.href='./install.php?step=convert&convert=yes&from=modernbb'">ModernBB</a><br />
  1580. <a href="#" onclick="location.href='./install.php?step=convert&convert=yes&from=phpbb'">phpBB</a><br />
  1581. <a href="#" onclick="location.href='./install.php?step=convert&convert=yes&from=mybb'">MyBB</a><br />
  1582. <a href="#" onclick="location.href='./install.php?step=convert&convert=yes&from=wordpress'">WordPress</a><br />-->
  1583. <a href="#" onclick="location.href='./install?step=convert&convert=yes&from=xenforo'">XenForo</a><br /><br />
  1584. <button class="btn btn-danger" onclick="location.href='./install?step=convert'">Cancel</button>
  1585. </div>
  1586. <?php
  1587. } else if(isset($_GET["convert"]) && isset($_GET["from"])){
  1588. ?>
  1589. <div class="well">
  1590. <?php
  1591. if(strtolower($_GET["from"]) === "modernbb"){
  1592. if(!Input::exists()){
  1593. ?>
  1594. <h4>Converting from ModernBB:</h4>
  1595.  
  1596. <?php
  1597. if(isset($_GET["error"])){
  1598. ?>
  1599. <div class="alert alert-danger">
  1600. Error connecting to the database. Are you sure you entered the correct credentials?
  1601. </div>
  1602. <?php
  1603. }
  1604. ?>
  1605.  
  1606. <form action="?step=convert&convert=yes&from=modernbb" method="post">
  1607. <div class="form-group">
  1608. <label for="InputDBAddress">ModernBB Database Address</label>
  1609. <input class="form-control" type="text" id="InputDBAddress" name="db_address" placeholder="Database address">
  1610. </div>
  1611. <div class="form-group">
  1612. <label for="InputDBName">ModernBB Database Name</label>
  1613. <input class="form-control" type="text" id="InputDBName" name="db_name" placeholder="Database name">
  1614. </div>
  1615. <div class="form-group">
  1616. <label for="InputDBUsername">ModernBB Database Username</label>
  1617. <input class="form-control" type="text" id="InputDBUsername" name="db_username" placeholder="Database username">
  1618. </div>
  1619. <div class="form-group">
  1620. <label for="InputDBPassword">ModernBB Database Password</label>
  1621. <input class="form-control" type="password" id="InputDBPassword" name="db_password" placeholder="Database password">
  1622. </div>
  1623. <div class="form-group">
  1624. <label for="InputDBPrefix">ModernBB Table Prefix (blank for none)</label>
  1625. <input class="form-control" type="text" id="InputDBPrefix" name="db_prefix" placeholder="Table prefix">
  1626. </div>
  1627. <input type="hidden" name="token" value="<?php echo Token::generate(); ?>">
  1628. <input type="hidden" name="action" value="convert">
  1629. <input class="btn btn-primary" type="submit" value="Convert">
  1630. <a href="#" class="btn btn-danger" onclick="location.href='./install?step=convert&convert=yes'">Cancel</a>
  1631. </form>
  1632.  
  1633. <?php
  1634. } else {
  1635. require 'core/converters/modernbb.php';
  1636. ?>
  1637. <div class="alert alert-success">
  1638. Successfully imported ModernBB data. <strong>Important:</strong> Please redefine any private categories in the Admin panel.<br />
  1639. <center><button class="btn btn-primary" onclick="location.href='./install?step=finish'">Proceed</button></center>
  1640. </div>
  1641. <?php
  1642. }
  1643. } else if(strtolower($_GET["from"]) === "phpbb"){
  1644. if(!Input::exists()){
  1645. ?>
  1646. <h4>Converting from phpBB:</h4>
  1647. Coming soon. This won't work yet!
  1648.  
  1649. <?php
  1650. if(isset($_GET["error"])){
  1651. ?>
  1652. <div class="alert alert-danger">
  1653. Error connecting to the database. Are you sure you entered the correct credentials?
  1654. </div>
  1655. <?php
  1656. }
  1657. ?>
  1658.  
  1659. <form action="?step=convert&convert=yes&from=phpbb" method="post">
  1660. <div class="form-group">
  1661. <label for="InputDBAddress">phpBB Database Address</label>
  1662. <input class="form-control" type="text" id="InputDBAddress" name="db_address" placeholder="Database address">
  1663. </div>
  1664. <div class="form-group">
  1665. <label for="InputDBName">phpBB Database Name</label>
  1666. <input class="form-control" type="text" id="InputDBName" name="db_name" placeholder="Database name">
  1667. </div>
  1668. <div class="form-group">
  1669. <label for="InputDBUsername">phpBB Database Username</label>
  1670. <input class="form-control" type="text" id="InputDBUsername" name="db_username" placeholder="Database username">
  1671. </div>
  1672. <div class="form-group">
  1673. <label for="InputDBPassword">phpBB Database Password</label>
  1674. <input class="form-control" type="password" id="InputDBPassword" name="db_password" placeholder="Database password">
  1675. </div>
  1676. <div class="form-group">
  1677. <label for="InputDBPrefix">phpBB Table Prefix (blank for none)</label>
  1678. <input class="form-control" type="text" id="InputDBPrefix" name="db_prefix" placeholder="Table prefix">
  1679. </div>
  1680. <input type="hidden" name="token" value="<?php echo Token::generate(); ?>">
  1681. <input type="hidden" name="action" value="convert">
  1682. <input class="btn btn-primary" type="submit" value="Convert">
  1683. <a href="#" class="btn btn-danger" onclick="location.href='./install?step=convert&convert=yes'">Cancel</a>
  1684. </form>
  1685.  
  1686. <?php
  1687. } else {
  1688. require 'core/converters/phpbb.php';
  1689. ?>
  1690. <div class="alert alert-success">
  1691. Successfully imported phpBB data. <strong>Important:</strong> Please redefine any private categories in the Admin panel.<br />
  1692. <center><button class="btn btn-primary" onclick="location.href='./install?step=finish'">Proceed</button></center>
  1693. </div>
  1694. <?php
  1695. }
  1696. /*
  1697. * ---- NEW, By dwilson390 -----
  1698. */
  1699. } else if(strtolower($_GET["from"]) === "wordpress"){
  1700. if(!Input::exists()){
  1701. ?>
  1702. <h4>Converting from WordPress:</h4>
  1703.  
  1704. <?php
  1705. if(isset($_GET["error"])){
  1706. ?>
  1707. <div class="alert alert-danger">
  1708. Error connecting to the database. Are you sure you entered the correct credentials?
  1709. </div>
  1710. <?php
  1711. }
  1712. ?>
  1713. <div class="alert alert-success">
  1714. WordPress conversion script created by dwilson390.<br />
  1715. </div>
  1716. <form action="?step=convert&convert=yes&from=wordpress" method="post">
  1717. <div class="form-group">
  1718. <label for="InputDBAddress">Wordpress Database Address</label>
  1719. <input class="form-control" type="text" id="InputDBAddress" name="db_address" placeholder="Database address">
  1720. </div>
  1721. <div class="form-group">
  1722. <label for="InputDBName">Wordpress Database Name</label>
  1723. <input class="form-control" type="text" id="InputDBName" name="db_name" placeholder="Database name">
  1724. </div>
  1725. <div class="form-group">
  1726. <label for="InputDBUsername">Wordpress Database Username</label>
  1727. <input class="form-control" type="text" id="InputDBUsername" name="db_username" placeholder="Database username">
  1728. </div>
  1729. <div class="form-group">
  1730. <label for="InputDBPassword">Wordpress Database Password</label>
  1731. <input class="form-control" type="password" id="InputDBPassword" name="db_password" placeholder="Database password">
  1732. </div>
  1733. <div class="form-group">
  1734. <label for="InputDBPrefix">Wordpress Table Prefix (blank for none) (<strong>Remember the '_'</strong>)</label>
  1735. <input class="form-control" type="text" id="InputDBPrefix" name="db_prefix" placeholder="Table prefix">
  1736. </div>
  1737. <div class="form-group">
  1738. <label for="InputDBCheckbox">I have bbPress installed (selecting this option will also import your forums and topics)</label>
  1739. <input class="form-control" type="checkbox" id="InputDBCheckbox" name="db_checkbox" placeholder="Table prefix">
  1740. </div>
  1741. <input type="hidden" name="token" value="<?php echo Token::generate(); ?>">
  1742. <input type="hidden" name="action" value="convert">
  1743. <input class="btn btn-primary" type="submit" value="Convert">
  1744. <a href="#" class="btn btn-danger" onclick="location.href='./install?step=convert&convert=yes'">Cancel</a>
  1745. </form>
  1746.  
  1747. <?php
  1748. } else {
  1749. require 'core/converters/wordpress.php';
  1750. ?>
  1751. <div class="alert alert-success">
  1752. Successfully imported Wordpress data. <strong>Important:</strong> Please redefine any private categories in the Admin panel.<br />
  1753. <center><button class="btn btn-primary" onclick="location.href='./install?step=finish'">Proceed</button></center>
  1754. </div>
  1755. <?php
  1756. }
  1757.  
  1758. /*
  1759. * ---- END, By dwilson390 -----
  1760. */
  1761. } else if(strtolower($_GET["from"]) === "mybb"){
  1762. ?>
  1763. <h4>Converting from MyBB:</h4>
  1764. Coming Soon
  1765. <?php
  1766. } else if(strtolower($_GET["from"]) === "xenforo"){
  1767. if(!Input::exists()){
  1768. ?>
  1769. <h4>Converting from XenForo:</h4>
  1770.  
  1771. <?php
  1772. if(isset($_GET["error"])){
  1773. ?>
  1774. <div class="alert alert-danger">
  1775. Error connecting to the database. Are you sure you entered the correct credentials?
  1776. </div>
  1777. <?php
  1778. }
  1779. ?>
  1780.  
  1781. <form action="?step=convert&convert=yes&from=xenforo" method="post">
  1782. <div class="form-group">
  1783. <label for="InputDBAddress">XenForo Database Address</label>
  1784. <input class="form-control" type="text" id="InputDBAddress" name="db_address" placeholder="Database address">
  1785. </div>
  1786. <div class="form-group">
  1787. <label for="InputDBName">XenForo Database Name</label>
  1788. <input class="form-control" type="text" id="InputDBName" name="db_name" placeholder="Database name">
  1789. </div>
  1790. <div class="form-group">
  1791. <label for="InputDBUsername">XenForo Database Username</label>
  1792. <input class="form-control" type="text" id="InputDBUsername" name="db_username" placeholder="Database username">
  1793. </div>
  1794. <div class="form-group">
  1795. <label for="InputDBPassword">XenForo Database Password</label>
  1796. <input class="form-control" type="password" id="InputDBPassword" name="db_password" placeholder="Database password">
  1797. </div>
  1798. <input type="hidden" name="token" value="<?php echo Token::generate(); ?>">
  1799. <input type="hidden" name="action" value="convert">
  1800. <input class="btn btn-primary" type="submit" value="Convert">
  1801. <a href="#" class="btn btn-danger" onclick="location.href='./install?step=convert&convert=yes'">Cancel</a>
  1802. </form>
  1803.  
  1804. <?php
  1805. } else {
  1806. require 'core/converters/xenforo.php';
  1807. ?>
  1808. <div class="alert alert-success">
  1809. Successfully imported XenForo data. <strong>Important:</strong> Please check your forum and group permissions, and update users' Minecraft usernames and UUID through the AdminCP.<br />
  1810. <center><button class="btn btn-primary" onclick="location.href='./install?step=finish'">Proceed</button></center>
  1811. </div>
  1812. <?php
  1813. }
  1814. }
  1815. ?>
  1816. </div>
  1817. <?php
  1818. } else if(!isset($_GET["convert"]) && !isset($_GET["from"]) && !isset($_GET["action"])){
  1819. ?>
  1820. <h2>Convert</h2>
  1821. <?php
  1822. if(isset($_GET['error']) && $_GET['error'] == 'uuid'){
  1823. ?>
  1824. <div class="alert alert-danger">
  1825. Notice: There was an error querying the Minecraft API to retrieve the admin account's UUID. Please update this manually from the AdminCP's users section.
  1826. </div>
  1827. <?php
  1828. }
  1829. ?>
  1830. <p>Convert from another forum software?</p>
  1831. <div class="btn-group">
  1832. <button class="btn btn-success" onclick="location.href='./install?step=convert&convert=yes'">Yes</button>
  1833. <button class="btn btn-primary" onclick="location.href='./install?step=finish'">No</button>
  1834. </div>
  1835. <?php
  1836. }
  1837. } else if($step === "finish"){
  1838. ?>
  1839. <div class="row page-header">
  1840. <h3>Finish</h3>
  1841. <hr class="small-margin">
  1842. <p>Great! NamelessMC has successfully been installed, you can now configure your site to your liking via the admin panel.</p>
  1843. </div>
  1844. <?php if(isset($_GET['from']) && $_GET['from'] == 'upgrade'){ ?>
  1845. <div class="alert alert-info">
  1846. <p>Please note that tables from your old NamelessMC installation have <strong>not</strong> been deleted. If you'd like to delete the old tables, you can manually delete the tables with your old prefix. The new tables have the prefix <strong>nl1_</strong>.</p>
  1847. </div>
  1848. <?php } ?>
  1849. <p>Thanks for using NamelessMC for your servers website. If you need support you can visit the support forums <a target="_blank" href="https://namelessmc.com">here</a> or you can visit also the offical repository <a target="_blank"href="https://github.com/NamelessMC/Nameless">here</a>.</p>
  1850. <button type="button" onclick="location.href='./admin/?from=install'" class="btn btn-primary">Proceed to the Admin Panel &raquo;</button>
  1851. <?php
  1852. }
  1853. ?>
  1854. <hr>
  1855.  
  1856. <footer>
  1857. <p>&copy; NamelessMC <?php echo date("Y"); ?></p>
  1858. </footer>
  1859. </div> <!-- /container -->
  1860.  
  1861. <?php
  1862. if($step === "start"){
  1863. ?>
  1864.  
  1865. <div class="modal fade" id="bungee_plugins" tabindex="-1" role="dialog" aria-hidden="true">
  1866. <div class="modal-dialog">
  1867. <div class="modal-content">
  1868. <div class="modal-header">
  1869. <h4 class="modal-title">Bungee Plugins</h4>
  1870. </div>
  1871. <div class="modal-body">
  1872. NamelessMC includes support for the following BungeeCord plugins:
  1873. <ul>
  1874. <li><a target="_blank" href="http://www.spigotmc.org/resources/bungee-admin-tools.444/">BungeeAdminTools</a> (for infractions)</li>
  1875. </ul>
  1876. </div>
  1877. <div class="modal-footer">
  1878. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  1879. </div>
  1880. </div>
  1881. </div>
  1882. </div>
  1883.  
  1884. <div class="modal fade" id="mc_plugins" tabindex="-1" role="dialog" aria-hidden="true">
  1885. <div class="modal-dialog">
  1886. <div class="modal-content">
  1887. <div class="modal-header">
  1888. <h4 class="modal-title">Minecraft Plugins</h4>
  1889. </div>
  1890. <div class="modal-body">
  1891. NamelessMC includes support for the following Bukkit/Spigot plugins:
  1892. <ul>
  1893. <li><a target="_blank" href="http://dev.bukkit.org/bukkit-plugins/buycraft/">Buycraft</a></li>
  1894. <li><a target="_blank" href="http://dev.bukkit.org/bukkit-plugins/ban-management/">Ban Management</a></li>
  1895. <li><a target="_blank" href="http://dev.bukkit.org/bukkit-plugins/maxbans/">MaxBans</a></li>
  1896. </ul>
  1897. Coming soon:
  1898. <ul>
  1899. <li><a target="_blank" href="http://www.spigotmc.org/resources/mcmmo.2445/">McMMO</a></li>
  1900. <li><a target="_blank" href="http://dev.bukkit.org/bukkit-plugins/lolmewnstats/">Stats</a></li>
  1901. <li><a target="_blank" href="http://www.spigotmc.org/resources/bukkitgames-hungergames.279/">BukkitGames</a></li>
  1902. </ul>
  1903. </div>
  1904. <div class="modal-footer">
  1905. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  1906. </div>
  1907. </div>
  1908. </div>
  1909. </div>
  1910.  
  1911. <?php
  1912. }
  1913. if($step === "settings"){
  1914. ?>
  1915. <div class="modal fade" id="twitter_id" tabindex="-1" role="dialog" aria-hidden="true">
  1916. <div class="modal-dialog">
  1917. <div class="modal-content">
  1918. <div class="modal-header">
  1919. <h4 class="modal-title">Twitter Feed ID</h4>
  1920. </div>
  1921. <div class="modal-body">
  1922. To find your Twitter feed ID, first head into the <a target="_blank" href="https://twitter.com/settings/widgets">Twitter Widgets tab</a> in your settings. Click the "Create new" button in the top right corner of the panel, set the "Height" to "500", and then click Create Widget.<br /><br />Underneath the Preview, a new textarea will appear with some HTML code. You need to find <code>data-widget-id=</code> and copy the number between the "". <br /><br />This is your Twitter feed ID.
  1923. </div>
  1924. <div class="modal-footer">
  1925. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  1926. </div>
  1927. </div>
  1928. </div>
  1929. </div>
  1930. <?php
  1931. }
  1932. ?>
  1933.  
  1934. <!-- Bootstrap core JavaScript
  1935. ================================================== -->
  1936. <!-- Placed at the end of the document so the pages load faster -->
  1937. <script src="./core/assets/js/jquery.min.js"></script>
  1938. <script src="./core/assets/js/bootstrap.min.js"></script>
  1939. </body>
  1940. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement