We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5417
    • 15 Posts
    Good morning to all from Berlin,

    ready for the next issue? Ok, then try this one

    I have limited the number of visible thumbs to three of a gallery containing 6 pictures - works fine so far adapting this tip for slimbox http://modxcms.com/forums/index.php/topic,14403.msg94078.html#msg94078
    (tip: it’s really important to use the <li></li> tags in the tpl’s, otherwise the layout for the slimbox will not work)

    Now, since I did so, uploading a file causes the following parse error, even though the files were uploaded and are showing up

    « MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « PHP Parse Error »

    PHP error debug
    Error: chmod() [function.chmod]: No such file or directory
    Error type/ Nr.: Warning - 2
    File: /is/htdocs/wp1034867_KMPZB4WG3E/www/de/assets/snippets/maxigallery/maxigallery.php
    Line: 372
    Line 372 source: chmod($mg->path_to_gal.$name,0666);

    Parser timing
    MySQL: 0.9529 s (4 Requests)
    PHP: 0.6121 s
    Total: 1.5649 s

    I tried to change the chmods in maxigallery.php as recommended in another post - no effect

    Any suggestions?

      • 7923
      • 4,213 Posts
      It seems that it cannot move the uploaded temp file to destination folder.. What is the exact snippet call that causes this? If you remove the &limit parameter from the snippet call, does it work ok then?


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 5417
        • 15 Posts
        Hi,

        no, it does not work if I remove the &limit call in the second chunk.

        Here’s the complete snippet call which I put into a chunk called {{DiaShow}}:

        [!MaxiGallery? &display=`embedded` &embedtype=`slimbox` &max_pic_size=`0` &disable_js_libs=`1` &max_thumb_size=`110` &thumb_use_dropshadow=`1` &limit=`3` &galleryPictureTpl=`mgGalPicTpl` &use_ftp_commands=`1` &lang=`de`!]


        [!MaxiGallery? &display=`embedded` &embedtype=`slimbox` &max_pic_size=`0` &disable_js_libs=`1` &galleryPictureTpl=`mgGalPicTplHidden` &lang=`de`!]


        I have the idea, for everything works fine as far as I don’t make all this hidden and limiting stuff, it has something do to with the fact, that this kind of solution for limiting the thumbs has the effect of doubling the mask for picture managing and also the pictures themselfes.

        wink Yes, it has a german language file now but the german js is only for the slimbox, so it’s not complete - anyway, if you want it, I’ll be glad to post it to you
          • 7923
          • 4,213 Posts
          Hmm.. I think I have a clue what’s going on.. When there is two snippet calls in the document and you go to manage pictures, both of the snippet calls goes into picture management mode and that may cause these problems..

          Try creating a new document and put the same snippet call to that document except add &is_target=`1` to the snippet call. Then, in the document that shows the gallery, add &manage_target=`ID` parameter to the snippet call, where ID is the document that you created before.

          What that does is that it makes MaxiGallery open the picture management on that another document and hopefully that way it won’t get messed up.. if that’s what’s going on here..

          And yes, post the German language files in the translation thread if you have the time to translate all of them.. it would be great smiley


            "He can have a lollipop any time he wants to. That's what it means to be a programmer."
            • 5417
            • 15 Posts
            Well, it works and it works not

            my steps:
            Try creating a new document and put the same snippet call to that document except add &is_target=`1` to the snippet call.

            So I did, created a Doc with ID 73 and I put inside it this snippet call
            [!MaxiGallery? [b]&is_target=`1`[/b] &display=`embedded` &embedtype=`slimbox` &max_pic_size=`0` &disable_js_libs=`1` &galleryPictureTpl=`mgGalPicTplHidden` &lang=`de`!]

            My main document got a chunk call {{DiaShow}} which has code
            [!MaxiGallery? [b]&manage_target=`73`[/b] &display=`embedded` &embedtype=`slimbox` &max_pic_size=`0` &disable_js_libs=`1` &max_thumb_size=`110` &thumb_use_dropshadow=`1` &limit=`3` &galleryPictureTpl=`mgGalPicTpl` &lang=`de`!]


            The result is: I can manage the gallery of ID 73 in 1, the thumbs are perfectly limited to three, but also the shown images
            So, this way the effect is zero
            huh
            Do you understand now, why I asked so sweet for a simple parameter like &limit_thumbs? wink
              • 7923
              • 4,213 Posts
              Quote from: claudia at May 28, 2007, 02:06 PM

              The result is: I can manage the gallery of ID 73 in 1, the thumbs are perfectly limited to three, but also the shown images
              What do you mean? I don’t understand..


                "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                • 5417
                • 15 Posts
                I should not try to joke in foreign languages, sorry

                it means this solves as you have foreseen the problem with having the "manage gallery" twice on one page and therefore also removes the chmod error but it unfortunately also removes the effect of having less thumbs than images displayed in the lightbox
                  • 5417
                  • 15 Posts
                  Hello,

                  after all, I tried a simple CSS approach to solve the matter of having limited thumbnails shown in the HTML-Page but more images behind in the gallery - maybe it’s not a very elegant solution, but it works fine for me in IE7 and in FF. Other browsers were not checked yet.

                  Just in case this solution might be of interest for anybody else:

                  1. call the default.css in maxigallery/css/
                  2. change the parameters for the class ".thumbscontainer" as shown below and tweak them according to your layout needs

                  .thumbscontainer {
                  margin: 0px 0 0.8em 0;
                  float: left;
                  overflow: hidden;
                  width: 100%;
                  max-height: 86px;
                  padding-bottom: 1em;
                  }

                  That’s all

                  Thanks to doze for support
                    • 7923
                    • 4,213 Posts
                    Quote from: claudia at May 28, 2007, 02:33 PM

                    it means this solves as you have foreseen the problem with having the "manage gallery" twice on one page and therefore also removes the chmod error but it unfortunately also removes the effect of having less thumbs than images displayed in the lightbox
                    Hmm.. what I said shouldn’t cause anything to the thumbnail output.. so I think that something else is going on.. that should work.

                    I believe that max-height css property is ignored by IE 5 and 6 btw..

                    EDIT: I just tried it and it works fine.. Here’s what I did.

                    1. The Gallery document (ID 50) has two snippet calls:

                    [!MaxiGallery? &manage_target=`47` &display=`embedded` &embedtype=`slimbox` &galleryPictureTpl=`mgGalPicTpl` &limit=`3`!]


                    [!MaxiGallery? &display=`embedded` &embedtype=`slimbox` &order_by=`pos` &limit=`99999` &galleryPictureTpl=`mgGalPicTplHidden` &manageButtonTpl=`@CODE:`!]


                    On the second snippet call, the &manageButtonTpl is set to @CODE: to define an empty template so the button will not show up.

                    2. mgGalPicTpl:
                    <li>
                    <a href="[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]" rel="lightbox[set[+maxigallery.picture.gal_id+]]" title="[+maxigallery.picture.title:htmlent+] - [+maxigallery.picture.descr:htmlent+]">
                    <img src="[(base_url)][+maxigallery.path_to_gal+]tn_[+maxigallery.picture.filename+]" class="thumbnail" title="[+maxigallery.picture.title:htmlent+] [+maxigallery.strings.click_to_zoom+]" alt="[+maxigallery.picture.title:htmlent+] [+maxigallery.strings.click_to_zoom+]" />
                    </a>
                    </li>


                    3. mgGalPicTplHidden:
                    <a style="display:none;" href="[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]" rel="lightbox[set[+maxigallery.picture.gal_id+]]" title="[+maxigallery.picture.title:htmlent+] - [+maxigallery.picture.descr:htmlent+]"> </a>


                    4. The document where picture management happens (ID 47) has this snippet call:

                    [!MaxiGallery? &is_target=`1` &max_pic_size=`0`!]


                    The snippet call only needs those parameters that affect to the picture management. Eg. no need for display types etc..


                      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                      • 5417
                      • 15 Posts
                      Hi, Doze,

                      sometimes computer life is really magic - I don’t know, what happened, but suddenly it works.
                      I changed nothing but really nothing in the first code with the hidden tpl and the visible one, just removed the css in the chunk call, which did not work for IE6

                      WHY huh There’s no logic inside that!!! Can it be the database is slowlier than the programmers thought?

                      Thanks again, and for the moment I am not going to touch anymore my wonderfull working MaxiGallery with only three thumbs