PageRenderTime 85ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 1ms

/install.php

https://github.com/danboy/Croissierd
PHP | 4187 lines | 3291 code | 626 blank | 270 comment | 128 complexity | 36c35573c12d69144550e3ae783023ff MD5 | raw file
  1. <?php
  2. /*
  3. =====================================================
  4. ExpressionEngine - by EllisLab
  5. -----------------------------------------------------
  6. http://expressionengine.com/
  7. -----------------------------------------------------
  8. Copyright (c) 2003 - 2010 EllisLab, Inc.
  9. =====================================================
  10. THIS IS COPYRIGHTED SOFTWARE
  11. PLEASE READ THE LICENSE AGREEMENT
  12. http://expressionengine.com/docs/license.html
  13. =====================================================
  14. File: install.php
  15. -----------------------------------------------------
  16. Purpose: Installation file
  17. =====================================================
  18. */
  19. error_reporting(E_ALL);
  20. @set_magic_quotes_runtime(0);
  21. if (isset($_GET) AND count($_GET) > 0)
  22. {
  23. if ( ! isset($_GET['page']) OR ! is_numeric($_GET['page']) OR count($_GET) > 1)
  24. {
  25. exit("Disallowed GET request");
  26. }
  27. }
  28. $data = array(
  29. 'app_full_version' => 'Version 1.6.8',
  30. 'app_version' => '168',
  31. 'doc_url' => 'http://expressionengine.com/docs/',
  32. 'ext' => '.php',
  33. 'ip' => '',
  34. 'database' => 'mysql',
  35. 'db_conntype' => '0',
  36. 'system_dir' => 'system',
  37. 'db_hostname' => 'localhost',
  38. 'db_username' => '',
  39. 'db_password' => '',
  40. 'db_name' => '',
  41. 'db_prefix' => 'exp',
  42. 'encryption_type' => 'sha1',
  43. 'site_name' => '',
  44. 'site_url' => '',
  45. 'site_index' => '',
  46. 'cp_url' => '',
  47. 'cp_index' => 'index.php',
  48. 'username' => '',
  49. 'password' => '',
  50. 'screen_name' => '',
  51. 'email' => '',
  52. 'webmaster_email' => '',
  53. 'deft_lang' => 'english',
  54. 'template' => '01',
  55. 'server_timezone' => 'UTC',
  56. 'daylight_savings' => '',
  57. 'redirect_method' => 'redirect',
  58. 'upload_folder' => 'uploads/',
  59. 'image_path' => '../images/',
  60. 'cp_images' => 'cp_images/',
  61. 'avatar_path' => '../images/avatars/',
  62. 'avatar_url' => 'images/avatars/',
  63. 'photo_path' => '../images/member_photos/',
  64. 'photo_url' => 'images/member_photos/',
  65. 'signature_img_path' => '../images/signature_attachments/',
  66. 'signature_img_url' => 'images/signature_attachments/',
  67. 'pm_path' => '../images/pm_attachments',
  68. 'captcha_path' => '../images/captchas/',
  69. 'theme_folder_path' => '../themes/',
  70. );
  71. foreach ($_POST as $key => $val)
  72. {
  73. if ( ! get_magic_quotes_gpc())
  74. $val = addslashes($val);
  75. if (isset($data[$key]))
  76. {
  77. $data[$key] = trim($val);
  78. }
  79. }
  80. $data['site_url'] = rtrim($data['site_url'], '/').'/';
  81. $data['system_dir'] = str_replace("/", "", $data['system_dir']);
  82. define('EXT', $data['ext']);
  83. $page = (! isset($_GET['page']) || $_GET['page'] > 7) ? 1 : $_GET['page'];
  84. if (phpversion() < '4.1.0')
  85. {
  86. $page = 0;
  87. }
  88. // HTML HEADER
  89. page_head();
  90. // Unsupported version of PHP
  91. // --------------------------------------------------------------------
  92. // --------------------------------------------------------------------
  93. if ($page == 0)
  94. {
  95. ?>
  96. <div id='innercontent'>
  97. <div class="error">Error:&nbsp;&nbsp;Unsupported PHP version</div>
  98. <p><b>In order to install ExpressionEngine, your server must be running PHP version 4.1 or newer.</b></p>
  99. <p><br />Your server is currently running PHP version: <?php echo phpversion(); ?></p>
  100. <p><br />If you would like to switch to a host that provides more current software,
  101. please consider <a href="http://www.enginehosting.com/">EngineHosting</a></p>
  102. </div>
  103. <?php
  104. }
  105. // PAGE ONE
  106. // --------------------------------------------------------------------
  107. // --------------------------------------------------------------------
  108. if ($page == 1)
  109. {
  110. ?>
  111. <div id='innercontent'>
  112. <h1>ExpressionEngine Installation Wizard</h1>
  113. <div class="botBorder">
  114. <div class="pad">
  115. <p><b>Do you need assistance?</b>&nbsp; If you have questions or problems please visit our <a href="http://expressionengine.com/support/">Support Resources</a> page</p>
  116. </div>
  117. </div>
  118. <div class="botBorder">
  119. <p><br /><span class='red'><b>Important:&nbsp;</b> Use this installation wizard <b>ONLY</b> if you are installing ExpressionEngine for the first time.&nbsp;
  120. Do <b>NOT</b> run this installation routine if you are already using ExpressionEngine and are updating to a newer version.&nbsp; You'll find
  121. update instructions in the user guide.</span><br />&nbsp;</p>
  122. </div>
  123. <div class="botBorder">
  124. <h4>Installation Instructions</h4>
  125. <p>Before proceeding please take a moment to read the
  126. <a href="http://expressionengine.com/docs/#install_docs" target="_blank">installation instructions</a> if you have not done so already.</p>
  127. <br />
  128. </div>
  129. <form method="post" action="install.php?page=2">
  130. <p class="center"><br />Are you ready to install ExpressionEngine?</p>
  131. <p class="center"><input type="submit" class="submit" value=" Click here to begin! " /></p>
  132. </form>
  133. </div>
  134. <?php
  135. }
  136. // PAGE TWO
  137. // --------------------------------------------------------------------
  138. // --------------------------------------------------------------------
  139. elseif ($page == 2)
  140. {
  141. license_agreement();
  142. }
  143. // PAGE THREE
  144. // --------------------------------------------------------------------
  145. // --------------------------------------------------------------------
  146. elseif ($page == 3)
  147. {
  148. if ( ! isset($_POST['agree']) OR $_POST['agree'] == 'no')
  149. {
  150. license_agreement();
  151. }
  152. else
  153. {
  154. system_folder_form();
  155. }
  156. }
  157. // PAGE FOUR
  158. // --------------------------------------------------------------------
  159. // --------------------------------------------------------------------
  160. elseif ($page == 4)
  161. {
  162. // Does the 'system' directory exist?
  163. // --------------------------------------------------------------------
  164. if ($data['system_dir'] == '' OR ! is_dir('./'.$data['system_dir']))
  165. {
  166. ?><div class='error'>Error: Unable to locate the directory you submitted.</div><?php
  167. system_folder_form();
  168. page_footer();
  169. exit;
  170. }
  171. // Are the various files and directories writable?
  172. // --------------------------------------------------------------------
  173. $system_path = './'.trim($data['system_dir']).'/';
  174. $writable_things = array(
  175. 'path.php',
  176. $system_path.'config.php',
  177. $system_path.'cache/'
  178. );
  179. $not_writable = array();
  180. foreach ($writable_things as $val)
  181. {
  182. if ( ! @is_writable($val))
  183. {
  184. $not_writable[] = $val;
  185. }
  186. }
  187. if ( ! @is_writable("./images/uploads"))
  188. {
  189. $not_writable[] = "images/uploads";
  190. }
  191. if ( ! @is_writable("./images/captchas"))
  192. {
  193. $not_writable[] = "images/captchas";
  194. }
  195. $i = count($not_writable);
  196. if ($i > 0)
  197. {
  198. echo "<div id='innercontent'>";
  199. $d = ($i > 1) ? 'Directories or Files' : 'Directory or File';
  200. echo "<div class='error'>Error: Incorrect Permissions for ".$d."</div>";
  201. $d = ($i > 1) ? 'directories or files' : 'directory or file';
  202. echo "<p>The following $d cannot be written to:</p>";
  203. foreach ($not_writable as $bad)
  204. {
  205. echo '<p>&nbsp;&nbsp;&nbsp;&nbsp;<strong>'.$bad.'</strong></p>';
  206. }
  207. $item = ($i > 1) ? 'items' : 'item';
  208. ?>
  209. <p>In order to run this installation, the file permissions on the above <?php echo $item; ?> must be set as indicated in the instructions.</p>
  210. <p>If you are not sure how to set permissions, <a href='http://expressionengine.com/knowledge_base/article/how_do_you_set_permissions_on_files_and_directories/' target='_blank'>click here</a>.</p>
  211. <p><b>Once you are done, please <a href='javascript:history.go(-1)'>run</a> this installation script again.</b></p>
  212. </div>
  213. <?php
  214. page_footer();
  215. exit;
  216. }
  217. if ( ! @file_exists($system_path.'config'.$data['ext']))
  218. {
  219. echo "<div class='error'><br />Error: Unable to locate your config.php file. Please make sure you have uploaded all components of this software.</div><br />";
  220. page_footer();
  221. exit;
  222. }
  223. else
  224. {
  225. require($system_path.'config'.$data['ext']);
  226. }
  227. if (isset($conf['install_lock']) AND $conf['install_lock'] == 1)
  228. {
  229. ?>
  230. <div id='innercontent'>
  231. <div class="error">Warning: Your installation lock is set</div>
  232. <p>There already appears to be an installed instance of ExpressionEngine</p>
  233. <p>If you absolutely want to install this program you must locate the file called <b>config.php</b> and delete its contents.</b>
  234. <p>Once you've done this, <a href="install.php?page=3">click here</a> to continue</p>
  235. </div>
  236. <?php
  237. }
  238. else
  239. {
  240. settings_form();
  241. }
  242. }
  243. // PAGE FIVE
  244. // --------------------------------------------------------------------
  245. // --------------------------------------------------------------------
  246. elseif ($page == 5)
  247. {
  248. if ($data['db_hostname'] == '' AND $data['db_username'] == '' AND $data['db_name'] == '')
  249. {
  250. echo "<p>An errror occured. <a href='install.php'>Click here</a> to return to the main page</a>";
  251. page_footer();
  252. exit;
  253. }
  254. $errors = array();
  255. $system_path = './'.trim($data['system_dir']).'/';
  256. if ( ! @file_exists($system_path.'config'.$data['ext']))
  257. {
  258. $errors[] = "Unable to locate the file called \"config.php\". Please make sure you have uploaded all components of this software.";
  259. }
  260. else
  261. {
  262. require($system_path.'config'.$data['ext']);
  263. }
  264. if (isset($conf['install_lock']) AND $conf['install_lock'] == 1)
  265. {
  266. $errors[] = "Your installation lock is set. Locate the file called <b>config.php</b> and delete its contents";
  267. }
  268. if (
  269. $data['db_hostname'] == '' ||
  270. $data['db_username'] == '' ||
  271. $data['db_name'] == '' ||
  272. $data['site_name'] == '' ||
  273. $data['username'] == '' ||
  274. $data['password'] == '' ||
  275. $data['email'] == ''
  276. )
  277. {
  278. $errors[] = "You left some form fields empty";
  279. }
  280. if (strlen($data['username']) < 4)
  281. {
  282. $errors[] = "Your username must be at least 4 characters in length";
  283. }
  284. if (strlen($data['password']) < 5)
  285. {
  286. $errors[] = "Your password must be at least 5 characters in length";
  287. }
  288. // Is password the same as username?
  289. $lc_user = strtolower($data['username']);
  290. $lc_pass = strtolower($data['password']);
  291. $nm_pass = strtr($lc_pass, 'elos', '3105');
  292. if ($lc_user == $lc_pass || $lc_user == strrev($lc_pass) || $lc_user == $nm_pass || $lc_user == strrev($nm_pass))
  293. {
  294. $errors[] = "Your password can not be based on the username";
  295. }
  296. if (strpos($data['db_password'], '$') !== FALSE)
  297. {
  298. $errors[] = "Your MySQL password can not contain a dollar sign (\$)";
  299. }
  300. if ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $data['email']))
  301. {
  302. $errors[] = "The email address you submitted is not valid";
  303. }
  304. if ($data['screen_name'] == '')
  305. {
  306. $data['screen_name'] = $data['username'];
  307. }
  308. // CONNECT TO DATABASE
  309. // --------------------------------------------------------------------
  310. $db_prefix = ($data['db_prefix'] == '') ? 'exp' : $data['db_prefix'];
  311. if ( ! @file_exists($system_path.'db/db.'.$data['database'].$data['ext']))
  312. {
  313. $errors[] = "Unable to locate the database file. Please make sure you have uploaded all components of this software.";
  314. }
  315. else
  316. {
  317. require($system_path.'db/db.'.$data['database'].$data['ext']);
  318. $db_config = array(
  319. 'hostname' => $data['db_hostname'],
  320. 'username' => $data['db_username'],
  321. 'password' => $data['db_password'],
  322. 'database' => $data['db_name'],
  323. 'conntype' => $data['db_conntype'],
  324. 'prefix' => $db_prefix,
  325. 'enable_cache' => FALSE
  326. );
  327. $DB = new DB($db_config);
  328. if ( ! $DB->db_connect(0))
  329. {
  330. $errors[] = "Unable to connect to your database server. ";
  331. if ($data['db_conntype'] == 1)
  332. {
  333. $errors[] = "Try switching to a non-persistent connection since some servers do not support persistent connections.";
  334. }
  335. }
  336. if ( ! $DB->select_db())
  337. {
  338. $errors[] = "Unable to select the database";
  339. }
  340. // Check for "strict mode", some queries used are incompatible
  341. if ($DB->conn_id !== FALSE && version_compare(mysql_get_server_info(), '4.1-alpha', '>=') !== FALSE)
  342. {
  343. $mode_query = $DB->query("SELECT CONCAT(@@global.sql_mode, @@session.sql_mode) AS sql_mode");
  344. if (strpos(strtoupper($mode_query->row['sql_mode']), 'STRICT') !== FALSE)
  345. {
  346. $errors[] = "ExpressionEngine will not run on a MySQL server operating in strict mode";
  347. }
  348. }
  349. }
  350. if ( ! file_exists($system_path.'language/'.$data['deft_lang'].'/email_data'.$data['ext']))
  351. {
  352. $errors[] = "Unable to locate the file containing your email templates. Make sure you have uploaded all components of this software.";
  353. }
  354. else
  355. {
  356. require($system_path.'language/'.$data['deft_lang'].'/email_data'.$data['ext']);
  357. }
  358. // DISPLAY ERRORS
  359. // --------------------------------------------------------------------
  360. if (count($errors) > 0)
  361. {
  362. $er = "<div class='error'>ERROR: The following Errors were encountered</div>";
  363. $er .= "<ol>";
  364. foreach ($errors as $doh)
  365. {
  366. $er .= "<li>".$doh."</li>";
  367. }
  368. $er .= "</ol>";
  369. $er .= "<div class='border'><p><b>Please correct the errors and resubmit the form</b><br /><br /></p></div>";
  370. settings_form($er);
  371. page_footer();
  372. exit;
  373. }
  374. // Existing Install?
  375. // --------------------------------------------------------------------
  376. // is the user trying to install to an existing installation?
  377. // This can happen if someone mistakenly copies over their config.php
  378. // during an update, and then trying to run the installer...
  379. $query = $DB->query("SHOW tables LIKE '".$DB->escape_str($db_prefix)."%'");
  380. if ($query->num_rows > 0 && ! isset($_POST['install_override']))
  381. {
  382. $fields = '';
  383. foreach($_POST as $key => $value)
  384. {
  385. if (get_magic_quotes_gpc())
  386. {
  387. $value = stripslashes($value);
  388. }
  389. $fields .= '<input type="hidden" name="'.str_replace("'", "&#39;", htmlspecialchars($key)).'" value="'.str_replace("'", "&#39;", htmlspecialchars($value)).'" />'."\n";
  390. }
  391. $er = '<div id="innercontent">
  392. <div class="error">Existing Installation Detected, Empty config.php File</div>
  393. <p>ExpressionEngine appears to be installed to your database, but your configuration file is empty.
  394. Continuing with this installation will destroy any information currently in your database.
  395. Are you sure you wish to perform a new installation?</p>
  396. <form action="install.php?page=5" method="post">
  397. '.$fields.'
  398. <input type="hidden" name="install_override" value="y" />
  399. <p><input type="submit" value="Continue Installation"></p>
  400. </form>
  401. <form action="install.php?page=6" method="post">
  402. '.$fields.'
  403. <input type="hidden" name="rebuild_config" value="y" />
  404. <p><input type="submit" value="Do NOT Install, Fix Configuration"></p>
  405. </form>
  406. </div>
  407. ';
  408. echo $er;
  409. page_footer();
  410. exit;
  411. }
  412. // Prep user submitted data for DB insertion
  413. // --------------------------------------------------------------------
  414. // --------------------------------------------------------------------
  415. /** -------------------------------------
  416. /** Get user's IP address
  417. /** -------------------------------------*/
  418. $CIP = ( ! isset($_SERVER['HTTP_CLIENT_IP'])) ? FALSE : $_SERVER['HTTP_CLIENT_IP'];
  419. $FOR = ( ! isset($_SERVER['HTTP_X_FORWARDED_FOR'])) ? FALSE : $_SERVER['HTTP_X_FORWARDED_FOR'];
  420. $RMT = ( ! isset($_SERVER['REMOTE_ADDR'])) ? FALSE : $_SERVER['REMOTE_ADDR'];
  421. if ($CIP)
  422. {
  423. $cip = explode('.', $CIP);
  424. $data['ip'] = ($cip['0'] != current(explode('.', $RMT))) ? implode('.', array_reverse($cip)) : $CIP;
  425. }
  426. elseif ($FOR)
  427. {
  428. $data['ip'] = (strstr($FOR, ',')) ? end(explode(',', $FOR)) : $FOR;
  429. }
  430. else
  431. $data['ip'] = $RMT;
  432. /** -------------------------------------
  433. /** Encrypt password and Unique ID
  434. /** -------------------------------------*/
  435. if (phpversion() >= 4.2)
  436. mt_srand();
  437. else
  438. mt_srand(hexdec(substr(md5(microtime()), -8)) & 0x7fffffff);
  439. $unique_id = uniqid(mt_rand());
  440. $password = stripslashes($data['password']);
  441. if ($data['encryption_type'] == 'sha1')
  442. {
  443. if ( ! function_exists('sha1'))
  444. {
  445. if ( ! function_exists('mhash'))
  446. {
  447. require './'.$data['system_dir'].'/core/core.sha1'.$data['ext'];
  448. $SH = new SHA;
  449. $unique_id = $SH->encode_hash($unique_id);
  450. $password = $SH->encode_hash($password);
  451. }
  452. else
  453. {
  454. $unique_id = bin2hex(mhash(MHASH_SHA1, $unique_id));
  455. $password = bin2hex(mhash(MHASH_SHA1, $password));
  456. }
  457. }
  458. else
  459. {
  460. $unique_id = sha1($unique_id);
  461. $password = sha1($password);
  462. }
  463. }
  464. else
  465. {
  466. $unique_id = md5($unique_id);
  467. $password = md5($password);
  468. }
  469. /** -------------------------------------
  470. /** Fetch current time as GMT
  471. /** -------------------------------------*/
  472. $time = time();
  473. $now = mktime(gmdate("H", $time), gmdate("i", $time), gmdate("s", $time), gmdate("m", $time), gmdate("d", $time), gmdate("Y", $time));
  474. $year = gmdate('Y', $now);
  475. $month = gmdate('m', $now);
  476. $day = gmdate('d', $now);
  477. // DEFINE DB TABLES
  478. // --------------------------------------------------------------------
  479. // --------------------------------------------------------------------
  480. // Sites
  481. $D[] = "exp_sites";
  482. $Q[] = "CREATE TABLE `exp_sites` (
  483. `site_id` int(5) unsigned NOT NULL auto_increment,
  484. `site_label` varchar(100) NOT NULL default '',
  485. `site_name` varchar(50) NOT NULL default '',
  486. `site_description` text NOT NULL,
  487. `site_system_preferences` TEXT NOT NULL ,
  488. `site_mailinglist_preferences` TEXT NOT NULL ,
  489. `site_member_preferences` TEXT NOT NULL ,
  490. `site_template_preferences` TEXT NOT NULL ,
  491. `site_weblog_preferences` TEXT NOT NULL ,
  492. PRIMARY KEY (`site_id`),
  493. KEY `site_name` (`site_name`))";
  494. // Session data
  495. $D[] = 'exp_sessions';
  496. $Q[] = "CREATE TABLE exp_sessions (
  497. session_id varchar(40) default '0' NOT NULL,
  498. site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
  499. member_id int(10) default '0' NOT NULL,
  500. admin_sess tinyint(1) default '0' NOT NULL,
  501. ip_address varchar(16) default '0' NOT NULL,
  502. user_agent varchar(50) NOT NULL,
  503. last_activity int(10) unsigned DEFAULT '0' NOT NULL,
  504. PRIMARY KEY (session_id),
  505. KEY (`member_id`),
  506. KEY (`site_id`)
  507. )";
  508. // Throttle
  509. $D[] = 'exp_throttle';
  510. $Q[] = "CREATE TABLE exp_throttle (
  511. ip_address varchar(16) default '0' NOT NULL,
  512. last_activity int(10) unsigned DEFAULT '0' NOT NULL,
  513. hits int(10) unsigned NOT NULL,
  514. locked_out char(1) NOT NULL default 'n',
  515. KEY (ip_address),
  516. KEY (last_activity)
  517. )";
  518. // System stats
  519. $D[] = 'exp_stats';
  520. $Q[] = "CREATE TABLE exp_stats (
  521. weblog_id int(6) unsigned NOT NULL default '0',
  522. site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
  523. total_members mediumint(7) NOT NULL default '0',
  524. recent_member_id int(10) default '0' NOT NULL,
  525. recent_member varchar(50) NOT NULL,
  526. total_entries mediumint(8) default '0' NOT NULL,
  527. total_forum_topics mediumint(8) default '0' NOT NULL,
  528. total_forum_posts mediumint(8) default '0' NOT NULL,
  529. total_comments mediumint(8) default '0' NOT NULL,
  530. total_trackbacks mediumint(8) default '0' NOT NULL,
  531. last_entry_date int(10) unsigned default '0' NOT NULL,
  532. last_forum_post_date int(10) unsigned default '0' NOT NULL,
  533. last_comment_date int(10) unsigned default '0' NOT NULL,
  534. last_trackback_date int(10) unsigned default '0' NOT NULL,
  535. last_visitor_date int(10) unsigned default '0' NOT NULL,
  536. most_visitors mediumint(7) NOT NULL default '0',
  537. most_visitor_date int(10) unsigned default '0' NOT NULL,
  538. last_cache_clear int(10) unsigned default '0' NOT NULL,
  539. KEY (weblog_id),
  540. KEY (site_id)
  541. )";
  542. // Online users
  543. $D[] = 'exp_online_users';
  544. $Q[] = "CREATE TABLE exp_online_users (
  545. weblog_id int(6) unsigned NOT NULL default '0',
  546. site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
  547. member_id int(10) default '0' NOT NULL,
  548. in_forum char(1) NOT NULL default 'n',
  549. name varchar(50) default '0' NOT NULL,
  550. ip_address varchar(16) default '0' NOT NULL,
  551. date int(10) unsigned default '0' NOT NULL,
  552. anon char(1) NOT NULL,
  553. KEY (date),
  554. KEY (site_id)
  555. )";
  556. // Actions table
  557. // Actions are events that require processing. Used by modules class.
  558. $D[] = 'exp_actions';
  559. $Q[] = "CREATE TABLE exp_actions (
  560. action_id int(4) unsigned NOT NULL auto_increment,
  561. class varchar(50) NOT NULL,
  562. method varchar(50) NOT NULL,
  563. PRIMARY KEY (action_id)
  564. )";
  565. // Modules table
  566. // Contains a list of all installed modules
  567. $D[] = 'exp_modules';
  568. $Q[] = "CREATE TABLE exp_modules (
  569. module_id int(4) unsigned NOT NULL auto_increment,
  570. module_name varchar(50) NOT NULL,
  571. module_version varchar(12) NOT NULL,
  572. has_cp_backend char(1) NOT NULL default 'n',
  573. PRIMARY KEY (module_id)
  574. )";
  575. // Referrer tracking table
  576. $D[] = 'exp_referrers';
  577. $Q[] = "CREATE TABLE exp_referrers (
  578. ref_id int(10) unsigned NOT NULL auto_increment,
  579. site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
  580. ref_from varchar(120) NOT NULL,
  581. ref_to varchar(120) NOT NULL,
  582. ref_ip varchar(16) default '0' NOT NULL,
  583. ref_date int(10) unsigned default '0' NOT NULL,
  584. ref_agent varchar(100) NOT NULL,
  585. user_blog varchar(40) NOT NULL,
  586. PRIMARY KEY (ref_id),
  587. KEY (site_id)
  588. )";
  589. // Security Hashes
  590. // Used to store hashes needed to process forms in 'secure mode'
  591. $D[] = 'exp_security_hashes';
  592. $Q[] = "CREATE TABLE exp_security_hashes (
  593. date int(10) unsigned NOT NULL,
  594. ip_address varchar(16) default '0' NOT NULL,
  595. hash varchar(40) NOT NULL,
  596. KEY (hash)
  597. )";
  598. // Captcha data
  599. $D[] = 'exp_captcha';
  600. $Q[] = "CREATE TABLE exp_captcha (
  601. captcha_id bigint(13) unsigned NOT NULL auto_increment,
  602. date int(10) unsigned NOT NULL,
  603. ip_address varchar(16) default '0' NOT NULL,
  604. word varchar(20) NOT NULL,
  605. PRIMARY KEY (captcha_id),
  606. KEY (word)
  607. )";
  608. // Password Lockout
  609. // If password lockout is enabled, a user only gets
  610. // four attempts to log-in within a specified period.
  611. // This table holds the a list of locked out users
  612. $D[] = 'exp_password_lockout';
  613. $Q[] = "CREATE TABLE exp_password_lockout (
  614. login_date int(10) unsigned NOT NULL,
  615. ip_address varchar(16) default '0' NOT NULL,
  616. user_agent varchar(50) NOT NULL,
  617. KEY (login_date),
  618. KEY (ip_address),
  619. KEY (user_agent)
  620. )";
  621. // Reset password
  622. // If a user looses their password, this table
  623. // holds the reset code.
  624. $D[] = 'exp_reset_password';
  625. $Q[] = "CREATE TABLE exp_reset_password (
  626. member_id int(10) unsigned NOT NULL,
  627. resetcode varchar(12) NOT NULL,
  628. date int(10) NOT NULL
  629. )";
  630. $D[] = 'exp_mailing_lists';
  631. $Q[] = "CREATE TABLE exp_mailing_lists (
  632. list_id int(7) unsigned NOT NULL auto_increment,
  633. list_name varchar(40) NOT NULL,
  634. list_title varchar(100) NOT NULL,
  635. list_template text NOT NULL,
  636. PRIMARY KEY (list_id),
  637. KEY (list_name)
  638. )";
  639. // Mailing list
  640. // Notes: "authcode" is a random hash assigned to each member
  641. // of the mailing list. We use this code in the "usubscribe" link
  642. // added to sent emails.
  643. $D[] = 'exp_mailing_list';
  644. $Q[] = "CREATE TABLE exp_mailing_list (
  645. user_id int(10) unsigned NOT NULL auto_increment,
  646. list_id int(7) unsigned default '0' NOT NULL,
  647. ip_address varchar(16) NOT NULL,
  648. authcode varchar(10) NOT NULL,
  649. email varchar(50) NOT NULL,
  650. KEY (list_id),
  651. KEY (user_id)
  652. )";
  653. // Mailing List Queue
  654. // When someone signs up for the mailing list, they are sent
  655. // a confirmation email. This prevents someone from signing
  656. // up another person. This table holds email addresses that
  657. // are pending activation.
  658. $D[] = 'exp_mailing_list_queue';
  659. $Q[] = "CREATE TABLE exp_mailing_list_queue (
  660. email varchar(50) NOT NULL,
  661. list_id int(7) unsigned default '0' NOT NULL,
  662. authcode varchar(10) NOT NULL,
  663. date int(10) NOT NULL
  664. )";
  665. // Email Cache
  666. // We store all email messages that are sent from the CP
  667. $D[] = 'exp_email_cache';
  668. $Q[] = "CREATE TABLE exp_email_cache (
  669. cache_id int(6) unsigned NOT NULL auto_increment,
  670. cache_date int(10) unsigned default '0' NOT NULL,
  671. total_sent int(6) unsigned NOT NULL,
  672. from_name varchar(70) NOT NULL,
  673. from_email varchar(70) NOT NULL,
  674. recipient text NOT NULL,
  675. cc text NOT NULL,
  676. bcc text NOT NULL,
  677. recipient_array mediumtext NOT NULL,
  678. subject varchar(120) NOT NULL,
  679. message mediumtext NOT NULL,
  680. `plaintext_alt` MEDIUMTEXT NOT NULL,
  681. mailinglist char(1) NOT NULL default 'n',
  682. mailtype varchar(6) NOT NULL,
  683. text_fmt varchar(40) NOT NULL,
  684. wordwrap char(1) NOT NULL default 'y',
  685. priority char(1) NOT NULL default '3',
  686. PRIMARY KEY (cache_id)
  687. )";
  688. // Cached Member Groups
  689. // We use this table to store the member group assignments
  690. // for each email that is sent. Since you can send email
  691. // to various combinations of members, we store the member
  692. // group numbers in this table, which is joined to the
  693. // table above when we need to re-send an email from cache.
  694. $D[] = 'exp_email_cache_mg';
  695. $Q[] = "CREATE TABLE exp_email_cache_mg (
  696. cache_id int(6) unsigned NOT NULL,
  697. group_id smallint(4) NOT NULL,
  698. KEY (cache_id)
  699. )";
  700. // We do the same with mailing lists
  701. $D[] = 'exp_email_cache_ml';
  702. $Q[] = "CREATE TABLE exp_email_cache_ml (
  703. cache_id int(6) unsigned NOT NULL,
  704. list_id smallint(4) NOT NULL,
  705. KEY (cache_id)
  706. )";
  707. // Email Console Cache
  708. // Emails sent from the member profile email console are saved here.
  709. $D[] = 'exp_email_console_cache';
  710. $Q[] = "CREATE TABLE exp_email_console_cache (
  711. cache_id int(6) unsigned NOT NULL auto_increment,
  712. cache_date int(10) unsigned default '0' NOT NULL,
  713. member_id int(10) unsigned NOT NULL,
  714. member_name varchar(50) NOT NULL,
  715. ip_address varchar(16) default '0' NOT NULL,
  716. recipient varchar(70) NOT NULL,
  717. recipient_name varchar(50) NOT NULL,
  718. subject varchar(120) NOT NULL,
  719. message mediumtext NOT NULL,
  720. PRIMARY KEY (cache_id)
  721. )";
  722. // Email Tracker
  723. // This table is used by the Email module for flood control.
  724. $D[] = 'exp_email_tracker';
  725. $Q[] = "CREATE TABLE exp_email_tracker (
  726. email_id int(10) unsigned NOT NULL auto_increment,
  727. email_date int(10) unsigned default '0' NOT NULL,
  728. sender_ip varchar(16) NOT NULL,
  729. sender_email varchar(75) NOT NULL ,
  730. sender_username varchar(50) NOT NULL ,
  731. number_recipients int(4) unsigned default '1' NOT NULL,
  732. PRIMARY KEY (email_id)
  733. )";
  734. // Member table
  735. // Contains the member info
  736. /*
  737. Note: The following fields are intended for use
  738. with the "user_blog" module.
  739. weblog_id int(6) unsigned NOT NULL default '0',
  740. template_id int(6) unsigned NOT NULL default '0',
  741. upload_id int(6) unsigned NOT NULL default '0',
  742. */
  743. $D[] = 'exp_members';
  744. $Q[] = "CREATE TABLE exp_members (
  745. member_id int(10) unsigned NOT NULL auto_increment,
  746. group_id smallint(4) NOT NULL default '0',
  747. weblog_id int(6) unsigned NOT NULL default '0',
  748. tmpl_group_id int(6) unsigned NOT NULL default '0',
  749. upload_id int(6) unsigned NOT NULL default '0',
  750. username varchar(50) NOT NULL,
  751. screen_name varchar(50) NOT NULL,
  752. password varchar(40) NOT NULL,
  753. unique_id varchar(40) NOT NULL,
  754. authcode varchar(10) NOT NULL,
  755. email varchar(50) NOT NULL,
  756. url varchar(75) NOT NULL,
  757. location varchar(50) NOT NULL,
  758. occupation varchar(80) NOT NULL,
  759. interests varchar(120) NOT NULL,
  760. bday_d int(2) NOT NULL,
  761. bday_m int(2) NOT NULL,
  762. bday_y int(4) NOT NULL,
  763. aol_im varchar(50) NOT NULL,
  764. yahoo_im varchar(50) NOT NULL,
  765. msn_im varchar(50) NOT NULL,
  766. icq varchar(50) NOT NULL,
  767. bio text NOT NULL,
  768. signature text NOT NULL,
  769. avatar_filename varchar(120) NOT NULL,
  770. avatar_width int(4) unsigned NOT NULL,
  771. avatar_height int(4) unsigned NOT NULL,
  772. photo_filename varchar(120) NOT NULL,
  773. photo_width int(4) unsigned NOT NULL,
  774. photo_height int(4) unsigned NOT NULL,
  775. sig_img_filename varchar(120) NOT NULL,
  776. sig_img_width int(4) unsigned NOT NULL,
  777. sig_img_height int(4) unsigned NOT NULL,
  778. ignore_list text NOT NULL,
  779. private_messages int(4) unsigned DEFAULT '0' NOT NULL,
  780. accept_messages char(1) NOT NULL default 'y',
  781. last_view_bulletins int(10) NOT NULL default 0,
  782. last_bulletin_date int(10) NOT NULL default 0,
  783. ip_address varchar(16) default '0' NOT NULL,
  784. join_date int(10) unsigned default '0' NOT NULL,
  785. last_visit int(10) unsigned default '0' NOT NULL,
  786. last_activity int(10) unsigned default '0' NOT NULL,
  787. total_entries smallint(5) unsigned NOT NULL default '0',
  788. total_comments smallint(5) unsigned NOT NULL default '0',
  789. total_forum_topics mediumint(8) default '0' NOT NULL,
  790. total_forum_posts mediumint(8) default '0' NOT NULL,
  791. last_entry_date int(10) unsigned default '0' NOT NULL,
  792. last_comment_date int(10) unsigned default '0' NOT NULL,
  793. last_forum_post_date int(10) unsigned default '0' NOT NULL,
  794. last_email_date int(10) unsigned default '0' NOT NULL,
  795. in_authorlist char(1) NOT NULL default 'n',
  796. accept_admin_email char(1) NOT NULL default 'y',
  797. accept_user_email char(1) NOT NULL default 'y',
  798. notify_by_default char(1) NOT NULL default 'y',
  799. notify_of_pm char(1) NOT NULL default 'y',
  800. display_avatars char(1) NOT NULL default 'y',
  801. display_signatures char(1) NOT NULL default 'y',
  802. smart_notifications char(1) NOT NULL default 'y',
  803. language varchar(50) NOT NULL,
  804. timezone varchar(8) NOT NULL,
  805. daylight_savings char(1) default 'n' NOT NULL,
  806. localization_is_site_default char(1) NOT NULL default 'n',
  807. time_format char(2) default 'us' NOT NULL,
  808. cp_theme varchar(32) NOT NULL,
  809. profile_theme varchar(32) NOT NULL,
  810. forum_theme varchar(32) NOT NULL,
  811. tracker text NOT NULL,
  812. template_size varchar(2) NOT NULL default '28',
  813. notepad text NOT NULL,
  814. notepad_size varchar(2) NOT NULL default '18',
  815. quick_links text NOT NULL,
  816. quick_tabs text NOT NULL,
  817. pmember_id int(10) NOT NULL default '0',
  818. PRIMARY KEY (member_id),
  819. KEY (`group_id`),
  820. KEY (`unique_id`),
  821. KEY (`password`)
  822. )";
  823. // CP homepage layout
  824. // Each member can have their own control panel layout.
  825. // We store their preferences here.
  826. $D[] = 'exp_member_homepage';
  827. $Q[] = "CREATE TABLE exp_member_homepage (
  828. member_id int(10) unsigned NOT NULL,
  829. recent_entries char(1) NOT NULL default 'l',
  830. recent_entries_order int(3) unsigned NOT NULL default '0',
  831. recent_comments char(1) NOT NULL default 'l',
  832. recent_comments_order int(3) unsigned NOT NULL default '0',
  833. recent_members char(1) NOT NULL default 'n',
  834. recent_members_order int(3) unsigned NOT NULL default '0',
  835. site_statistics char(1) NOT NULL default 'r',
  836. site_statistics_order int(3) unsigned NOT NULL default '0',
  837. member_search_form char(1) NOT NULL default 'n',
  838. member_search_form_order int(3) unsigned NOT NULL default '0',
  839. notepad char(1) NOT NULL default 'r',
  840. notepad_order int(3) unsigned NOT NULL default '0',
  841. bulletin_board char(1) NOT NULL default 'r',
  842. bulletin_board_order int(3) unsigned NOT NULL default '0',
  843. pmachine_news_feed char(1) NOT NULL default 'n',
  844. pmachine_news_feed_order int(3) unsigned NOT NULL default '0',
  845. KEY (member_id)
  846. )";
  847. // Member Groups table
  848. $D[] = 'exp_member_groups';
  849. $Q[] = "CREATE TABLE exp_member_groups (
  850. group_id smallint(4) unsigned NOT NULL,
  851. site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
  852. group_title varchar(100) NOT NULL,
  853. group_description text NOT NULL,
  854. is_locked char(1) NOT NULL default 'y',
  855. can_view_offline_system char(1) NOT NULL default 'n',
  856. can_view_online_system char(1) NOT NULL default 'y',
  857. can_access_cp char(1) NOT NULL default 'y',
  858. can_access_publish char(1) NOT NULL default 'n',
  859. can_access_edit char(1) NOT NULL default 'n',
  860. can_access_design char(1) NOT NULL default 'n',
  861. can_access_comm char(1) NOT NULL default 'n',
  862. can_access_modules char(1) NOT NULL default 'n',
  863. can_access_admin char(1) NOT NULL default 'n',
  864. can_admin_weblogs char(1) NOT NULL default 'n',
  865. can_admin_members char(1) NOT NULL default 'n',
  866. can_delete_members char(1) NOT NULL default 'n',
  867. can_admin_mbr_groups char(1) NOT NULL default 'n',
  868. can_admin_mbr_templates char(1) NOT NULL default 'n',
  869. can_ban_users char(1) NOT NULL default 'n',
  870. can_admin_utilities char(1) NOT NULL default 'n',
  871. can_admin_preferences char(1) NOT NULL default 'n',
  872. can_admin_modules char(1) NOT NULL default 'n',
  873. can_admin_templates char(1) NOT NULL default 'n',
  874. can_edit_categories char(1) NOT NULL default 'n',
  875. can_delete_categories char(1) NOT NULL default 'n',
  876. can_view_other_entries char(1) NOT NULL default 'n',
  877. can_edit_other_entries char(1) NOT NULL default 'n',
  878. can_assign_post_authors char(1) NOT NULL default 'n',
  879. can_delete_self_entries char(1) NOT NULL default 'n',
  880. can_delete_all_entries char(1) NOT NULL default 'n',
  881. can_view_other_comments char(1) NOT NULL default 'n',
  882. can_edit_own_comments char(1) NOT NULL default 'n',
  883. can_delete_own_comments char(1) NOT NULL default 'n',
  884. can_edit_all_comments char(1) NOT NULL default 'n',
  885. can_delete_all_comments char(1) NOT NULL default 'n',
  886. can_moderate_comments char(1) NOT NULL default 'n',
  887. can_send_email char(1) NOT NULL default 'n',
  888. can_send_cached_email char(1) NOT NULL default 'n',
  889. can_email_member_groups char(1) NOT NULL default 'n',
  890. can_email_mailinglist char(1) NOT NULL default 'n',
  891. can_email_from_profile char(1) NOT NULL default 'n',
  892. can_view_profiles char(1) NOT NULL default 'n',
  893. can_delete_self char(1) NOT NULL default 'n',
  894. mbr_delete_notify_emails varchar(255) NOT NULL,
  895. can_post_comments char(1) NOT NULL default 'n',
  896. exclude_from_moderation char(1) NOT NULL default 'n',
  897. can_search char(1) NOT NULL default 'n',
  898. search_flood_control mediumint(5) unsigned NOT NULL,
  899. can_send_private_messages char(1) NOT NULL default 'n',
  900. prv_msg_send_limit smallint unsigned NOT NULL default '20',
  901. prv_msg_storage_limit smallint unsigned NOT NULL default '60',
  902. can_attach_in_private_messages char(1) NOT NULL default 'n',
  903. can_send_bulletins char(1) NOT NULL default 'n',
  904. include_in_authorlist char(1) NOT NULL default 'n',
  905. include_in_memberlist char(1) NOT NULL default 'y',
  906. include_in_mailinglists char(1) NOT NULL default 'y',
  907. KEY (group_id),
  908. KEY (site_id)
  909. )";
  910. // Weblog access privs
  911. // Member groups assignment for each weblog
  912. $D[] = 'exp_weblog_member_groups';
  913. $Q[] = "CREATE TABLE exp_weblog_member_groups (
  914. group_id smallint(4) unsigned NOT NULL,
  915. weblog_id int(6) unsigned NOT NULL,
  916. KEY (group_id)
  917. )";
  918. // Module access privs
  919. // Member Group assignment for each module
  920. $D[] = 'exp_module_member_groups';
  921. $Q[] = "CREATE TABLE exp_module_member_groups (
  922. group_id smallint(4) unsigned NOT NULL,
  923. module_id mediumint(5) unsigned NOT NULL,
  924. KEY (group_id)
  925. )";
  926. // Template Group access privs
  927. // Member group assignment for each template group
  928. $D[] = 'exp_template_member_groups';
  929. $Q[] = "CREATE TABLE exp_template_member_groups (
  930. group_id smallint(4) unsigned NOT NULL,
  931. template_group_id mediumint(5) unsigned NOT NULL,
  932. KEY (group_id)
  933. )";
  934. // Member Custom Fields
  935. // Stores the defenition of each field
  936. $D[] = 'exp_member_fields';
  937. $Q[] = "CREATE TABLE exp_member_fields (
  938. m_field_id int(4) unsigned NOT NULL auto_increment,
  939. m_field_name varchar(32) NOT NULL,
  940. m_field_label varchar(50) NOT NULL,
  941. m_field_description text NOT NULL,
  942. m_field_type varchar(12) NOT NULL default 'text',
  943. m_field_list_items text NOT NULL,
  944. m_field_ta_rows tinyint(2) default '8',
  945. m_field_maxl smallint(3) NOT NULL,
  946. m_field_width varchar(6) NOT NULL,
  947. m_field_search char(1) NOT NULL default 'y',
  948. m_field_required char(1) NOT NULL default 'n',
  949. m_field_public char(1) NOT NULL default 'y',
  950. m_field_reg char(1) NOT NULL default 'n',
  951. m_field_fmt char(5) NOT NULL default 'none',
  952. m_field_order int(3) unsigned NOT NULL,
  953. PRIMARY KEY (m_field_id)
  954. )";
  955. // Member Data
  956. // Stores the actual data
  957. $D[] = 'exp_member_data';
  958. $Q[] = "CREATE TABLE exp_member_data (
  959. member_id int(10) unsigned NOT NULL,
  960. KEY (member_id)
  961. )";
  962. // Weblog Table
  963. $D[] = 'exp_weblogs';
  964. // Note: The is_user_blog field indicates whether the blog is
  965. // assigned as a "user blogs" weblog
  966. $Q[] = "CREATE TABLE exp_weblogs (
  967. weblog_id int(6) unsigned NOT NULL auto_increment,
  968. site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
  969. is_user_blog char(1) NOT NULL default 'n',
  970. blog_name varchar(40) NOT NULL,
  971. blog_title varchar(100) NOT NULL,
  972. blog_url varchar(100) NOT NULL,
  973. blog_description varchar(225) NOT NULL,
  974. blog_lang varchar(12) NOT NULL,
  975. blog_encoding varchar(12) NOT NULL,
  976. total_entries mediumint(8) default '0' NOT NULL,
  977. total_comments mediumint(8) default '0' NOT NULL,
  978. total_trackbacks mediumint(8) default '0' NOT NULL,
  979. last_entry_date int(10) unsigned default '0' NOT NULL,
  980. last_comment_date int(10) unsigned default '0' NOT NULL,
  981. last_trackback_date int(10) unsigned default '0' NOT NULL,
  982. cat_group varchar(255) NOT NULL,
  983. status_group int(4) unsigned NOT NULL,
  984. deft_status varchar(50) NOT NULL default 'open',
  985. field_group int(4) unsigned NOT NULL,
  986. search_excerpt int(4) unsigned NOT NULL,
  987. enable_trackbacks char(1) NOT NULL default 'n',
  988. trackback_use_url_title char(1) NOT NULL default 'n',
  989. trackback_max_hits int(2) unsigned NOT NULL default '5',
  990. trackback_field int(4) unsigned NOT NULL,
  991. deft_category varchar(60) NOT NULL,
  992. deft_comments char(1) NOT NULL default 'y',
  993. deft_trackbacks char(1) NOT NULL default 'y',
  994. weblog_require_membership char(1) NOT NULL default 'y',
  995. weblog_max_chars int(5) unsigned NOT NULL,
  996. weblog_html_formatting char(4) NOT NULL default 'all',
  997. weblog_allow_img_urls char(1) NOT NULL default 'y',
  998. weblog_auto_link_urls char(1) NOT NULL default 'y',
  999. weblog_notify char(1) NOT NULL default 'n',
  1000. weblog_notify_emails varchar(255) NOT NULL,
  1001. comment_url varchar(80) NOT NULL,
  1002. comment_system_enabled char(1) NOT NULL default 'y',
  1003. comment_require_membership char(1) NOT NULL default 'n',
  1004. comment_use_captcha char(1) NOT NULL default 'n',
  1005. comment_moderate char(1) NOT NULL default 'n',
  1006. comment_max_chars int(5) unsigned NOT NULL,
  1007. comment_timelock int(5) unsigned NOT NULL default '0',
  1008. comment_require_email char(1) NOT NULL default 'y',
  1009. comment_text_formatting char(5) NOT NULL default 'xhtml',
  1010. comment_html_formatting char(4) NOT NULL default 'safe',
  1011. comment_allow_img_urls char(1) NOT NULL default 'n',
  1012. comment_auto_link_urls char(1) NOT NULL default 'y',
  1013. comment_notify char(1) NOT NULL default 'n',
  1014. comment_notify_authors char(1) NOT NULL default 'n',
  1015. comment_notify_emails varchar(255) NOT NULL,
  1016. comment_expiration int(4) unsigned NOT NULL default '0',
  1017. search_results_url varchar(80) NOT NULL,
  1018. tb_return_url varchar(80) NOT NULL,
  1019. ping_return_url varchar(80) NOT NULL,
  1020. show_url_title char(1) NOT NULL default 'y',
  1021. trackback_system_enabled char(1) NOT NULL default 'n',
  1022. show_trackback_field char(1) NOT NULL default 'y',
  1023. trackback_use_captcha char(1) NOT NULL default 'n',
  1024. show_ping_cluster char(1) NOT NULL default 'y',
  1025. show_options_cluster char(1) NOT NULL default 'y',
  1026. show_button_cluster char(1) NOT NULL default 'y',
  1027. show_forum_cluster char(1) NOT NULL default 'y',
  1028. show_pages_cluster CHAR(1) NOT NULL DEFAULT 'y',
  1029. show_show_all_cluster CHAR(1) NOT NULL DEFAULT 'y',
  1030. show_author_menu char(1) NOT NULL default 'y',
  1031. show_status_menu char(1) NOT NULL default 'y',
  1032. show_categories_menu char(1) NOT NULL default 'y',
  1033. show_date_menu char(1) NOT NULL default 'y',
  1034. rss_url varchar(80) NOT NULL,
  1035. enable_versioning char(1) NOT NULL default 'n',
  1036. enable_qucksave_versioning char(1) NOT NULL default 'n',
  1037. max_revisions smallint(4) unsigned NOT NULL default 10,
  1038. default_entry_title varchar(100) NOT NULL,
  1039. url_title_prefix varchar(80) NOT NULL,
  1040. live_look_template int(10) UNSIGNED NOT NULL default 0,
  1041. PRIMARY KEY (weblog_id),
  1042. KEY (cat_group),
  1043. KEY (status_group),
  1044. KEY (field_group),
  1045. KEY (is_user_blog),
  1046. KEY (site_id)
  1047. )";
  1048. // Weblog Titles
  1049. // We store weblog titles separately from weblog data
  1050. $D[] = 'exp_weblog_titles';
  1051. $Q[] = "CREATE TABLE exp_weblog_titles (
  1052. entry_id int(10) unsigned NOT NULL auto_increment,
  1053. site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
  1054. weblog_id int(4) unsigned NOT NULL,
  1055. author_id int(10) unsigned NOT NULL default '0',
  1056. pentry_id int(10) NOT NULL default '0',
  1057. forum_topic_id int(10) unsigned NOT NULL,
  1058. ip_address varchar(16) NOT NULL,
  1059. title varchar(100) NOT NULL,
  1060. url_title varchar(75) NOT NULL,
  1061. status varchar(50) NOT NULL,
  1062. versioning_enabled char(1) NOT NULL default 'n',
  1063. view_count_one int(10) unsigned NOT NULL default '0',
  1064. view_count_two int(10) unsigned NOT NULL default '0',
  1065. view_count_three int(10) unsigned NOT NULL default '0',
  1066. view_count_four int(10) unsigned NOT NULL default '0',
  1067. allow_comments varchar(1) NOT NULL default 'y',
  1068. allow_trackbacks varchar(1) NOT NULL default 'n',
  1069. sticky varchar(1) NOT NULL default 'n',
  1070. entry_date int(10) NOT NULL,
  1071. dst_enabled varchar(1) NOT NULL default 'n',
  1072. year char(4) NOT NULL,
  1073. month char(2) NOT NULL,
  1074. day char(3) NOT NULL,
  1075. expiration_date int(10) NOT NULL default '0',
  1076. comment_expiration_date int(10) NOT NULL default '0',
  1077. edit_date bigint(14),
  1078. recent_comment_date int(10) NOT NULL,
  1079. comment_total int(4) unsigned NOT NULL default '0',
  1080. trackback_total int(4) unsigned NOT NULL default '0',
  1081. sent_trackbacks text NOT NULL,
  1082. recent_trackback_date int(10) NOT NULL,
  1083. PRIMARY KEY (entry_id),
  1084. KEY (weblog_id),
  1085. KEY (author_id),
  1086. KEY (url_title),
  1087. KEY (status),
  1088. KEY (entry_date),
  1089. KEY (expiration_date),
  1090. KEY (site_id)
  1091. )";
  1092. $D[] = 'exp_entry_versioning';
  1093. $Q[] = "CREATE TABLE exp_entry_versioning (
  1094. version_id int(10) unsigned NOT NULL auto_increment,
  1095. entry_id int(10) unsigned NOT NULL,
  1096. weblog_id int(4) unsigned NOT NULL,
  1097. author_id int(10) unsigned NOT NULL,
  1098. version_date int(10) NOT NULL,
  1099. version_data mediumtext NOT NULL,
  1100. PRIMARY KEY (version_id),
  1101. KEY (entry_id)
  1102. )";
  1103. // Weblog Custom Field Groups
  1104. $D[] = 'exp_field_groups';
  1105. $Q[] = "CREATE TABLE exp_field_groups (
  1106. group_id int(4) unsigned NOT NULL auto_increment,
  1107. site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
  1108. group_name varchar(50) NOT NULL,
  1109. PRIMARY KEY (group_id),
  1110. KEY (site_id)
  1111. )";
  1112. // Weblog Custom Field Definitions
  1113. $D[] = 'exp_weblog_fields';
  1114. $Q[] = "CREATE TABLE exp_weblog_fields (
  1115. field_id int(6) unsigned NOT NULL auto_increment,
  1116. site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
  1117. group_id int(4) unsigned NOT NULL,
  1118. field_name varchar(32) NOT NULL,
  1119. field_label varchar(50) NOT NULL,
  1120. field_instructions TEXT NOT NULL,
  1121. field_type varchar(12) NOT NULL default 'text',
  1122. field_list_items text NOT NULL,
  1123. field_pre_populate char(1) NOT NULL default 'n',
  1124. field_pre_blog_id int(6) unsigned NOT NULL,
  1125. field_pre_field_id int(6) unsigned NOT NULL,
  1126. field_related_to varchar(12) NOT NULL default 'blog',
  1127. field_related_id int(6) unsigned NOT NULL,
  1128. field_related_orderby varchar(12) NOT NULL default 'date',
  1129. field_related_sort varchar(4) NOT NULL default 'desc',
  1130. field_related_max smallint(4) NOT NULL,
  1131. field_ta_rows tinyint(2) default '8',
  1132. field_maxl smallint(3) NOT NULL,
  1133. field_required char(1) NOT NULL default 'n',
  1134. field_text_direction CHAR(3) NOT NULL default 'ltr',
  1135. field_search char(1) NOT NULL default 'n',
  1136. field_is_hidden char(1) NOT NULL default 'n',
  1137. field_fmt varchar(40) NOT NULL default 'xhtml',
  1138. field_show_fmt char(1) NOT NULL default 'y',
  1139. field_order int(3) unsigned NOT NULL,
  1140. PRIMARY KEY (field_id),
  1141. KEY (group_id),
  1142. KEY (site_id)
  1143. )";
  1144. // Relationships table
  1145. $D[] = 'exp_relationships';
  1146. $Q[] = "CREATE TABLE exp_relationships (
  1147. rel_id int(6) unsigned NOT NULL auto_increment,
  1148. rel_parent_id int(10) NOT NULL default '0',
  1149. rel_child_id int(10) NOT NULL default '0',
  1150. rel_type varchar(12) NOT NULL,
  1151. rel_data mediumtext NOT NULL,
  1152. reverse_rel_data mediumtext NOT NULL,
  1153. PRIMARY KEY (rel_id),
  1154. KEY (rel_parent_id),
  1155. KEY (rel_child_id)
  1156. )";
  1157. // Field formatting definitions
  1158. $D[] = 'exp_field_formatting';
  1159. $Q[] = "CREATE TABLE exp_field_formatting (
  1160. field_id int(10) unsigned NOT NULL,
  1161. field_fmt varchar(40) NOT NULL,
  1162. KEY (field_id)
  1163. )";
  1164. // Weblog data
  1165. $D[] = 'exp_weblog_data';
  1166. $Q[] = "CREATE TABLE exp_weblog_data (
  1167. entry_id int(10) unsigned NOT NULL,
  1168. site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
  1169. weblog_id int(4) unsigned NOT NULL,
  1170. field_id_1 text NOT NULL,
  1171. field_ft_1 tinytext NULL,
  1172. field_id_2 text NOT NULL,
  1173. field_ft_2 tinytext NULL,
  1174. field_id_3 text NOT NULL,
  1175. field_ft_3 tinytext NULL,
  1176. KEY (entry_id),
  1177. KEY (weblog_id),
  1178. KEY (site_id)
  1179. )";
  1180. // Ping Status
  1181. // This table saves the status of the xml-rpc ping buttons
  1182. // that were selected when an entry was submitted. This
  1183. // enables us to set the buttons to the same state when editing
  1184. $D[] = 'exp_entry_ping_status';
  1185. $Q[] = "CREATE TABLE exp_entry_ping_status (
  1186. entry_id int(10) unsigned NOT NULL,
  1187. ping_id int(10) unsigned NOT NULL
  1188. )";
  1189. // Comment table
  1190. $D[] = 'exp_comments';
  1191. $Q[] = "CREATE TABLE exp_comments (
  1192. comment_id int(10) unsigned NOT NULL auto_increment,
  1193. site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
  1194. entry_id int(10) unsigned NOT NULL default '0',
  1195. weblog_id int(4) unsigned NOT NULL,
  1196. author_id int(10) unsigned NOT NULL default '0',
  1197. status char(1) NOT NULL default 'o',
  1198. name varchar(50) NOT NULL,
  1199. email varchar(50) NOT NULL,
  1200. url varchar(75) NOT NULL,
  1201. location varchar(50) NOT NULL,
  1202. ip_address varchar(16) NOT NULL,
  1203. comment_date int(10) NOT NULL,
  1204. edit_date timestamp(14),
  1205. comment text NOT NULL,
  1206. notify char(1) NOT NULL default 'n',
  1207. PRIMARY KEY (comment_id),
  1208. KEY (entry_id),
  1209. KEY (weblog_id),
  1210. KEY (author_id),
  1211. KEY (status),
  1212. KEY (site_id)
  1213. )";
  1214. // Trackback table.
  1215. $D[] = 'exp_trackbacks';
  1216. $Q[] = "CREATE TABLE exp_trackbacks (
  1217. trackback_id int(10) unsigned NOT NULL auto_increment,
  1218. site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
  1219. entry_id int(10) unsigned NOT NULL default '0',
  1220. weblog_id int(4) unsigned NOT NULL,
  1221. title varchar(100) NOT NULL,
  1222. content text NOT NULL,
  1223. weblog_name varchar(100) NOT NULL,
  1224. trackback_url varchar(200) NOT NULL,
  1225. trackback_date int(10) NOT NULL,
  1226. trackback_ip varchar(16) NOT NULL,
  1227. PRIMARY KEY (trackback_id),
  1228. KEY (entry_id),
  1229. KEY (weblog_id),
  1230. KEY (site_id)
  1231. )";
  1232. // Status Groups
  1233. $D[] = 'exp_status_groups';
  1234. $Q[] = "CREATE TABLE exp_status_groups (
  1235. group_id int(4) unsigned NOT NULL auto_increment,
  1236. site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
  1237. group_name varchar(50) NOT NULL,
  1238. PRIMARY KEY (group_id),
  1239. KEY (site_id)
  1240. )";
  1241. // Status data
  1242. $D[] = 'exp_statuses';
  1243. $Q[] = "CREATE TABLE exp_statuses (
  1244. status_id int(6) unsigned NOT NULL auto_increment,
  1245. site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
  1246. group_id int(4) unsigned NOT NULL,
  1247. status varchar(50) NOT NULL,
  1248. status_order int(3) unsigned NOT NULL,
  1249. highlight varchar(30) NOT NULL,
  1250. PRIMARY KEY (status_id),
  1251. KEY (group_id),
  1252. KEY (site_id)
  1253. )";
  1254. // Status "no access"
  1255. // Stores groups that can not access certain statuses
  1256. $D[] = 'exp_status_no_access';
  1257. $Q[] = "CREATE TABLE exp_status_no_access (
  1258. status_id int(6) unsigned NOT NULL,
  1259. member_group smallint(4) unsigned NOT NULL
  1260. )";
  1261. // Category Groups
  1262. // Note: The is_user_blog field indicates whether the blog is
  1263. // assigned as a "user blogs" weblog
  1264. $D[] = 'exp_category_groups';
  1265. $Q[] = "CREATE TABLE exp_category_groups (
  1266. group_id int(6) unsigned NOT NULL auto_increment,
  1267. site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
  1268. group_name varchar(50) NOT NULL,
  1269. sort_order char(1) NOT NULL default 'a',
  1270. `field_html_formatting` char(4) NOT NULL default 'all',
  1271. `can_edit_categories` TEXT NOT NULL,
  1272. `can_delete_categories` TEXT NOT NULL,
  1273. is_user_blog char(1) NOT NULL default 'n',
  1274. PRIMARY KEY (group_id),
  1275. KEY (site_id)
  1276. )";
  1277. // Category data
  1278. $D[] = 'exp_categories';
  1279. $Q[] = "CREATE TABLE exp_categories (
  1280. cat_id int(10) unsigned NOT NULL auto_increment,
  1281. site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
  1282. group_id int(6) unsigned NOT NULL,
  1283. parent_id int(4) unsigned NOT NULL,
  1284. cat_name varchar(100) NOT NULL,
  1285. `cat_url_title` varchar(75) NOT NULL,
  1286. cat_description text NOT NULL,
  1287. cat_image varchar(120) NOT NULL,
  1288. cat_order int(4) unsigned NOT NULL,
  1289. PRIMARY KEY (cat_id),
  1290. KEY (group_id),
  1291. KEY (cat_name),
  1292. KEY (site_id)
  1293. )";
  1294. $D[] = 'exp_category_fields';
  1295. $Q[] = "CREATE TABLE `exp_category_fields` (
  1296. `field_id` int(6) unsigned NOT NULL auto_increment,
  1297. `site_id` int(4) unsigned NOT NULL default 1,
  1298. `group_id` int(4) unsigned NOT NULL,
  1299. `field_name` varchar(32) NOT NULL default '',
  1300. `field_label` varchar(50) NOT NULL default '',
  1301. `field_type` varchar(12) NOT NULL default 'text',
  1302. `field_list_items` text NOT NULL,
  1303. `field_maxl` smallint(3) NOT NULL default 128,
  1304. `field_ta_rows` tinyint(2) NOT NULL default 8,
  1305. `field_default_fmt` varchar(40) NOT NULL default 'none',
  1306. `field_show_fmt` char(1) NOT NULL default 'y',
  1307. `field_text_direction` CHAR(3) NOT NULL default 'ltr',
  1308. `field_required` char(1) NOT NULL default 'n',
  1309. `field_order` int(3) unsigned NOT NULL,
  1310. PRIMARY KEY (`field_id`),
  1311. KEY `site_id` (`site_id`),
  1312. KEY `group_id` (`group_id`)
  1313. )";
  1314. $D[] = 'exp_category_field_data';
  1315. $Q[] = "CREATE TABLE `exp_category_field_data` (
  1316. `cat_id` int(4) unsigned NOT NULL,
  1317. `site_id` int(4) unsigned NOT NULL default 1,
  1318. `group_id` int(4) unsigned NOT NULL,
  1319. PRIMARY KEY (`cat_id`),
  1320. KEY `site_id` (`site_id`),
  1321. KEY `group_id` (`group_id`)
  1322. )";
  1323. // Category posts
  1324. // This table stores the weblog entry ID and the category IDs
  1325. // that are assigned to it
  1326. $D[] = 'exp_category_posts';
  1327. $Q[] = "CREATE TABLE exp_category_posts (
  1328. entry_id int(10) unsigned NOT NULL,
  1329. cat_id int(10) unsigned NOT NULL,
  1330. KEY (entry_id),
  1331. KEY (cat_id)
  1332. )";
  1333. // Control panel log
  1334. $D[] = 'exp_cp_log';
  1335. $Q[] = "CREATE TABLE exp_cp_log (
  1336. id int(10) NOT NULL auto_increment,
  1337. site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
  1338. member_id int(10) unsigned NOT NULL,
  1339. username varchar(32) NOT NULL,
  1340. ip_address varchar(16) default '0' NOT NULL,
  1341. act_date int(10) NOT NULL,
  1342. action varchar(200) NOT NULL,
  1343. PRIMARY KEY (id),
  1344. KEY (site_id)
  1345. )";
  1346. // HTML buttons
  1347. // These are the buttons that appear on the PUBLISH page.
  1348. // Each member can have their own set of buttons
  1349. $D[] = 'exp_html_buttons';
  1350. $Q[] = "CREATE TABLE exp_html_buttons (
  1351. id int(10) unsigned NOT NULL auto_increment,
  1352. site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
  1353. member_id int(10) default '0' NOT NULL,
  1354. tag_name varchar(32) NOT NULL,
  1355. tag_open varchar(120) NOT NULL,
  1356. tag_close varchar(120) NOT NULL,
  1357. accesskey varchar(32) NOT NULL,
  1358. tag_order int(3) unsigned NOT NULL,
  1359. tag_row char(1) NOT NULL default '1',
  1360. PRIMARY KEY (id),
  1361. KEY (site_id)
  1362. )";
  1363. // Ping Servers
  1364. // Each member can have their own set ping server definitions
  1365. $D[] = 'exp_ping_servers';
  1366. $Q[] = "CREATE TABLE exp_ping_servers (
  1367. id int(10) unsigned NOT NULL auto_increment,
  1368. site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
  1369. member_id int(10) default '0' NOT NULL,
  1370. server_name varchar(32) NOT NULL,
  1371. server_url varchar(150) NOT NULL,
  1372. port varchar(4) NOT NULL default '80',
  1373. ping_protocol varchar(12) NOT NULL default 'xmlrpc',
  1374. is_default char(1) NOT NULL default 'y',
  1375. server_order int(3) unsigned NOT NULL,
  1376. PRIMARY KEY (id),
  1377. KEY (site_id)
  1378. )";
  1379. // Template Groups
  1380. // Note: The 'is_user_blog' field is used to indicate
  1381. // whether a template group has been assigned to a
  1382. // specific user as part of the "user blogs" module
  1383. $D[] = 'exp_template_groups';
  1384. $Q[] = "CREATE TABLE exp_template_groups (
  1385. group_id int(6) unsigned NOT NULL auto_increment,
  1386. site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
  1387. group_name varchar(50) NOT NULL,
  1388. group_order int(3) unsigned NOT NULL,
  1389. is_site_default char(1) NOT NULL default 'n',
  1390. is_user_blog char(1) NOT NULL default 'n',
  1391. PRIMARY KEY (group_id),
  1392. KEY (site_id)
  1393. )";
  1394. // Template data
  1395. $D[] = 'exp_templates';
  1396. $Q[] = "CREATE TABLE exp_templates (
  1397. template_id int(10) unsigned NOT NULL auto_increment,
  1398. site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
  1399. group_id int(6) unsigned NOT NULL,
  1400. template_name varchar(50) NOT NULL,
  1401. save_template_file char(1) NOT NULL default 'n',
  1402. template_type varchar(16) NOT NULL default 'webpage',
  1403. template_data mediumtext NOT NULL,
  1404. template_notes text NOT NULL,
  1405. edit_date int(10) NOT NULL DEFAULT 0,
  1406. last_author_id int(10) UNSIGNED NOT NULL,
  1407. cache char(1) NOT NULL default 'n',
  1408. refresh int(6) unsigned NOT NULL,
  1409. no_auth_bounce varchar(50) NOT NULL,
  1410. enable_http_auth CHAR(1) NOT NULL default 'n',
  1411. allow_php char(1) NOT NULL default 'n',
  1412. php_parse_location char(1) NOT NULL default 'o',
  1413. hits int(10) unsigned NOT NULL,
  1414. PRIMARY KEY (template_id),
  1415. KEY (group_id),
  1416. KEY (site_id)
  1417. )";
  1418. // Template "no access"
  1419. // Since each template can be made private to specific member groups
  1420. // we store member IDs of people who can not access certain templates
  1421. $D[] = 'exp_template_no_access';
  1422. $Q[] = "CREATE TABLE exp_template_no_access (
  1423. template_id int(6) unsigned NOT NULL,
  1424. member_group smallint(4) unsigned NOT NULL,
  1425. KEY (`template_id`)
  1426. )";
  1427. // Specialty Templates
  1428. // This table contains the various specialty templates, like:
  1429. // Admin notification of new members
  1430. // Admin notification of comments and trackbacks
  1431. // Membership activation instruction
  1432. // Member lost password instructions
  1433. // Validated member notification
  1434. // Remove from mailinglist notification
  1435. $D[] = 'exp_specialty_templates';
  1436. $Q[] = "CREATE TABLE exp_specialty_templates (
  1437. template_id int(6) unsigned NOT NULL auto_increment,
  1438. site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
  1439. enable_template char(1) NOT NULL default 'y',
  1440. template_name varchar(50) NOT NULL,
  1441. data_title varchar(80) NOT NULL,
  1442. template_data text NOT NULL,
  1443. PRIMARY KEY (template_id),
  1444. KEY (template_name),
  1445. KEY (site_id)
  1446. )";
  1447. // Global variables
  1448. // These are user-definable variables
  1449. $D[] = 'exp_global_variables';
  1450. $Q[] = "CREATE TABLE exp_global_variables (
  1451. variable_id int(6) unsigned NOT NULL auto_increment,
  1452. site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
  1453. variable_name varchar(50) NOT NULL,
  1454. variable_data text NOT NULL,
  1455. user_blog_id int(6) NOT NULL default '0',
  1456. PRIMARY KEY (variable_id),
  1457. KEY (variable_name),
  1458. KEY (site_id)
  1459. )";
  1460. // Revision tracker
  1461. // This is our versioning table, used to store each
  1462. // change that is made to a template.
  1463. $D[] = 'exp_revision_tracker';
  1464. $Q[] = "CREATE TABLE exp_revision_tracker (
  1465. tracker_id int(10) unsigned NOT NULL auto_increment,
  1466. item_id int(10) unsigned NOT NULL,
  1467. item_table varchar(20) NOT NULL,
  1468. item_field varchar(20) NOT NULL,
  1469. item_date int(10) NOT NULL,
  1470. item_author_id int(10) UNSIGNED NOT NULL,
  1471. item_data mediumtext NOT NULL,
  1472. PRIMARY KEY (tracker_id),
  1473. KEY (item_id)
  1474. )";
  1475. // Upload preferences
  1476. // Note: The is_user_blog field indicates whether the blog is
  1477. // assigned as a "user blogs" weblog
  1478. $D[] = 'exp_upload_prefs';
  1479. $Q[] = "CREATE TABLE exp_upload_prefs (
  1480. id int(4) unsigned NOT NULL auto_increment,
  1481. site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
  1482. is_user_blog char(1) NOT NULL default 'n',
  1483. name varchar(50) NOT NULL,
  1484. server_path varchar(100) NOT NULL,
  1485. url varchar(100) NOT NULL,
  1486. allowed_types varchar(3) NOT NULL default 'img',
  1487. max_size varchar(16) NOT NULL,
  1488. max_height varchar(6) NOT NULL,
  1489. max_width varchar(6) NOT NULL,
  1490. properties varchar(120) NOT NULL,
  1491. pre_format varchar(120) NOT NULL,
  1492. post_format varchar(120) NOT NULL,
  1493. file_properties varchar(120) NOT NULL,
  1494. file_pre_format varchar(120) NOT NULL,
  1495. file_post_format varchar(120) NOT NULL,
  1496. PRIMARY KEY (id),
  1497. KEY (site_id)
  1498. )";
  1499. // Upload "no access"
  1500. // We store the member groups that can not access various upload destinations
  1501. $D[] = 'exp_upload_no_access';
  1502. $Q[] = "CREATE TABLE exp_upload_no_access (
  1503. upload_id int(6) unsigned NOT NULL,
  1504. upload_loc varchar(3) NOT NULL,
  1505. member_group smallint(4) unsigned NOT NULL
  1506. )";
  1507. // Search results
  1508. $D[] = 'exp_search';
  1509. $Q[] = "CREATE TABLE exp_search (
  1510. search_id varchar(32) NOT NULL,
  1511. site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
  1512. search_date int(10) NOT NULL,
  1513. keywords varchar(60) NOT NULL,
  1514. member_id int(10) unsigned NOT NULL,
  1515. ip_address varchar(16) NOT NULL,
  1516. total_results int(6) NOT NULL,
  1517. per_page smallint(3) unsigned NOT NULL,
  1518. query mediumtext NULL DEFAULT NULL,
  1519. custom_fields mediumtext NULL DEFAULT NULL,
  1520. result_page varchar(70) NOT NULL,
  1521. PRIMARY KEY (search_id),
  1522. KEY (site_id)
  1523. )";
  1524. // Search term log
  1525. $D[] = 'exp_search_log';
  1526. $Q[] = "CREATE TABLE exp_search_log (
  1527. id int(10) NOT NULL auto_increment,
  1528. site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
  1529. member_id int(10) unsigned NOT NULL,
  1530. screen_name varchar(50) NOT NULL,
  1531. ip_address varchar(16) default '0' NOT NULL,
  1532. search_date int(10) NOT NULL,
  1533. search_type varchar(32) NOT NULL,
  1534. search_terms varchar(200) NOT NULL,
  1535. PRIMARY KEY (id),
  1536. KEY (site_id)
  1537. )";
  1538. // Private messating tables
  1539. $D[] = 'exp_message_attachments';
  1540. $Q[] = "CREATE TABLE exp_message_attachments (
  1541. attachment_id int(10) unsigned NOT NULL auto_increment,
  1542. sender_id int(10) unsigned NOT NULL default '0',
  1543. message_id int(10) unsigned NOT NULL default '0',
  1544. attachment_name varchar(50) NOT NULL default '',
  1545. attachment_hash varchar(40) NOT NULL default '',
  1546. attachment_extension varchar(20) NOT NULL default '',
  1547. attachment_location varchar(125) NOT NULL default '',
  1548. attachment_date int(10) unsigned NOT NULL default '0',
  1549. attachment_size int(10) unsigned NOT NULL default '0',
  1550. is_temp char(1) NOT NULL default 'y',
  1551. PRIMARY KEY (attachment_id)
  1552. )";
  1553. $D[] = 'exp_message_copies';
  1554. $Q[] = "CREATE TABLE exp_message_copies (
  1555. copy_id int(10) unsigned NOT NULL auto_increment,
  1556. message_id int(10) unsigned NOT NULL default '0',
  1557. sender_id int(10) unsigned NOT NULL default '0',
  1558. recipient_id int(10) unsigned NOT NULL default '0',
  1559. message_received char(1) NOT NULL default 'n',
  1560. message_read char(1) NOT NULL default 'n',
  1561. message_time_read int(10) unsigned NOT NULL default '0',
  1562. attachment_downloaded char(1) NOT NULL default 'n',
  1563. message_folder int(10) unsigned NOT NULL default '1',
  1564. message_authcode varchar(10) NOT NULL default '',
  1565. message_deleted char(1) NOT NULL default 'n',
  1566. message_status varchar(10) NOT NULL default '',
  1567. PRIMARY KEY (copy_id),
  1568. KEY message_id (message_id),
  1569. KEY recipient_id (recipient_id),
  1570. KEY sender_id (sender_id)
  1571. )";
  1572. $D[] = 'exp_message_data';
  1573. $Q[] = "CREATE TABLE exp_message_data (
  1574. message_id int(10) unsigned NOT NULL auto_increment,
  1575. sender_id int(10) unsigned NOT NULL default '0',
  1576. message_date int(10) unsigned NOT NULL default '0',
  1577. message_subject varchar(255) NOT NULL default '',
  1578. message_body text NOT NULL,
  1579. message_tracking char(1) NOT NULL default 'y',
  1580. message_attachments char(1) NOT NULL default 'n',
  1581. message_recipients varchar(200) NOT NULL default '',
  1582. message_cc varchar(200) NOT NULL default '',
  1583. message_hide_cc char(1) NOT NULL default 'n',
  1584. message_sent_copy char(1) NOT NULL default 'n',
  1585. total_recipients int(5) unsigned NOT NULL default '0',
  1586. message_status varchar(25) NOT NULL default '',
  1587. PRIMARY KEY (message_id),
  1588. KEY sender_id (sender_id)
  1589. )";
  1590. $D[] = 'exp_message_folders';
  1591. $Q[] = "CREATE TABLE exp_message_folders (
  1592. member_id int(10) unsigned NOT NULL default '0',
  1593. folder1_name varchar(50) NOT NULL default 'InBox',
  1594. folder2_name varchar(50) NOT NULL default 'Sent',
  1595. folder3_name varchar(50) NOT NULL default '',
  1596. folder4_name varchar(50) NOT NULL default '',
  1597. folder5_name varchar(50) NOT NULL default '',
  1598. folder6_name varchar(50) NOT NULL default '',
  1599. folder7_name varchar(50) NOT NULL default '',
  1600. folder8_name varchar(50) NOT NULL default '',
  1601. folder9_name varchar(50) NOT NULL default '',
  1602. folder10_name varchar(50) NOT NULL default '',
  1603. KEY member_id (member_id)
  1604. )";
  1605. $D[] = 'exp_message_listed';
  1606. $Q[] = "CREATE TABLE exp_message_listed (
  1607. listed_id int(10) unsigned NOT NULL auto_increment,
  1608. member_id int(10) unsigned NOT NULL default '0',
  1609. listed_member int(10) unsigned NOT NULL default '0',
  1610. listed_description varchar(100) NOT NULL default '',
  1611. listed_type varchar(10) NOT NULL default 'blocked',
  1612. PRIMARY KEY (listed_id)
  1613. )";
  1614. $D[] = 'exp_extensions';
  1615. $Q[] = "CREATE TABLE `exp_extensions` (
  1616. `extension_id` int(10) unsigned NOT NULL auto_increment,
  1617. `class` varchar(50) NOT NULL default '',
  1618. `method` varchar(50) NOT NULL default '',
  1619. `hook` varchar(50) NOT NULL default '',
  1620. `settings` text NOT NULL,
  1621. `priority` int(2) NOT NULL default '10',
  1622. `version` varchar(10) NOT NULL default '',
  1623. `enabled` char(1) NOT NULL default 'y',
  1624. PRIMARY KEY (`extension_id`)
  1625. )";
  1626. $D[] = 'exp_member_search';
  1627. $Q[] = "CREATE TABLE `exp_member_search`
  1628. (
  1629. `search_id` varchar(32) NOT NULL,
  1630. `site_id` INT(4) UNSIGNED NOT NULL DEFAULT 1,
  1631. `search_date` int(10) unsigned NOT NULL,
  1632. `keywords` varchar(200) NOT NULL,
  1633. `fields` varchar(200) NOT NULL,
  1634. `member_id` int(10) unsigned NOT NULL,
  1635. `ip_address` varchar(16) NOT NULL,
  1636. `total_results` int(8) unsigned NOT NULL,
  1637. `query` text NOT NULL,
  1638. PRIMARY KEY (`search_id`),
  1639. KEY `member_id` (`member_id`),
  1640. KEY `site_id` (`site_id`)
  1641. )";
  1642. $D[] = 'exp_member_bulletin_board';
  1643. $Q[] = "CREATE TABLE `exp_member_bulletin_board`
  1644. (
  1645. `bulletin_id` int(10) unsigned NOT NULL auto_increment,
  1646. `sender_id` int(10) unsigned NOT NULL,
  1647. `bulletin_group` int(8) unsigned NOT NULL,
  1648. `bulletin_date` int(10) unsigned NOT NULL,
  1649. `hash` varchar(10) NOT NULL DEFAULT '',
  1650. `bulletin_expires` int(10) unsigned NOT NULL DEFAULT 0,
  1651. `bulletin_message` text NOT NULL,
  1652. PRIMARY KEY (`bulletin_id`),
  1653. KEY `sender_id` (`sender_id`),
  1654. KEY `hash` (`hash`)
  1655. )";
  1656. // Define default DB data
  1657. // --------------------------------------------------------------------
  1658. // --------------------------------------------------------------------
  1659. // Which version is being installed?
  1660. // This lets us conditionally add only the supported
  1661. // items to the templates.
  1662. $type = 'core';
  1663. if ($fp = @opendir($system_path.'modules/'))
  1664. {
  1665. while (false !== ($file = readdir($fp)))
  1666. {
  1667. if ( ! stristr($file, '.'))
  1668. {
  1669. if ($file == 'mailinglist')
  1670. {
  1671. $type = 'full';
  1672. break;
  1673. }
  1674. }
  1675. }
  1676. closedir($fp);
  1677. }
  1678. if ( ! @include_once('./themes/site_themes/'.$data['template'].'/'.$data['template'].'.php'))
  1679. {
  1680. $er = "<div class='error'>Error: Unable to load the theme you have selected. Please ensure the theme file's permissions are such that they are readable.</div>";
  1681. settings_form($er);
  1682. page_footer();
  1683. exit;
  1684. }
  1685. // Template data
  1686. $Q[] = "insert into exp_template_groups(group_id, group_name, group_order, is_site_default) values ('', 'site', '1', 'y')";
  1687. foreach ($template_matrix as $tmpl)
  1688. {
  1689. $func = $tmpl['0'];
  1690. // This allows old templates to be compatible
  1691. $temp = str_replace("{stylesheet=weblog/weblog_css}", "{stylesheet=site/site_css}", $func());
  1692. foreach (array('index', 'comments', 'comment_preview', 'trackbacks', 'categories', 'archives', 'rss_1.0', 'rss_2.0', 'rss_atom', 'referrers', 'smileys') as $val)
  1693. {
  1694. $temp = str_replace("weblog/".$val, "site/".$val, $temp);
  1695. }
  1696. $temp = str_replace('weblog1', 'default_site', $temp);
  1697. if ($func == 'weblog_css')
  1698. $func = 'site_css';
  1699. // --------------------
  1700. $Q[] = "insert into exp_templates(template_id, group_id, template_name, template_type, template_data, edit_date, last_author_id) values ('', '1', '".$func."', '".$tmpl['1']."', '".addslashes($temp)."', {$now}, 1)";
  1701. }
  1702. unset($template_matrix);
  1703. require './themes/site_themes/rss/rss.php';
  1704. // This allows old templates to be compatible
  1705. $temp = str_replace("{stylesheet=weblog/weblog_css}", "{stylesheet=site/site_css}", rss_2());
  1706. foreach (array('index', 'comments', 'comment_preview', 'trackbacks', 'categories', 'archives', 'rss_1.0', 'rss_2.0', 'rss_atom', 'referrers', 'smileys') as $val)
  1707. {
  1708. $temp = str_replace("weblog/".$val, "site/".$val, $temp);}
  1709. $temp = str_replace('weblog1', 'default_site', $temp);
  1710. $Q[] = "insert into exp_templates(template_id, group_id, template_name, template_type, template_data, edit_date, last_author_id) values ('', '1', 'rss_2.0', 'rss', '".addslashes($temp)."', {$now}, 1)";
  1711. // This allows old templates to be compatible
  1712. $temp = str_replace("{stylesheet=weblog/weblog_css}", "{stylesheet=site/site_css}", atom());
  1713. foreach (array('index', 'comments', 'comment_preview', 'trackbacks', 'categories', 'archives', 'rss_1.0', 'rss_2.0', 'rss_atom', 'referrers', 'smileys') as $val)
  1714. {
  1715. $temp = str_replace("weblog/".$val, "site/".$val, $temp);}
  1716. $temp = str_replace('weblog1', 'default_site', $temp);
  1717. $Q[] = "insert into exp_templates(template_id, group_id, template_name, template_type, template_data, edit_date, last_author_id) values ('', '1', 'atom', 'rss', '".addslashes($temp)."', {$now}, 1)";
  1718. $Q[] = "insert into exp_template_groups(group_id, group_name, group_order) values ('', 'search', '3')";
  1719. unset($template_matrix);
  1720. require './themes/site_themes/search/search.php';
  1721. foreach ($template_matrix as $tmpl)
  1722. {
  1723. $name = ($tmpl['0'] == 'search_index') ? 'index' : $tmpl['0'];
  1724. $func = $tmpl['0'];
  1725. // This allows old templates to be compatible
  1726. $temp = str_replace("{stylesheet=weblog/weblog_css}", "{stylesheet=site/site_css}", $func());
  1727. foreach (array('index', 'comments', 'comment_preview', 'trackbacks', 'categories', 'archives', 'rss_1.0', 'rss_2.0', 'rss_atom', 'referrers', 'smileys') as $val)
  1728. {
  1729. $temp = str_replace("weblog/".$val, "site/".$val, $temp);}
  1730. $temp = str_replace('weblog1', 'default_site', $temp);
  1731. $Q[] = "insert into exp_templates(template_id, group_id, template_name, template_type, template_data, edit_date, last_author_id) values ('', '2', '".$name."', '".$tmpl['1']."', '".addslashes($temp)."', {$now}, 1)";
  1732. }
  1733. // Default Site
  1734. $Q[] = $DB->insert_string('exp_sites',array('site_id' => 1, 'site_label' => $data['site_name'], 'site_name' => 'default_site'));
  1735. // Specialty templates
  1736. $Q[] = "insert into exp_specialty_templates(template_id, template_name, data_title, template_data) values ('', 'offline_template', '', '".addslashes(offline_template())."')";
  1737. $Q[] = "insert into exp_specialty_templates(template_id, template_name, data_title, template_data) values ('', 'message_template', '', '".addslashes(message_template())."')";
  1738. $Q[] = "insert into exp_specialty_templates(template_id, template_name, data_title, template_data) values ('', 'admin_notify_reg', '".addslashes(trim(admin_notify_reg_title()))."', '".addslashes(admin_notify_reg())."')";
  1739. $Q[] = "insert into exp_specialty_templates(template_id, template_name, data_title, template_data) values ('', 'admin_notify_entry', '".addslashes(trim(admin_notify_entry_title()))."', '".addslashes(admin_notify_entry())."')";
  1740. $Q[] = "insert into exp_specialty_templates(template_id, template_name, data_title, template_data) values ('', 'admin_notify_mailinglist', '".addslashes(trim(admin_notify_mailinglist_title()))."', '".addslashes(admin_notify_mailinglist())."')";
  1741. $Q[] = "insert into exp_specialty_templates(template_id, template_name, data_title, template_data) values ('', 'admin_notify_comment', '".addslashes(trim(admin_notify_comment_title()))."', '".addslashes(admin_notify_comment())."')";
  1742. $Q[] = "insert into exp_specialty_templates(template_id, template_name, data_title, template_data) values ('', 'admin_notify_gallery_comment', '".addslashes(trim(admin_notify_gallery_comment_title()))."', '".addslashes(admin_notify_gallery_comment())."')";
  1743. $Q[] = "insert into exp_specialty_templates(template_id, template_name, data_title, template_data) values ('', 'admin_notify_trackback', '".addslashes(trim(admin_notify_trackback_title()))."', '".addslashes(admin_notify_trackback())."')";
  1744. $Q[] = "insert into exp_specialty_templates(template_id, template_name, data_title, template_data) values ('', 'mbr_activation_instructions', '".addslashes(trim(mbr_activation_instructions_title()))."', '".addslashes(mbr_activation_instructions())."')";
  1745. $Q[] = "insert into exp_specialty_templates(template_id, template_name, data_title, template_data) values ('', 'forgot_password_instructions', '".addslashes(trim(forgot_password_instructions_title()))."', '".addslashes(forgot_password_instructions())."')";
  1746. $Q[] = "insert into exp_specialty_templates(template_id, template_name, data_title, template_data) values ('', 'reset_password_notification', '".addslashes(trim(reset_password_notification_title()))."', '".addslashes(reset_password_notification())."')";
  1747. $Q[] = "insert into exp_specialty_templates(template_id, template_name, data_title, template_data) values ('', 'validated_member_notify', '".addslashes(trim(validated_member_notify_title()))."', '".addslashes(validated_member_notify())."')";
  1748. $Q[] = "insert into exp_specialty_templates(template_id, template_name, data_title, template_data) values ('', 'decline_member_validation', '".addslashes(trim(decline_member_validation_title()))."', '".addslashes(decline_member_validation())."')";
  1749. $Q[] = "insert into exp_specialty_templates(template_id, template_name, data_title, template_data) values ('', 'mailinglist_activation_instructions', '".addslashes(trim(mailinglist_activation_instructions_title()))."', '".addslashes(mailinglist_activation_instructions())."')";
  1750. $Q[] = "insert into exp_specialty_templates(template_id, template_name, data_title, template_data) values ('', 'comment_notification', '".addslashes(trim(comment_notification_title()))."', '".addslashes(comment_notification())."')";
  1751. $Q[] = "insert into exp_specialty_templates(template_id, template_name, data_title, template_data) values ('', 'gallery_comment_notification', '".addslashes(trim(gallery_comment_notification_title()))."', '".addslashes(gallery_comment_notification())."')";
  1752. $Q[] = "insert into exp_specialty_templates(template_id, template_name, data_title, template_data) values ('', 'private_message_notification', '".addslashes(trim(private_message_notification_title()))."', '".addslashes(private_message_notification())."')";
  1753. $Q[] = "insert into exp_specialty_templates(template_id, template_name, data_title, template_data) values ('', 'pm_inbox_full', '".addslashes(trim(pm_inbox_full_title()))."', '".addslashes(pm_inbox_full())."')";
  1754. // Mailing list data
  1755. $Q[] = "insert into exp_mailing_lists(list_id, list_name, list_title, list_template) values ('', 'default', 'Default Mailing List', '".addslashes(mailinglist_template())."')";
  1756. // Default weblog preference data
  1757. $Q[] = "insert into exp_weblogs (weblog_id, cat_group, blog_name, blog_title, blog_url, comment_url, search_results_url, tb_return_url, ping_return_url, blog_lang, blog_encoding, total_entries, last_entry_date, status_group, deft_status, field_group, deft_comments, deft_trackbacks, trackback_field, comment_max_chars, comment_require_email, comment_require_membership, weblog_require_membership, comment_text_formatting, search_excerpt) values ('', '1', 'default_site', 'Default Site Weblog', '".$data['site_url'].$data['site_index']."/site/index/', '".$data['site_url'].$data['site_index']."/site/comments/', '".$data['site_url'].$data['site_index']."/site/comments/', '".$data['site_url'].$data['site_index']."/site/comments/', '".$data['site_url'].$data['site_index']."', 'en', 'utf-8', '1', '$now', '1', 'open', '1', 'y', 'y', '2', '5000', 'y', 'n', 'y', 'xhtml', '2')";
  1758. // Custom field and field group data
  1759. $Q[] = "insert into exp_field_groups(group_id, group_name) values ('', 'Default Field Group')";
  1760. $Q[] = "insert into exp_weblog_fields(field_id, group_id, field_name, field_label, field_type, field_list_items, field_ta_rows, field_search, field_order, field_is_hidden) values ('', '1', 'summary', 'Summary', 'textarea', '', '6', 'n', '1', 'y')";
  1761. $Q[] = "insert into exp_weblog_fields(field_id, group_id, field_name, field_label, field_type, field_list_items, field_ta_rows, field_search, field_order, field_is_hidden) values ('', '1', 'body', 'Body', 'textarea', '', '10', 'y', '2', 'n')";
  1762. $Q[] = "insert into exp_weblog_fields(field_id, group_id, field_name, field_label, field_type, field_list_items, field_ta_rows, field_search, field_order, field_is_hidden) values ('', '1', 'extended', 'Extended text', 'textarea', '', '12', 'n', '3', 'y')";
  1763. $Q[] = "insert into exp_field_formatting (field_id, field_fmt) values ('1', 'none')";
  1764. $Q[] = "insert into exp_field_formatting (field_id, field_fmt) values ('1', 'br')";
  1765. $Q[] = "insert into exp_field_formatting (field_id, field_fmt) values ('1', 'xhtml')";
  1766. $Q[] = "insert into exp_field_formatting (field_id, field_fmt) values ('2', 'none')";
  1767. $Q[] = "insert into exp_field_formatting (field_id, field_fmt) values ('2', 'br')";
  1768. $Q[] = "insert into exp_field_formatting (field_id, field_fmt) values ('2', 'xhtml')";
  1769. $Q[] = "insert into exp_field_formatting (field_id, field_fmt) values ('3', 'none')";
  1770. $Q[] = "insert into exp_field_formatting (field_id, field_fmt) values ('3', 'br')";
  1771. $Q[] = "insert into exp_field_formatting (field_id, field_fmt) values ('3', 'xhtml')";
  1772. // Custom statuses
  1773. $Q[] = "insert into exp_status_groups (group_id, group_name) values ('', 'Default Status Group')";
  1774. $Q[] = "insert into exp_statuses (status_id, group_id, status, status_order, highlight) values ('', '1', 'open', '1', '009933')";
  1775. $Q[] = "insert into exp_statuses (status_id, group_id, status, status_order, highlight) values ('', '1', 'closed', '2', '990000')";
  1776. // Member groups
  1777. $Q[] = "insert into exp_member_groups values ('1', 1, 'Super Admins', '', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', '', 'y', 'y', 'y', '0', 'y', '20', '60', 'y', 'y', 'y', 'y', 'y')";
  1778. $Q[] = "insert into exp_member_groups values ('2', 1, 'Banned', '', 'y', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', '', 'n', 'n', 'n', '60', 'n', '20', '60', 'n', 'n', 'n', 'n', 'n')";
  1779. $Q[] = "insert into exp_member_groups values ('3', 1, 'Guests', '', 'y', 'n', 'y', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'y', 'n', '', 'y', 'n', 'y', '15', 'n', '20', '60', 'n', 'n', 'n', 'n', 'n')";
  1780. $Q[] = "insert into exp_member_groups values ('4', 1, 'Pending', '', 'y', 'n', 'y', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'y', 'n', '', 'y', 'n', 'y', '15', 'n', '20', '60', 'n', 'n', 'n', 'n', 'n')";
  1781. $Q[] = "insert into exp_member_groups values ('5', 1, 'Members', '', 'y', 'n', 'y', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'n', 'y', 'y', 'n', '', 'y', 'n', 'y', '10', 'y', '20', '60', 'y', 'n', 'n', 'y', 'y')";
  1782. // Register the default admin
  1783. $quick_link = 'My Site|'.$data['site_url'].$data['site_index'].'|1';
  1784. $Q[] = "insert into exp_members (member_id, group_id, username, password, unique_id, email, screen_name, join_date, ip_address, timezone, daylight_savings, total_entries, last_entry_date, quick_links, language) values ('', '1', '".$DB->escape_str($data['username'])."', '".$password."', '".$unique_id."', '".$DB->escape_str($data['email'])."', '".$DB->escape_str($data['screen_name'])."', '".$now."', '".$data['ip']."', '".$data['server_timezone']."', '".$data['daylight_savings']."', '1', '".$now."', '$quick_link', '".$DB->escape_str($data['deft_lang'])."')";
  1785. $Q[] = "insert into exp_member_homepage (member_id, recent_entries_order, recent_comments_order, site_statistics_order, notepad_order, pmachine_news_feed) values ('1', '1', '2', '1', '2', 'l')";
  1786. $Q[] = "insert into exp_member_data (member_id) VALUES ('1')";
  1787. // Default system stats
  1788. $Q[] = "insert into exp_stats (total_members, total_entries, last_entry_date, recent_member, recent_member_id, last_cache_clear) values ('1', '1', '".$now."', '".$DB->escape_str($data['screen_name'])."', '1', '".$now."')";
  1789. // HTML formatting buttons
  1790. $Q[] = "insert into exp_html_buttons values ('', 1, '0', '<b>', '<b>', '</b>', 'b', '1', '1')";
  1791. $Q[] = "insert into exp_html_buttons values ('', 1, '0', '<bq>', '<blockquote>', '</blockquote>', 'q', '2', '1')";
  1792. $Q[] = "insert into exp_html_buttons values ('', 1, '0', '<del>', '<del>', '</del>', 'd', '3', '1')";
  1793. $Q[] = "insert into exp_html_buttons values ('', 1, '0', '<i>', '<i>', '</i>', 'i', '4', '1')";
  1794. // Ping servers
  1795. //$Q[] = "insert into exp_ping_servers values ('', '0', 'weblogs.com', 'http://rpc.weblogs.com/RPC2', '80', 'xmmlrpc', 'n', '1')";
  1796. //$Q[] = "insert into exp_ping_servers values ('', '0', 'blo.gs', 'http://ping.blo.gs/', '80', 'xmmlrpc', 'n', '2')";
  1797. //$Q[] = "insert into exp_ping_servers values ('', '0', 'blogrolling.com', 'http://rpc.blogrolling.com/pinger/', '80', 'xmmlrpc', 'n', '3')";
  1798. //$Q[] = "insert into exp_ping_servers values ('', '0', 'blogshares.com', 'http://www.blogshares.com/rpc.php', '80', 'xmmlrpc', 'n', '4')";
  1799. // Create default categories
  1800. $Q[] = "insert into exp_category_groups (group_id, group_name, is_user_blog) values ('', 'Default Category Group', 'n')";
  1801. $Q[] = "insert into exp_categories (cat_id, group_id, parent_id, cat_name, cat_url_title, cat_order) values ('1', '1', '0', 'Blogging', 'Blogging', '1')";
  1802. $Q[] = "insert into exp_categories (cat_id, group_id, parent_id, cat_name, cat_url_title, cat_order) values ('2', '1', '0', 'News', 'News', '2')";
  1803. $Q[] = "insert into exp_categories (cat_id, group_id, parent_id, cat_name, cat_url_title, cat_order) values ('3', '1', '0', 'Personal', 'Personal', '3')";
  1804. $Q[] = "insert into exp_category_field_data (cat_id, group_id, site_id) values ('1', '1', '1')";
  1805. $Q[] = "insert into exp_category_field_data (cat_id, group_id, site_id) values ('2', '1', '1')";
  1806. $Q[] = "insert into exp_category_field_data (cat_id, group_id, site_id) values ('3', '1', '1')";
  1807. $Q[] = "insert into exp_category_posts (entry_id, cat_id) values ('1', '1')";
  1808. // Create a default weblog entry
  1809. $body = <<<PLOPP
  1810. Thank you for choosing ExpressionEngine! This entry contains helpful resources to help you <a href="http://expressionengine.com/docs/overview/get_most.html">get the most from ExpressionEngine</a> and the EllisLab Community.
  1811. [b]Technical Support:[/b]
  1812. All tech support is handled through our Community forums. Our staff and the community respond to issues in a timely manner. Please review the <a href="http://expressionengine.com/docs/overview/getting_help.html">Getting Help</a> section of the User Guide before posting in the forums.
  1813. [b]Learning resources:[/b]
  1814. <a href="http://expressionengine.com/docs/overview/">Getting Started Guide</a>
  1815. <a href="http://expressionengine.com/docs/quick_start/">Quick Start Tutorial</a>
  1816. <a href="http://expressionengine.com/tutorials/">Video Tutorials</a>
  1817. [b]Additional Support Resources:[/b]
  1818. <a href="http://expressionengine.com/docs/">ExpressionEngine User Guide</a>
  1819. <a href="http://expressionengine.com/knowledge_base/">Knowledge Base</a>
  1820. <a href="http://expressionengine.com/wiki/">ExpressionEngine Wiki</a>
  1821. If you need to hire a web developer consider our <a href="http://expressionengine.com/professionals/">Professionals Network</a>. You can also place an ad on our <a href="http://expressionengine.com/forums/viewforum/47/">Job Board</a> if you prefer that professionals find you.
  1822. Love ExpressionEngine? Help spread the word and make some spare change with our <a href="http://expressionengine.com/affiliates/">Affiliates program</a>.
  1823. See you on the boards,
  1824. [size=4]The EllisLab Team[/size]
  1825. PLOPP;
  1826. $Q[] = "insert into exp_weblog_titles (entry_id, weblog_id, author_id, ip_address, entry_date, edit_date, year, month, day, title, url_title, status, dst_enabled) values ('', '1', '1', '".$data['ip']."', '".$now."', '".date("YmdHis")."', '".$year."', '".$month."', '".$day."', 'Getting Started with ExpressionEngine', 'getting_started', 'open', '".$data['daylight_savings']."')";
  1827. $Q[] = "insert into exp_weblog_data (entry_id, weblog_id, field_id_2, field_ft_1, field_ft_2, field_ft_3) values ('1', '1', '".$DB->escape_str($body)."', 'xhtml', 'xhtml', 'xhtml')";
  1828. // Upload prefs
  1829. if (@realpath(str_replace('../', './', $data['image_path'])) !== FALSE)
  1830. {
  1831. $data['image_path'] = str_replace('../', './', $data['image_path']);
  1832. $data['image_path'] = str_replace("\\", "/", realpath($data['image_path'])).'/';
  1833. }
  1834. $props = "style=\"border: 0;\" alt=\"image\"";
  1835. $Q[] = "insert into exp_upload_prefs (id, name, server_path, url, allowed_types, properties) values ('', 'Main Upload Directory', '".$data['image_path'].$data['upload_folder']."', '".$data['site_url'].'images/'.$data['upload_folder']."', 'all', '$props')";
  1836. // Actions
  1837. // Comment module
  1838. $Q[] = "INSERT INTO exp_modules (module_id, module_name, module_version, has_cp_backend) VALUES ('', 'Comment', '1.2', 'n')";
  1839. $Q[] = "INSERT INTO exp_actions (action_id, class, method) VALUES ('', 'Comment', 'insert_new_comment')";
  1840. $Q[] = "INSERT INTO exp_actions (action_id, class, method) VALUES ('', 'Comment_CP', 'delete_comment_notification')";
  1841. // Emoticon module
  1842. $Q[] = "INSERT INTO exp_modules (module_id, module_name, module_version, has_cp_backend) VALUES ('', 'Emoticon', '1.0', 'n')";
  1843. // Mailing List module
  1844. $Q[] = "INSERT INTO exp_modules (module_id, module_name, module_version, has_cp_backend) VALUES ('', 'Mailinglist', '2.0', 'y')";
  1845. $Q[] = "INSERT INTO exp_actions (action_id, class, method) VALUES ('', 'Mailinglist', 'insert_new_email')";
  1846. $Q[] = "INSERT INTO exp_actions (action_id, class, method) VALUES ('', 'Mailinglist', 'authorize_email')";
  1847. $Q[] = "INSERT INTO exp_actions (action_id, class, method) VALUES ('', 'Mailinglist', 'unsubscribe')";
  1848. // Member module
  1849. $Q[] = "INSERT INTO exp_modules (module_id, module_name, module_version, has_cp_backend) VALUES ('', 'Member', '1.3', 'n')";
  1850. $Q[] = "INSERT INTO exp_actions (action_id, class, method) VALUES ('', 'Member', 'registration_form')";
  1851. $Q[] = "INSERT INTO exp_actions (action_id, class, method) VALUES ('', 'Member', 'register_member')";
  1852. $Q[] = "INSERT INTO exp_actions (action_id, class, method) VALUES ('', 'Member', 'activate_member')";
  1853. $Q[] = "INSERT INTO exp_actions (action_id, class, method) VALUES ('', 'Member', 'member_login')";
  1854. $Q[] = "INSERT INTO exp_actions (action_id, class, method) VALUES ('', 'Member', 'member_logout')";
  1855. $Q[] = "INSERT INTO exp_actions (action_id, class, method) VALUES ('', 'Member', 'retrieve_password')";
  1856. $Q[] = "INSERT INTO exp_actions (action_id, class, method) VALUES ('', 'Member', 'reset_password')";
  1857. $Q[] = "INSERT INTO exp_actions (action_id, class, method) VALUES ('', 'Member', 'send_member_email')";
  1858. $Q[] = "INSERT INTO exp_actions (action_id, class, method) VALUES ('', 'Member', 'update_un_pw')";
  1859. $Q[] = "INSERT INTO exp_actions (action_id, class, method) VALUES ('', 'Member', 'member_search')";
  1860. $Q[] = "INSERT INTO exp_actions (action_id, class, method) VALUES ('', 'Member', 'member_delete')";
  1861. // Query module
  1862. $Q[] = "INSERT INTO exp_modules (module_id, module_name, module_version, has_cp_backend) VALUES ('', 'Query', '1.0', 'n')";
  1863. // Referrer module
  1864. $Q[] = "INSERT INTO exp_modules (module_id, module_name, module_version, has_cp_backend) VALUES ('', 'Referrer', '1.3', 'y')";
  1865. // RSS module
  1866. $Q[] = "INSERT INTO exp_modules (module_id, module_name, module_version, has_cp_backend) VALUES ('', 'Rss', '1.0', 'n')";
  1867. // Stats module
  1868. $Q[] = "INSERT INTO exp_modules (module_id, module_name, module_version, has_cp_backend) VALUES ('', 'Stats', '1.0', 'n')";
  1869. // Trackback module
  1870. $Q[] = "INSERT INTO exp_modules (module_id, module_name, module_version, has_cp_backend) VALUES ('', 'Trackback', '1.1', 'n')";
  1871. $Q[] = "INSERT INTO exp_actions (action_id, class, method) VALUES ('', 'Trackback_CP', 'receive_trackback')";
  1872. // Weblog module
  1873. $Q[] = "INSERT INTO exp_modules (module_id, module_name, module_version, has_cp_backend) VALUES ('', 'Weblog', '1.2', 'n')";
  1874. $Q[] = "INSERT INTO exp_actions (action_id, class, method) VALUES ('', 'Weblog', 'insert_new_entry')";
  1875. // Search module
  1876. $Q[] = "INSERT INTO exp_modules (module_id, module_name, module_version, has_cp_backend) VALUES ('', 'Search', '1.2', 'n')";
  1877. $Q[] = "INSERT INTO exp_actions (action_id, class, method) VALUES ('', 'Search', 'do_search')";
  1878. // Email module
  1879. //$Q[] = "INSERT INTO exp_modules (module_id, module_name, module_version, has_cp_backend) VALUES ('', 'Email', '1.0', 'n')";
  1880. //$Q[] = "INSERT INTO exp_actions (action_id, class, method) VALUES ('', 'Email', 'send_email')";
  1881. // Create DB tables and insert data
  1882. // --------------------------------------------------------------------
  1883. // --------------------------------------------------------------------
  1884. foreach($D as $kill)
  1885. {
  1886. $DB->query('drop table if exists '.$kill);
  1887. }
  1888. foreach($Q as $sql)
  1889. {
  1890. if ($DB->query($sql) === FALSE)
  1891. {
  1892. foreach($D as $kill)
  1893. {
  1894. $DB->query('drop table if exists '.$kill);
  1895. }
  1896. //echo $sql; exit;
  1897. $er = "<div class='error'>Error: Unable to perform the SQL queries needed to install
  1898. this program. Please make sure your MySQL account has the proper GRANT privileges:
  1899. CREATE, DROP, ALTER, INSERT, and DELETE</div>";
  1900. settings_form($er);
  1901. page_footer();
  1902. exit;
  1903. }
  1904. }
  1905. // WRITE CONFIG FILE
  1906. // --------------------------------------------------------------------
  1907. // --------------------------------------------------------------------
  1908. $data['cp_url'] = rtrim($data['cp_url'], '/').'/';
  1909. $captcha_url = rtrim($data['site_url'], '/').'/';
  1910. $captcha_url .= 'images/captchas/';
  1911. if (@realpath(str_replace('../', './', $data['avatar_path'])) !== FALSE)
  1912. {
  1913. $data['avatar_path'] = str_replace('../', './', $data['avatar_path']);
  1914. $data['avatar_path'] = str_replace("\\", "/", realpath($data['avatar_path'])).'/';
  1915. }
  1916. if (@realpath(str_replace('../', './', $data['photo_path'])) !== FALSE)
  1917. {
  1918. $data['photo_path'] = str_replace('../', './', $data['photo_path']);
  1919. $data['photo_path'] = str_replace("\\", "/", realpath($data['photo_path'])).'/';
  1920. }
  1921. if (@realpath(str_replace('../', './', $data['signature_img_path'])) !== FALSE)
  1922. {
  1923. $data['signature_img_path'] = str_replace('../', './', $data['signature_img_path']);
  1924. $data['signature_img_path'] = str_replace("\\", "/", realpath($data['signature_img_path'])).'/';
  1925. }
  1926. if (@realpath(str_replace('../', './', $data['pm_path'])) !== FALSE)
  1927. {
  1928. $data['pm_path'] = str_replace('../', './', $data['pm_path']);
  1929. $data['pm_path'] = str_replace("\\", "/", realpath($data['pm_path'])).'/';
  1930. }
  1931. if (@realpath(str_replace('../', './', $data['captcha_path'])) !== FALSE)
  1932. {
  1933. $data['captcha_path'] = str_replace('../', './', $data['captcha_path']);
  1934. $data['captcha_path'] = str_replace("\\", "/", realpath($data['captcha_path'])).'/';
  1935. }
  1936. if (@realpath(str_replace('../', './', $data['theme_folder_path'])) !== FALSE)
  1937. {
  1938. $data['theme_folder_path'] = str_replace('../', './', $data['theme_folder_path']);
  1939. $data['theme_folder_path'] = str_replace("\\", "/", realpath($data['theme_folder_path'])).'/';
  1940. }
  1941. $config = array(
  1942. 'app_version' => $data['app_version'],
  1943. 'license_number' => '',
  1944. 'debug' => '1',
  1945. 'install_lock' => '1',
  1946. 'db_hostname' => $data['db_hostname'],
  1947. 'db_username' => $data['db_username'],
  1948. 'db_password' => $data['db_password'],
  1949. 'db_name' => $data['db_name'],
  1950. 'db_type' => $data['database'],
  1951. 'db_prefix' => ($data['db_prefix'] != '') ? $data['db_prefix'] : 'exp',
  1952. 'db_conntype' => $data['db_conntype'],
  1953. 'encryption_type' => $data['encryption_type'],
  1954. 'system_folder' => $data['system_dir'],
  1955. 'cp_url' => $data['cp_url'].$data['cp_index'],
  1956. 'site_index' => $data['site_index'],
  1957. 'site_name' => $data['site_name'],
  1958. 'site_url' => $data['site_url'],
  1959. 'theme_folder_url' => $data['site_url'].'themes/',
  1960. 'doc_url' => $data['doc_url'],
  1961. 'webmaster_email' => $data['webmaster_email'],
  1962. 'webmaster_name' => '',
  1963. 'weblog_nomenclature' => 'weblog',
  1964. 'max_caches' => '150',
  1965. 'captcha_url' => $captcha_url,
  1966. 'captcha_path' => $data['captcha_path'],
  1967. 'captcha_font' => 'y',
  1968. 'captcha_rand' => 'y',
  1969. 'captcha_require_members' => 'n',
  1970. 'enable_db_caching' => 'y',
  1971. 'enable_sql_caching' => 'n',
  1972. 'force_query_string' => 'n',
  1973. 'show_queries' => 'n',
  1974. 'template_debugging' => 'n',
  1975. 'include_seconds' => 'n',
  1976. 'cookie_domain' => '',
  1977. 'cookie_path' => '',
  1978. 'cookie_prefix' => '',
  1979. 'user_session_type' => 'c',
  1980. 'admin_session_type' => 'cs',
  1981. 'allow_username_change' => 'y',
  1982. 'allow_multi_logins' => 'y',
  1983. 'password_lockout' => 'y',
  1984. 'password_lockout_interval' => '1',
  1985. 'require_ip_for_login' => 'y',
  1986. 'require_ip_for_posting' => 'y',
  1987. 'allow_multi_emails' => 'n',
  1988. 'require_secure_passwords' => 'n',
  1989. 'allow_dictionary_pw' => 'y',
  1990. 'name_of_dictionary_file' => '',
  1991. 'xss_clean_uploads' => 'y',
  1992. 'redirect_method' => $data['redirect_method'],
  1993. 'deft_lang' => $data['deft_lang'],
  1994. 'xml_lang' => 'en',
  1995. 'charset' => 'utf-8',
  1996. 'send_headers' => 'y',
  1997. 'gzip_output' => 'n',
  1998. 'log_referrers' => 'y',
  1999. 'max_referrers' => '500',
  2000. 'is_system_on' => 'y',
  2001. 'time_format' => 'us',
  2002. 'server_timezone' => $data['server_timezone'],
  2003. 'server_offset' => '',
  2004. 'daylight_savings' => $data['daylight_savings'],
  2005. 'default_site_timezone' => $data['server_timezone'],
  2006. 'default_site_dst' => $data['daylight_savings'],
  2007. 'honor_entry_dst' => 'y',
  2008. 'mail_protocol' => 'mail',
  2009. 'smtp_server' => '',
  2010. 'smtp_username' => '',
  2011. 'smtp_password' => '',
  2012. 'email_debug' => 'n',
  2013. 'email_charset' => 'utf-8',
  2014. 'email_batchmode' => 'n',
  2015. 'email_batch_size' => '',
  2016. 'mail_format' => 'plain',
  2017. 'word_wrap' => 'y',
  2018. 'email_console_timelock' => '5',
  2019. 'log_email_console_msgs' => 'y',
  2020. 'cp_theme' => 'default',
  2021. 'email_module_captchas' => 'n',
  2022. 'log_search_terms' => 'y',
  2023. 'un_min_len' => '4',
  2024. 'pw_min_len' => '5',
  2025. 'allow_member_registration' => 'y',
  2026. 'allow_member_localization' => 'y',
  2027. 'req_mbr_activation' => 'email',
  2028. 'new_member_notification' => 'n',
  2029. 'mbr_notification_emails' => '',
  2030. 'require_terms_of_service' => 'y',
  2031. 'use_membership_captcha' => 'n',
  2032. 'default_member_group' => '5',
  2033. 'profile_trigger' => 'member',
  2034. 'member_theme' => 'default',
  2035. 'enable_avatars' => 'y',
  2036. 'allow_avatar_uploads' => 'n',
  2037. 'avatar_url' => $data['site_url'].$data['avatar_url'],
  2038. 'avatar_path' => $data['avatar_path'],
  2039. 'avatar_max_width' => '100',
  2040. 'avatar_max_height' => '100',
  2041. 'avatar_max_kb' => '50',
  2042. 'enable_photos' => 'n',
  2043. 'photo_url' => $data['site_url'].$data['photo_url'],
  2044. 'photo_path' => $data['photo_path'],
  2045. 'photo_max_width' => '100',
  2046. 'photo_max_height' => '100',
  2047. 'photo_max_kb' => '50',
  2048. 'allow_signatures' => 'y',
  2049. 'sig_maxlength' => '500',
  2050. 'sig_allow_img_hotlink' => 'n',
  2051. 'sig_allow_img_upload' => 'n',
  2052. 'sig_img_url' => $data['site_url'].$data['signature_img_url'],
  2053. 'sig_img_path' => $data['signature_img_path'],
  2054. 'sig_img_max_width' => '480',
  2055. 'sig_img_max_height' => '80',
  2056. 'sig_img_max_kb' => '30',
  2057. 'prv_msg_upload_path' => $data['pm_path'],
  2058. 'prv_msg_max_attachments' => '3',
  2059. 'prv_msg_attach_maxsize' => '250',
  2060. 'prv_msg_attach_total' => '100',
  2061. 'prv_msg_html_format' => 'safe',
  2062. 'prv_msg_auto_links' => 'y',
  2063. 'prv_msg_max_chars' => '6000',
  2064. 'strict_urls' => 'n',
  2065. 'site_404' => '',
  2066. 'save_tmpl_revisions' => 'n',
  2067. 'max_tmpl_revisions' => '5',
  2068. 'save_tmpl_files' => 'n',
  2069. 'tmpl_file_basepath' => '',
  2070. 'secure_forms' => 'y',
  2071. 'deny_duplicate_data' => 'y',
  2072. 'redirect_submitted_links' => 'n',
  2073. 'enable_censoring' => 'n',
  2074. 'censored_words' => '',
  2075. 'censor_replacement' => '',
  2076. 'banned_ips' => '',
  2077. 'banned_emails' => '',
  2078. 'banned_usernames' => '',
  2079. 'banned_screen_names' => '',
  2080. 'ban_action' => 'restrict',
  2081. 'ban_message' => 'This site is currently unavailable',
  2082. 'ban_destination' => 'http://www.yahoo.com/',
  2083. 'enable_emoticons' => 'y',
  2084. 'emoticon_path' => $data['site_url'].'images/smileys/',
  2085. 'recount_batch_total' => '1000',
  2086. 'enable_image_resizing' => 'y',
  2087. 'image_resize_protocol' => 'gd2',
  2088. 'image_library_path' => '',
  2089. 'thumbnail_prefix' => 'thumb',
  2090. 'word_separator' => 'underscore',
  2091. 'use_category_name' => 'n',
  2092. 'reserved_category_word' => 'category',
  2093. 'auto_convert_high_ascii' => 'n',
  2094. 'new_posts_clear_caches' => 'y',
  2095. 'auto_assign_cat_parents' => 'y',
  2096. 'remap_pm_urls' => 'n',
  2097. 'remap_pm_dest' => '',
  2098. 'new_version_check' => 'y',
  2099. 'publish_tab_behavior' => 'hover',
  2100. 'sites_tab_behavior' => 'hover',
  2101. 'enable_throttling' => 'n',
  2102. 'banish_masked_ips' => 'y',
  2103. 'max_page_loads' => '10',
  2104. 'time_interval' => '8',
  2105. 'lockout_time' => '30',
  2106. 'banishment_type' => 'message',
  2107. 'banishment_url' => '',
  2108. 'banishment_message' => 'You have exceeded the allowed page load frequency.',
  2109. 'enable_search_log' => 'y',
  2110. 'max_logged_searches' => '500',
  2111. 'allow_extensions' => 'n',
  2112. 'mailinglist_enabled' => 'y',
  2113. 'mailinglist_notify' => 'n',
  2114. 'mailinglist_notify_emails' => '',
  2115. 'memberlist_order_by' => "total_posts",
  2116. 'memberlist_sort_order' => "desc",
  2117. 'memberlist_row_limit' => "20",
  2118. 'is_site_on' => 'y',
  2119. 'multiple_sites_enabled' => "n",
  2120. 'theme_folder_path' => $data['theme_folder_path'],
  2121. );
  2122. // --------------------------------------------------------------------
  2123. // Writes Sites Database
  2124. // --------------------------------------------------------------------
  2125. /** ---------------------------------------
  2126. /** Default Administration Prefs
  2127. /** ---------------------------------------*/
  2128. $admin_default = array( 'encryption_type',
  2129. 'site_index',
  2130. 'site_name',
  2131. 'site_url',
  2132. 'theme_folder_url',
  2133. 'webmaster_email',
  2134. 'webmaster_name',
  2135. 'weblog_nomenclature',
  2136. 'max_caches',
  2137. 'captcha_url',
  2138. 'captcha_path',
  2139. 'captcha_font',
  2140. 'captcha_rand',
  2141. 'captcha_require_members',
  2142. 'enable_db_caching',
  2143. 'enable_sql_caching',
  2144. 'force_query_string',
  2145. 'show_queries',
  2146. 'template_debugging',
  2147. 'include_seconds',
  2148. 'cookie_domain',
  2149. 'cookie_path',
  2150. 'user_session_type',
  2151. 'admin_session_type',
  2152. 'allow_username_change',
  2153. 'allow_multi_logins',
  2154. 'password_lockout',
  2155. 'password_lockout_interval',
  2156. 'require_ip_for_login',
  2157. 'require_ip_for_posting',
  2158. 'allow_multi_emails',
  2159. 'require_secure_passwords',
  2160. 'allow_dictionary_pw',
  2161. 'name_of_dictionary_file',
  2162. 'xss_clean_uploads',
  2163. 'redirect_method',
  2164. 'deft_lang',
  2165. 'xml_lang',
  2166. 'charset',
  2167. 'send_headers',
  2168. 'gzip_output',
  2169. 'log_referrers',
  2170. 'max_referrers',
  2171. 'time_format',
  2172. 'server_timezone',
  2173. 'server_offset',
  2174. 'daylight_savings',
  2175. 'default_site_timezone',
  2176. 'default_site_dst',
  2177. 'honor_entry_dst',
  2178. 'mail_protocol',
  2179. 'smtp_server',
  2180. 'smtp_username',
  2181. 'smtp_password',
  2182. 'email_debug',
  2183. 'email_charset',
  2184. 'email_batchmode',
  2185. 'email_batch_size',
  2186. 'mail_format',
  2187. 'word_wrap',
  2188. 'email_console_timelock',
  2189. 'log_email_console_msgs',
  2190. 'cp_theme',
  2191. 'email_module_captchas',
  2192. 'log_search_terms',
  2193. 'secure_forms',
  2194. 'deny_duplicate_data',
  2195. 'redirect_submitted_links',
  2196. 'enable_censoring',
  2197. 'censored_words',
  2198. 'censor_replacement',
  2199. 'banned_ips',
  2200. 'banned_emails',
  2201. 'banned_usernames',
  2202. 'banned_screen_names',
  2203. 'ban_action',
  2204. 'ban_message',
  2205. 'ban_destination',
  2206. 'enable_emoticons',
  2207. 'emoticon_path',
  2208. 'recount_batch_total',
  2209. 'remap_pm_urls', // Get out of Weblog Prefs
  2210. 'remap_pm_dest', // Get out of Weblog Prefs
  2211. 'new_version_check',
  2212. 'publish_tab_behavior',
  2213. 'sites_tab_behavior',
  2214. 'enable_throttling',
  2215. 'banish_masked_ips',
  2216. 'max_page_loads',
  2217. 'time_interval',
  2218. 'lockout_time',
  2219. 'banishment_type',
  2220. 'banishment_url',
  2221. 'banishment_message',
  2222. 'enable_search_log',
  2223. 'max_logged_searches',
  2224. 'theme_folder_path',
  2225. 'is_site_on');
  2226. $site_prefs = array();
  2227. foreach($admin_default as $value)
  2228. {
  2229. $site_prefs[$value] = str_replace('\\', '\\\\', $config[$value]);
  2230. }
  2231. $DB->query($DB->update_string('exp_sites', array('site_system_preferences' => addslashes(serialize($site_prefs))), "site_id = 1"));
  2232. /** ---------------------------------------
  2233. /** Default Mailinglists Prefs
  2234. /** ---------------------------------------*/
  2235. $mailinglist_default = array('mailinglist_enabled', 'mailinglist_notify', 'mailinglist_notify_emails');
  2236. $site_prefs = array();
  2237. foreach($mailinglist_default as $value)
  2238. {
  2239. $site_prefs[$value] = str_replace('\\', '\\\\', $config[$value]);
  2240. }
  2241. $DB->query($DB->update_string('exp_sites', array('site_mailinglist_preferences' => addslashes(serialize($site_prefs))), "site_id = 1"));
  2242. /** ---------------------------------------
  2243. /** Default Members Prefs
  2244. /** ---------------------------------------*/
  2245. $member_default = array('un_min_len',
  2246. 'pw_min_len',
  2247. 'allow_member_registration',
  2248. 'allow_member_localization',
  2249. 'req_mbr_activation',
  2250. 'new_member_notification',
  2251. 'mbr_notification_emails',
  2252. 'require_terms_of_service',
  2253. 'use_membership_captcha',
  2254. 'default_member_group',
  2255. 'profile_trigger',
  2256. 'member_theme',
  2257. 'enable_avatars',
  2258. 'allow_avatar_uploads',
  2259. 'avatar_url',
  2260. 'avatar_path',
  2261. 'avatar_max_width',
  2262. 'avatar_max_height',
  2263. 'avatar_max_kb',
  2264. 'enable_photos',
  2265. 'photo_url',
  2266. 'photo_path',
  2267. 'photo_max_width',
  2268. 'photo_max_height',
  2269. 'photo_max_kb',
  2270. 'allow_signatures',
  2271. 'sig_maxlength',
  2272. 'sig_allow_img_hotlink',
  2273. 'sig_allow_img_upload',
  2274. 'sig_img_url',
  2275. 'sig_img_path',
  2276. 'sig_img_max_width',
  2277. 'sig_img_max_height',
  2278. 'sig_img_max_kb',
  2279. 'prv_msg_upload_path',
  2280. 'prv_msg_max_attachments',
  2281. 'prv_msg_attach_maxsize',
  2282. 'prv_msg_attach_total',
  2283. 'prv_msg_html_format',
  2284. 'prv_msg_auto_links',
  2285. 'prv_msg_max_chars',
  2286. 'memberlist_order_by',
  2287. 'memberlist_sort_order',
  2288. 'memberlist_row_limit');
  2289. $site_prefs = array();
  2290. foreach($member_default as $value)
  2291. {
  2292. $site_prefs[$value] = str_replace('\\', '\\\\', $config[$value]);
  2293. }
  2294. $DB->query($DB->update_string('exp_sites', array('site_member_preferences' => addslashes(serialize($site_prefs))), "site_id = 1"));
  2295. /** ---------------------------------------
  2296. /** Default Templates Prefs
  2297. /** ---------------------------------------*/
  2298. $template_default = array('strict_urls',
  2299. 'site_404',
  2300. 'save_tmpl_revisions',
  2301. 'max_tmpl_revisions',
  2302. 'save_tmpl_files',
  2303. 'tmpl_file_basepath');
  2304. $site_prefs = array();
  2305. foreach($template_default as $value)
  2306. {
  2307. $site_prefs[$value] = str_replace('\\', '\\\\', $config[$value]);
  2308. }
  2309. $DB->query($DB->update_string('exp_sites', array('site_template_preferences' => addslashes(serialize($site_prefs))), "site_id = 1"));
  2310. /** ---------------------------------------
  2311. /** Default Weblogs Prefs
  2312. /** ---------------------------------------*/
  2313. $weblog_default = array('enable_image_resizing',
  2314. 'image_resize_protocol',
  2315. 'image_library_path',
  2316. 'thumbnail_prefix',
  2317. 'word_separator',
  2318. 'use_category_name',
  2319. 'reserved_category_word',
  2320. 'auto_convert_high_ascii',
  2321. 'new_posts_clear_caches',
  2322. 'auto_assign_cat_parents');
  2323. $site_prefs = array();
  2324. foreach($weblog_default as $value)
  2325. {
  2326. $site_prefs[$value] = str_replace('\\', '\\\\', $config[$value]);
  2327. }
  2328. $DB->query($DB->update_string('exp_sites', array('site_weblog_preferences' => addslashes(serialize($site_prefs))), "site_id = 1"));
  2329. /** ---------------------------------------
  2330. /** Remove Site Prefs from Config
  2331. /** ---------------------------------------*/
  2332. foreach(array_merge($admin_default, $mailinglist_default, $member_default, $template_default, $weblog_default) as $value)
  2333. {
  2334. unset($config[$value]);
  2335. }
  2336. // --------------------------------------------------------------------
  2337. // Write config file
  2338. // --------------------------------------------------------------------
  2339. $conf = '<?php';
  2340. $conf .= "\n\nif ( ! defined('EXT')){\nexit('Invalid file request');\n}\n\n";
  2341. foreach ($config as $key => $val)
  2342. {
  2343. $val = str_replace('\\', '\\\\', $val);
  2344. $val = str_replace("'", "\\'", $val);
  2345. $val = str_replace("\"", "\\\"", $val);
  2346. $conf .= "\$conf['".$key."'] = \"".$val."\";\n";
  2347. }
  2348. $conf .= '?'.'>';
  2349. $cfile = './'.$data['system_dir'].'/config.php';
  2350. if ( ! $fp = @fopen($cfile, 'wb'))
  2351. {
  2352. echo "<div class='error'>Error: unable to write the config file.</div>";
  2353. page_footer();
  2354. exit;
  2355. }
  2356. fwrite($fp, $conf, strlen($conf));
  2357. fclose($fp);
  2358. $cbfile = './'.$data['system_dir'].'/config_bak.php';
  2359. if ($fp = @fopen($cbfile, 'wb'))
  2360. {
  2361. fwrite($fp, $conf, strlen($conf));
  2362. fclose($fp);
  2363. }
  2364. // Write the path.php file
  2365. // --------------------------------------------------------------------
  2366. // --------------------------------------------------------------------
  2367. $path = "<?php\n\n";
  2368. $path .= '// ------------------------------------------------------'."\n";
  2369. $path .= '// DO NOT ALTER THIS FILE UNLESS YOU HAVE A REASON TO'."\n\n";
  2370. $path .= '// ------------------------------------------------------'."\n";
  2371. $path .= '// Path to the directory containing your backend files'."\n\n";
  2372. $path .= '$system_path = "./'.$data['system_dir'].'/"'.";\n\n";
  2373. $path .= '// ------------------------------------------------------'."\n";
  2374. $path .= '// MANUALLY CONFIGURABLE VARIABLES'."\n";
  2375. $path .= '// See user guide for more information'."\n";
  2376. $path .= '// ------------------------------------------------------'."\n\n";
  2377. $path .= '$template_group = "";'."\n";
  2378. $path .= '$template = "";'."\n";
  2379. $path .= '$site_url = "";'."\n";
  2380. $path .= '$site_index = "";'."\n";
  2381. $path .= '$site_404 = "";'."\n";
  2382. $path .= '$global_vars = array(); // This array must be associative'."\n\n";
  2383. $path .= '?'.'>';
  2384. if ( ! $fp = @fopen('path.php', 'wb'))
  2385. {
  2386. echo "<div class='error'>Error: unable to write the path.php file.</div>";
  2387. page_footer();
  2388. exit;
  2389. }
  2390. fwrite($fp, $path);
  2391. fclose($fp);
  2392. @chmod('path.php', 0644);
  2393. // Create cache directories
  2394. // --------------------------------------------------------------------
  2395. // --------------------------------------------------------------------
  2396. $cache_path = './'.$data['system_dir'].'/cache/';
  2397. $cache_dirs = array('db_cache', 'page_cache', 'tag_cache', 'sql_cache');
  2398. $errors = array();
  2399. foreach ($cache_dirs as $dir)
  2400. {
  2401. if ( ! @is_dir($cache_path.$dir))
  2402. {
  2403. if ( ! @mkdir($cache_path.$dir, 0777))
  2404. {
  2405. $errors[] = $dir;
  2406. continue;
  2407. }
  2408. @chmod($cache_path.$dir, 0777);
  2409. }
  2410. }
  2411. // Show "success" page
  2412. // --------------------------------------------------------------------
  2413. // --------------------------------------------------------------------
  2414. ?>
  2415. <div id='innercontent'>
  2416. <h3>ExpressionEngine has been successfully installed!</h3>
  2417. <?php
  2418. if (count($errors) > 0)
  2419. {
  2420. ?>
  2421. <p><span class="red">Please Note: There was a problem creating your caching directories. This is not a critical problem, but you may be unable to use the caching feature.</span></p>
  2422. <?php
  2423. }
  2424. ?>
  2425. <div class="border"><p><span class="red"><b>Important:</b>&nbsp; Using your FTP program, please delete the file called <b>install.php</b> from your server.<br />Leaving it on your server presents a security risk.</span></p></div>
  2426. <p><br /><b>Please bookmark these two links:</b></p>
  2427. <p><a href='./<?php echo $data['system_dir']; ?>/index.php' target="_blank">Click here to access your control panel</a></p>
  2428. <p><a href='<?php echo $data['site_url'].$data['site_index']; ?>' target="_blank">Click here to view your site</a></p>
  2429. <p><br />We hope you enjoy ExpressionEngine!</p>
  2430. </div>
  2431. <?php
  2432. }
  2433. // PAGE SIX
  2434. // --------------------------------------------------------------------
  2435. // Pages 6 and 7 are for aborted installations due to accidentally
  2436. // overwritten config.php files
  2437. // --------------------------------------------------------------------
  2438. elseif ($page == 6)
  2439. {
  2440. // this is the landing page for an aborted installation after the installer
  2441. // detected existing ExpressionEngine tables
  2442. $offer_update = FALSE;
  2443. if ($data['system_dir'] != '' AND @is_dir('./'.trim($data['system_dir'])))
  2444. {
  2445. $system_path = './'.trim($data['system_dir']).'/';
  2446. if (@file_exists($system_path.'config_bak'.$data['ext']))
  2447. {
  2448. require_once($system_path.'config_bak'.$data['ext']);
  2449. $ver = isset($conf['app_version']) ? $conf['app_version'] : NULL;
  2450. if ($ver >= 160)
  2451. {
  2452. // config_bak.php looks ok, and is for 160+ so it should be safe
  2453. // to allow them to proceed to the update script if they want,
  2454. // after using the backup to rebuild their config.php file.
  2455. $offer_update = TRUE;
  2456. }
  2457. }
  2458. }
  2459. ?>
  2460. <div id='innercontent'>
  2461. <div class="error">Existing Installation Detected, Empty config.php File</div>
  2462. <p>Your configuration file is empty, or incomplete, but ExpressionEngine tables exist in your database
  2463. from an existing installation. It may be that you inadvertently overwrote your config.php file
  2464. when uploading files to your server intending to perform an update.</p>
  2465. <?php if ($offer_update == TRUE)
  2466. {
  2467. ?>
  2468. <p>If you intended to update your site, we can rebuild your config.php from what appears to be a
  2469. recent copy (config_bak.php). If you would like us to do so and then proceed with the update, please read the
  2470. <a href="http://expressionengine.com/docs/installation/update.html">update instructions</a> carefully,
  2471. and then click the Update button at the bottom of this page to proceed.
  2472. </p>
  2473. <p>If you do not wish us to use the backup configuration file for the update, and would like to restore
  2474. the config.php file on your own, please do so at this time, and then proceed with the update instructions
  2475. linked above.
  2476. </p>
  2477. <form action="install.php?page=7" method="post">
  2478. <input type="hidden" name="system_dir" value="<?php echo addslashes($data['system_dir']); ?>" />
  2479. <input type="hidden" name="rebuild_config" value="y" />
  2480. <p><input type="submit" value="Update my installation"></p>
  2481. </form>
  2482. <?php
  2483. }
  2484. else
  2485. {
  2486. ?>
  2487. <p>If you intended to update your site, you will need to restore your config.php file. If you
  2488. do not have a backup, check to see if your config_bak.php file is also empty. If it did not
  2489. get overwritten as well, then you can use the contents of that file to restore your config.php file.</p>
  2490. <p>After restoring your config.php file, please follow the
  2491. <a href="http://expressionengine.com/docs/installation/update.html">update instructions</a> carefully.</p>
  2492. <?php
  2493. }
  2494. }
  2495. // PAGE SEVEN
  2496. // --------------------------------------------------------------------
  2497. // Pages 6 and 7 are for aborted installations due to accidentally
  2498. // overwritten config.php files
  2499. // --------------------------------------------------------------------
  2500. elseif ($page == 7)
  2501. {
  2502. // this page rebuilds the config.php file from the config_bak.php file
  2503. // and redirects to the update script
  2504. $offer_update = FALSE;
  2505. if ($data['system_dir'] != '' AND is_dir('./'.trim($data['system_dir'])) AND isset($_POST['rebuild_config']))
  2506. {
  2507. $system_path = './'.trim($data['system_dir']).'/';
  2508. if (@file_exists($system_path.'config_bak'.$data['ext']))
  2509. {
  2510. require_once($system_path.'config_bak'.$data['ext']);
  2511. $ver = isset($conf['app_version']) ? $conf['app_version'] : NULL;
  2512. if ($ver >= 160 AND ($fp = @fopen($system_path.'config'.$data['ext'], 'wb')))
  2513. {
  2514. // config_bak.php looks ok, and is for 160+ so it should be safe
  2515. // to allow them to proceed to the update script if they want,
  2516. // after using the backup to rebuild their config.php file.
  2517. $offer_update = TRUE;
  2518. }
  2519. }
  2520. }
  2521. ?>
  2522. <div id='innercontent'>
  2523. <div class="error">Configuration File Rebuild</div>
  2524. <?php
  2525. if ($offer_update == FALSE)
  2526. {
  2527. ?>
  2528. <p><b>We're sorry but we are unable to perform this task. Please refer to the User Guide
  2529. instructions for assistance:</b><br /><br />
  2530. <a href="http://expressionengine.com/docs/installation/installation.html">Installation Instructions</a><br /><br />
  2531. <a href="http://expressionengine.com/docs/installation/update.html">Updating to the latest <em>Version</em></a><br /><br />
  2532. <a href="http://expressionengine.com/docs/installation/update_build.html">Updating to the latest <em>Build</em>
  2533. </p>
  2534. <?php
  2535. }
  2536. else
  2537. {
  2538. /** -----------------------------------------
  2539. /** Write config file as a string
  2540. /** -----------------------------------------*/
  2541. $new = "<?php\n\n";
  2542. $new .= "if ( ! defined('EXT')){\nexit('Invalid file request');\n}\n\n";
  2543. foreach ($conf as $key => $val)
  2544. {
  2545. $val = str_replace("\\\"", "\"", $val);
  2546. $val = str_replace("\\'", "'", $val);
  2547. $val = str_replace('\\\\', '\\', $val);
  2548. $val = str_replace('\\', '\\\\', $val);
  2549. $val = str_replace("'", "\\'", $val);
  2550. $val = str_replace("\"", "\\\"", $val);
  2551. $new .= "\$conf['".$key."'] = \"".$val."\";\n";
  2552. }
  2553. $new .= '?'.'>';
  2554. /** -----------------------------------------
  2555. /** Write config file
  2556. /** -----------------------------------------*/
  2557. flock($fp, LOCK_EX);
  2558. fwrite($fp, $new, strlen($new));
  2559. flock($fp, LOCK_UN);
  2560. fclose($fp);
  2561. ?>
  2562. <p>Configuration file rebuilt from backup!</p>
  2563. <p>Click this link to proceed to the <a href="<?php echo $data['system_dir']; ?>/update.php">update script</a>.</p>
  2564. </div>
  2565. <?php
  2566. }
  2567. }
  2568. // END PAGES
  2569. // --------------------------------------------------------------------
  2570. // --------------------------------------------------------------------
  2571. // System folder form
  2572. // --------------------------------------------------------------------
  2573. // --------------------------------------------------------------------
  2574. function system_folder_form()
  2575. {
  2576. global $data;
  2577. $dir = ( ! isset($data['system_dir'])) ? 'system' : $data['system_dir'];
  2578. ?>
  2579. <div id='innercontent'>
  2580. <h1>ExpressionEngine Installation Wizard</h1>
  2581. <h2>Name of your "system" folder</h2>
  2582. <p>As a security precaution you may have renamed the "<b>system</b>" folder, as indicated in the installation instructions.</p>
  2583. <p>If you have renamed it, please indicate the new name here. Otherwise, leave it as "system"</p>
  2584. <p>
  2585. <form method='post' action='install.php?page=4'>
  2586. <input type="hidden" name="nothing" value="0" />
  2587. <input type='text' name='system_dir' value='<?php echo $dir; ?>' size='20' class='input'>
  2588. </p>
  2589. <p>
  2590. <input type='submit' value='Submit' class='submit'>
  2591. </p>
  2592. </form>
  2593. </p>
  2594. </div>
  2595. <?php
  2596. }
  2597. // Database Settings form
  2598. // --------------------------------------------------------------------
  2599. // --------------------------------------------------------------------
  2600. function settings_form($errors = '')
  2601. {
  2602. global $_SERVER, $data;
  2603. $pathinfo = pathinfo(__FILE__);
  2604. $self = $pathinfo['basename'];
  2605. $host = ( ! isset($_SERVER['HTTP_HOST'])) ? '' : $_SERVER['HTTP_HOST'];
  2606. $phpself = ( ! isset($_SERVER['PHP_SELF'])) ? '' : htmlentities($_SERVER['PHP_SELF']);
  2607. $path = "http://" . $host.$phpself;
  2608. $path = substr($path, 0, - strlen($self));
  2609. $dir = ($data['system_dir'] == '') ? 'system' : $data['system_dir'];
  2610. $cp_url = ($data['cp_url'] == '') ? $path.$dir.'/' : $data['cp_url'];
  2611. $site_url = ($data['site_url'] == '' OR $data['site_url'] == '/') ? $path : $data['site_url'];
  2612. $site_index = ($data['site_index'] == '') ? 'index.php' : $data['site_index'];
  2613. $db_hostname = ($data['db_hostname'] == '') ? 'localhost' : stripslashes($data['db_hostname']);
  2614. $db_username = ($data['db_username'] == '') ? '' : stripslashes($data['db_username']);
  2615. $db_password = ($data['db_password'] == '') ? '' : stripslashes($data['db_password']);
  2616. $db_name = ($data['db_name'] == '') ? '' : stripslashes($data['db_name']);
  2617. $db_prefix = ($data['db_prefix'] == '') ? 'exp' : stripslashes($data['db_prefix'] );
  2618. $db_conntype = ($data['db_conntype'] == '') ? '0' : stripslashes($data['db_conntype'] );
  2619. $username = ($data['username'] == '') ? '' : stripslashes($data['username']);
  2620. $password = ($data['password'] == '') ? '' : stripslashes($data['password']);
  2621. $email = ($data['email'] == '') ? '' : stripslashes($data['email']);
  2622. $screen_name = ($data['screen_name'] == '') ? '' : stripslashes($data['screen_name']);
  2623. $redirect_method = ($data['redirect_method'] == '') ? '' : stripslashes($data['redirect_method']);
  2624. $daylight_savings = ($data['daylight_savings'] == '') ? '' : stripslashes($data['daylight_savings']);
  2625. $webmaster_email = ($data['webmaster_email'] == '') ? '' : stripslashes($data['webmaster_email']);
  2626. $template = ($data['template'] == '') ? '01' : stripslashes($data['template']);
  2627. $site_name = ($data['site_name'] == '') ? '' : stripslashes($data['site_name']);
  2628. $deft_lang = ($data['deft_lang'] == '') ? 'english' : stripslashes($data['deft_lang']);
  2629. $timezone = ($data['server_timezone'] == '') ? 'UTC' : $data['server_timezone'];
  2630. $encryption_type = ($data['encryption_type'] == '') ? 'sha1' : stripslashes($data['encryption_type']);
  2631. if ($redirect_method == '' || $redirect_method == 'redirect')
  2632. {
  2633. $redirect = 'checked="checked"';
  2634. $refresh = '';
  2635. }
  2636. else
  2637. {
  2638. $refresh = 'checked="checked"';
  2639. $redirect = '';
  2640. }
  2641. if ($db_conntype == 1)
  2642. {
  2643. $persistent = 'checked="checked"';
  2644. $nonpersistent = '';
  2645. }
  2646. else
  2647. {
  2648. $persistent = '';
  2649. $nonpersistent = 'checked="checked"';
  2650. }
  2651. if ($daylight_savings == 'y')
  2652. {
  2653. $dst1 = 'checked="checked"';
  2654. $dst2 = '';
  2655. }
  2656. else
  2657. {
  2658. $dst2 = 'checked="checked"';
  2659. $dst1 = '';
  2660. }
  2661. if ($encryption_type == '' || $encryption_type == 'sha1')
  2662. {
  2663. $sha1 = 'checked="checked"';
  2664. $md5 = '';
  2665. }
  2666. else
  2667. {
  2668. $md5 = 'checked="checked"';
  2669. $sha1 = '';
  2670. }
  2671. ?>
  2672. <div id='innercontent'>
  2673. <h1>ExpressionEngine Installation Wizard</h1>
  2674. <?php
  2675. if ($errors != '')
  2676. {
  2677. echo $errors;
  2678. }
  2679. else
  2680. {
  2681. echo "<h2>Enter Your Settings</h2>";
  2682. }
  2683. ?>
  2684. <p><span class="red"><b>Note: </b> If you are not sure what any of these settings should be, please contact your hosting provider and ask them.</span></p>
  2685. <form method='post' action='install.php?page=5'>
  2686. <input type='hidden' name='system_dir' value='<?php echo $dir; ?>'>
  2687. <div class="shade">
  2688. <div class="settingHead">Server Settings</div>
  2689. <h5>Name of the index page of your ExpressionEngine site</h5>
  2690. <p>Unless you renamed the file, it will be called <b>index.php</b></p>
  2691. <p><input type='text' name='site_index' value='<?php echo $site_index; ?>' size='40' class='input'></p>
  2692. <h5>URL to the directory where the above index page is located</h5>
  2693. <p>Typically this will be the root of your site (http://www.yourdomain.com/)
  2694. <br />Do not include the index page in the URL</p>
  2695. <p><input type='text' name='site_url' value='<?php echo $site_url; ?>' size='60' class='input'></p>
  2696. <h5>URL to your "<?php echo $dir; ?>" directory</h5>
  2697. <p><input type='text' name='cp_url' value='<?php echo $cp_url; ?>' size='60' class='input'></p>
  2698. <h5>Email address of webmaster</h5>
  2699. <p><input type='text' name='webmaster_email' value='<?php echo $webmaster_email; ?>' size='40' class='input'></p>
  2700. <h5>What type of server are your hosted on?</h5>
  2701. <p>If you don't know, choose <b>Unix</b></p>
  2702. <p>
  2703. <input type="radio" class='radio' name="redirect_method" value="redirect" <?php echo $redirect; ?> /> Unix (or Unix variant, like Linux, Mac OS X, BSD, Solaris, etc.)<br />
  2704. <input type="radio" class='radio' name="redirect_method" value="refresh" <?php echo $refresh; ?> /> Windows (NT or IIs)
  2705. </p>
  2706. </div>
  2707. <div class="shade">
  2708. <div class="settingHead">Database Settings</div>
  2709. <h5>MySQL Server Address</h5>
  2710. <p>Usually you will use 'localhost', but your hosting provider may require something else</p>
  2711. <p><input type='text' name='db_hostname' value='<?php echo $db_hostname; ?>' size='40' class='input' /></p>
  2712. <h5>MySQL Username</h5>
  2713. <p>The username you use to access your MySQL database</p>
  2714. <p><input type='text' name='db_username' value='<?php echo $db_username; ?>' size='40' class='input' /></p>
  2715. <h5>MySQL Password</h5>
  2716. <p>The password you use to access your MySQL database</p>
  2717. <p><input type='text' name='db_password' value='<?php echo $db_password; ?>' size='40' class='input' /></p>
  2718. <h5>MySQL Database Name</h5>
  2719. <p>The name of the database where you want ExpressionEngine installed.</p>
  2720. <p class="red">Note: The installation wizard will not create the database for you so you must specify the name of a database that exists.</p>
  2721. <p><input type='text' name='db_name' value='<?php echo $db_name; ?>' size='40' class='input' /></p>
  2722. <h5>Database Prefix</h5>
  2723. <p>Use <b>exp</b> unless you need to use a different prefix</p>
  2724. <p><input type='text' name='db_prefix' value='<?php echo $db_prefix; ?>' size='12' maxlength='30' class='input' /></p>
  2725. <h5>What type of database connection do you prefer?</h5>
  2726. <p>
  2727. A <b>non-persistent</b> connection is recommended.</p>
  2728. <p>
  2729. <input type="radio" class='radio' name="db_conntype" value="0" <?php echo $nonpersistent; ?> /> Non-persistent<br />
  2730. <input type="radio" class='radio' name="db_conntype" value="1" <?php echo $persistent; ?> /> Persistent
  2731. </p>
  2732. </div>
  2733. <div class="shade">
  2734. <div class="settingHead">Encryption Settings</div>
  2735. <h5>What type of password encryption do you prefer?</h5>
  2736. <p><b>SHA1</b> is recommended since it is more secure, but MD5 can be used for more broad compatibility with other PHP applications.</p>
  2737. <p>
  2738. <input type="radio" class='radio' name="encryption_type" value="sha1" <?php echo $sha1; ?> /> SHA1<br />
  2739. <input type="radio" class='radio' name="encryption_type" value="md5" <?php echo $md5; ?> /> MD5
  2740. </p>
  2741. </div>
  2742. <div class="shade">
  2743. <div class="settingHead">Create your admin account</div>
  2744. <p>You will use these settings to access your ExpressionEngine control panel</p>
  2745. <h5>Username</h5>
  2746. <p><span class='red'>Use at least four characters</span></p>
  2747. <p><input type='text' name='username' value='<?php echo $username; ?>' size='40' maxlength='50' class='input' /></p>
  2748. <h5>Password</h5>
  2749. <p><span class='red'>Use at least five characters</span></p>
  2750. <p><input type='text' name='password' value='<?php echo $password; ?>' size='40' maxlength='32' class='input' /></p>
  2751. <h5>Your email address</h5>
  2752. <p><input type='text' name='email' value='<?php echo $email; ?>' size='40' maxlength='80' class='input' /></p>
  2753. <h5>Screen Name</h5>
  2754. <p>This is the name that will appear on your entries
  2755. <br />If you leave this field blank, your username will be used as your screen name</p>
  2756. <p><input type='text' name='screen_name' value='<?php echo $screen_name; ?>' size='40' maxlength='50' class='input' /></p>
  2757. <h5>Name of your site</h5>
  2758. <p><input type='text' name='site_name' value='<?php echo $site_name; ?>' size='40' class='input'></p>
  2759. </div>
  2760. <div class="shade">
  2761. <div class="settingHead">Localization Settings</div>
  2762. <h5>Your Time Zone</h5>
  2763. <p>
  2764. <select name='server_timezone' class='select'>
  2765. <?php $selected = ($timezone == 'UM12') ? " selected" : ""; ?>
  2766. <option value='UM12'<?php echo $selected; ?>>(UTC - 12:00) Eniwetok, Kwajalein</option>
  2767. <?php $selected = ($timezone == 'UM11') ? " selected" : ""; ?>
  2768. <option value='UM11'<?php echo $selected; ?>>(UTC - 11:00) Nome, Midway Island, Samoa</option>
  2769. <?php $selected = ($timezone == 'UM10') ? " selected" : ""; ?>
  2770. <option value='UM10'<?php echo $selected; ?>>(UTC - 10:00) Hawaii</option>
  2771. <?php $selected = ($timezone == 'UM95') ? " selected" : ""; ?>
  2772. <option value='UM95'<?php echo $selected; ?>>(UTC - 9:30) Marquesas Islands</option>
  2773. <?php $selected = ($timezone == 'UM9') ? " selected" : ""; ?>
  2774. <option value='UM9'<?php echo $selected; ?>>(UTC - 9:00) Alaska</option>
  2775. <?php $selected = ($timezone == 'UM8') ? " selected" : ""; ?>
  2776. <option value='UM8'<?php echo $selected; ?>>(UTC - 8:00) Pacific Time</option>
  2777. <?php $selected = ($timezone == 'UM7') ? " selected" : ""; ?>
  2778. <option value='UM7'<?php echo $selected; ?>>(UTC - 7:00) Mountain Time</option>
  2779. <?php $selected = ($timezone == 'UM6') ? " selected" : ""; ?>
  2780. <option value='UM6'<?php echo $selected; ?>>(UTC - 6:00) Central Time, Mexico City</option>
  2781. <?php $selected = ($timezone == 'UM5') ? " selected" : ""; ?>
  2782. <option value='UM5'<?php echo $selected; ?>>(UTC - 5:00) Eastern Time, Bogota, Lima, Quito</option>
  2783. <?php $selected = ($timezone == 'UM45') ? " selected" : ""; ?>
  2784. <option value='UM45'<?php echo $selected; ?>>(UTC - 4:30) Venezuelan Standard Time</option>
  2785. <?php $selected = ($timezone == 'UM4') ? " selected" : ""; ?>
  2786. <option value='UM4'<?php echo $selected; ?>>(UTC - 4:00) Atlantic Time, Caracas, La Paz</option>
  2787. <?php $selected = ($timezone == 'UM35') ? " selected" : ""; ?>
  2788. <option value='UM35'<?php echo $selected; ?>>(UTC - 3:30) Newfoundland</option>
  2789. <?php $selected = ($timezone == 'UM3') ? " selected" : ""; ?>
  2790. <option value='UM3'<?php echo $selected; ?>>(UTC - 3:00) Brazil, Buenos Aires, Georgetown, Falkland Is.</option>
  2791. <?php $selected = ($timezone == 'UM2') ? " selected" : ""; ?>
  2792. <option value='UM2'<?php echo $selected; ?>>(UTC - 2:00) Mid-Atlantic, Ascention Is., St Helena</option>
  2793. <?php $selected = ($timezone == 'UM1') ? " selected" : ""; ?>
  2794. <option value='UM1'<?php echo $selected; ?>>(UTC - 1:00) Azores, Cape Verde Islands</option>
  2795. <?php $selected = ($timezone == 'UTC') ? " selected" : ""; ?>
  2796. <option value='UTC'<?php echo $selected; ?>>(UTC) Casablanca, Dublin, Edinburgh, London, Lisbon, Monrovia</option>
  2797. <?php $selected = ($timezone == 'UP1') ? " selected" : ""; ?>
  2798. <option value='UP1'<?php echo $selected; ?>>(UTC + 1:00) Berlin, Brussels, Copenhagen, Madrid, Paris, Rome</option>
  2799. <?php $selected = ($timezone == 'UP2') ? " selected" : ""; ?>
  2800. <option value='UP2'<?php echo $selected; ?>>(UTC + 2:00) Kaliningrad, South Africa, Warsaw</option>
  2801. <?php $selected = ($timezone == 'UP3') ? " selected" : ""; ?>
  2802. <option value='UP3'<?php echo $selected; ?>>(UTC + 3:00) Baghdad, Riyadh, Moscow, Nairobi</option>
  2803. <?php $selected = ($timezone == 'UP35') ? " selected" : ""; ?>
  2804. <option value='UP35'<?php echo $selected; ?>>(UTC + 3:30) Tehran</option>
  2805. <?php $selected = ($timezone == 'UP4') ? " selected" : ""; ?>
  2806. <option value='UP4'<?php echo $selected; ?>>(UTC + 4:00) Abu Dhabi, Baku, Muscat, Tbilisi</option>
  2807. <?php $selected = ($timezone == 'UP45') ? " selected" : ""; ?>
  2808. <option value='UP45'<?php echo $selected; ?>>(UTC + 4:30) Kabul</option>
  2809. <?php $selected = ($timezone == 'UP5') ? " selected" : ""; ?>
  2810. <option value='UP5'<?php echo $selected; ?>>(UTC + 5:00) Islamabad, Karachi, Tashkent</option>
  2811. <?php $selected = ($timezone == 'UP55') ? " selected" : ""; ?>
  2812. <option value='UP55'<?php echo $selected; ?>>(UTC + 5:30) Bombay, Calcutta, Madras, New Delhi</option>
  2813. <?php $selected = ($timezone == 'UP575') ? " selected" : ""; ?>
  2814. <option value='UP575'<?php echo $selected; ?>>(UTC + 5:45) Nepal Time</option>
  2815. <?php $selected = ($timezone == 'UP6') ? " selected" : ""; ?>
  2816. <option value='UP6'<?php echo $selected; ?>>(UTC + 6:00) Almaty, Colombo, Dhaka</option>
  2817. <?php $selected = ($timezone == 'UP65') ? " selected" : ""; ?>
  2818. <option value='UP65'<?php echo $selected; ?>>(UTC + 6:30) Cocos Islands, Myanmar</option>
  2819. <?php $selected = ($timezone == 'UP7') ? " selected" : ""; ?>
  2820. <option value='UP7'<?php echo $selected; ?>>(UTC + 7:00) Bangkok, Hanoi, Jakarta</option>
  2821. <?php $selected = ($timezone == 'UP8') ? " selected" : ""; ?>
  2822. <option value='UP8'<?php echo $selected; ?>>(UTC + 8:00) Beijing, Hong Kong, Perth, Singapore, Taipei</option>
  2823. <?php $selected = ($timezone == 'UP875') ? " selected" : ""; ?>
  2824. <option value='UP875'<?php echo $selected; ?>>(UTC + 8:45) Australian Central Western Time</option>
  2825. <?php $selected = ($timezone == 'UP9') ? " selected" : ""; ?>
  2826. <option value='UP9'<?php echo $selected; ?>>(UTC + 9:00) Osaka, Sapporo, Seoul, Tokyo, Yakutsk</option>
  2827. <?php $selected = ($timezone == 'UP95') ? " selected" : ""; ?>
  2828. <option value='UP95'<?php echo $selected; ?>>(UTC + 9:30) Adelaide, Darwin</option>
  2829. <?php $selected = ($timezone == 'UP10') ? " selected" : ""; ?>
  2830. <option value='UP10'<?php echo $selected; ?>>(UTC + 10:00) Melbourne, Papua New Guinea, Sydney, Vladivostok</option>
  2831. <?php $selected = ($timezone == 'UP105') ? " selected" : ""; ?>
  2832. <option value='UP105'<?php echo $selected; ?>>(UTC + 10:30) Lord Howe Island</option>
  2833. <?php $selected = ($timezone == 'UP11') ? " selected" : ""; ?>
  2834. <option value='UP11'<?php echo $selected; ?>>(UTC + 11:00) Magadan, New Caledonia, Solomon Islands</option>
  2835. <?php $selected = ($timezone == 'UP115') ? " selected" : ""; ?>
  2836. <option value='UP115'<?php echo $selected; ?>>(UTC + 11:30) Norfolk Island</option>
  2837. <?php $selected = ($timezone == 'UP12') ? " selected" : ""; ?>
  2838. <option value='UP12'<?php echo $selected; ?>>(UTC + 12:00) Auckland, Wellington, Fiji, Marshall Island</option>
  2839. <?php $selected = ($timezone == 'UP1275') ? " selected" : ""; ?>
  2840. <option value='UP1275'<?php echo $selected; ?>>(UTC + 12:45) Chatham Islands Standard Time</option>
  2841. <?php $selected = ($timezone == 'UP13') ? " selected" : ""; ?>
  2842. <option value='UP13'<?php echo $selected; ?>>(UTC + 13:00) Phoenix Islands Time, Tonga</option>
  2843. <?php $selected = ($timezone == 'UP14') ? " selected" : ""; ?>
  2844. <option value='UP14'<?php echo $selected; ?>>(UTC + 14:00) Line Islands</option>
  2845. </select>
  2846. </p>
  2847. <p>Are you currently observing Daylight Saving Time?<br />
  2848. <input class='radio' type="radio" name="daylight_savings" value="y" <?php echo $dst1; ?> /> Yes &nbsp;&nbsp;<input type="radio" class='radio' name="daylight_savings" value="n" <?php echo $dst2; ?> /> No
  2849. </p>
  2850. </div>
  2851. <div class="shade">
  2852. <div class="settingHead">Choose your default template design</div>
  2853. <p><a href='http://expressionengine.com/templates/themes/category/site_themes/' target="_blank">Browse the templates</a></p>
  2854. <p>
  2855. <select name='template' class='select'>
  2856. <?php
  2857. $system_path = './'.trim($data['system_dir']).'/';
  2858. $themes = array();
  2859. if ($fp = @opendir('./themes/site_themes/'))
  2860. {
  2861. while (false !== ($folder = readdir($fp)))
  2862. {
  2863. if (@is_dir('./themes/site_themes/'.$folder) && $folder !== '.' && $folder !== '..' && $folder !== '.svn' && $folder !== '.cvs')
  2864. {
  2865. $themes[] = $folder;
  2866. }
  2867. }
  2868. closedir($fp);
  2869. sort($themes);
  2870. }
  2871. if (count($themes) > 0)
  2872. {
  2873. foreach ($themes as $val)
  2874. {
  2875. if ($val == 'rss' || $val == 'search')
  2876. continue;
  2877. $nval = str_replace("_", " ", $val);
  2878. $nval = ucwords($nval);
  2879. $selected = ($template == $val) ? " selected" : "";
  2880. ?><option value='<?php echo $val;?>'<?php echo $selected; ?>><?php echo $nval; ?></option><?php echo "\n";
  2881. }
  2882. }
  2883. ?>
  2884. </select>
  2885. </p>
  2886. </div>
  2887. <p><input type='submit' value=' Click Here to Install ExpressionEngine! ' class='submit'></p>
  2888. </form>
  2889. </div>
  2890. <?php
  2891. }
  2892. // HTML FOOTER
  2893. page_footer();
  2894. // HTML HEADER
  2895. // --------------------------------------------------------------------
  2896. // --------------------------------------------------------------------
  2897. function page_head()
  2898. {
  2899. global $data;
  2900. ?>
  2901. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2902. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2903. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
  2904. <head>
  2905. <title>ExpressionEngine | Installation Wizard</title>
  2906. <meta http-equiv='content-type' content='text/html; charset=UTF-8' />
  2907. <meta http-equiv='expires' content='-1' />
  2908. <meta http-equiv= 'pragma' content='no-cache' />
  2909. <style type='text/css'>
  2910. body {
  2911. margin: 0;
  2912. padding: 0;
  2913. font-family: Verdana, Geneva, Helvetica, Trebuchet MS, Sans-serif;
  2914. font-size: 12px;
  2915. color: #333;
  2916. background-color: #455087;
  2917. }
  2918. a {
  2919. font-size: 12px;
  2920. text-decoration: underline;
  2921. font-weight: bold;
  2922. color: #330099;
  2923. background-color: transparent;
  2924. }
  2925. a:visited {
  2926. color: #330099;
  2927. background-color: transparent;
  2928. }
  2929. a:active {
  2930. color: #ccc;
  2931. background-color: transparent;
  2932. }
  2933. a:hover {
  2934. color: #000;
  2935. text-decoration: none;
  2936. background-color: transparent;
  2937. }
  2938. #content {
  2939. background: #fff;
  2940. width: 760px;
  2941. margin-top: 25px;
  2942. margin-right: auto;
  2943. margin-left: auto;
  2944. border: 1px solid #000;
  2945. }
  2946. #innercontent {
  2947. margin: 20px 30px 0 20px;
  2948. }
  2949. #pageheader {
  2950. background: #696EA4 url(./themes/cp_global_images/header_bg.jpg) repeat-x left top;
  2951. border-bottom: 1px solid #000;
  2952. }
  2953. .solidLine {
  2954. border-top: #999 1px solid;
  2955. }
  2956. .rightheader {
  2957. background-color: transparent;
  2958. font-family: Verdana, Geneva, Tahoma, Trebuchet MS, Arial, Sans-serif;
  2959. font-size: 12px;
  2960. font-weight: bold;
  2961. color: #fff;
  2962. padding: 0 22px 0 20px;
  2963. }
  2964. .error {
  2965. font-family: Verdana, Trebuchet MS, Arial, Sans-serif;
  2966. font-size: 15px;
  2967. margin-bottom: 8px;
  2968. font-weight: bold;
  2969. color: #990000;
  2970. border-bottom: 1px solid #990000;
  2971. }
  2972. .shade {
  2973. background-color: #f6f6f6;
  2974. padding: 0 0 10px 22px;
  2975. margin-top: 10px;
  2976. margin-bottom: 20px;
  2977. border: #7B81A9 1px solid;
  2978. }
  2979. .stephead {
  2980. font-family: Arial, Trebuchet MS, Verdana, Sans-serif;
  2981. font-size: 18px;
  2982. font-weight: bold;
  2983. color: #999;
  2984. letter-spacing: 2px;
  2985. margin: 0;
  2986. background-color: transparent;
  2987. }
  2988. .settingHead {
  2989. font-family: Arial, Trebuchet MS, Verdana, Sans-serif;
  2990. font-size: 18px;
  2991. font-weight: bold;
  2992. color: #990000;
  2993. letter-spacing: 2px;
  2994. margin-top: 10px;
  2995. margin-bottom: 10px;
  2996. background-color: transparent;
  2997. }
  2998. h1 {
  2999. font-family: Verdana, Trebuchet MS, Arial, Sans-serif;
  3000. font-size: 16px;
  3001. font-weight: bold;
  3002. color: #5B6082;
  3003. margin-top: 15px;
  3004. margin-bottom: 16px;
  3005. background-color: transparent;
  3006. border-bottom: #7B81A9 2px solid;
  3007. }
  3008. h2 {
  3009. font-family: Arial, Trebuchet MS, Verdana, Sans-serif;
  3010. font-size: 14px;
  3011. color: #000;
  3012. letter-spacing: 2px;
  3013. margin-top: 6px;
  3014. margin-bottom: 6px;
  3015. background-color: transparent;
  3016. }
  3017. h3 {
  3018. font-family: Arial, Trebuchet MS, Verdana, Sans-serif;
  3019. font-size: 18px;
  3020. color: #000;
  3021. letter-spacing: 2px;
  3022. margin-top: 15px;
  3023. margin-bottom: 15px;
  3024. border-bottom: #7B81A9 1px dashed;
  3025. background-color: transparent;
  3026. }
  3027. h4 {
  3028. font-family: Verdana, Geneva, Trebuchet MS, Arial, Sans-serif;
  3029. font-size: 16px;
  3030. font-weight: bold;
  3031. color: #000;
  3032. margin-top: 5px;
  3033. margin-bottom: 14px;
  3034. background-color: transparent;
  3035. }
  3036. h5 {
  3037. font-family: Verdana, Geneva, Trebuchet MS, Arial, Sans-serif;
  3038. font-size: 12px;
  3039. font-weight: bold;
  3040. color: #000;
  3041. margin-top: 16px;
  3042. margin-bottom: 0;
  3043. background-color: transparent;
  3044. }
  3045. p {
  3046. font-family: Verdana, Geneva, Trebuchet MS, Arial, Sans-serif;
  3047. font-size: 12px;
  3048. font-weight: normal;
  3049. color: #333;
  3050. margin-top: 4px;
  3051. margin-bottom: 8px;
  3052. background-color: transparent;
  3053. }
  3054. .botBorder {
  3055. margin-bottom: 8px;
  3056. border-bottom: #7B81A9 1px dashed;
  3057. background-color: transparent;
  3058. }
  3059. li {
  3060. font-family: Verdana, Trebuchet MS, Arial, Sans-serif;
  3061. font-size: 11px;
  3062. margin-bottom: 4px;
  3063. color: #000;
  3064. margin-left: 10px;
  3065. }
  3066. .pad {
  3067. padding: 1px 0 4px 0;
  3068. }
  3069. .center {
  3070. text-align: center;
  3071. }
  3072. strong {
  3073. font-weight: bold;
  3074. }
  3075. i {
  3076. font-style: italic;
  3077. }
  3078. .red {
  3079. color: #990000;
  3080. }
  3081. .copyright {
  3082. text-align: center;
  3083. font-family: Verdana, Geneva, Helvetica, Trebuchet MS, Sans-serif;
  3084. font-size: 9px;
  3085. color: #999999;
  3086. line-height: 15px;
  3087. margin-top: 20px;
  3088. margin-bottom: 15px;
  3089. padding: 20px;
  3090. }
  3091. .border {
  3092. border-bottom: #7B81A9 1px dashed;
  3093. }
  3094. form {
  3095. margin: 0;
  3096. padding: 0;
  3097. border: 0;
  3098. }
  3099. .hidden {
  3100. margin: 0;
  3101. padding: 0;
  3102. border: 0;
  3103. }
  3104. .input {
  3105. border-top: 2px solid #979AC2;
  3106. border-left: 2px solid #979AC2;
  3107. border-bottom: 1px solid #979AC2;
  3108. border-right: 1px solid #979AC2;
  3109. color: #333;
  3110. font-family: Verdana, Geneva, Tahoma, Trebuchet MS, Arial, Sans-serif;
  3111. font-size: 11px;
  3112. height: 1.7em;
  3113. padding: 0;
  3114. margin: 0;
  3115. }
  3116. .textarea {
  3117. border-top: 2px solid #979AC2;
  3118. border-left: 2px solid #979AC2;
  3119. border-bottom: 1px solid #979AC2;
  3120. border-right: 1px solid #979AC2;
  3121. color: #333;
  3122. font-family: Verdana, Geneva, Tahoma, Trebuchet MS, Arial, Sans-serif;
  3123. font-size: 11px;
  3124. padding: 0;
  3125. margin: 0;
  3126. }
  3127. .select {
  3128. background-color: #fff;
  3129. font-family: Verdana, Geneva, Tahoma, Trebuchet MS, Arial, Sans-serif;
  3130. font-size: 11px;
  3131. font-weight: normal;
  3132. letter-spacing: .1em;
  3133. color: #333;
  3134. margin-top: 2px;
  3135. margin-bottom: 2px;
  3136. }
  3137. .multiselect {
  3138. border-top: 2px solid #979AC2;
  3139. border-left: 2px solid #979AC2;
  3140. border-bottom: 1px solid #979AC2;
  3141. border-right: 1px solid #979AC2;
  3142. background-color: #fff;
  3143. color: #333;
  3144. font-family: Verdana, Geneva, Tahoma, Trebuchet MS, Arial, Sans-serif;
  3145. font-size: 11px;
  3146. margin-top: 2px;
  3147. margin-top: 2px;
  3148. }
  3149. .radio {
  3150. color: transparent;
  3151. background-color: transparent;
  3152. margin-top: 4px;
  3153. margin-bottom: 4px;
  3154. padding: 0;
  3155. border: 0;
  3156. }
  3157. .checkbox {
  3158. background-color: transparent;
  3159. color: transparent;
  3160. padding: 0;
  3161. border: 0;
  3162. }
  3163. .submit {
  3164. background-color: #fff;
  3165. font-family: Verdana, Geneva, Tahoma, Trebuchet MS, Arial, Sans-serif;
  3166. font-size: 11px;
  3167. font-weight: normal;
  3168. border-top: 1px solid #989AB6;
  3169. border-left: 1px solid #989AB6;
  3170. border-right: 1px solid #434777;
  3171. border-bottom: 1px solid #434777;
  3172. letter-spacing: .1em;
  3173. padding: 1px 3px 2px 3px;
  3174. margin: 0;
  3175. background-color: #6C73B4;
  3176. color: #fff;
  3177. }
  3178. </style>
  3179. </head>
  3180. <body>
  3181. <div id='content'>
  3182. <div id='pageheader'>
  3183. <table style="width:100%;" height="50" border="0" cellpadding="0" cellspacing="0">
  3184. <tr>
  3185. <td style="width:45%;"><img src="./themes/cp_global_images/ee_logo.jpg" width="260" height="80" border="0" alt="ExpressionEngine" /></td>
  3186. <td style="width:55%;" align="right" class="rightheader"><?php echo $data['app_full_version']; ?></td>
  3187. </tr>
  3188. </table>
  3189. </div>
  3190. <?php
  3191. }
  3192. /* END */
  3193. // HTML FOOTER
  3194. // --------------------------------------------------------------------
  3195. // --------------------------------------------------------------------
  3196. function page_footer()
  3197. {
  3198. global $data;
  3199. ?>
  3200. <div class='copyright'>ExpressionEngine <?php echo $data['app_full_version']; ?> - &#169; Copyright 2003 - 2010 EllisLab, Inc. - All Rights Reserved</div>
  3201. </div>
  3202. </body>
  3203. </html>
  3204. <?php
  3205. }
  3206. // -----------------------------------------
  3207. // Fetch names of installed languages
  3208. // -----------------------------------------
  3209. function language_pack_names($default)
  3210. {
  3211. global $data;
  3212. $source_dir = './'.trim($data['system_dir']).'/language/';
  3213. $filelist = array();
  3214. if ($fp = @opendir($source_dir))
  3215. {
  3216. while (false !== ($file = readdir($fp)))
  3217. {
  3218. $filelist[count($filelist)] = $file;
  3219. }
  3220. }
  3221. closedir($fp);
  3222. sort($filelist);
  3223. $r = "<div class='default'>";
  3224. $r .= "<select name='deft_lang' class='select'>\n";
  3225. $skip = array('.php', '.html', '.DS_Store', '.');
  3226. for ($i =0; $i < sizeof($filelist); $i++)
  3227. {
  3228. foreach($skip as $a)
  3229. {
  3230. if (stristr($filelist[$i], $a))
  3231. {
  3232. continue(2);
  3233. }
  3234. }
  3235. $selected = ($filelist[$i] == $default) ? " selected='selected'" : '';
  3236. $r .= "<option value='{$filelist[$i]}'{$selected}>".ucfirst($filelist[$i])."</option>\n";
  3237. }
  3238. $r .= "</select>";
  3239. $r .= "</div>";
  3240. return $r;
  3241. }
  3242. /* END */
  3243. // -----------------------------------------
  3244. // Member Profile template wrapper
  3245. // -----------------------------------------
  3246. function member_index()
  3247. {
  3248. return <<<EOF
  3249. {exp:member:manager}
  3250. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  3251. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3252. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{lang}">
  3253. <head>
  3254. <title>{page_title}</title>
  3255. <meta http-equiv='content-type' content='text/html; charset={charset}' />
  3256. {stylesheet}
  3257. </head>
  3258. <body>
  3259. <div id="content">
  3260. <div class='header'><h1>{heading}</h1></div>
  3261. {breadcrumb}
  3262. {content}
  3263. {copyright}
  3264. </div>
  3265. </body>
  3266. </html>
  3267. {/exp:member:manager}
  3268. EOF;
  3269. }
  3270. /* END */
  3271. function license_agreement()
  3272. {
  3273. ?>
  3274. <div id='innercontent'>
  3275. <h1>ExpressionEngine Installation Wizard</h1>
  3276. <h2>License Agreement</h2>
  3277. <form method='post' action='install.php?page=3'>
  3278. <p>
  3279. <textarea class="textarea" cols="50" rows="20" style="width:100%;" readonly="readonly"><?php echo trim(license()); ?></textarea>
  3280. </p>
  3281. <p><input type="radio" name="agree" value="yes" /> I agree to abide by the license Terms and Conditions as stated above.</p>
  3282. <p><input type="radio" name="agree" value="no" checked="checked" /> I do NOT agree to abide by the license Terms and Conditions as stated above</p>
  3283. <p><br />
  3284. <input type='submit' value='Submit' class='submit'>
  3285. </p>
  3286. </form>
  3287. </p>
  3288. </div>
  3289. <?php
  3290. }
  3291. function license() {
  3292. return <<<EOF
  3293. This license is a legal agreement between you and EllisLab, Inc. for the use of ExpressionEngine Software (the "Software"). By downloading ExpressionEngine or any ExpressionEngine Modules you agree to be bound by the terms and conditions of this license. EllisLab, Inc. reserves the right to alter this agreement at any time, for any reason, without notice.
  3294. Revised on: 26 March, 2007
  3295. PERMITTED USE
  3296. * Core License: Users of the Core License may use the Software only on a website engaging in personal, non-commercial, or non-profit activities.
  3297. * Personal License: Users of the Personal License may use the Software only on a website engaging in personal, non-commercial, or non-profit activities. One license grants the right to perform one installation of the Software. Each additional installation of the Software requires an additional purchased license.
  3298. * Commercial License: Users of the Commercial License may use the Software on a website engaging a commercial, or for-profit activities. Websites engaging in direct, or indirect commercial activities must purchase a Commercial License. One license grants the right to perform one installation of the Software. Each additional installation of the Software requires an additional purchased license.
  3299. EllisLab, Inc. will be the sole arbiter as to what constitutes commercial activities.
  3300. RESTRICTIONS
  3301. Unless you have been granted prior, written consent from EllisLab, Inc., you may not:
  3302. * Use the Software as the basis of a hosted weblogging service, or to provide hosting services to others.
  3303. * Reproduce, distribute, or transfer the Software, or portions thereof, to any third party.
  3304. * Sell, rent, lease, assign, or sublet the Software or portions thereof.
  3305. * Grant rights to any other person.
  3306. * Use the Software in violation of any U.S. or international law or regulation.
  3307. DISPLAY OF COPYRIGHT NOTICES
  3308. All copyright and proprietary notices and logos in the Control Panel and within the Software files must remain intact.
  3309. GIVING CREDIT
  3310. Core License Users are required to display a "powered by ExpressionEngine" link or graphic on their publicly accessible site, pointing to http://expressionengine.com/ . Users of a purchased Personal or Commercial license are exempt from this requirement.
  3311. MAKING COPIES
  3312. You may make copies of the Software for back-up purposes, provided that you reproduce the Software in its original form and with all proprietary notices on the back-up copy.
  3313. SOFTWARE MODIFICATION
  3314. You may alter, modify, or extend the Software for your own use, or commission a third-party to perform modifications for you, but you may not resell, redistribute or transfer the modified or derivative version without prior written consent from EllisLab, Inc. Components from the Software may not be extracted and used in other programs without prior written consent from EllisLab, Inc.
  3315. TECHNICAL SUPPORT
  3316. Technical support is available only through the Online Support Forums at ExpressionEngine.com. EllisLab does not provide direct email or phone support. No representations or guarantees are made regarding the response time in which support questions are answered.
  3317. REFUNDS
  3318. Due to the non-returnable nature of downloadable software, EllisLab, Inc. does not issue refunds once a transaction has been completed. All software offered by EllisLab is available for free evaluation prior to purchasing. We encourage you to thoroughly test the system you are interested in before purchasing to determine its suitability for your purposes and compatibility with your hosting account.
  3319. INDEMNITY
  3320. You agree to indemnify and hold harmless EllisLab, Inc. and EngineHosting for any third-party claims, actions or suits, as well as any related expenses, liabilities, damages, settlements or fees arising from your use or misuse of the Software, or a violation of any terms of this license.
  3321. DISCLAIMER OF WARRANTY
  3322. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF QUALITY, PERFORMANCE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. FURTHER, ELLISLAB, INC. DOES NOT WARRANT THAT THE SOFTWARE OR ANY RELATED SERVICE WILL ALWAYS BE AVAILABLE.
  3323. Limitations Of Liability
  3324. YOU ASSUME ALL RISK ASSOCIATED WITH THE INSTALLATION AND USE OF THE SOFTWARE. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS OF THE SOFTWARE BE LIABLE FOR CLAIMS, DAMAGES OR OTHER LIABILITY ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE. LICENSE HOLDERS ARE SOLELY RESPONSIBLE FOR DETERMINING THE APPROPRIATENESS OF USE AND ASSUME ALL RISKS ASSOCIATED WITH ITS USE, INCLUDING BUT NOT LIMITED TO THE RISKS OF PROGRAM ERRORS, DAMAGE TO EQUIPMENT, LOSS OF DATA OR SOFTWARE PROGRAMS, OR UNAVAILABILITY OR INTERRUPTION OF OPERATIONS.
  3325. EOF;
  3326. }
  3327. ?>