On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Looking to download this? Get the resources from MODx resource repository!

    Hi,

    So I’ve been doing this more advanced gallery snippet for a while and thought, that it’s ready for the public viewing now. It is still pretty much work in progress, but very usable in the current state too. I started to work on this snipped based on EtoGal and many thanks goes to it’s authors Frank Siegert (hugelmopf) + Mike Finley (mikef) for their hard work. MaxiGallery is evolved from it’s origin alot and have tons of great new features. Main features being:


    • Included language files: English, Finnish, Deutch, Spanish, France, Italian, Dutch. Easy to make more, every output string extenalized to a language file.
    • Possible to allow webusers/usergroups to manage their own or shared galleries
    • Slidebox and Lightbox v2.0 enabled browsing and of embedded galleries (also option for popup and new window)
    • Automatic watermarking of images (text or transparent PNG)
    • Automatic imagemasking, you can use your own made grayscale masks
    • Automatic dropshadow generation to images
    • Possible to manage pictures on a separate document or call management of one gallery on another doc
    • Possible to set a max pictures limit in a gallery
    • Possible to keep original (or just bigger) images and link to them from browsing mode
    • Possible to set quality percentage of each picture size
    • Possible to paginate gallery overviews to multiple pages
    • Support jpg/jpeg, png and gif images (gif’s are converted to png). Also in zip-archives if ZZIPlib is installed.
    • And lots of other smaller additions and enhancements to the code what’s left from etogal

    Also by using the MaxiGallerySolo snippet (attatched below) you can achieve the following:


    • Get latest or random pictures from selected galleries
    • Possible to limit how many pictures are retrieved
    • Possible actions to do when user clicks the images:[list]
      [li]Open in lightbox (which has all pictures from selected galleries on the pictureset)
    • Open the image in the normal gallery image browser
    • Open the gallery overview which that image belongs to
    [/li]
    [/list]

    There is some demos here (if the site is not offline). You can see the snippet calls at the bottom of the pages, what were used to create these galleries. I’m using this as a test site for myself, so if there is something weird going on when you visit there, I’m probably just testing something. grin

    ScottyDelicious has also put up a great demosite for MaxiGallery.
    There is 4 sections at the site, you can see the snippet calls at the gallery pages:

    • Default - basically nothing more than [!MaxiGallery!]
    • DropShadow - uses drop shadow on the images and thumbs.
    • LightBox2 - uses the LightBox2 embedding feature.
    • Popup/Watermark - js popup window reveals full size image with sD watermark

    To get this snippet fully working, you have to use the latest MODx release.

    Installation is pretty straight forward:

    • 1. Extract the contents of the zip file to your computer
    • 2. FTP to your server an go to the modx installation folder
    • 3. Copy all exept maxigallery.txt to assets/snippets/maxigallery/ -folder
    • 4. Create a new folder assets/galleries/ and make it writable (CHMOD 0666 or 0777)
    • 5. Close your FTP program and go to the MODx manager
    • 6. Create a new snippet called "MaxiGallery" and paste the contents of maxigallery.txt to it
    • 7. Call the snippet on some document, check the available parameters at the start of the snippet
      [list]
      [li]There are some example snippet calls at the demo site
    • You have to call the snippet on an uncached page using "cached" snippet call i.e [[MaxiGallery]], because the automated javascript/css registration in MODx requires this for now. If you don’t call it this way, sometimes when you view the lightbox enabled galleries, the pictures may just open in a new window instead of the lightbox.
    [/li]
    [li]8. Go to the page that has the snippet call and you should see "Manage pictures" -button in there (if you did not set it off in the snippet call ofcourse wink)

    • note that you must be logged into the manager and have rights to edit the document (unless you have defined webusers/groups who can manage the callery and you are logged in at front-end)
    [/li][li]9. Upload some pics to the gallery and see the results.[/li]
    [/list]

    Extra info:

    • You can create new language files for the gallery too. Create lang_en.php in the maxigallery folder and slidebox_lang_en.js in the slidebox folder, where "en" is the key for your lang file. After this, use it in the $language setting at the snippet.
    • You can change the look of the lightbox by editing the maxigallery/slidebox/style.css -file. You can also change the overlay color of it and the loading images by creating new ones and defining them in your slidebox_lang_xx.js -file

    IMPORTANT NOTE: It depends on your server settings that how many pictures you can upload at a time and how big. The image masking process for example is very slow and you might get a "Maximum execution time of NN seconds exceeded" -error message, if you are trying to upload many images at the same time with imagemasking on.. or if the pictures are large. Also when using big images, you may get "Memory Size Exhausted" -error as the image processing takes alot of memory too. These errors are not errors in the snippet code, they are caused by server settings. MaxiGallery script tries to use ini_set to increase the execution time and memory limit if needed, but it cannot do it if php is running in safe mode. (I have my setup on a safe_mode enabled server with 15seconds of execution time and 30sec max_input_time and 32Mb memory limit. It can handle 10 images at a time taken with 4MP camera, but with image masking on I can kill it pretty easily)

    Wanna use picture commenting in MaxiGallery?

    It’s very easy to implement with the awesome Replix snippet (look for demo here). Here’s the steps to get it done:


    • 1. Create/Modify Replix form template and remove the action from the form tag
    • 2. Create a snippet called "GetPictureID" and use this at the snippet code:
      [list]
      [li]return $_GET[’pic’];
    [/li]
    [li]3. Create new chunk called "GalleryReplix" and add this to the chunk:

    • [!Replix? &tagid=[[GetPictureID]] &tplForm=`name_of_replix_form_chunk`!]
    [/li]
    [li]4. Create a document what is used to show gallery pictures. [/li]
    [li]5. Add the MaxiGallery and chunk calls to the target document:

    • [[MaxiGallery? &is_target=`1`]] {{GalleryReplix}}
    [/li]
    [li]6. Create a Gallery what uses the document above for target to display the pics:

    • [[MaxiGallery? &picture_target=`insert_target_document_id_here`]]
    [/li]
    [li]7. View results (add some pics to the gallery first smiley)[/li][/list]

    PS. This will be a bit easier and even more flexible when the templating of MaxiGallery is done.. (and that should be soon).

    Looking to download this? Get the resources from MODx resource repository!


      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
    • Dang ... that is just plain awesome. You trying to give G2 a run for its money? smiley

        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
      • That is AWESOME!!!!!!! GREAT WORK!!!!!!!!

        Only 1 suggestion, you might want to look into lightbox 2 as it has photoset support (multiple photos w prev next buttons w/o loading a new box...)
          [html]<div><div style="float:left;"><a href="http://modxcms.com/Ditto-487.html" target="_blank"><img src="http://modxcms.com/assets/images/ditto.gif" alt="" border="0"></a></div><div style="float:left; padding: 0 5px 0 5px; border-left: 2px solid #ddd; margin-left: 5px;"><a style="display:block;"href="http://modxcms.com/ditto_docs.html">Documentation</a><a style="display:block;" href="http://modxcms.com/ditto_trac.html">TRAC (Bugtracker)</a><a style="display:block;"href="http://modxcms.com/forums/index.php/board,180.0.html">Forum</a><a style="display:block;"href="http://modxcms.com/forums/index.php/topic,13348.0.html">How to get help</a></div><div style="float:left; padding: 0 5px 0 5px; border-left: 2px solid #ddd;"><a style="display:block;"href="http://modxcms.com/ditto_wiki.html">User Wiki</a><a style="display:block;" href="http://modxcms.com/ditto_credits.html">Credits</a><a style="display:block;"href="http://modxcms.com/ditto_svn.html">SVN Server</a><a style="display:block;"href="http://modxcms.com/ditto">Ditto HQ</a></div><div style="float:left; padding: 0 5px 0 5px; border-left: 2px solid #ddd;"><a style="display:block;"href="http://modxcms.com/ditto_stable_download.html"><strong><span style="color:#CC0000;">Stable Download</span></strong></a><a style="display:block;"href="http://modxcms.com/ditto_download.html"><strong><span style="color:#CC0000;">Development Download</span></strong></a></div><div style="clear: both;"></div></div>[/html]
        • Quote from: Mark at Apr 07, 2006, 02:45 AM

          Only 1 suggestion, you might want to look into lightbox 2 as it has photoset support (multiple photos w prev next buttons w/o loading a new box...)

          Look the demo. He got it with ajax and lightbox.

          That is AWESOME!!!!!!! GREAT WORK!!!!!!!!
          • I dont have another words... LOL laugh

            Its AWESOME!!!! GREAT WORK!!!!

            ;D

            Thanks for sharing

            regards,

            zi
              Zaigham R - MODX Professional | Skype | Email | Twitter

              Digging the interwebs for #MODX gems and bringing it to you. modx.link
            • Woaw it’s plain awesome, I just love the lightbox effects and overall feel of the gallery !

              Now I am off to read the code see what kind of parameters there are for this snippet smiley
                .: COO - Commerce Guys - Community Driven Innovation :.


                MODx est l&#39;outil id
              • Quote from: Mark at Apr 07, 2006, 02:45 AM
                Only 1 suggestion, you might want to look into lightbox 2 as it has photoset support (multiple photos w prev next buttons w/o loading a new box...)
                Hi, the lightbox/slidebox combination I have does support multiple photosets. If you use embedded display type and set embedtype to lightbox, you will get that. Upload your pics and click the "Save changes" and you should see it when viewing the gallery. I didn’t quite like the lightbox v2 my self, but I’ll add it as an option too. Also just remembered that I didn’t finish the FURL changes what I allredy started, gotta do that too.. expect an update soon!

                Thanks for the comments all! grin

                I have done some bug testing at the same time I built this, but there maybe some hidden ones still there.. so I’d appreciate that you inform me about them if you find any! wink

                EDIT: And feature suggestions are welcome also!


                  "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                • Magnificent! smiley

                  Must install and play with it now!

                  Richard
                  • This is very impressive, I will definatly have to give this a go on my site.
                    • It’s a very cool addon to MODx.

                      The installation seems to be quite intuitive for me. The snippet parameter can be a real tragedy for newbie, but you know what? Having a great flexibility and configuration at hands is a lot better, rather than missing those features. The best way will be to provide sample snippet calling to get this snippet up and running. wink

                      Another thing, check out my chunktpl library.
                      http://svn.djamoer.net/?do=browse&project=MODx&path=/trunk/libs/chunktpl/

                      It’s a simple library to do templating with chunk or plain text tpl file that you can shipped it together with your snippet distribution as a theme.
                      Hope it will help your development process a lot faster to bring this snippet into a stable state.

                      Keep up the good work. I wouldn’t mind seeing this as one of our official resources, when it’s stable. wink
                        Wendy Novianto
                        [font=Verdana]PT DJAMOER Technology Media
                        [font=Verdana]Xituz Media

                      This discussion is closed to further replies. Keep calm and carry on.