一、下載源碼
地址: http://download.csdn.net/detail/u011781521/9722570
下載之后解壓出來會有這么些文件
把這些文件復制到網站目錄xsser中
二、配置環境
步驟:
1、修改config.PHP里面的數據庫連接字段,包括用戶名,密碼,數據庫名,訪問URL起始和偽靜態的設置。
1.1在phpmyadmin中新建xssplatform數據庫
1.2修改訪問的url起始地址為:http://localhost/xsser 也就是目錄名
2、在web根目錄下有一個xssplatform.sql,在phpmyadmin中創建好數據庫后導入庫。
2.1phpmyadmin導入SQL
執行之后會多出9張表
3、進入數據庫執行語句修改域名為自己的:
UPDATE oc_module SET
code=REPLACE(code,'http://xsser.me','http://localhost/xsser')
4.修改themes\default\templates\register.html中的提交按鈕的源碼為:注如果修改了下面注冊的頁面就不用修改了!!
行53
<input id="btnRegister" type="button" onclick="Register()" value="提交注冊" />
修改為
<input id="btnRegister" type="submit" value="提交注冊" />
5.登錄頁面,回車登錄;加載完頁面后,自動將光標定位在user輸入框
文件themes/default/templates/login.html的修改:
- <!-- <input type="submit" value="登錄" onclick="Login()"> -->
- <input type="submit" value="登錄" onclick="Login()">
在body的最后添加:
- <!-- 頁面加載完成后,將光標定位到user輸入框 -->
- <script>document.getElementById('user').focus();</script>
6.修改提示頁面跳轉時間為500ms
文件themes/default/templates/notice.html:
行11
setTimeout("location.href='{$notice.turnto}'",3000);
修改為
setTimeout("location.href='{$notice.turnto}'",500);
7.創建項目頁面,自動將光標置於項目名稱處
themes/default/templates/project_create.html
行55,添加
<script>document.getElementById('title').focus();</script>
8.rewrite規則
在web根目錄下建立.htaccess偽靜態文件
並加入以下內容、注意如果偽靜態沒配置成功,那么下面xsser生成的項目中的URL將不能訪問!!!
范例:
Apache:
- RewriteEngine On
- RewriteRule ^([0-9a-zA-Z]{6})$ /xsser/index.php?do=code&urlKey=$1 [L]
- RewriteRule ^do/auth/(\w+?)(/domain/([\w\.]+?))?$ /xsser/index.php?do=do&auth=$1&domain=$3 [L]
- RewriteRule ^register/(.*?)$ /xsser/index.php?do=register&key=$1 [L]
- RewriteRule ^register-validate/(.*?)$ /xsser/index.php?do=register&act=validate&key=$1 [L]
- RewriteRule ^login$ /xsser/index.php?do=login [L]
Nginx:
- rewrite "^/([0-9a-zA-Z]{6})$" /index.php?do=code&urlKey=$1 last;
- rewrite "^/do/auth/(\w+?)(/domain/([\w\.]+?))?$" /index.php?do=do&auth=$1&domain=$3 last;
- rewrite "^/register/(.*?)$" /index.php?do=register&key=$1 last;
- rewrite "^/register-validate/(.*?)$" /index.php?do=register&act=validate&key=$1 last;
三、使用
差不多了,我們訪問這個地址:http://localhost/xsser/index.php
在注冊之前、首先把注冊配置修改為normal進行保存
然后就可以注冊了、邀請碼隨便填寫,其他的都是注冊的時候需要的
點擊提交注冊,發現沒卵用,他這搞錯了,審查下元素,就能發現,他把type=submit寫成了type=button,改回來就可以了。
就完成了注冊。注冊成功之后他會跳到這個頁面
然后我們到數據庫中的user表里面
把adminLevel修改為1,把自己定義為最高管理員權限,不然沒法發送邀請碼。再回到config.php中,修改注冊配置為invite
保存后我們重新登陸進去生成邀請碼
http://localhost/xsser/index.php?do=user&act=invite
點擊生成其他邀請碼
93cd389730d7e601f0dc6ec5a6992d69
生成,成功,現在來看看可以正常注冊不
修改type=submit、然后點擊提交注冊
注冊成功。
四、測試
新建一個項目、測試其中的地址
點擊下一步
點擊下一步創建完成。
能訪問:
說明Apache偽靜態配置成功、如果偽靜態沒有配置成功就會出現下面的錯誤