Discuz教程网

[代码修改] Discuz X1.5相当醒目的会员注册提醒 增加8秒自动关闭

[复制链接]
authicon dly 发表于 2011-5-3 19:44:11 | 显示全部楼层 |阅读模式
截图402.jpg

打开/template/default/member/  的login_simple.htm文件

在<!--{if CURSCRIPT != 'member'}--> 下面添加如下代码:

  1. <style type="text/css">
  2. #regTip01{
  3. position:absolute;
  4. width:159px;
  5. height:60px;
  6. padding-right:5px;
  7. top:5px;
  8. left:490px;
  9. text-align:center;
  10. background:url('/static/image/lemo_images/reTip01.gif') no-repeat 0 0;
  11. z-index:100;
  12. }
  13. #regTip01 .a1{
  14. font-size:14px;
  15. color:#c9671c;
  16. font-weight:bold;
  17. }
  18. #regTip01 .a2{
  19. display:block;
  20. float:left;
  21. margin:3px;
  22. width:12px;
  23. height:12px;
  24. background:url('/static/image/lemo_images/guanbi01.gif') no-repeat 0 0;
  25. }
  26. #regTip01 .tipbox{
  27. float:left;
  28. margin-top:10px;
  29. }
  30. #regTip01 span{
  31. color:#6d6d6d;
  32. }
  33. .regTip01new{display:none;}
  34. </style>
  35. <!--登陆小提示 开始-->
  36. <div id="regTip01">
  37. <a class="a2" onclick="display('regTip01')" href="javascript:;"></a>
  38. <div class="tipbox">
  39. 还没有帐户?<a href="member.php?mod={$_G[setting][regname]}" onclick="showWindow('register', this.href)" class="xi2">马上注册</a><br>
  40. <span>会员有机会获得礼品哦!</span>
  41. </div>
  42. </div>
  43. <!--登陆小提示 结束-->
复制代码

如果位置有偏差,请修改top:5px;

left:490px;
的数值
如果不显示请修改图片路径

打开模板下的header.thm文件,找到body下面加:

  1. <SCRIPT LANGUAGE="JavaScript1.2">
  2. adTime=8;
  3. chanceAd=1;

  4. var ns=(document.layers);
  5. var ie=(document.all);
  6. var w3=(document.getElementById && !ie);
  7. adCount=0;
  8. function initAd(){
  9. if(!ns && !ie && !w3) return;
  10. if(ie) adDiv=eval('document.all.sponsorAdDiv.style');
  11. else if(ns) adDiv=eval('document.layers["sponsorAdDiv"]');
  12. else if(w3) adDiv=eval('document.getElementById("sponsorAdDiv").style');
  13. randAd=Math.ceil(Math.random()*chanceAd);
  14. if (ie||w3)
  15. adDiv.visibility="visible";
  16. else
  17. adDiv.visibility ="show";
  18. if(randAd==1) showAd();
  19. }
  20. function showAd(){
  21. if(adCount<adTime*10){adCount+=1;
  22. if (ie){documentWidth =document.body.offsetWidth/2+document.body.scrollLeft-20;
  23. documentHeight =document.body.offsetHeight/2+document.body.scrollTop-20;}
  24. else if (ns){documentWidth=window.innerWidth/2+window.pageXOffset-20;
  25. documentHeight=window.innerHeight/2+window.pageYOffset-20;}
  26. else if (w3){documentWidth=self.innerWidth/2+window.pageXOffset-20;
  27. documentHeight=self.innerHeight/2+window.pageYOffset-20;}
  28. adDiv.left=documentWidth-200;adDiv.top =documentHeight-200;
  29. setTimeout("showAd()",100);}else closeAd();
  30. }
  31. function closeAd(){
  32. if (ie||w3)
  33. adDiv.display="none";
  34. else
  35. adDiv.visibility ="hide";
  36. }
  37. onload=initAd;
  38. //End-->
  39. </script>
复制代码

再把刚刚前面的那个修改成下面代码
  1. <!--登陆小提示 开始 -->
  2. <div id="sponsorAdDiv" style="visibility:hidden">
  3. <div id="regTip01">
  4. <a class="a2" onclick="display('regTip01')" href="javascript:;"></a>
  5. <div class="tipbox">
  6. 还没有帐户?<a href="member.php?mod={$_G[setting][regname]}" onclick="showWindow('register', this.href)" class="xi2">马上注册</a><br>
  7. <span>有机会获得礼品!</span>
  8. </div></div>
  9. </div>
  10. <!--登陆小提示 结束 -->
复制代码

也只是增加了
<div id="sponsorAdDiv" style="visibility:hidden">

图片附件下载:
游客,如果您要查看本帖隐藏内容请回复






上一篇:Discuz X 1, 1.5, 2默认头像按性别区分
下一篇:Discuz X1.5加强帖子阅读页屏蔽提示,提高警示作用!
authicon rabzhang 发表于 2011-5-3 23:54:39 | 显示全部楼层
进来学习一下,谢谢楼主提供
authicon forever21 发表于 2011-5-6 17:08:13 | 显示全部楼层
好像不错的样子
authicon 皆无 发表于 2011-5-6 17:09:45 | 显示全部楼层
哦哦,发财了啊,看到好东西啦
authicon 皆无 发表于 2011-5-6 17:15:35 | 显示全部楼层
好东西,要下来看看
authicon 计晨 发表于 2011-5-6 17:15:44 | 显示全部楼层
万分感谢楼主
authicon nancybingling 发表于 2011-5-6 17:18:13 | 显示全部楼层
不错,我喜欢
authicon nancybingling 发表于 2011-5-6 17:29:56 | 显示全部楼层
不错,谢谢分享
authicon cutiemimi 发表于 2011-5-6 17:36:55 | 显示全部楼层
这个要顶起来啊
authicon 蓝色天空k 发表于 2011-5-6 17:38:03 | 显示全部楼层
有意思~顶顶 ,继续顶顶。继续顶哦
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

1314学习网 ( 浙ICP备10214163号 )

GMT+8, 2025-5-3 05:40

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

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