We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19257
    • 141 Posts
    So, if you create a chunk for themaxigallery &galleryPictureTpl parameter (easiest to copy the default html file from the maxigallery templates directory), you just need to modify the <img src> tag. The default looks like this:

    Does this chunk need a specific name to work with phpthumb? If so, where do we call the chunk after we create it?
      • 7923
      • 4,213 Posts
      Quote from: miamisurf at Jul 26, 2009, 12:26 AM

      Does this chunk need a specific name to work with phpthumb? If so, where do we call the chunk after we create it?
      No, It can be named what ever you like. Use it in MaxiGallery call like: &galleryPictureTpl=`chunk_name_here`


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 19257
        • 141 Posts
        Very nice, thank you.
          • 15758
          • 7 Posts
          Hello !

          Thanks, this is a great tricks, to have thumbnail with same size...
          BUT, I got a strange "bug"
          now phpthumb is installed, Loading the thumbs are really slow, and didn’t work at all,
          sometimes, it doesn’t load all the thumb images, so I got wrong images src (but only with the small thumb pictures)

          I think this comes from the phpthumb cache folder, but I can make it working after differents test configs...
          I create the folder here /assets/images/phpthumb_cache with authorizations 777 as I tell in the phpthumb config file (i think)...
          but I can’t see anything on that folder... undecided
          Do I need the phpthumb_plugin ?

          Is someone may help me please ?

          Perhaps do I have to reinstall all from Ø?
          or perhaps something like imageMagick is missing PHP server configs?

          Thanks in advance!
            • 8109
            • 128 Posts
            Hi Keyman.

            Sadly, the phx version of phpTHumb does not ship with the demo files (why, I can’t say). Go to the phpthumb website (http://phpthumb.sourceforge.net/) and download the latest distribution, then drop the demos folder into your snippets/phpthumb folder and point your browser to

            http://yourdomain/assets/snippets/phpthumb/demo/phpThumb.demo.check.php

            You’ll see all sorts of useful information, including your cache file settings. I found that in my ftp client (Transmit) the cache file wasn’t visible by default, as it is preceded by a period. Until I figured out this demo stuff I wasn’t sure if the cache was working, but if it isn’t, then phpthumb has to process your images every time you refresh the page!

            Note, ImageMagick is not required for most phpThumb functions, though in principle many of its functions would be faster if ImageMagick is installed (the demo above will tell you if your server has it installed). Note there are some ImageMagic settings in phpThumb.config.php.

            ImageMagic is needed if you want to crop your sqare thumbnails to anything other than the center of the image. I’m in the process of exploring how to do this easily in maxiGallery, but I currently don’t have ImageMagick working on my server. Once that’s settled, I’ll post a tutorial.
              Revo 2.0.8-pl
              • 15758
              • 7 Posts
              Great !
              Thanks it is working now,
              thank you very much for this tricks.
              k.
                • 20413
                • 2,877 Posts
                To get the phx:phpThumb snippit to work in maxigallery, I found that the call, rather than being in [+plus brackets+] as indicated in the documentation, must be in [*asterisk_brackets*]. (I’d love for someone to explain why this is.)

                [+ +] is when calling a TV [* *] from inside of a dynamic snippet "tpl"!
                  @hawproductions | http://mrhaw.com/

                  Infograph: MODX Advanced Install in 7 steps:
                  http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

                  Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
                  http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
                • This is because a snippet like Ditto or Wayfinder will determine the value for the TV in the document it is currently processing, then load it into the placeholders array. The value will be different for each document it processes. So in the tpl for Ditto or Wayfinder you use [+...+] because you want that value for that listed item.

                  MODx is asked to generate a page from the News document. It doesn’t care about the Article 1 document or any other document. So you use the Ditto snippet to get links and summaries for Article 1, Article 2 and Article 3 documents. It has to put the TV values it finds for those documents in a placeholder, because if MODx sees [*...*] tags it only thinks of these for the document it was asked for, News. Ditto is doing all the work of getting the values for each document it’s been asked to list, and replacing the placeholder tags in its tpl chunk with the values for each document. Ditto repeats the process for each document it’s been told to list. Meanwhile, MODx is still only going to work with the News document, including the output that Ditto gives it.

                  The whole trick is to keep the processes separate in your mind, MODx is the outer main process, and a snippet like Ditto is an inner process to generate more content for MODx to insert into the page MODx is building.
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org
                    • 9359
                    • 128 Posts
                    Hi,
                    i have a issue with this feature:
                    - I have installed Phthumb following the instructions related.
                    - i have a ditto call with this tmpl chunk for display a list of resources with thumb (by MaxiGallery):

                    <table>
                    <tr>
                    <td width="70">[[MaxiGallery?&gal_query_ids=`[+id+]`&limit=`1`&max_thumb_size=`30x50`&thumb_use_dropshadow=`1`&galleryPictureTpl=`Picture-tmpl`]] </td>
                    <td width="530">
                    <h2><a href="[+link+]">[+pagetitle+]</a></h2>
                    <p>[+description+]</p>
                    </td>
                    </tr>
                    </table>

                    - This is the galleryPictureTpl:
                    <div>
                    <img src="[*myimage:phpthumb=`h=50&w=30&zc=1#[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]#1`*]" class="thumbnail" title="[+maxigallery.picture.title:htmlent+] [+maxigallery.strings.click_to_zoom+]" alt="[+maxigallery.picture.title:htmlent+] [+maxigallery.strings.click_to_zoom+]" />
                    </div>

                    When i go in the frontend this error occurred:
                    failed to include_once(phpthumb.functions.php) - realpath=""

                    huh
                      "Destiny is not a matter of chance, it's a matter of choice"