setconfig.html 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <!-- inc:head -->
  2. <script type="text/javascript">
  3. function GetQueryString(name)
  4. {
  5. var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
  6. //window.location
  7. var r = location.search.substr(1).match(reg);
  8. if(r!=null)return unescape(r[2]); return null;
  9. }
  10. function to_engine(val)
  11. {
  12. if(!val)
  13. {
  14. getid("db_host").disabled = false;
  15. getid("db_port").disabled = false;
  16. getid("db_user").disabled = false;
  17. getid("db_pass").disabled = false;
  18. getid("db_host").value = "";
  19. getid("db_port").value = "";
  20. getid("db_user").value = "";
  21. getid("db_pass").value = "";
  22. return false;
  23. }
  24. var t = val.split(":");
  25. if(t[0] == "mysql")
  26. {
  27. getid("db_host").disabled = false;
  28. getid("db_port").disabled = false;
  29. getid("db_user").disabled = false;
  30. getid("db_pass").disabled = false;
  31. getid("db_host").value = "localhost";
  32. getid("db_port").value = "3306";
  33. getid("db_user").value = "root";
  34. getid("db_pass").value = GetQueryString("dbpass");
  35. getid("db_data").value = GetQueryString("dbname");
  36. getid("admin_pass").value = GetQueryString("adminpass");
  37. }
  38. else if(t[0] == "sqlite")
  39. {
  40. getid("db_host").disabled = true;
  41. getid("db_port").disabled = true;
  42. getid("db_user").disabled = true;
  43. getid("db_pass").disabled = true;
  44. getid("db_host").value = "localhost";
  45. getid("db_port").value = "3306";
  46. getid("db_user").value = "root";
  47. getid("db_pass").value = "**********";
  48. }
  49. else if(t[0] == "mssql")
  50. {
  51. getid("db_host").disabled = false;
  52. getid("db_port").disabled = false;
  53. getid("db_user").disabled = false;
  54. getid("db_pass").disabled = false;
  55. getid("db_host").value = "(local)";
  56. getid("db_port").value = "1433";
  57. getid("db_user").value = "Administrator";
  58. getid("db_pass").value = "";
  59. }
  60. else if(t[0] == "pgsql")
  61. {
  62. getid("db_host").disabled = false;
  63. getid("db_port").disabled = false;
  64. getid("db_user").disabled = false;
  65. getid("db_pass").disabled = false;
  66. getid("db_host").value = "localhost";
  67. getid("db_port").value = "5432";
  68. getid("db_user").value = "postgres";
  69. getid("db_pass").value = "";
  70. }
  71. return true;
  72. }
  73. function check()
  74. {
  75. var db_data = getid("db_data").value;
  76. if(!db_data)
  77. {
  78. alert("数据库名称不允许为空!");
  79. return false;
  80. }
  81. var admin_user = getid("admin_user").value;
  82. if(!admin_user)
  83. {
  84. alert("管理员账号不允许为空!");
  85. return false;
  86. }
  87. var admin_pass = getid("admin_pass").value;
  88. if(!admin_pass)
  89. {
  90. alert("管理员密码不允许为空!");
  91. return false;
  92. }
  93. getid("phpok_submit").disabled = true;
  94. }
  95. </script>
  96. <div class="div_w m_top">
  97. <div class="left">
  98. <div class="model"><div class="bg">
  99. <h5>安装步骤</h5>
  100. <ol class="ol">
  101. <li><a href="index.php">安装说明</a></li>
  102. <li class="red">配置安装参数</li>
  103. <li><a href="#">完成</a></li>
  104. </ol>
  105. </div></div>
  106. <div class="space"></div>
  107. </div>
  108. <div class="right">
  109. <div class="model"><div class="bg">
  110. <form method="post" action="index.php?act=save" onsubmit="return check();">
  111. <h5>设置数据库</h5>
  112. <div class="msg" style="padding:5px 15px;">
  113. <table>
  114. <tr>
  115. <td width="160px" align="right">数据库类型:</td>
  116. <td>
  117. <select id="db_type" name="db_type" onchange="to_engine(this.value)">
  118. <option value="mysql:mysql">MySQL(MySQL引挈)</option>
  119. </select>
  120. </td>
  121. </tr>
  122. <tr>
  123. <td align="right">服务器:</td>
  124. <td><input type="text" id="db_host" name="db_host" class="input_login" /></td>
  125. </tr>
  126. <tr>
  127. <td align="right">端口:</td>
  128. <td><input type="text" id="db_port" name="db_port" class="short_input" /></td>
  129. </tr>
  130. <tr>
  131. <td align="right">账号:</td>
  132. <td><input type="text" id="db_user" name="db_user" class="input_login" /></td>
  133. </tr>
  134. <tr>
  135. <td align="right">密码:</td>
  136. <td><input type="text" id="db_pass" name="db_pass" class="input_login" /></td>
  137. </tr>
  138. <tr>
  139. <td align="right">数据库名:</td>
  140. <td><input type="text" id="db_data" name="db_data" class="input_login" /> 数据库必须存在!</td>
  141. </tr>
  142. <input type="hidden" id="prefix" name="prefix" class="input_login" value="yehnet_" />
  143. <tr>
  144. <td align="right"></td>
  145. <td></td>
  146. </tr>
  147. <tr>
  148. <td align="right"></td>
  149. <td></td>
  150. </tr>
  151. </table>
  152. </div>
  153. </div></div>
  154. <div class="space"></div>
  155. <div class="model"><div class="bg">
  156. <h5>缓存设置</h5>
  157. <div class="msg" style="padding:5px 15px;">
  158. <table>
  159. <tr>
  160. <td width="160px" align="right" valign="top">缓存类型:</td>
  161. <td><input type="radio" name="cache_type" value="txt" checked /> 文本缓存 &nbsp; <input type="radio" name="cache_type" value="mem" /> Memcache缓存 &nbsp; <input type="radio" name="cache_type" value="sql" /> 数据库缓存<br />如果有独立服务器且支持Memcache,推荐使用Memcache缓存</td>
  162. </tr>
  163. <tr>
  164. <td align="right">缓存时间:</td>
  165. <td><input type="text" id="cache_time" name="cache_time" class="short_input" value="3600" /> 秒</td>
  166. </tr>
  167. <tr>
  168. <td align="right">Memcache 服务器:</td>
  169. <td><input type="text" id="cache_server" name="cache_server" class="input_login" value="localhost" /></td>
  170. </tr>
  171. <tr>
  172. <td align="right">Memcache 端口:</td>
  173. <td><input type="text" id="cache_port" name="cache_port" value="11211" class="short_input" /></td>
  174. </tr>
  175. </table>
  176. </div>
  177. </div></div>
  178. <div class="space"></div>
  179. <div class="model"><div class="bg">
  180. <h5>网站 / 管理员设置</h5>
  181. <div class="msg" style="padding:5px 15px;">
  182. <table>
  183. <tr>
  184. <td align="right" width="160px">网站网址:</td>
  185. <td><input type="text" id="siteurl" name="siteurl" class="long_input" value="{:$site_url}" /> 请填写网站地址</td>
  186. </tr>
  187. <tr>
  188. <td align="right">管理员账号:</td>
  189. <td><input type="text" id="admin_user" name="admin_user" class="input_login" value="admin" /></td>
  190. </tr>
  191. <tr>
  192. <td align="right">管理员密码:</td>
  193. <td><input type="text" id="admin_pass" name="admin_pass" class="input_login" /></td>
  194. </tr>
  195. </table>
  196. </div>
  197. </div></div>
  198. <div class="space"></div>
  199. <div align="right"><button type="submit" class="btn" id="phpok_submit"><span><span>完成安装</span></span></button></div>
  200. </div>
  201. </form>
  202. <div class="clear"></div>
  203. </div>
  204. <script type="text/javascript">to_engine("mysql:mysql");</script>
  205. <!-- inc:foot -->