Home > Panele > Aplet proszący o zarejes

Aplet proszący o zarejes

Dodane przez: piciu
opis:
kod Aplet proszący o zarejestrowanie się na stronie
Kod:
  1. if (!iMEMBER) {
  2. echo'<style type="text/css">
  3.  
  4. #topbar{
  5. position:absolute;
  6. border: 1px solid black;
  7. padding: 2px;
  8. background-color: white;
  9. width: 600px;
  10. visibility: hidden;
  11. z-index: 350;
  12. }
  13.  
  14.  
  15. </style> <script type="text/javascript">
  16. var persistclose=0 //set to 0 or 1. 1 means once the bar is manually closed, it will remain closed for browser session
  17. var startX = 30 //set x offset of bar in pixels
  18. var startY = 5 //set y offset of bar in pixels
  19. var verticalpos="fromtop" //enter "fromtop" or "frombottom"
  20.  
  21. function iecompattest(){
  22. return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
  23. }
  24.  
  25. function get_cookie(Name) {
  26. var search = Name + "="
  27. var returnvalue = "";
  28. if (document.cookie.length > 0) {
  29. offset = document.cookie.indexOf(search)
  30. if (offset != -1) {
  31. offset += search.length
  32. end = document.cookie.indexOf(";", offset);
  33. if (end == -1) end = document.cookie.length;
  34. returnvalue=unescape(document.cookie.substring(offset, end))
  35. }
  36. }
  37. return returnvalue;
  38. }
  39.  
  40. function closebar(){
  41. if (persistclose)
  42. document.cookie="remainclosed=1"
  43. document.getElementById("topbar").style.visibility="hidden"
  44. }
  45.  
  46. function staticbar(){
  47. barheight=document.getElementById("topbar").offsetHeight
  48. var ns = (navigator.appName.indexOf("Netscape") != -1) || window.opera;
  49. var d = document;
  50. function ml(id){
  51. var el=d.getElementById(id);
  52. if (!persistclose || persistclose && get_cookie("remainclosed")=="")
  53. el.style.visibility="visible"
  54. if(d.layers)el.style=el;
  55. el.sP=function(x,y){this.style.center=x+"px";this.style.top=y+"px";};
  56. el.x = startX;
  57. if (verticalpos=="fromtop")
  58. el.y = startY;
  59. else{
  60. el.y = ns ? pageYOffset + innerHeight : iecompattest().scrollTop + iecompattest().clientHeight;
  61. el.y -= startY;
  62. }
  63. return el;
  64. }
  65. window.stayTopLeft=function(){
  66. if (verticalpos=="fromtop"){
  67. var pY = ns ? pageYOffset : iecompattest().scrollTop;
  68. ftlObj.y += (pY + startY - ftlObj.y)/8;
  69. }
  70. else{
  71. var pY = ns ? pageYOffset + innerHeight - barheight: iecompattest().scrollTop + iecompattest().clientHeight - barheight;
  72. ftlObj.y += (pY - startY - ftlObj.y)/8;
  73. }
  74. ftlObj.sP(ftlObj.x, ftlObj.y);
  75. setTimeout("stayTopLeft()", 10);
  76. }
  77. ftlObj = ml("topbar");
  78. stayTopLeft();
  79. }
  80.  
  81. if (window.addEventListener)
  82. window.addEventListener("load", staticbar, false)
  83. else if (window.attachEvent)
  84. window.attachEvent("onload", staticbar)
  85. else if (document.getElementById)
  86. window.onload=staticbar
  87. </script>
  88.  
  89. <div id="topbar"><span class=gen><font face="verdana"><center>
  90. Aby w pełni korzystać z serwisu '.BASEDIR.' należy się zarejestrować. Można to zrobić <a href="'.BASEDIR.'register.php" class="gen"><b><font color="red"><blink>TUTAJ</blink></font></b></a><br/>Zapraszamy także na <a href="'.FORUM.'"><b><font color="blue">Forum '.$settings['sitename'].'</b></font></a><br><font color="#000000">Ten aplet jest widoczny tylko dla niezarejestrowanych użytkowników!</font>
  91. </center></font></span></div>';
  92. }

©