查看: 2885|回复: 6
收起左侧

[已解决] 求提取邮箱登录代码

 关闭 [复制链接]
lomo
发表于 2010-11-17 10:10:33 | 显示全部楼层 |阅读模式
本帖最后由 lomo 于 2010-11-17 11:58 编辑

想在自己blog页面添加一个电邮嵌入式登录模板
能否从以下页面源代码提取红框选定的内容,做一个简单的登录代码
要求wordpress可以支持
点击登录后能在新窗口打开
http://mail.rove.org.ru/


可用如下临时账户测试
邮箱:test@rove.org.ru
密码:try123

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?快速注册

x
特邀体验者
发表于 2010-11-17 11:33:08 | 显示全部楼层
一般的会搞,嵌在wp里面就不会了,没有接触wp的模板
Lgwu
头像被屏蔽
发表于 2010-11-17 11:33:31 | 显示全部楼层
CSS楼主可自己增加:
  1. <DIV class=content>
  2. <DIV class=main>
  3. <DIV class=login>
  4. <FORM class=form name=dform onsubmit="return doSubmit()" action=""
  5. method=post><INPUT type=hidden value=rove.org.ru name=domain>
  6. <DIV class=fi><LABEL class=lb>帐 号:</LABEL> <INPUT class=ipt-t
  7. style="WIDTH: 140px" name=account_name> <B class=at>@</B><STRONG
  8. class=domain>rove.org.ru</STRONG> </DIV>
  9. <DIV class=fi><LABEL class=lb>密 码:</LABEL> <INPUT class="ipt-t ipt-t-pwd"
  10. style="WIDTH: 140px" type=password name=password> <A
  11. href="http://mail.rove.org.ru/pass.htm" target=_blank>忘记密码</A> </DIV>
  12. <DIV class="fi fi-btns"><BUTTON class="btn btn-login"
  13. onmouseover="this.className+=' btn-login-hover'"
  14. onmouseout="this.className='btn btn-login'" type=submit><SPAN>登
  15. 录</SPAN></BUTTON> </DIV></FORM></DIV></DIV></DIV>
  16. <SCRIPT type=text/javascript>
  17.         function resize(){
  18.                 var minh = 700;
  19.                 document.getElementById("divPage").style.height = document.documentElement.offsetHeight < minh ? minh+"px" : "100%";
  20.         }

  21.         window.onresize = resize;

  22.         window.onload = function(){
  23.                 resize();               
  24.                
  25.                 var fm = window.document.dform;
  26.                 var remUserName=cookie("ym_rem_user");
  27.                 if(remUserName){
  28.                         var user=remUserName.split("@",2)[0];                       
  29.                         var domain=remUserName.split("@",2)[1];                       
  30.                                
  31.                         fm.account_name.value=user;
  32.                                        
  33.                         fm.rem.checked="checked";
  34.                                
  35.                        
  36.                         fm.password.focus();
  37.                 }
  38.         }
  39.        
  40.        
  41.        
  42.         function doSubmit(){               
  43.                 var fm = window.document.dform;
  44.                 var user = fm.account_name.value;
  45.                 var pass = fm.password.value;
  46.                 if( user == '' || user.length == 0 ||
  47.                         pass == '' || pass.length == 0 ){
  48.                         alert( "请输入用户名和密码" );
  49.                         return false;
  50.                 }
  51.                
  52.                 var t = user.split("@");                                       
  53.                 if( t.length >= 2 ){
  54.                         user = t[0];
  55.                         fm.account_name.value = t[0];
  56.                         if( t[1] != 'rove.org.ru' ){
  57.                                 alert( "你输入的用户域名不匹配,请重新输入" );
  58.                                 return false;
  59.                         }
  60.                 }
  61.                
  62.                 //fm.action = fm.ssl.checked?"https://entry.ym.163.com/login/login":
  63.                                 //"http://entry.ym.163.com/login/login";
  64.                 fm.action="https://entry.ym.163.com/login/login";
  65.                
  66.                
  67.                 var exp  = new Date();
  68.                 var userAtDomain = user + "@rove.org.ru";
  69.                 //if(fm.rem.checked){                          
  70.                            exp.setTime(exp.getTime() + 86400 * 365 * 10);
  71.                         document.cookie="ym_rem_user="+userAtDomain+";domain=rove.org.ru;path=/;expires="+exp.toGMTString();
  72.                 //}else{  
  73.                         //exp.setTime(exp.getTime()-1);
  74.                         //document.cookie="ym_rem_user=;domain=rove.org.ru;path=/;expires="+exp.toGMTString();
  75.                 //}
  76.                
  77.                 return true;               
  78.         }
  79.        
  80.        
  81.        

  82. cookie = function(key, value, options){
  83.         if(typeof value=="undefined"){
  84.                 value=null;
  85.                 if(document.cookie && document.cookie!=''){
  86.                         var arr = document.cookie.split(";");
  87.                         for(var i=0;i<arr.length;i++){
  88.                                 var c = arr[i].trim();
  89.                                 if (c.substring(0, key.length + 1) == (key + '=')) {
  90.                                         value = decodeURIComponent(c.substring(key.length + 1));
  91.                                         break;
  92.                                 }
  93.                         }
  94.                 }
  95.                 return value;
  96.         }
  97.         options = options || {};
  98.         if(value===null){
  99.                 value="";
  100.                 options.expires=-1;
  101.         }
  102.         var expires="";
  103.         if(options.expires && (typeof options.expire=="number" || options.expires.toUTCString)){
  104.                 var date;
  105.                 if(typeof options.expire=="number"){
  106.                         date = new Date();
  107.                         date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
  108.                 }else{
  109.                         date = options.expires;
  110.                 }
  111.                 expires = "; expires=" + date.toUTCString();
  112.         }
  113.         var path = options.path ? '; path=' + (options.path) : '';
  114.         var domain = options.domain ? '; domain=' + (options.domain) : '';
  115.         var secure = options.secure ? '; secure' : '';
  116.         document.cookie = [key, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
  117. }       

  118. String.prototype.trim = function() {
  119.         return this.replace(/(^\s+)|(\s+$)/g, "");
  120. };
  121. </SCRIPT>

复制代码

评分

参与人数 1人气 +1 收起 理由
lomo + 1 感谢帮助

查看全部评分

lomo
 楼主| 发表于 2010-11-17 11:39:31 | 显示全部楼层
回复 3楼 Lgwu 的帖子

谢谢!可用!
能否设定为在新窗口打开邮箱
那个_blank加在哪里
再把【忘记密码】去掉
麻烦完善下
lomo
 楼主| 发表于 2010-11-17 11:47:19 | 显示全部楼层
嗯 我自己也看了下
这代码分为两部分
刚开始只复制了上面一部分 所以无法调用
Lgwu
头像被屏蔽
发表于 2010-11-17 11:52:12 | 显示全部楼层
回复 4楼 lomo 的帖子

新窗口打开,在<form>标签里面增加target="_blank"
  1. <FORM class=form name=dform onsubmit="return doSubmit()" action=""
  2. method=post target="_blank">
复制代码
去掉【忘记密码】,去掉下面的代码:
  1. <A
  2. href="http://mail.rove.org.ru/pass.htm" target=_blank>忘记密码</A>
复制代码

评分

参与人数 1经验 +10 收起 理由
宝贝要升天了 + 10 感谢提供分享

查看全部评分

lomo
 楼主| 发表于 2010-11-17 11:58:04 | 显示全部楼层
回复 6楼 Lgwu 的帖子

谢谢!
人气待恢复后奉上~
您需要登录后才可以回帖 登录 | 快速注册

本版积分规则

手机版|杀毒软件|软件论坛| 卡饭论坛

Copyright © KaFan  KaFan.cn All Rights Reserved.

Powered by Discuz! X3.4( 沪ICP备2020031077号-2 ) GMT+8, 2025-6-15 14:59 , Processed in 0.131062 second(s), 20 queries .

卡饭网所发布的一切软件、样本、工具、文章等仅限用于学习和研究,不得将上述内容用于商业或者其他非法用途,否则产生的一切后果自负,本站信息来自网络,版权争议问题与本站无关,您必须在下载后的24小时之内从您的电脑中彻底删除上述信息,如有问题请通过邮件与我们联系。

快速回复 客服 返回顶部 返回列表