找回密码
 注-册

QQ登录

只需一步,快速开始

查看: 1503|回复: 0

[美化] 跳出提醒注冊窗口 Dz通用(提示注册插件)

[复制链接]
Leya 发表于 2008-10-16 00:14:32 | 显示全部楼层 |阅读模式
1。编辑模板header.htm
在</head> 和 <body> 间插入以下代码
  1. <!--{if !$discuz_user}--><SCRIPT language=JavaScript1.2>
  2. adTime=5;
  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-160;
  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. </SCRIPT>
  39. <!--{/if}-->
复制代码
2。修改index.htm模板

找到
  1. {template header}
复制代码
在下面加入
  1. <!--{if !$discuz_user}-->
  2. <DIV id=sponsorAdDiv style="position: absolute;visibility: hidden;height: 1;width: 1;top: 50;left: 50">

  3. <table width=520 height=320 bgcolor={BORDERCOLOR} style="border: 1 outset #FFFFFF"><tr><td>

  4. <table width=490 height=290 bgcolor=FFFFFF align=center style="border: 1 inset #EEEEEE">
  5. <tr><td align=center valign=middle>
  6. <img src={IMGDIR}/logo.gif border=0><P>请先注冊以避免此视窗出现<br><br>
  7. <b><a href=register.php title=按这里进行注冊><u>注 冊</u></a>  
  8. <a href=logging.php?action=login title=从这里开始进入社区><u>登 入</u></a></b><p>(此视窗將于 5 秒后自动关闭)</td></tr></table></td></tr></table></div><!--{/if}-->
复制代码
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注-册

本版积分规则

Archiver|手机版|小黑屋|DoDVip ( 桂ICP备14000730号 )

GMT+8, 2024-5-18 16:03 , Processed in 0.049075 second(s), 21 queries .

Powered by Discuz! X3.5

Copyright © 2001-2024 Tencent Cloud.

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