We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22253
    • 54 Posts
    Ok just a little issue. The thumbnails seemed to still be spacing themselves as if they wern’t cropped. For example landscape image left spaces in between whereas portrait images butted up against each other. But they were all still showing through squares.

    My galleryPictureTpl chunk at the time was this:
    <li>
       <a href="[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]" rel="lightbox[image[+maxigallery.pageinfo.id+]set]" title="[+maxigallery.picture.title:htmlent+] - [+maxigallery.picture.descr:htmlent+]">	
          <img src="[+phx:input=`[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]`:phpthumb=`&h=80&w=80&zc=1&q=95`+]" class="thumbnail" title="[+maxigallery.picture.title:htmlent+] [+maxigallery.strings.click_to_zoom+]" alt="[+maxigallery.picture.title:htmlent+] [+maxigallery.strings.click_to_zoom+]" />
       </a>
       <p style="width: [+maxigallery.picture_width_thumb+]px;">
          [+maxigallery.picture.title:htmlent+]
       </p>
    </li>


    So I took away the extra paragraph section and the <li>’s so it now looks like this:
    <a href="[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]" rel="lightbox[image[+maxigallery.pageinfo.id+]set]" title="[+maxigallery.picture.title:htmlent+] - [+maxigallery.picture.descr:htmlent+]">	
          <img src="[+phx:input=`[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]`:phpthumb=`&h=80&w=80&zc=1&q=95`+]" class="thumbnail" title="[+maxigallery.picture.title:htmlent+] [+maxigallery.strings.click_to_zoom+]" alt="[+maxigallery.picture.title:htmlent+] [+maxigallery.strings.click_to_zoom+]" />
       </a>


    This seems to have worked. The images are all spacing equally now but there is a blue border around the thumbnails which I can’t get rid of. I’ve looked through thetemplates and the css to see if there is anything there but nothing stood out to me.

    Also curious as to what I removed from the code to make this work? This bit:
    <p style="width: [+maxigallery.picture_width_thumb+]px;">
          [+maxigallery.picture.title:htmlent+]
       </p>


    Thanks again. smiley


      • 22253
      • 54 Posts
      Ok I seemed to have sorted it. I just copied the whole default galleryPictureTpl and edited the section to do with img source. (line 50)

      I then added margins to my thumbnail li in the default css.

      Getting the hang of this. smiley
        • 7923
        • 4,213 Posts
        It’s this line that makes the thumbnails still reserve the space they really are:
        style="width: [+maxigallery.picture_width_thumb+]px;"
        


        change it to (where 50px is the width of your square thumbnails):
        style="width: 50px;"
        


          "He can have a lollipop any time he wants to. That's what it means to be a programmer."
          • 22253
          • 54 Posts
          Ah ok that makes sense. So I could effectively use this to define my spacing rather than editing the CSS?
            • 25260
            • 156 Posts
            Ok doze, I did what you told me yesterday:

            http://192.168.1.129/modx_evo_bis/assets/snippets/phpthumb/phpThumb.php?src=/modx_evo_bis/assets/galleries/106/pal_cast1.jpg&h=50&w=50&zc=1&q=95


            and the result is:

            "/modx_evo_bis/assets/galleries/106/pal_cast1.jpg" does not exist


            hints?
              • 7923
              • 4,213 Posts
              Quote from: Roberto at Nov 04, 2009, 02:24 PM

              and the result is:

              "/modx_evo_bis/assets/galleries/106/pal_cast1.jpg" does not exist


              hints?
              Well.. does that file exist?

              If it does and the path is correct, try removing the /modx_evo_bis from the image url.. also try adding full url, eg. http://192.168.1.129/modx_evo_bis/..


                "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                • 25260
                • 156 Posts
                Quote from: doze at Nov 05, 2009, 07:53 AM

                Well.. does that file exist?

                If it does and the path is correct, try removing the /modx_evo_bis from the image url.. also try adding full url, eg. http://192.168.1.129/modx_evo_bis/..

                Yes, it exists, the path is correct, and it only works enabling $PHPTHUMB_CONFIG[’allow_local_http_src’] = true;

                and then using the complete path, http://192.169.1.129/rest_of_the_path

                but I want to get it working the "normal" way... because it matches with the maxigallery urls!

                Cheers,

                Roberto
                  • 7923
                  • 4,213 Posts
                  You can make maxigallery to output the urls like that by using this as the content of your "phx:phpthumb" snippet:
                  $output = '[(site_url)]assets/snippets/phpthumb/phpThumb.php?src=' . $output . $options;
                  return str_replace('&', '&', $output);
                  

                  Not sure if you need a / after [(site_url)].. check the html source of the page that maxigallery renders and see if the url is fine.


                    "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                    • 25260
                    • 156 Posts
                    Yes, that’s quite simple, but reading from http://phpthumb.sourceforge.net/demo/docs/phpthumb.readme.txt it is

                    Always use the local image filename wherever possible rather than a full http:// URL because performance is much better, less (or no) use of temp files, and the last-modified check for cached files doesn’t work for remote files. For example:
                    good: phpThumb.php?src=/images/nicepic.jpg
                    bad: phpThumb.php?src=/home/httpd/example/images/nicepic.jpg
                    worse: phpThumb.php?src=http://example.com/images/nicepic.jpg

                    BUT, most important of all, that thumbnails are not the ones that I want laugh

                    I want (if possible, of course) this kind of thumbnails:

                    http://brunelleschi.imss.fi.it/galileopalazzostrozzi/object/MusaSphericalAstrolabe.html

                    the ones under the "The skies of Islam".

                    Is it possible with phpThumb or do I need others tools?

                    Thanks,

                    Roberto
                      • 7923
                      • 4,213 Posts
                      Quote from: Roberto at Nov 05, 2009, 08:28 AM

                      Yes, that’s quite simple, but reading from...
                      Yeah.. it’s better to point to the correct filepath and not add the url of the file.. Did you try different combinations of your file path? eg. /assets/galleries/106/pal_cast1.jpg and without / in the front etc.. It’s just a matter of finding the correct file path. Also check that it’s not some permission issue.. If you cannot figure it out, I can’t help you more if the server isn’t online.

                      Quote from: Roberto at Nov 05, 2009, 08:28 AM

                      BUT, most important of all, that thumbnails are not the ones that I want laugh

                      I want (if possible, of course) this kind of thumbnails:

                      http://brunelleschi.imss.fi.it/galileopalazzostrozzi/object/MusaSphericalAstrolabe.html

                      the ones under the "The skies of Islam".

                      Is it possible with phpThumb or do I need others tools?
                      What’s special about those thumbnails? Seems like normal thumbnails to me... or do you mean the borders around the thumbnails? That can be done with css alone. phpThumb can do similar borders to the image files too though.. but if you don’t want / need square thumbnails, you can do the borders with css just fine.


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