>/", $dbsettings["prefix"]."_$1", $query)); if ($sqlquery == false) { die(mysql_error() . "

" . $query); } return $sqlquery; } function dorow($sqlquery, $force = "") { // Abstraction layer part deux. switch (mysql_num_rows($sqlquery)) { case 0: $row = false; break; case 1: if ($force == "") { $row = mysql_fetch_assoc($sqlquery); } else { $temprow = mysql_fetch_assoc($sqlquery); $row[$temprow[$force]] = $temprow; } break; default: if ($force == "") { while ($temprow = mysql_fetch_assoc($sqlquery)) { $row[] = $temprow; } } else { while ($temprow = mysql_fetch_assoc($sqlquery)) { $row[$temprow[$force]] = $temprow; } } break; } return $row; } // Thanks to Predrag Supurovic from php.net for this function! function dobatch($p_query) { $query_split = preg_split ("/[;]+/", $p_query); foreach ($query_split as $command_line) { $command_line = trim($command_line); if ($command_line != '') { $query_result = doquery($command_line); if ($query_result == 0) { break; } } } return $query_result; } /***** DONE WITH ALL THE SETUP STUFF, SO ACTUALLY START INSTALLING. *****/ function one() { // Test file permissions. $botcheck = false; $f = fopen("images/botcheck/test.txt", "a"); if ($f) { if (fwrite($f,"test")) { $botcheck = true; fclose($f); unlink("images/botcheck/test.txt"); } } $users = false; $f = fopen("images/users/test.txt", "a"); if ($f) { if (fwrite($f,"test")) { $users = true; fclose($f); unlink("images/users/test.txt"); } } // Display status. if ($botcheck) { $botcheck = "Pass"; } else { $botcheck = "Fail"; } if ($users) { $users = "Pass"; } else { $users = "Fail"; } if (MYSQLRESULT) { $mysqlresult = "Pass"; } else { $mysqlresult = "Fail"; } if (DBRESULT) { $dbresult = "Pass"; } else { $dbresult = "Fail"; } // Done. Show page. $page = << Dragon Scourge :: Installation (Step 1)

Dragon Scourge :: Installation (Step 1)

  1. Verify Settings
  2. Install Database
  3. Primary Game Settings
  4. Create Admin User
Verify Settings
MySQL Connection$mysqlresult
MySQL Database$dbresult
File Permissions: /images/users/$users
File Permissions: /images/botcheck/$botcheck


If any of the above settings display Fail, please go back and make sure everything is correct.

For failures on either MySQL Connection or MySQL Database, please ensure that you have inserted the correct values for your server configuration into config.php, and make sure that the database to which you will be installing Dragon Scourge already exists on your server.

For failures on either of the two File Permissions settings, make sure that the appropriate folders have been CHMODed to 0777 (on Unix/Linux servers), or are not set to read-only (on Windows servers). If you need help with this, click here for tutorials on how to do this in several major FTP clients.

Once you have checked all the appropriate settings, reload this page and make sure that all four tests indicate Pass before continuing.

Once all tests pass, click the link below to continue to step two.

Continue to Step Two: Install Database
Installing the database may take several seconds. Please click the link only once.
THEVERYENDOFYOU; die($page); } function two() { $installsql = file_get_contents("install.sql"); $status = dobatch($installsql); $page = << Dragon Scourge :: Installation (Step 2)

Dragon Scourge :: Installation (Step 2)

  1. Verify Settings
  2. Install Database
  3. Primary Game Settings
  4. Create Admin User
The database installation is now complete. Click the link below to set up your initial game settings.

Continue to Step Three: Primary Game Settings
THEVERYENDOFYOU; die($page); } function three() { // Path stuff. Easy. $gamepath = str_replace("install.php","",__FILE__); $gamepath = str_replace("\\","/",$gamepath); $avatarpath = $gamepath . "images/users/"; $gameurl = "http://" . $_SERVER["SERVER_NAME"] . $_SERVER["PHP_SELF"]; $gameurl = str_replace("install.php","",$gameurl); $avatarurl = $gameurl . "images/users/"; $page = << Dragon Scourge :: Installation (Step 3)

Dragon Scourge :: Installation (Step 3)

  1. Verify Settings
  2. Install Database
  3. Primary Game Settings
  4. Create Admin User
Game Name
The name of your game. Used in page titles and when sending email to new users.

Game Path
The full server path to your game. If you don't know this, please ask your host for assistance.

Game URL
The full URL to your game.

Forum URL
If you have a support forum for your game, enter its URL here - otherwise leave blank to disable this link.

Avatar Path
The full server path to your avatar uploads folder.

Avatar URL
The full URL to your avatar uploads folder.

Avatar Max Filesize
Enter the maximum file size (in bytes) for uploaded avatars.
Range: 0 to 4294967295.


Show Babblebox? Yes
Enables the Babblebox iframe in the right panel.

Show Who's Online? Yes
Enables the Who's Online listing in the right panel.

Show SigBot URL? Yes
The SigBot allows users to display their character stats in forum signature images. This setting only controls whether SigBot URLs are displayed on the Characters page. To disable SigBot completely, remove the file .htaccess from your game installation folder.

Admin's Email
This is the game owner's email address, used when sending email to new users.

Enable Email Functions? Yes
Sends a verification letter to anyone who registers an account, to enforce valid email addresses. Also allows users to request new passwords if they lose/forget theirs.
NOTE: Some Windows servers may have issues if their php.ini settings are improperly configured. If you're on a Windows host and get a lot of email sending errors, disable this setting or contact your host for more information.


Enable ZLib Compression? Yes
Enables ZLib output compression, which reduces bandwidth and speeds up page access time for end-users.

Enable Debug Info? Yes
Displays extra information (query count & page generation time) in the footer, and displays full MySQL query errors if they occur.

Bot Check
Bot Check ensures that players are human by displaying a CAPTCHA challenge form every so often (random 1 in n chance) during exploring. Higher numbers show the Bot Check less often, but may not be as secure. Lower numbers will show the bot check more often, but may annoy some users. Enter 0 to disable the bot check completely.
Range: 0 to 4294967295.
Recommended: 255.


PVP Refresh Time
The amount of time (in seconds) the mini PVP frame should wait before refreshing itself to check for new data. Low numbers may cause strain on your server if you have a lot of concurrent users.
Range: 0 to 4294967295.


PVP Timeout Limit
The amount of time (in seconds) it takes for someone to remain inactive and cause the PVP battle to close.
Range: 0 to 4294967295.


Guild Startup Cost
The amount of gold it takes for a player to start their own Guild.
Range: 0 to 4294967295.


Guild Start Level
The minimum level a player must reach before being allowed to start a Guild.
Range: 0 to 4294967295.


Guild Join Level
The minimum level a player must reach before being allowed to join a Guild.
Range: 0 to 4294967295.


Guild Update Time
The amount of time (in hours) before automatically recalculating Guild Honor Points.
Range: 0 to 4294967295.



THEVERYENDOFYOU; die($page); } function four() { // Check for errors. $requires = array("gamename","gamepath","gameurl","avatarpath","avatarurl","avatarmaxsize","adminemail","botcheck","pvprefresh","pvptimeout","guildstartup","guildstartlvl","guildjoinlvl","guildupdate"); $numerics = array("avatarmaxsize","botcheck","pvprefresh","pvptimeout","guildstartup","guildstartlvl","guildjoinlvl","guildupdate"); $toggles = array("showshout","showonline","showsigbot","verifyemail","compression","debug"); $errors = ""; foreach($requires as $a => $b) { if (!isset($_POST[$b]) || trim($_POST[$b])=="") { $errors .= "$b field is required.
"; } } foreach($numerics as $a => $b) { if (!is_numeric($_POST[$b])) { $errors .= "$b field must contain numbers only.
"; } } if ($errors != "") { die("The following errors occurred. Please go back and correct these errors before continuing.

$errors"); } // Check toggles. foreach($toggles as $a => $b) { if (!isset($_POST[$b])) { $_POST[$b] = "0"; } } // No errors, so set up the table. extract($_POST); doquery("INSERT INTO <> SET id='1', gamename='$gamename', gameopen='1', gamepath='$gamepath', gameurl='$gameurl', forumurl='$forumurl', avatarpath='$avatarpath', avatarurl='$avatarurl', avatarmaxsize='$avatarmaxsize', cookiename='scourge', cookiedomain='', showshout='$showshout', showonline='$showonline', showitemimages='1', showmonsterimages='0', showsigbot='$showsigbot', adminemail='$adminemail', verifyemail='$verifyemail', compression='$compression', debug='$debug', botcheck='$botcheck', moddedby='', pvprefresh='$pvprefresh', pvptimeout='$pvptimeout', guildstartup='$guildstartup', guildstartlvl='$guildstartlvl', guildjoinlvl='$guildjoinlvl', guildupdate='$guildupdate' "); // Done with the controlrow creator. Now show admin user creation form.' $page = << Dragon Scourge :: Installation (Step 4)

Dragon Scourge :: Installation (Step 4)

  1. Verify Settings
  2. Install Database
  3. Primary Game Settings
  4. Create Admin User
Username

Password

Email Address

THEVERYENDOFYOU; die($page); } function five() { // Check for errors. $requires = array("username","password","emailaddress"); $errors = ""; foreach($requires as $a => $b) { if (!isset($_POST[$b]) || trim($_POST[$b])=="") { $errors .= "$b field is required.
"; } } if ($errors != "") { die("The following errors occurred. Please go back and correct these errors before continuing.

$errors"); } // No errors, so set up the table. extract($_POST); $password = md5($password); doquery("INSERT INTO <> SET id='1', username='$username', password='$password', emailaddress='$emailaddress', verifycode='1', regdate=NOW(), regip='".$_SERVER["REMOTE_ADDR"]."', authlevel='255', language='English', characters='0', activechar='0', imageformat='.png', minimap='1' "); // Done with the controlrow creator. Now show admin user creation form.' $page = << Dragon Scourge :: Installation Complete

Dragon Scourge :: Installation Complete

Dragon Scourge Installation has now completed. Congratulations.

For security reasons, please delete install.php and install.sql from your game directory at this time!

Click here to log into your game for the first time. Once you log in, you will be asked to create your first Character.
THEVERYENDOFYOU; die($page); } ?>