On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Hi @nir-z, and thanks for your answer.

    So here is the script:

    jQuery(document).ready(function(){
        if (document.cookie.indexOf('visited=true') == -1) {
            var fifteenDays = 1000*60*60*24*15;
            var expires = new Date((new Date()).valueOf() + fifteenDays);
            document.cookie = "visited=true;expires=" + expires.toUTCString();
            $.colorbox({width:"30%", inline:true, href:"#subscribe"});
        }
    });


    Is it possible to make the div appear after 20 or 30 seconds ?

    Tks
      Webdesigner and musician.
    • In case you still not found it.... setTimeout will do it.

      var t = setTimeout(function(){
      .....something (like $.colorbox....)
      },20000);

      should be 20 seconds.

      Regards.
        ___________________
        www.cascompany.net :: Dedicated & Shared Hosting
      • Has anyone tried using this with an SSL site as of yet? I tried playing around with this on a couple of my sites that have pretty similar setups and it seems to work on one, but the one that I force to go through https:// seems to create a 301 redirect when I click the link from this snippet to a url like this: https://www.mydomain.com443/home/ from https://www.mydomain.com/home/ (it adds 443 after the .com)


        This is my htaccess file:

        <IfModule mod_expires.c>
        ExpiresActive On
        ExpiresByType image/jpg "access 1 year"
        ExpiresByType image/jpeg "access 1 year"
        ExpiresByType image/gif "access 1 year"
        ExpiresByType image/png "access 1 year"
        ExpiresByType text/css "access 1 month"
        ExpiresByType text/html "access 1 month"
        ExpiresByType application/pdf "access 1 month"
        ExpiresByType text/x-javascript "access 1 month"
        ExpiresByType application/x-shockwave-flash "access 1 month"
        ExpiresByType image/x-icon "access 1 year"
        ExpiresDefault "access 1 month"
        </IfModule>
         
        Options +FollowSymlinks
        RewriteEngine On
        RewriteBase /
         
        # Fix Apache internal dummy connections from breaking [(site_url)] cache
        RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
        RewriteRule .* - [F,L]
         
        # Rewrite www.domain.com -> domain.com -- used with SEO Strict URLs plugin
        RewriteCond %{HTTP_HOST} .
        RewriteCond %{HTTP_HOST} !^sandramillerfloral\.com [NC]
        RewriteRule (.*) http://sandramillerfloral.com/$1 [R=301,L]
        
        # HTTPS goes first, with ending [L]
        RewriteCond %{HTTPS} off
        RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]
        
        # For Friendly URLs
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
         
        # Reduce server overhead by enabling output compression if supported.
        php_flag zlib.output_compression On
        php_value zlib.output_compression_level 5
        


        And this is the headers when doing a net-trace while clicking the link:

        Remote Address:107.170.25.225:443
        Request URL:https://sandramillerfloral.com/home2/?cl_add=96
        Request Method:GET
        Status Code:302 Found
        Request Headersview source
        Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
        Accept-Encoding:gzip,deflate,sdch
        Accept-Language:en-US,en;q=0.8
        Connection:keep-alive
        Cookie:cookieList[items]=238%2C96; _jsuid=2253275308; cookieList[cl_check]=1; minishop2-category-grid-41=%7B%22start%22%3A0%2C%22limit%22%3A%22%22%2C%22action%22%3A%22mgr/product/getlist%22%2C%22parent%22%3A%2241%22%7D; minishop2-category-grid-291=%7B%22start%22%3A0%2C%22limit%22%3A%22%22%2C%22action%22%3A%22mgr/product/getlist%22%2C%22parent%22%3A%22291%22%7D; _sp_id.1249=fff95082430ff96f.1409625806.5.1412220935.1412018382; minishop2-category-grid-67=%7B%22start%22%3A0%2C%22limit%22%3A%22%22%2C%22action%22%3A%22mgr/product/getlist%22%2C%22parent%22%3A%2267%22%7D; cookieList[items]=238; _gat=1; _ga=GA1.2.517265031.1408034058; PHPSESSID=cjoovd9lkah7qagcdh2uq111g1
        Host:sandramillerfloral.com
        Referer:https://sandramillerfloral.com/home2/
        User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36
        Query String Parametersview sourceview URL encoded
        cl_add:96
        Response Headersview source
        Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
        Connection:Keep-Alive
        Content-Encoding:gzip
        Content-Length:26
        Content-Type:text/html
        Date:Thu, 02 Oct 2014 16:51:53 GMT
        Expires:Thu, 19 Nov 1981 08:52:00 GMT
        Keep-Alive:timeout=5, max=98
        Location:https://sandramillerfloral.com443/home2/
        Pragma:no-cache
        Server:Apache
        Set-Cookie:PHPSESSID=cjoovd9lkah7qagcdh2uq111g1; path=/; httponly
        Set-Cookie:cookieList[items]=238%2C96; expires=Sat, 01-Nov-2014 16:51:53 GMT
        Vary:Accept-Encoding
        X-Powered-By:PHP/5.3.10-1ubuntu3.9
        
        



        Anyone had any experience with this in the past?
        • Quote from: paulp at Mar 16, 2013, 03:31 PM
          Right I've really got no idea how I can resolve this, I'm willing to pay someone to get this sorted for me / us and release an update as it doesn't appear to be supported.

          Could someone give me a price and I'll PM you FTP and admin logins ( no one with 2 posts though, has to be a trusted member ) wink

          Thanks

          Hi Paul,

          Did you ever find a fix for this. I'm having a very similar problem. However, I think this may be more of a getresources issue. This is my call:

          [[!getCookieList:isnot=``:then=`
          	[[!getResources?
          		&resources=`[[!getCookieList]]`
          		&parent=`795`
          		&tpl=`chnk_Basket`
          		&limit=`5`
          		&depth=`5`
          	]]
          `:else=`
          	<li>
          		<h4>The list is empty!</h4>
          	</li>
          `]]
          <li>
          [[!getCookieList]]
          </li>


          My second call [[!getCookieList]] lists the ID of the pages I have added to cookielist. But when I go to my Container for those items the getresources call shows ALL the resources in the container. If I change the &resources=`[[!getCookieList]]` to just a single resource ID it's also ignored by the call and still displays all the resources in that container. This is why I think it may be getresources. Would be great to know if you found a fix?
          • Well, I managed to resolve the issue with cookielist and getresource displaying resources other than those in the cookielist list. I'm not able to detail specifics as it was trial and error using different getresources calls in different templates until I got the desired results across my site.

            I do however have another issue and probably a feature request? I raised this here: http://forums.modx.com/thread/?thread=77771&page=1#dis-post-521081 but thought I would run it by the Cookielist Page too. But only briefly as all the info is on the other post.

            I'd like to use cookielist to have a 'Buy It Now' button, which will add an item to cookielist and then redirect to the basket page. I wondered if this is possible?
            • @nick - Did you ever solve this?
              I have had same issue and found the following on line 166 of CookieList class
              return $protocol.'://'.$_SERVER['SERVER_NAME'].$port.$params;

              Removed
              .$port

              and all sorted. Not sure of the logic for that being included in the url string.