emlog交互式注冊賬號代碼

此代碼是很久之前寫的需要和emlog一路上注冊插件配合使用,替換一路上注冊插件的前臺頁面為以下代碼.本代碼美化部分沒有弄好,還很簡陋.代碼亂的現(xiàn)在我都覺得不可思議它還能正確的執(zhí)行(我已經(jīng)快要看不懂了).


session_start();

!defined('EMLOG_ROOT') && exit('access deined!');

if(ROLE == 'admin' || ROLE == 'writer'){

header('Location:'.BLOG_URL.'admin/');

}

global $CACHE;

$options_cache = $CACHE->readCache('options');

$DB = MySql::getInstance();

$blogname = $options_cache['blogname'];

$bloginfo = $options_cache['bloginfo'];

$site_title = $options_cache['blogname'];

$site_title = '注冊用戶 - '.$blogname;

$site_description = $options_cache['bloginfo'];

$site_key = $options_cache['site_key'];

$log_title = '注冊用戶';

$comments = array('commentStacks'=>array(), 'commentPageUrl'=>'');

$yls_reg_enable = $options_cache['yls_reg_enable'];

if($yls_reg_enable != 'y'){

echo '';

exit();

}

$username = isset($_POST['name']) ? addslashes(trim($_POST['name'])) : '';

$password = isset($_POST['mima']) ? addslashes(trim($_POST['mima'])) : '';

$password2 = isset($_POST['mima2']) ? addslashes(trim($_POST['mima'])) : '';

if($username && $password && $password2 ?&& $yls_reg_enable == 'y'){

$sessionCode = isset($_SESSION['code']) ? $_SESSION['code'] : '';

//echo 去掉驗證碼

$User_Model = new User_Model();

if(!$User_Model -> isUserExist($username)){

$hsPWD = new PasswordHash(8, true);

$password = $hsPWD->HashPassword($password);

$User_Model->addUser($username, $password, 'writer', 'y');

$CACHE->updateCache();

echo'';

}else{

echo'';

}

}

?>


.{overflow-y:scroll}

button{

background-color: #ffffff;

border: 1px solid #ff6600;

box-shadow: 1px 1px 5px #ff6600;

color: ff6600;

width: 120px;

height: 32px;

margin-top: 18px;

}

input{

border: 1px solid #ff6600;

box-shadow: 1px 1px 5px #ff6600;

text-shadow: 1px 1px 5px #2828FF;

height: 32px;

font-size: 22px;

margin-right: 20px;

margin-bottom:0px;

padding: 1px 0px 1px 5px;

}

#h_reg{border: 1px solid #66ccff;width:860px;height:460px;text-align:center;margin-right:auto;margin-left:auto;padding:20px;}

#h_reg_lrft{border: 1px solid #ff6600;width:200px;height:440px;float:left;margin-right:20px;}

#h_reg_right{border: 1px solid #ff0000;width:636px;height:440px;float:left;}

#myContent{margin:10px;line-height:36px;font-size:26px;float:left;text-align:left;background:#ffffff;color:#282800;text-shadow: 1px 1px 5px #2828FF;overflow:auto;width:616px;height:380px;}

御坂網(wǎng)絡歡迎你


你好,我是御坂00000號,請問你是要加入御坂網(wǎng)絡,成為御坂網(wǎng)絡的一員嗎?


var myContenttxt = "";

var charIndex = -1;

var stringLength = 0;

var inputText;

var t;

function writeContent(init,w){

if(init){

if(w==0){if(document.getElementById("1").value){t=999;charIndex=-1;inputText ="接口已經(jīng)關閉了呢";}else{t=w;charIndex=-1;inputText = document.getElementById('contentToWrite').innerHTML;}}

if(w==1){t=w;charIndex=-1;inputText = "
御坂00000號:好的,那么請問該怎么稱呼你呢?";}

if(w==2){t=w;charIndex=-1;inputText = "
御坂00000號:再見,( ^_^ )/~~拜拜";}

if(w==3){t=w;charIndex=-1;inputText = "
御坂00000號:好的,"+"你的名字是 "+document.getElementById("name").value+" ,確定就用這個名字了嗎?";}

if(w==31){t=w;charIndex=-1;inputText = "
御坂00000號:你沒有輸入任何內(nèi)容啊,請輸入.";}

if(w==32){t=w;charIndex=-1;inputText = "
御坂00000號:名字太短啦,從新輸入.";}

if(w==33){t=w;charIndex=-1;inputText = "
御坂00000號:名字不能有空格呢,從新輸入.";}

if(w==4){t=w;charIndex=-1;inputText = "
御坂00000號:好的,"+"「 "+document.getElementById("name").value+" 」確定!
下面為這個名字設置一個對應的口令吧,在與御坂網(wǎng)絡連接時我會確認你的口令,不對的話就不能連接了!不要忘記了哦.";}

if(w==5){t=w;charIndex=-1;inputText = "
御坂00000號:好的,請從新輸入一個名字吧!";}

if(w==61){t=w;charIndex=-1;inputText = "
御坂00000號:"+"「 "+document.getElementById("name").value+" 」,剛剛是故意的吧,還有空沒填寫,請重新填寫口令呢.";}

if(w==62){t=w;charIndex=-1;inputText = "
御坂00000號:"+"「 "+document.getElementById("name").value+" 」,剛剛是故意的吧,兩個空填的內(nèi)容都不一樣的,請重新填寫口令呢.";}

if(w==64){t=w;charIndex=-1;inputText = "
御坂00000號:"+"「 "+document.getElementById("name").value+" 」,剛剛是故意的吧,密碼的長度太短了,請重新填寫口令呢.";}

if(w==65){t=w;charIndex=-1;inputText = "
御坂00000號:"+"「 "+document.getElementById("name").value+" 」,剛剛是故意的吧,密碼有空格,請重新填寫口令呢.";}

if(w==63){if(document.getElementById("2").value){t=63;charIndex=-1;inputText = "
御坂00000號:"+"恭喜你「 "+document.getElementById("name").value+" 」,系統(tǒng)接受了你的連接申請啦.
你的連接ID是: "+document.getElementById("name").value+"
你的連接口令: 剛剛輸入的口令



";}

if(document.getElementById("3").value){t=664;charIndex=-1;inputText = "
御坂00000號:"+"這個名字被別人用啦.";}}

if(w==8){t=w;charIndex=-1;inputText = "新人指引
御坂網(wǎng)絡是一個和諧有愛的地方,需要大家能共同維護呢.要時刻注意,不要以任何方式去攻擊他人哦!
下面開始新人指引咯:
在21世紀的某一天,一位平凡的科學家在經(jīng)歷無數(shù)次的失敗后終于使用NeuralLinker裝置成功的連接到了虛擬的世界--御坂網(wǎng)絡,從這一刻開始,禁錮人類幾千年的次元之墻終于被打破,等待人類的將是怎樣的未來?,御坂網(wǎng)絡在這一刻誕生了.
";}

if(w==10){t=w;charIndex=-1;inputText = "新人指引進行中...
御坂網(wǎng)絡使用了指令式的互動方式,區(qū)別于普通訪問方式之外還可以直接輸入指令進行網(wǎng)絡互動.我想初次訪問時你已經(jīng)發(fā)現(xiàn)了首頁的五種模式選擇了吧,雖然那時候的你還無法使用這個功能.現(xiàn)在,你已經(jīng)可以使用這些功能了.
";}

if(w==11){t=w;charIndex=-1;inputText = "新人指引進行中...
模式選擇:御坂網(wǎng)絡共有5中模式選擇,分別是「 搜索模式」,「 娛樂模式」,「互動模式 」,「游戲模式 」和「 普通模式」,不同模式可以使用不同指令進行操作哦.輸入對應的名稱就可以進入到對應模式中操作了.如果操作指令忘記了的話也可以在任何模式中輸入「幫助」即可顯示出使用幫助,這里就不在細說了.更多功能還需自己去發(fā)現(xiàn),不能一下子就全都給泄露出去呢,嘿嘿.輸入互動模式試著和大家互動看看.
";}

if(w==9){t=w;charIndex=-1;inputText = "
御坂00000號和你的連接被主動斷開,新人指引程序結束.
御坂網(wǎng)絡的相關功能和操作只能靠自己去摸索啦.
";}

}

if(charIndex==-1){

charIndex = 0;

stringLength = inputText.length;

}

var initString = document.getElementById('myContent').innerHTML;

initString = initString.replace(/

var theChar = inputText.charAt(charIndex);

var nextFourChars = inputText.substr(charIndex,4);

if(nextFourChars=='
' || nextFourChars=='
'){

theChar ?= '
';

charIndex+=3;

}

initString = initString + theChar + " ";

document.getElementById('myContent').innerHTML = initString;

charIndex = charIndex/1 +1;

if(charIndex%2==1){

document.getElementById('blink').style.display='none';

}else{

document.getElementById('blink').style.display='inline';

}

if(charIndex<=stringLength){

setTimeout('writeContent(false)',10);

}else{

blinkSpan();

myContenttxt=document.getElementById("myContent").innerHTML+"
";

w=t;

if(w==999){document.getElementById("myContent").innerHTML=inputText+"再見";

}

if(w==0){document.getElementById("myContent").innerHTML="";

document.getElementById("myContent").innerHTML=myContenttxt+"

YES? NO

";

}

if(w==1 || w==664){document.getElementById("myContent").innerHTML=inputText+"

取好了

";

}

if(w==3){document.getElementById("myContent").innerHTML=inputText+"

YES? NO

";//

}

if(w==31){document.getElementById("myContent").innerHTML=inputText+"

取好了

";

}

if(w==32){document.getElementById("myContent").innerHTML=inputText+"

取好了

";

}

if(w==33){document.getElementById("myContent").innerHTML=inputText+"

取好了

";

}

if(w==5){document.getElementById("myContent").innerHTML=inputText+"

取好了

";

}

if(w==4){document.getElementById("myContent").innerHTML=inputText+"

輸入口令


重復口令


我設置完了

";

}

if(w==61){document.getElementById("myContent").innerHTML=inputText+"

輸入口令


重復口令


我設置完了

提示:沒有填寫完整口令哦";}

if(w==62){document.getElementById("myContent").innerHTML=inputText+"

輸入口令


重復口令


我設置完了

提示:兩次輸入的口令不正確哦";}

if(w==64){document.getElementById("myContent").innerHTML=inputText+"

輸入口令


重復口令


我設置完了

提示:密碼長度太短了哦";}

if(w==65){document.getElementById("myContent").innerHTML=inputText+"

輸入口令


重復口令


我設置完了

提示:密碼不能有空格哦";}

if(w==63){document.getElementById("myContent").innerHTML=inputText+"查看新人指引我不需要
數(shù)據(jù)寫入御坂網(wǎng)絡,成功連接到網(wǎng)頁模塊.";}

if(w==8){document.getElementById("myContent").innerHTML=inputText+"繼續(xù)";}

if(w==10){document.getElementById("myContent").innerHTML=inputText+"繼續(xù)";}

if(w==11){document.getElementById("myContent").innerHTML=inputText+"我明白啦,再見";}

if(w==9){document.getElementById("myContent").innerHTML=inputText+"再見";}

}

}

var currentStyle = 'inline';

function blinkSpan(){

if(currentStyle=='inline'){

currentStyle='none';

}else{

currentStyle='inline';

}

document.getElementById('blink').style.display = currentStyle;

setTimeout('blinkSpan()',1000);

}

writeContent(true,0);

function myFunction(r){//鼠標點擊

if(r==1){

document.getElementById("myContent").innerHTML="";

writeContent(true,1);

}else if(r==2){

document.getElementById("myContent").innerHTML="";

writeContent(true,2);

}else if(r==3){

var name = document.getElementById("yonghuming").value;

if(document.getElementById("yonghuming").value==""){

document.getElementById("myContent").innerHTML="";writeContent(true,31);

}else if(name.length < 2){document.getElementById("myContent").innerHTML="";writeContent(true,32);

}else if(name.match(/\s/)){document.getElementById("myContent").innerHTML="";writeContent(true,33);}else{

document.getElementById("name").value=document.getElementById("yonghuming").value;

document.getElementById("myContent").innerHTML="";

writeContent(true,3);}

}else if(r==4){

document.getElementById("myContent").innerHTML="";

writeContent(true,4);

}else if(r==6){

document.getElementById("mima").value=document.getElementById("mymima").value;

document.getElementById("mima2").value=document.getElementById("mymima2").value;

var mima = document.getElementById("mima").value;

var mima2 = document.getElementById("mima2").value;

if(document.getElementById("mima").value=="" || document.getElementById("mima2").value==""){document.getElementById("myContent").innerHTML="";writeContent(true,61);}

else if(document.getElementById("mima").value!=document.getElementById("mima2").value){document.getElementById("myContent").innerHTML="";writeContent(true,62);}else if(mima.length < 6 || mima2.length < 6){document.getElementById("myContent").innerHTML="";writeContent(true,64);}else if(mima.match(/\s/) || mima2.match(/\s/)){document.getElementById("myContent").innerHTML="";writeContent(true,65);}else{document.getElementById("myContent").innerHTML="";document.getElementById("myForm").submit();writeContent(true,63);}

}else ?if(r==7){writeContent(true,7);}else if(r==8){document.getElementById("myContent").innerHTML="";writeContent(true,8);}else if(r==9){document.getElementById("myContent").innerHTML="";writeContent(true,9);}else if(r==10){document.getElementById("myContent").innerHTML="";writeContent(true,10);}else if(r==11){document.getElementById("myContent").innerHTML="";writeContent(true,11);}else{

document.getElementById("myContent").innerHTML="";

writeContent(true,5);

}

}

function seover(r){//鼠標移到 yes no 顯示的內(nèi)容

if(r==1){

document.getElementById("myContent").innerHTML=myContenttxt+"

YES? NO
";

}else if(r==2){

document.getElementById("myContent").innerHTML=myContenttxt+"

YES? NO
";

}else if(r==4){

document.getElementById("myContent").innerHTML=myContenttxt+"

YES? NO
";

}else{

document.getElementById("myContent").innerHTML=myContenttxt+"

YES? NO
";

}

}

最后編輯于
?著作權歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內(nèi)容

  • 單例模式 適用場景:可能會在場景中使用到對象,但只有一個實例,加載時并不主動創(chuàng)建,需要時才創(chuàng)建 最常見的單例模式,...
    Obeing閱讀 2,315評論 1 10
  • 事件源對象 event.srcElement.tagName event.srcElement.type 捕獲釋放...
    孤魂草閱讀 1,007評論 0 0
  • 1. tab列表折疊效果 html: 能源系統(tǒng)事業(yè)部 崗位名稱: 工作地點 崗位名...
    lilyping閱讀 2,014評論 0 1
  • 在初中時,我學過辛棄疾的一首詞《丑奴兒·書博山道中壁》: 少年不識愁滋味,愛上層樓。愛上層樓,為賦新詞強說愁。 而...
    c7d9204d01d5閱讀 525評論 0 0
  • 今天兒子開學第六天,看來他已經(jīng)習慣了,早晨我也送兒子去學校,看著兒子背著書包走進校園的背影,忽然覺得...
    皓小然媽媽閱讀 192評論 0 0

友情鏈接更多精彩內(nèi)容