We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24449
    • 81 Posts
    Hi dredzs,

    Sounds like you have it working perfectly and it is correctly preventing you from creating a gallery without being logged in wink

    If you don’t give the AutoGallery snippet an explicit "gallery=" (Which you don’t want to do if you want just one page to format all galleries) then it looks in the request (the PHP REQUEST array covers both GET and POST) - so it will expect you to have hit a link of the form "gallerypage?gallery=MY%20GREAT%20PICS". If that doesn’t exist it defaults to the MODx page id of the page its on (I suspect thats the 18 in this case).

    However it has selected a gallery it then looks for the folder under assets/galleries. If you have made a nice folder full of images there it will display it. In your case its looking for /assets/galleries/18. Since that isn’t there it can’t do anything. The recent additions allow for web based gallery management. Consequently, if you were logged in (to the frontend, via weblogin or webloginPE) as a user in one of the designated admin groups (set in the admingroups argument to the snippet call) it would create the folder and the MemberCheck call on the line below would present you with the "Add an image" button. Since you aren’t logged in it doesn’t create the directory (which seems a good idea, otherwise people could hit gallerypage?gallery=../../../../../etc/evildir" or whatever).

    Also, the snippet calls on gallerypage ought to end with !] rather than ]] - I’ve just had a look at the example on our site and it was wrong because MODx had changed it(!). You have to do some slightly fruity things to get MODx to display [!blah!] rather than try to execute it!


    Ramsay
      • 34120
      • 236 Posts
      Hi, nice snippet, thanks!
      I’ve got a basic setup working. Any updates on image ordering? There is a fix back on page one but I was wondering if anything has been added to the latest version.

      I’d also like to confirm what is the latest version and where is it available?

      Thanks
        • 24449
        • 81 Posts
        Hi,

        The latest version is (and will always be) the one at http://www.zombietuesday.com/autogallery

        I can’t get the MODx website snippet manager system to work consistently, so I haven’t kept that one up to date.

        As for ordering, it currently orders the items in whatever way the PHP sort() function chooses. This is built in to the current code.

        If there is demand for more complex ordering I could add it. What orderings do people want? Arbitrary from a db field would seem the obvious one.


        Ramsay
          • 1687
          • 25 Posts
          Hello,

          I’m trying to have two different call in the same page...
          I have square cropped pictures 200X200 and i need 400X300 for the other call... But the second call give the same 200X200 result...

          Could someone help me ?

          Many thanks
            • 24449
            • 81 Posts
            Hi,

            Are you trying to get the same gallery in each of the calls? At present thats impossible since - once it has generated the thumbnails once - they exist as actual files in the filesystem and there is no way to have two files thumbnails for the same file. I’d suggest calling AutoGallery once with the larger size and then using width and height arguments to the img tag to scale them down for the smaller display, since the browser will only download the file once anyway. If you need cropping you will have to do some fancy things with hidden-overflow divs... You might need some JS to copy the src values across, since I can’t think how you’d structure an item chunk to be in two sets at once.

            If, however, you are trying to display two different galleries then you will need to put a gallery= argument in the snippet calls, else they will pick up the same gallery from the Request or page id.


            Ramsay
            http://www.zombietuesday.com
              • 1687
              • 25 Posts
              Hi Ramsay,

              Thank you very much for your reply.

              I think about an auto-solution...

              Maybe something like that :

              Gallery name (folder) = page id
              each calls on the same document could have sub-number folders in the parent folder.

              Ex :
              - if there is one call > no subfolders ;
              - if there is multiple calls > folder(id)/subfolder(-01) + subfolder(-02)...
              The original pictures are always on the parent...

              Bravo and thanks for your great Snippet
                • 24449
                • 81 Posts
                Hi,

                Interesting idea. I think what might be a more general solution, though, would be to allow each snippet call to (optionally) specify a thumbnail prefix to use, so you could have two sets of thumbnails. Maybe something like:
                [!AutoGallery?blah...&tnprefix=`tn_`!]
                
                <blah>
                
                [!AutoGallery?blah..&tnprefix=`tn2_`!]


                Then you’s have three sets of files in the directory: filename.jpg, tn_filename.jpg, and tn2_filename.jpg and each snippet call could fish out its own ones.

                The principle downside is that it makes the file system contents more messy. I’m not sure how people feel about this? My attitude has always been that no-one sees the filesystem contents so it doesn’t matter very much, but given how upset everyone got when it doubled the extension for the thumbnails... wink

                It is possible to auto-detect that this is the second (or subsequent) call to AutoGallery on this page, if people really would prefer to let it work it out. I could even have it auto-detect whether the thumbnail size arguments had changed, but that might be considered overkill. Hence it appeals to me, so I might implement that too wink

                Anyway, I’ll have a go at implementing this a bit later.


                Ramsay

                  • 23235
                  • 40 Posts
                  Is there a way to limit the number of pictures displayed on a page, and then have pagination. I thought I had seen this for autoGallery, but now I can’t find it. Sorry if this is somewhere obvious and I just don’t see it.
                    • 24449
                    • 81 Posts
                    Hi Philbert,

                    The short answer is no, there isn’t. Its been on my list to add for a little while now.

                    What CAN be done is using AutoGallery with an XML chunk, and then using an AJAX frontend to do the pagination.

                    http://www.oursharedworld.com/Media.html does this - and you should feel free to steal the JS file wink I really should clean it up and present it rather more neatly. I think its a bit flaky and it may not do pagination so much as a kind of large gallery with a moving ’window’. If I remember correctly it expects an XML item with the class "galitem" that contains "name", "thumbnail", and "label".



                    Ramsay
                      • 23235
                      • 40 Posts
                      Thanks, I’ll look into it. If I can’t figure out, I’ll check back to see if pagination gets added. This is a really awesome snippet. I’ve got it started but once they start adding more pictures the load time for that page will really slow down. Here’s what it looks like.
                      http://www.yoursivet.com/pet-pics.php