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 Gang,

    I have just released version 2.6 with the two extra features mentioned on here: pagination and support for multiple calling. I have added the following blurb to the description:

    Version 2.6 includes support for pagination using the pagesize and page arguments (the latter can be retrieved from the request). Also included is support for running two copies of AutoGallery on the same page. If tnprefix is specified then this will allow thumbnails of different sizes and qualities to be created for each call. If this is left blank AutoGallery will autodetect multiple runs and use the prefixes ’tn_’, ’tn1_’, ’tn2_’ etc. If this is used the you <strong>must</strong> also include a tnprefixes argument as a comma separated list of all the prefixes used on the page. This prevents the generation of "tn1_tn_filename.jpg" on the second pass. It also sets the page placeholders prevpage and nextpage with the number of the previous and next pages respectively to help create forward and back buttons.

    Downloads as always available via http://www.zombietuesday.com/autogallery

    See some examples (and cute baby pictures with me looking like I haven’t slept for three days!) here: http://www.zombietuesday.com/chloegal.html


    Ramsay
      • 24449
      • 81 Posts
      Oh, incase anyone is interested: those images are huge so creating the thumbnails took more than 30 seconds and my php install killed the process. This is a good example of why AG creates the thumbnail files and then reuses them - I was able to just reload the page three or four times until they were all ready, and now you can all enjoy them! wink


      Ramsay
        • 23235
        • 40 Posts
        Thanks alot.
          • 24449
          • 81 Posts
          Hi Everyone,

          I’ve just found a bit of a bug in AutoGallery 2.6. Specifically, if you weren’t using the pagination it wouldn’t return anything at all. So, if you’ve downloaded it in the last day and couldn’t work out why it wasn’t doing anything you might want to download it again. Sorry for the inconvinience!

          If you are curious its line 410 of AutoGallery.inc.php

              } else if($item < $pagesize)  {


          is changed to

              } else if(($item < $pagesize) || ($pagesize == '')) {


          Yes, I am very silly. smiley


          Ramsay
            • 9439
            • 90 Posts
            Drove me nuts trying to display thumbnails! Thought I’d really lost it undecided. Only managed to get anything to display when I included pagesize. I checked the inc file and it hadn’t had the fix applied (even though it was downloaded only a few days ago). But even with the mod applied I still need to include pagesize in the call. Not such a big deal (now I know...) but should be fixed I suppose for the default call.

            On a separate point, the thumbnails don’t display as the permissions on the created thumbnails are set to 0600. When manually set to 0644 they’re fine. Is this a host problem, modx setting (in the config new files are set to 0644) or an AutoGallery thing?

            Need a drink.

            David Heriot
              David Heriot
              pfsmedia
              • 24449
              • 81 Posts
              hi,

              The files on the server as of 15th Jan should have the fix applied - but not before that! Not sure why it doesn’t work if you have applied the fix?

              Regarding permissions: AutoGallery creates them using the php function imagejpeg (or imagepng). On our server it seems to create files with 644 permissions. There shouldn’t be any involvement with the MODx config setting. No idea what *does* determine the permissions. If you are really having trouble you could add the following after line 175 (so move line 176 down):

              chmod($tnimagepath, 0644);


              The 0644 is the perms, so you can just change this value to suit, but remember the leading 0 to make it octal!


              Ramsay


                • 9439
                • 90 Posts
                Ramsay, thanks for quick reply. Worked - except that the line should be chmod($tnimgpath, 0644); smiley

                Just while I’m on - sorry - but on another test site I get an error running any form of autogallery call: "Fatal error: Call to undefined function: stripos() in modx/assets/snippets/AutoGallery.inc.php on line 286". Is it a path thing? Seems like something I’ve caused given I’ve finally got it to work on my other site, but can you give me a clue where to look?

                thanks again

                DH
                  David Heriot
                  pfsmedia
                  • 24449
                  • 81 Posts
                  On Sunday night I think I can be forgiven not reading abbreviated var names that carefully wink

                  stripos is a php built in function I think but it’s php5. Maybe you have an old install? Or it’s some library that’s on by default on our installation?

                  I can’t check from here whether its vital that it’s case insensitive or you could just use strpos (which is in php 4). I will have done it deliberately but if you are sure it will never come up and you don’t want to mess with the php install that would be an option.

                  Ramsay
                    • 9439
                    • 90 Posts
                    Just browsing through the forum looking for information on linking thumbs to image descriptions, I saw the beginning of a useful contribution from wyleyrabbit (p3 I think) but there wasn’t any follow up. Is there a way to include descriptions with the thumbnail? I tried using a tv linked to the filename - eg [*tv-[+filename+]*] in the chunk but that didn’t work.

                    Any ideas / working solutions anyone?

                    cheers

                    David Heriot
                      David Heriot
                      pfsmedia
                      • 24449
                      • 81 Posts
                      Sorry, I’m not sure I understand what you are trying to do, and I can’t seem to find the post by wylerabbit that you mention (but it is almost 11pm...)

                      If you want descriptions then there is a description DB field (that can be modified with the mod code). This appears as [+description+] - along with [+title+] - when the item chunk is processed. Is that what you are after?

                      As an example, this item chunk works with a lightbox variant and presents the title when the box pops up:

                      <div class="galthumbs"><a href="[+imgpath+]" rel="shadowbox[Gallery]" title="[+title+]"><img src="[+tnpath+]" border="0"  alt="[+description+]" /><br /></a>[+adminbuttons+]</div>


                      There would be nothing to stop you putting the title or description under the thumbnail like so:

                      <div class="galthumbs"><a href="[+imgpath+]"><img src="[+tnpath+]" border="0"  alt="[+description+]" /><br />[+title+]</a>[+adminbuttons+]</div>




                      Ramsay