We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7571
    • 135 Posts
    Доброго времени суток.
    Скажите, пожалуйста, а возможно сделать такую задумку:
    Есть папка с фотками, в этой папке еще много разных папок с разными фотографиями.
    Нужно, чтобы на главной странице в определенном месте выводилось штук 6 случайных фоток из разных папок в уменьшенном виде, а при нажатии на фотографию открывалась увеличенная фотка или категория, где эта фотка лежит.
    huh
      • 11055 ☆ A M B ☆
      • 3,112 Posts
      Quote from: kokamvd at Sep 22, 2010, 10:15 AM

      If height=0 image should resize exhibited width, and in proportion to height. Or I do not understand correctly the question?
      OK, I’ll make this adjustment by an option.

      Quote from: Djeak at Sep 23, 2010, 02:21 AM

      Доброго времени суток.
      Скажите, пожалуйста, а возможно сделать такую задумку:
      Есть папка с фотками, в этой папке еще много разных папок с разными фотографиями.
      Нужно, чтобы на главной странице в определенном месте выводилось штук 6 случайных фоток из разных папок в уменьшенном виде, а при нажатии на фотографию открывалась увеличенная фотка или категория, где эта фотка лежит.
      huh
      You mean, clicking the directory thumbnail will open up the thumbnail’s image?
      Have you try to change the template?
        Rico
        Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
        MODx is great, but knowing how to use it well makes it perfect!

        www.virtudraft.com

        Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

        Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

        Maintainter/contributor of Babel

        Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
        • 11055 ☆ A M B ☆
        • 3,112 Posts
        Quote from: goldsky at Sep 23, 2010, 07:35 PM

        Quote from: kokamvd at Sep 22, 2010, 10:15 AM

        If height=0 image should resize exhibited width, and in proportion to height. Or I do not understand correctly the question?
        OK, I’ll make this adjustment by an option.

        Updated in extra download area.
          Rico
          Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
          MODx is great, but knowing how to use it well makes it perfect!

          www.virtudraft.com

          Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

          Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

          Maintainter/contributor of Babel

          Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
          • 19880
          • 54 Posts
          Hi!
          There is, i think, well known snippet easy2Dropdown to make available selecting some gallery to attach to modX document. Here it is:
          <?php
          /*
          * @name easy2DropDown
          * @descк Сниппет создает многоуровневое выпадающее меню на основе структуры
          * галерей easy2 gallery
          *
          */
          $sql = "SELECT `cat_id`, `cat_name`, `cat_level`
          FROM `".$modx->db->config[’table_prefix’]."easy2_dirs`
          WHERE `cat_visible` = 1
          AND `cat_id` > 1
          ORDER BY `cat_left`, `cat_id` ASC";

          $result = $modx->db->query($sql);

          if($modx->db->getRecordCount($result) >= 1 ) {
          $output = ’Выберите афишку==1||’;
          $nbsp=chr(0xC2).chr(0xA0);
          while($row = $modx->db->getRow($result)) {
          if ($row[’cat_level’] > 1) {
          $output .= str_repeat($nbsp, ($row[’cat_level’]-1)*3);
          $output .= "|--";
          }
          $output .= "${row[’cat_name’]}==${row[’cat_id’]}||";
          }
          $output = substr($output, 0, strlen($output)-2);
          } else {
          $output = ’Error ocured’;
          }
          echo $output;
          ?>
          My question is: could you suggest how shall i modify it to have an ability to attach exact images (from the exact gallery)?
          Or, maybe, there is a solvation? Just need a single_pic2doc.

          PS. I need no galleries, but pics from the selected one to be listed in TV and to be available for attach/
            • 11055 ☆ A M B ☆
            • 3,112 Posts
            to do exactly like this: http://picasatutorials.com/2008/12/picasa-tip-nested-folders/
            will need more code.
            the TV should be make as @BINDING

            the code itself will be much more than that easy2Dropdown, but it can be done.
            the basic concept is:
            1. retrieve the dirs
            2. while reading each of dirs, get sub-dirs and retrieve the file children
            3. continuing reading each of the sub-dirs’ contents.

            so, from the easy2Dropdown, you should add the file’s reading, before the end of the directory reading.

            can you understand me on this? smiley
              Rico
              Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
              MODx is great, but knowing how to use it well makes it perfect!

              www.virtudraft.com

              Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

              Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

              Maintainter/contributor of Babel

              Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
              • 19880
              • 54 Posts
              well, it’s common.
              could you give an example, howto: read a one specific file from the dir?
              hope, i can rule with "foreach"’s and other stuff ))

              P.S. the help with bindings will be requested as this point of the process be reached )
                • 11055 ☆ A M B ☆
                • 3,112 Posts
                hang on...
                are you talking about the drop-down menu on the front-end (using snippet) or back-end (using template variable) ?
                  Rico
                  Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
                  MODx is great, but knowing how to use it well makes it perfect!

                  www.virtudraft.com

                  Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

                  Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

                  Maintainter/contributor of Babel

                  Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
                  • 19880
                  • 54 Posts
                  it’s about back-end.

                  You see, i’m making a kind of event-calendar. i need to attach to every post an image, not a folder, as easy2Dropdown allows to )
                    • 7571
                    • 135 Posts
                    Ребят, совсем запутался. Как вывести просто одну рандомную фотку на страницу без всяких экскизов, папок, чтобы как я ее закачал на сервер, она в таком же виде и показалось, чтобы без нажатия на нее и приближения, а просто фотку.
                    А что такое "целевая страница?" Не заметил разницы между [ ! easy2? &landingpage=`__own_ID__` ! ] и [!easy2?gid=`ID` &showonly=`images`!]
                    И как пользоваться комментариями? я включаю, но на экскиже, у меня нарисован нолик и все. Как добавлять для фотки коменты?
                    Подскажите, пожалуйста, а то еще не до конца разобрался в modx.
                      • 11055 ☆ A M B ☆
                      • 3,112 Posts
                      for your PM, try to use this:
                      [+easy2:back+]
                      http://wiki.modxcms.com/index.php/Easy2gallery#Gallery

                      Quote from: Djeak at Sep 26, 2010, 07:00 AM

                      Ребят, совсем запутался. Как вывести просто одну рандомную фотку на страницу без всяких экскизов, папок, чтобы как я ее закачал на сервер, она в таком же виде и показалось, чтобы без нажатия на нее и приближения, а просто фотку.
                      [!easy2? &rgid=`_yourGallery_ID_`!]
                      the template is random_thumbnail.htm

                      Quote from: Djeak at Sep 26, 2010, 07:00 AM

                      А что такое "целевая страница?" Не заметил разницы между [ ! easy2? &landingpage=`__own_ID__` ! ] и [!easy2?gid=`ID` &showonly=`images`!]
                      Landingpage is useful when you don’t want the iframe pop-up.
                      http://arslantic.co.id/evo/e2g-test-page/go-to-landingpage.html

                      Quote from: Djeak at Sep 26, 2010, 07:00 AM

                      И как пользоваться комментариями? я включаю, но на экскиже, у меня нарисован нолик и все. Как добавлять для фотки коменты?
                      Подскажите, пожалуйста, а то еще не до конца разобрался в modx.
                      Currently comment is only for image. The call is in the template:
                                  <span class="[+easy2:com+]">[+easy2:comments+]</span>
                      
                        Rico
                        Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
                        MODx is great, but knowing how to use it well makes it perfect!

                        www.virtudraft.com

                        Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

                        Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

                        Maintainter/contributor of Babel

                        Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.