A tumblelog CMS built on AJAX, PHP and MySQL.

install.php 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <?php
  2. if(!defined('entry') || !entry) define('entry',true);
  3. /* ===========================
  4. gelato CMS - A PHP based tumblelog CMS
  5. development version
  6. http://www.gelatocms.com/
  7. gelato CMS is a free software licensed under the GPL 2.0
  8. Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
  9. =========================== */
  10. // Received a valid request, better start setting globals we'll need throughout the app in entry.php
  11. require_once('entry.php');
  12. $configFile = Absolute_Path."config.php";
  13. if(file_exists($configFile)){
  14. require_once($configFile);
  15. }else{
  16. exit("You need to rename config-sample.php to config.php and fill out the required details.");
  17. }
  18. global $user, $conf, $tumble;
  19. $install = new Install();
  20. $install->data = $_POST;
  21. $install->check_form();
  22. ?>
  23. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  24. <html xmlns="http://www.w3.org/1999/xhtml">
  25. <head>
  26. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  27. <meta name="generator" content="gelato cms <?php echo version();?>" />
  28. <title>gelato :: installation</title>
  29. <link rel="shortcut icon" href="images/favicon.ico" />
  30. <style type="text/css" media="screen">
  31. @import "admin/css/style.css";
  32. </style>
  33. </head>
  34. <body>
  35. <div id="cont">
  36. <div id="head">
  37. <h1><a href="index.php" title="gelato :: home">gelato cms</a></h1>
  38. </div>
  39. <div id="main">
  40. <?php
  41. if ($install->showForm) {
  42. ?>
  43. <div class="box">
  44. <ul class="menu manage">
  45. <h3>gelato :: installation</h3>
  46. <li class="selected"><a>Install</a></li>
  47. </ul>
  48. <div class="tabla">
  49. <form action="install.php" method="post" id="config_form" autocomplete="off" class="newpost">
  50. <fieldset class="install">
  51. <legend class="install">Database Settings</legend>
  52. <ul>
  53. <li><label for="login">User:</label>
  54. <input type="text" name="db_login" id="db_login" value="<?php echo isset($install->data['db_login'])?$install->data['db_login']:''?>" class="txt"/><?php echo $install->mostrarerror("10")?></li>
  55. <li><label for="password">Password:</label>
  56. <input type="password" name="db_password" id="db_password" value="" class="txt"/></li>
  57. <li><label for="password2">Re-type password:</label>
  58. <input type="password" name="db_password2" id="db_password2" value="" class="txt"/><?php echo $install->mostrarerror("9")?></li>
  59. <li><label for="email">Database Host:</label>
  60. <input type="text" name="db_host" id="db_host" value="<?php echo (!empty($install->data['db_host']))? $install->data['db_host'] : 'localhost'?>" class="txt"/><?php echo $install->mostrarerror("7")?></li>
  61. <li><label for="email">Database Name:</label>
  62. <input type="text" name="db_name" id="db_name" value="<?php echo (!empty($install->data['db_name']))? $install->data['db_name'] : 'gelatocms'?>" class="txt"/><?php echo $install->mostrarerror("8")?></li>
  63. </ul>
  64. </fieldset><br />
  65. <fieldset class="install">
  66. <legend class="install">Admin user</legend>
  67. <ul>
  68. <li><label for="login">User:</label>
  69. <input type="text" name="login" id="login" value="<?php echo isset($install->data['login'])?$install->data['login']:''?>" class="txt"/><?php echo $install->mostrarerror("1")?></li>
  70. <li><label for="password">Password:</label>
  71. <input type="password" name="password" id="password" value="" class="txt"/><?php echo $install->mostrarerror("2")?></li>
  72. <li><label for="password2">Re-type password:</label>
  73. <input type="password" name="password2" id="password2" value="" class="txt"/><?php echo $install->mostrarerror("3")?></li>
  74. <li><label for="email">E-mail:</label>
  75. <input type="text" name="email" id="email" value="<?php echo isset($install->data['email'])?$install->data['email']:''?>" class="txt"/><?php echo $install->mostrarerror("4")?></li>
  76. </ul>
  77. </fieldset><br />
  78. <fieldset class="install">
  79. <legend class="install">Tumblelog configuration</legend>
  80. <ul>
  81. <li><label for="title">Title:</label>
  82. <input type="text" name="title" id="title" value="<?php echo isset($install->data['title'])?$install->data['title']:''?>" class="txt"/></li>
  83. <li><label for="description">Description:</label>
  84. <input type="text" name="description" id="description" value="<?php echo isset($install->data['description'])?$install->data['description']:''?>" class="txt"/></li>
  85. <li><label for="url_installation">Installation URL</label>
  86. <input type="text" name="url_installation" id="url_installation" value="<?php if(isset($_SERVER['SCRIPT_URI']))echo substr($_SERVER["SCRIPT_URI"], '0', '-12'); ?>" class="txt"/><?php echo $install->mostrarerror("5")?></li>
  87. <li><label for="posts_limit">Post limit:</label>
  88. <input type="text" name="posts_limit" id="posts_limit" value="10" class="txt"/></li>
  89. <li><label for="lang">Language:</label>
  90. <select id="lang" name="lang">
  91. <option value="en" selected="selected">english</option>
  92. </select>
  93. </li>
  94. <li><label for="template">Template:</label>
  95. <select id="template" name="template">
  96. <?php
  97. $themes = getThemes();
  98. foreach ($themes as $theme) {
  99. echo "<option value=\"".$theme."\" selected=\"true\">".$theme."</option>\n";
  100. }
  101. ?> </select>
  102. <li>
  103. <li><label for="time_offsets">Time Offset:</label>
  104. <select id="time_offsets" name="time_offsets">
  105. <option value="-12,Pacific/Kwajalein">(GMT -12:00) International Date Line West</option>
  106. <option value="-11,Pacific/Samoa">(GMT -11:00) Midway Island, Samoa</option>
  107. <option value="-10,Pacific/Honolulu">(GMT -10:00) Hawaii</option>
  108. <option value="-9,US/Alaska">(GMT -9:00) Alaska</option>
  109. <option value="-8,US/Pacific">(GMT -8:00) Pacific Time (US &amp; Canada); Tijuana</option>
  110. <option value="-7,US/Mountain">(GMT -7:00) Mountain Time (US &amp; Canada)</option>
  111. <option value="-7,US/Arizona">(GMT -7:00) Arizona</option>
  112. <option value="-7,Mexico/BajaNorte">(GMT -7:00) Chihuahua, La Paz, Mazatlan</option>
  113. <option value="-6,US/Central">(GMT -6:00) Central Time (US &amp; Canada)</option>
  114. <option value="-6,America/Costa_Rica">(GMT -6:00) Central America</option>
  115. <option value="-6,Mexico/General" selected="selected">(GMT -6:00) Guadalajara, Mexico City, Monterrey</option>
  116. <option value="-6,Canada/Saskatchewan">(GMT -6:00) Saskatchewan</option>
  117. <option value="-5,US/Eastern">(GMT -5:00) Eastern Time (US &amp; Canada)</option>
  118. <option value="-5,America/Bogota">(GMT -5:00) Bogota, Lima, Quito</option>
  119. <option value="-5,US/East-Indiana">(GMT -5:00) Indiana (East)</option>
  120. <option value="-4,Canada/Eastern">(GMT -4:00) Atlantic Time (Canada)</option>
  121. <option value="-4,America/Caracas">(GMT -4:00) Caracas, La Paz</option>
  122. <option value="-4,America/Santiago">(GMT -4:00) Santiago</option>
  123. <option value="-3.50,Canada/Newfoundland">(GMT -3:30) Newfoundland</option>
  124. <option value="-3,Canada/Atlantic">(GMT -3:00) Brasilia, Greenland</option>
  125. <option value="-3,America/Buenos_Aires">(GMT -3:00) Buenos Aires, Georgetown</option>
  126. <option value="-2,Atlantic/Central">(GMT -2:00) Atlantic Central</option>
  127. <option value="-1,Atlantic/Cape_Verde">(GMT -1:00) Cape Verde Is.</option>
  128. <option value="-1,Atlantic/Azores">(GMT -1:00) Azores</option>
  129. <option value="0,Africa/Casablanca">(GMT) Casablanca, Monrovia</option>
  130. <option value="0,Europe/Dublin">(GMT) Greenwich Mean Time : Dublin, Edinburgh, London</option>
  131. <option value="1,Europe/Amsterdam">(GMT +1:00) Amsterdam, Berlin, Rome, Stockholm, Vienna</option>
  132. <option value="1,Europe/Prague">(GMT +1:00) Belgrade, Bratislava, Budapest, Prague</option>
  133. <option value="1,Europe/Paris">(GMT +1:00) Brussels, Copenhagen, Madrid, Paris</option>
  134. <option value="1,Europe/Warsaw">(GMT +1:00) Sarajevo, Skopje, Warsaw, Zagreb</option>
  135. <option value="1,Africa/Bangui">(GMT +1:00) West Central Africa</option>
  136. <option value="2,Europe/Istanbul">(GMT +2:00) Athens, Beirut, Bucharest, Cairo, Istanbul </option>
  137. <option value="2,Asia/Jerusalem">(GMT +2:00) Harare, Jerusalem, Pretoria</option>
  138. <option value="2,Europe/Kiev">(GMT +2:00) Helsinki, Kiev, Riga, Sofia, Tallinn, Vilnius</option>
  139. <option value="3,Asia/Riyadh">(GMT +3:00) Kuwait, Nairobi, Riyadh</option>
  140. <option value="3,Europe/Moscow">(GMT +3:00) Baghdad, Moscow, St. Petersburg, Volgograd</option>
  141. <option value="3.50,Asia/Tehran">(GMT +3:30) Tehran</option>
  142. <option value="4,Asia/Muscat">(GMT +4:00) Abu Dhabi, Muscat</option>
  143. <option value="4,Asia/Baku">(GMT +4:00) Baku, Tbilsi, Yerevan</option>
  144. <option value="4.50,Asia/Kabul">(GMT +4:30) Kabul</option>
  145. <option value="5,Asia/Yekaterinburg">(GMT +5:00) Yekaterinburg</option>
  146. <option value="5,Asia/Karachi">(GMT +5:00) Islamabad, Karachi, Tashkent</option>
  147. <option value="5.50,Asia/Calcutta">(GMT +5:30) Chennai, Calcutta, Mumbai, New Delhi</option>
  148. <option value="5.75,Asia/Katmandu">(GMT +5:45) Katmandu</option>
  149. <option value="6,Asia/Almaty">(GMT +6:00) Almaty, Novosibirsk</option>
  150. <option value="6,Asia/Dhaka">(GMT +6:00) Astana, Dhaka, Sri Jayawardenepura</option>
  151. <option value="6.50,Asia/Rangoon">(GMT +6:30) Rangoon</option>
  152. <option value="7,Asia/Bangkok">(GMT +7:00) Bangkok, Hanoi, Jakarta</option>
  153. <option value="7,Asia/Krasnoyarsk">(GMT +7:00) Krasnoyarsk</option>
  154. <option value="8,Asia/Hong_Kong">(GMT +8:00) Beijing, Chongqing, Hong Kong, Urumqi</option>
  155. <option value="8,Asia/Irkutsk">(GMT +8:00) Irkutsk, Ulaan Bataar</option>
  156. <option value="8,Asia/Singapore">(GMT +8:00) Kuala Lumpar, Perth, Singapore, Taipei</option>
  157. <option value="9,Asia/Tokyo">(GMT +9:00) Osaka, Sapporo, Tokyo</option>
  158. <option value="9,Asia/Seoul">(GMT +9:00) Seoul</option>
  159. <option value="9,Asia/Yakutsk">(GMT +9:00) Yakutsk</option>
  160. <option value="9.50,Australia/Adelaide">(GMT +9:30) Adelaide</option>
  161. <option value="9.50Australia/Darwin">(GMT +9:30) Darwin</option>
  162. <option value="10,Australia/Brisbane">(GMT +10:00) Brisbane, Guam, Port Moresby</option>
  163. <option value="10,Australia/Canberra">(GMT +10:00) Canberra, Hobart, Melbourne, Sydney</option>
  164. <option value="11,Asia/Magadan">(GMT +11:00) Magadan, Soloman Is., New Caledonia</option>
  165. <option value="12,Pacific/Auckland">(GMT +12:00) Auckland, Wellington</option>
  166. <option value="12,Pacific/Fiji">(GMT +12:00) Fiji, Kamchatka, Marshall Is.</option>
  167. </select>
  168. </li>
  169. </ul>
  170. </fieldset>
  171. <p>
  172. <input type="hidden" name="website" id="website" value="" />
  173. <input type="hidden" name="about" id="about" value="" />
  174. <input type="hidden" name="action" id="action" value="config" />
  175. <input type="submit" name="btnsubmit" id="btnsubmit" value="<< Install >>" class="submit"/>
  176. </p>
  177. </form>
  178. </div>
  179. <div class="footer-box">&nbsp;</div>
  180. </div>
  181. <?php
  182. } else {
  183. echo "<p><em>Finished!</em></p>";
  184. echo "<p>Now you can <a href=\"login.php\" class=\"inslnl\">log in</a> with your <strong>username</strong> and <strong>password</strong></p>";
  185. }
  186. ?>
  187. </div>
  188. <div id="foot">
  189. <a href="http://www.gelatocms.com/" title="gelato CMS">gelato CMS</a> :: PHP/MySQL Tumblelog Content Management System.
  190. </div>
  191. </div>
  192. </body>
  193. </html>