We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18913
    • 654 Posts
    The document with the main call to Easy2Gallery shows the gallery. In my test case, it’s one with sliding transitions.

    When I click on an image though, it is brought up full size in it’s own page. At the top of the page is a clickable area which toggles area-tagging mode. When that is enabled, one can draw a rectangle (whose proportions are set in the code somewhere as I recall) and then enter a word in the dialog box that pops up.

    Below the image is an area that lists the areas tagged in that picture, with each tag being represented by the outline of a box in the image.

    So someone clicking on an image for which tags have already been applied would see those already in place.

    This reminds me of a glitch I noticed. I think there’s a z-index conflict somewhere as I was not seeing the same hover state behavior for a tagged area as is shown in the original demo. Haven’t tackled that one yet. Also, I don’t know why the rectangle is set up to have limits on it’s dimensions. That should get looked into.

    I agree that it would be nice to be able to search for an image area tag and generate a gallery with all images that have that criterion met. Or to be able to use the tags with other category-enabled code. But I just haven’t thought about how to get there. (And anyone looking at my code might question whether or not I should try wink )

    Hope that answers your question!
      • 26931
      • 2,314 Posts
      Hope that answers your question!
      yes, thanks for clarification smiley
        • 11055 ☆ A M B ☆
        • 3,112 Posts
        Wow... dude!
        This is awesome!
        Just curious, why do you make 2 snippets?
        Why not just one and make 2 functions within it?

        Anyway,
        I’ve built a ’plugin’ section for Easy 2 Gallery.
        The plugin in here is actually only a new layer above the specified image, which is connected by its ID and imageID.
        But if you’re a JS master, you can append the image with everything.

        Right now, i’m still playing with it, and wonder which part of the gallery should be applied.
        Currently i only try star rating plug in for the image thumbnail.
        Perhaps, by your great idea above, we can have the landing-page plugin.
        If you don’t mind, I’ll play with your code, and it’ll become the landing-page plug-in example, and will help me to show how to create the kind with the easiest way.
          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.
          • 18913
          • 654 Posts
          Hi
          Just curious, why do you make 2 snippets?
          Why not just one and make 2 functions within it?

          Well, that’s where the part about inefficient code, brighter minds than me and there’s-gotta-be-a-better-way come into play...

          :)

          In all seriousness, it just evolved that way. I was trying to replicate the page structure of what I saw on the demo site, and it had things broken out that way. And since
          if you’re a JS master
          is most definitely *not* the case, I didn’t go further in trying to tighten things up. I was just happy when an image area got tagged and stayed that way wink

          Perhaps, by your great idea above, we can have the landing-page plugin.
          If you don’t mind, I’ll play with your code

          I’m not the one with the great ideas. The original author down in Australia is the one that deserves the credit. All I’ve done is tried to drag it into the MODx world. You and anyone else is free to do whatever you want with the above code.

          FWIW, the genesis of this has been a pile of old photographs that have various details in them that need identification. But one person doesn’t have all the knowledge to do that. So what I wanted to do was post the pictures and allow logged in users to tag various elements in an image. Then, have a tag cloud get generated that would allow someone to see, say, all photos with "skateboards" in them. It would also be helpful to then be able to print out a report that has all the tags and then what images are associated with each tag. Or the other way around - what tags are associated with what photos. So it’s a step towards making a crowd-sourced application...

          Hope that makes sense. I’ll look forward to whatever plugin or ideas you come up with and will try to help where I can. Just don’t expect any JS wizardry wink

          Matt
            • 18913
            • 654 Posts
            Another entry in the "proof-of-concept" category ...

            This snippet
            <?php
            $tags=explode(',',$tags);
            $tags=implode("','", $tags);
            
            $query="SELECT modx_easy2_files.filename FROM modx_easy2_files LEFT JOIN phototags ON modx_easy2_files.id = phototags.pic WHERE phototags.title IN ('". $tags . "')";
            
            $rs=$modx->db->query($query);
            $pics=array();
            while ($row=$modx->db->getRow($rs)){
            	$pics[$row['filename']]=$row['filename'];
            } 
            return implode(',',$pics);
            ?>


            called this way in a document
            [!searchpics? &tags=`knob,nose,bolts`!]


            will return a comma-delimited list of filenames from the easy2 table for images with tags in the "tag" list, in this case, images with the word knob or nose or bolts in the phototags table.

            As written it’s only the filename, not the full path.

            FWIW,
            Matt
              • 10608
              • 36 Posts
              I don’t know if this has been asked before: how can I avoid that my large picture in a slideshow gets "inner:cropped" if I only want the thumbnails to be "inner:cropped"? The only way I can avoid to get my large pictures "cropped" is by setting the thumbnails to be "shrinked". That’s not so nice, I want filled square boxes for the slideshow. I want the thumbnails to be cropped and the large images to be shrinked when necessary.

              I’m using Beta 4 and a slightly modified layout of Galleriffic-5 slideshow.

              See: http://www.morecookies.be/gevan/nl/realisaties/keukens.html
                • 18913
                • 654 Posts
                @geertdeg - in galleriffic-gevan.css try removing the "background" line on the styling for a.thumb (Firebug says it’s line 149).

                Matt
                  • 18913
                  • 654 Posts
                  More on getting a gallery from photo area tags ...
                  By changing the above searchpics snippet to this
                  <?php
                  //$table_images = $modx->getFullTableName('easy2_files');
                  //$table_tags = $modx->getFullTableName('phototags');
                  $tags=explode(',',$tags);
                  $tags=implode("','", $tags);
                  
                  $query="SELECT modx_easy2_files.id FROM modx_easy2_files LEFT JOIN phototags ON modx_easy2_files.id = phototags.pic WHERE phototags.title IN ('". $tags . "')";
                  
                  $rs=$modx->db->query($query);
                  $pics=array();
                  while ($row=$modx->db->getRow($rs)){
                  	$pics[$row['id']]=$row['id'];
                  } 
                  $tagresults = implode(',',$pics);
                  $modx->setPlaceholder('tagresults', $tagresults);
                  return;
                  ?>


                  I end up with a placeholder containing the easy2 file ids for images with the requested tags.
                  It would then like to pass them to a slideshow like this
                  [!easy2? &fid=`[+tagresults+]` &slideshow=`smoothgallery` &ss_config=`slidingtransition` &landingpage=`51`!]

                  except that the easy2 snippet throws an error. If I hardcode the fid parameter to be something like `80,2` it shows the correct slideshow.

                  goldsky - what would you suggest is the best way to return and pass the file ids?

                  At this point it seems like it should be straightforward to create a category list or tag cloud from the unique values in the phototagging table, with each value generating a call to searchpics, followed by a call to easy2 for a slideshow of the requested images.

                  "Seems" is the operative word wink
                  Matt
                    • 11055 ☆ A M B ☆
                    • 3,112 Posts
                    @geertdeg,
                    open the galleriffic.php,
                    Delete line 59
                    max-height: '.$ss_h.'px; /* This should be set to be at least the height of the largest image in the slideshow */
                    


                    Change line 194, from
                    <a class="thumb" name="'.$_ssfile['title'][$i].'" href="'.$_ssfile['resizedimg'][$i].'" title="'.$_ssfile['title'][$i].'">
                    


                    to be
                    <a class="thumb" name="'.$_ssfile['title'][$i].'" href="'.$_ssfile['src'][$i].'" title="'.$_ssfile['title'][$i].'">
                    


                    And it’s done.
                      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: mconsidine at May 29, 2010, 07:34 AM

                      except that the easy2 snippet throws an error. If I hardcode the fid parameter to be something like `80,2` it shows the correct slideshow.

                      goldsky - what would you suggest is the best way to return and pass the file ids?
                      what was the error?
                        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.