Advertisement
tok124

installation

Apr 15th, 2015
260
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $host = $_POST['dbhost'];
  3. $dbuser = $_POST['dbuser'];
  4. $dbpass = $_POST['dbpass'];
  5. $dbname = $_POST['webdb'];
  6. $authdb = $_POST['authdb'];
  7. $chardb = $_POST['chardb'];
  8. $worlddb = $_POST['worlddb'];
  9. $soapUsername = $_POST['soapuser'];
  10. $soapPassword = $_POST['soappass'];
  11. $soapHost = $_POST['soaphost'];
  12. $soapPort = $_POST['soapport'];
  13. $title = $_POST['title'];
  14. $realmlist = $_POST['realmlist'];
  15. $table = "azer_config";
  16. $itemtable = "azer_items";
  17. $logtable = "azer_items_log";
  18. $linktable = "azer_links";
  19. $posttable = "azer_posts";
  20. $slidertable = "azer_slider";
  21.    
  22. $myfile = fopen("../../config/db_conf.php", "w") or die("Unable to open file!");
  23.  
  24. $txt = "<?php\n";
  25. fwrite($myfile, $txt);
  26.  
  27. $txt = "\$host = \"$host\";\n";
  28. fwrite($myfile, $txt);
  29.  
  30. $txt = "\$dbuser = \"$dbuser\";\n";
  31. fwrite($myfile, $txt);
  32.  
  33. $txt = "\$dbpass = \"$dbpass\";\n";
  34. fwrite($myfile, $txt);
  35.  
  36. $txt = "\$dbname = \"$dbname\";\n";
  37. fwrite($myfile, $txt);
  38.  
  39. $txt = "\$authdb = \"$authdb\";\n";
  40. fwrite($myfile, $txt);
  41.  
  42. $txt = "\$chardb = \"$chardb\";\n";
  43. fwrite($myfile, $txt);
  44.  
  45. $txt = "\$worlddb = \"$worlddb\";\n";
  46. fwrite($myfile, $txt);
  47.  
  48. $txt = "\$soapUsername = \"$soapUsername\";\n";
  49. fwrite($myfile, $txt);
  50.  
  51. $txt = "\$soapPassword = \"$soapPassword\";\n";
  52. fwrite($myfile, $txt);
  53.  
  54. $txt = "\$soapHost = \"$soapHost\";\n";
  55. fwrite($myfile, $txt);
  56.  
  57. $txt = "\$title = \"$title\";\n";
  58. fwrite($myfile, $txt);
  59.  
  60. $txt = "\$realmlist = \"$realmlist\";\n";
  61. fwrite($myfile, $txt);
  62.  
  63. $txt = "\$table = \"$table\";";
  64. fwrite($myfile, $txt);
  65.  
  66. fclose($myfile);
  67.  
  68. $conn = new mysqli($host, $dbuser, $dbpass, $dbname);
  69.  
  70. if ($conn->connect_error) {
  71.     die("Connection failed: " . $conn->connect_error);
  72. }
  73.  
  74. $sql = "CREATE TABLE IF NOT EXISTS `$itemtable` (
  75.  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  76.  `item_entry` int(10) unsigned DEFAULT '0',
  77.  `points` int(10) unsigned DEFAULT '0',
  78.  PRIMARY KEY (`id`)
  79. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
  80.  
  81. if ($conn->query($sql) === TRUE) {
  82. } else {
  83.     echo "Error creating table: " . $conn->error;
  84. }
  85.  
  86. $sql2 = "CREATE TABLE IF NOT EXISTS `$logtable` (
  87.  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  88.  `account` varchar(50) NOT NULL,
  89.  `character` varchar(50) NOT NULL,
  90.  `item` int(11) NOT NULL,
  91.  `status` varchar(50) NOT NULL,
  92.  `buy_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  93.  PRIMARY KEY (`id`)
  94. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
  95.  
  96. if ($conn->query($sql2) === TRUE) {
  97. } else {
  98.     echo "Error creating table: " . $conn->error;
  99. }
  100.  
  101. $sql3 = "CREATE TABLE IF NOT EXISTS `$linktable` (
  102.  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  103.  `link` varchar(50) NOT NULL,
  104.  `name` varchar(50) NOT NULL,
  105.  `login_req` smallint(5) unsigned NOT NULL DEFAULT '0',
  106.  `type` smallint(5) unsigned NOT NULL DEFAULT '0',
  107.  PRIMARY KEY (`id`)
  108. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
  109.  
  110. if ($conn->query($sql3) === TRUE) {
  111. } else {
  112.     echo "Error creating table: " . $conn->error;
  113. }
  114.  
  115. $sql4 = "CREATE TABLE IF NOT EXISTS `$posttable` (
  116.  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  117.  `title` varchar(50) NOT NULL DEFAULT '0',
  118.  `content` longtext NOT NULL,
  119.  `author` varchar(50) NOT NULL DEFAULT '0',
  120.  `avatar` varchar(50) NOT NULL DEFAULT '0',
  121.  `rank` varchar(50) NOT NULL DEFAULT '0',
  122.  `post_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  123.  PRIMARY KEY (`id`)
  124. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
  125.  
  126. if ($conn->query($sql4) === TRUE) {
  127. } else {
  128.     echo "Error creating table: " . $conn->error;
  129. }
  130.  
  131. $sql5 = "CREATE TABLE IF NOT EXISTS `$slidertable` (
  132.  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  133.  `href` varchar(50) DEFAULT '0',
  134.  `imgdiv_open` longtext,
  135.  `image` longtext,
  136.  `imgdiv_close` longtext,
  137.  `a_open` longtext,
  138.  `title` longtext,
  139.  `a_close` longtext,
  140.  `contentdiv_open` longtext,
  141.  `content` longtext,
  142.  `contentdiv_close` longtext,
  143.  PRIMARY KEY (`id`)
  144. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
  145.  
  146. if ($conn->query($sql5) === TRUE) {
  147. } else {
  148.     echo "Error creating table: " . $conn->error;
  149. }
  150.  
  151. $sql6 = "INSERT INTO `$slidertable` (`id`, `href`, `imgdiv_open`, `image`, `imgdiv_close`, `a_open`, `title`, `a_close`, `contentdiv_open`, `content`, `contentdiv_close`) VALUES (1, '<a href=\"#\">', '<div class=\"slide\" id=\"slide-0\" style=\"background-image: url(\'images/', 'slide1.jpg', '\'); \"></div></a>', '<a href=\"javascript:;\" id=\"paging-0\" onclick=\"Slideshow.jump(0, this);\" class=\"current\"><div class=\"slide-panel-heading-1\">', 'Lost Army WoW', '</div>', '<div class=\"slide-panel-info-1\">', 'Experienced Staff', '</div></a>');";
  152. if(mysqli_query($conn, $sql6)) {
  153. }else{
  154. }
  155.  
  156. $sql7 = "INSERT INTO `$slidertable` (`id`, `href`, `imgdiv_open`, `image`, `imgdiv_close`, `a_open`, `title`, `a_close`, `contentdiv_open`, `content`, `contentdiv_close`) VALUES (2, '<a href=\"#\">', '<div class=\"slide\" id=\"slide-1\" style=\"background-image: url(\'images/', 'slide2.jpg', '\'); display: none;\"></div></a>', '<a href=\"javascript:;\" id=\"paging-1\" onclick=\"Slideshow.jump(1, this);\"><div class=\"slide-panel-heading\">', 'Level 90 Realm', '</div>', '<div class=\"slide-panel-info\">', 'Instant Level 90', '</div></a>');";
  157. if(mysqli_query($conn, $sql7)) {
  158. }else{
  159. }
  160.  
  161. $sql8 = "INSERT INTO `$slidertable` (`id`, `href`, `imgdiv_open`, `image`, `imgdiv_close`, `a_open`, `title`, `a_close`, `contentdiv_open`, `content`, `contentdiv_close`) VALUES (3, '<a href=\"#\">', '<div class=\"slide\" id=\"slide-2\" style=\"background-image: url(\'images/', 'slide3.jpg', '\'); display: none;\"></div></a>', '<a href=\"javascript:;\" id=\"paging-2\" onclick=\"Slideshow.jump(2, this);\"><div class=\"slide-panel-heading\">', 'Unique 3D Models', '</div>', '<div class=\"slide-panel-info\">', 'Here on Lost Army WoW we have Custom Wing Models', '</div></a>');";
  162. if(mysqli_query($conn, $sql8)) {
  163. }else{
  164. }
  165.  
  166. $sql9 = "INSERT INTO `$slidertable` (`id`, `href`, `imgdiv_open`, `image`, `imgdiv_close`, `a_open`, `title`, `a_close`, `contentdiv_open`, `content`, `contentdiv_close`) VALUES (4, '<a href=\"#\">', '<div class=\"slide\" id=\"slide-3\" style=\"background-image: url(\'images/', 'slide4.jpg', '\'); display: none;\"></div></a>', '<a href=\"javascript:;\" id=\"paging-3\" onclick=\"Slideshow.jump(3, this);\"><div class=\"slide-panel-heading\">', 'Custom Fishing Event', '</div>', '<div class=\"slide-panel-info\">', 'Come ingame and try our fishing event !', '</div></a>');";
  167. if(mysqli_query($conn, $sql9)) {
  168. }else{
  169. }
  170.  
  171. $sql10 = "INSERT INTO `$slidertable` (`id`, `href`, `imgdiv_open`, `image`, `imgdiv_close`, `a_open`, `title`, `a_close`, `contentdiv_open`, `content`, `contentdiv_close`) VALUES (5, '<a href=\"#\">', '<div class=\"slide\" id=\"slide-4\" style=\"background-image: url(\'images/', 'slide1.jpg', '\'); display: none;\"></div></a>', '<a href=\"javascript:;\" id=\"paging-4\" onclick=\"Slideshow.jump(4, this);\" class=\"last-slide\"><div class=\"slide-panel-heading\">', 'High Stats', '</div>', '<div class=\"slide-panel-info\">', 'Items with good stats and good haste', '</div></a>');";
  172. if(mysqli_query($conn, $sql10)) {
  173. }else{
  174. }
  175.  
  176. $sql11 = "INSERT INTO `$linktable` (`id`, `link`, `name`, `login_req`, `type`) VALUES (1, '?p=home', 'Home', 1, 0);";
  177. if(mysqli_query($conn, $sql11)) {
  178. }else{
  179. }
  180.  
  181. $sql12 = "INSERT INTO `$linktable` (`id`, `link`, `name`, `login_req`, `type`) VALUES (2, '?p=register', 'Register', 0, 0);";
  182. if(mysqli_query($conn, $sql12)) {
  183. }else{
  184. }
  185.  
  186. $sql13 = "INSERT INTO `$linktable` (`id`, `link`, `name`, `login_req`, `type`) VALUES (3, '?p=connect', 'Connect', 1, 0);";
  187. if(mysqli_query($conn, $sql13)) {
  188. }else{
  189. }
  190.  
  191. $sql14 = "INSERT INTO `$linktable` (`id`, `link`, `name`, `login_req`, `type`) VALUES (4, '?p=downloads', 'Downloads', 1, 0);";
  192. if(mysqli_query($conn, $sql14)) {
  193. }else{
  194. }
  195.  
  196. $sql15 = "INSERT INTO `$linktable` (`id`, `link`, `name`, `login_req`, `type`) VALUES (5, 'forum', 'Forum', 1, 0);";
  197. if(mysqli_query($conn, $sql15)) {
  198. }else{
  199. }
  200.  
  201. $sql15 = "INSERT INTO `$linktable` (`id`, `link`, `name`, `login_req`, `type`) VALUES (5, 'forum', 'Forum', 1, 0);";
  202. if(mysqli_query($conn, $sql15)) {
  203. }else{
  204. }
  205.  
  206. $sql15 = "INSERT INTO `$posttable` (`id`, `title`, `content`, `author`, `avatar`, `rank`, `post_date`) VALUES (1, 'Welcome to TokDevCMS', 'Hello and Welcome to TokdevCMS. This website was designed by Baked and Coded by Tim Levinsson', 'TokDev', 'ava1.png', 'webdev', '2015-04-16 03:00:25');";
  207. if(mysqli_query($conn, $sql15)) {
  208. }else{
  209. }
  210.  
  211. $sql16 = "ALTER TABLE $authdb.account ADD vp VARCHAR( 255 ) after recruiter;";
  212.  
  213. if ($conn->query($sql16) === TRUE) {
  214. } else {
  215.     echo "Error " . $conn->error;
  216. }
  217.  
  218. $sql17 = "ALTER TABLE $authdb.account CHANGE COLUMN `vp` `vp` VARCHAR(255) NULL DEFAULT '0' AFTER `recruiter`;";
  219.  
  220. if ($conn->query($sql17) === TRUE) {
  221. } else {
  222.     echo "Error " . $conn->error;
  223. }
  224.  
  225. $sql16 = "ALTER TABLE $authdb.account ADD dp VARCHAR( 255 ) after vp;";
  226.  
  227. if ($conn->query($sql16) === TRUE) {
  228. } else {
  229.     echo "Error " . $conn->error;
  230. }
  231.  
  232. $sql17 = "ALTER TABLE $authdb.account CHANGE COLUMN `dp` `dp` VARCHAR(255) NULL DEFAULT '0' AFTER `vp`;";
  233.  
  234. if ($conn->query($sql17) === TRUE) {
  235. } else {
  236.     echo "Error " . $conn->error;
  237. }
  238.  
  239. header('location: ../?p=finished');
  240. ?>
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement