daily pastebin goal
43%
SHARE
TWEET

Cookie bar

kartofelek007 Mar 29th, 2013 303 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php /*****************************************
  2. pamiętaj o dołączeniu do strony biblioteki :
  3. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
  4.  
  5. ...i podmianie linków w tekście belki
  6.  
  7. ************************************************/
  8. ?>
  9.  
  10. <?php
  11. if (!isset($_COOKIE['cookieInfo'])): //cokie bar begin
  12. ?>
  13.     <div class="cookie-bar">
  14.         <div>
  15.                 W ramach naszej witryny stosujemy pliki cookies, aby ułatwić Ci korzystanie z naszego serwisu oraz do celów statystycznych. Korzystanie z witryny bez zmiany ustawień dotyczących plików cookies oznacza zgodę na ich użycie oraz zapisanie w pamięci urządzenia. Możesz samodzielnie zarządzać cookies i dokonać zmiany ustawień w swojej przeglądarce.<br>
  16.                         Więcej informacji w naszej <a href="#">Polityce prywatności</a>.
  17.         </div>
  18.         <span class="close" title="Zamknij (ESC)">OK</span>
  19.     </div>
  20.         <style type="text/css">
  21.                 .cookie-bar {position:relative; background:#eee; overflow:hidden; box-shadow:inset 0 -1px 1px rgba(0, 0, 0, 0.2);}
  22.                 .cookie-bar > div {font:11px Arial, sans-serif; color:#444; max-width:960px; margin:10px auto; text-align: left; padding-left:10px; padding-right:100px;}
  23.                 .cookie-bar a {text-decoration:none; color:#1373cc; text-decoration: underline;}
  24.                 .cookie-bar .close {font:bold 12px/28px Arial, sans-serif; color:#fff; position:absolute; top:50%; margin-top:-15px; right:10px; cursor:pointer; background: #666; display:inline-block; border-radius:3px; height:30px; width:60px; display:block; text-align:center; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;}
  25.                 .cookie-bar .close:hover {background:#555;}                    
  26.                 @media only screen and (max-width: 400px) {
  27.                         .cookie-bar > div {padding-left:10px; padding-right:10px; margin:15px 0;}
  28.                         .cookie-bar .close {position: relative; display:block; width:96%; margin:5px 2%; top:0; right:0;}
  29.                 }
  30.         </style>
  31.         <script type="text/javascript">
  32.            $.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1}var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000))}else{date=options.expires}expires='; expires='+date.toUTCString()}var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('')}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break}}}return cookieValue}};
  33.                 function destroyCookie() {$.cookie('hideCookieBar',1,{expires:365})};$(function(){if($.cookie('hideCookieBar')){$('.cookie-bar').remove();}else{$('.cookie-bar').show();}$(document).keyup(function(e) {e.preventDefault();if (e.keyCode == 27) {$('.cookie-bar .close').click();}});$('.cookie-bar .close').on('click', function(e) {e.preventDefault();$(this).parents('.cookie-bar').slideUp(),function(){destroyCookie();});});})
  34.         </script>
  35. <?php
  36. endif; //end cookie bar
  37. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top