We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18913
    • 654 Posts
    I’m probably missing something pretty basic here, but can’t quite figure it out. You can see here what I’m trying to accomplish
    http://www.considine.net/recaptcha/index.php?id=38" target="_blank" rel="nofollow">/http://www.considine.net/recaptcha/index.php?id=38

    The idea is to have a tag cloud with the tag words linked to galleries of images with those tag words. But rather than use something like "smooth gallery" I want the gallery to be pages of thumbnails. Then, when a thumbnail is clicked, I’d like to bring up the landingpage I’ve been using to date (namely, the one which allows one to add/delete area tags).

    In the case of the main page (above), the thumbnails shown are only for those images that *don’t* have any tags. That part works.

    What doesn’t seem to be working is the jump to the landing page. I seem to get tossed over to show.easy2gallery.php all the time.

    The snippet which triggers the call to easy2 looks like this :
    <?php
    $tags = isset($imgtags) ? $imgtags : $_GET['imgtags'];
    $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 IS NULL ';
    
    $rs=$modx->db->query($query);
    $pics=array();
    while ($row=$modx->db->getRow($rs)){
    	$pics[$row['id']]=$row['id'];
    } 
    
    $tagresults = implode(',',$pics);
    $output = $modx->runSnippet('easy2',array(  
        'fid' => $tagresults,
        'w' => '70',
        'h' => '70',
        'landingpage' => '40'
    ));
    return $output;
    ?>
    


    If I replace that with this
    [!easy2? &w=`70` &h=`70` &landingpage=`40`!]

    it *does* work (except that it shows all the thumbnails rather than only those with no tags).

    Is there some subtlety I’m missing?

      • 11055 ☆ A M B ☆
      • 3,112 Posts
      Uhm... may be.

      Let me explain the basic difference between the calls then:
      Original page:
      - [!easy2!]: will show basic &gid=`1`, folders and thumbnails
      - [!easy2? &tag=`dog`!] : all the dirs (only 1 level deep) & files which are tagged ’dog’
      - [!easy2? &tag=`dog` &showonly=`files`!] or =`folders`

      I guess this should work on your computer?
      Or perhaps I should update more revision, since I’ve make more changes:
      - [!easy2? &landingpage=`6`!] : like usual &gid=`1`, but it won’t open the javascript library, but go to the landing page document ID #6. (I will upload the newer revision after this post). Folders still exist, as usual &gid parameter.
      - [!easy2? &tag=`dog` &landingpage=`6`!] : files AND folders which are tagged ’dog’.
      dirs only 1 level deep content, and files will have landing page.

      ON THE LANDING PAGE #6:
      - [!easy2? &landingpage=`6`!] : blank page!
        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.
        • 9757
        • 82 Posts
        Quote from: goldsky at Jun 07, 2010, 06:27 AM

        isn’t that supposed to be like this?
        <?php // highlighting
        
        $mb_detect_encoding = mb_detect_encoding($zip_entry_name);
        
        if($mb_detect_encoding != 'ASCII' && $mb_detect_encoding != 'UTF-8'){
          if(!$mb_detect_encoding){
            $zip_entry_name = UTF8::convert_from( $zip_entry_name, "ASCII" );
          }
          else {
            $zip_entry_name = UTF8::convert_from( $zip_entry_name, $mb_detect_encoding );
          }
        }
        

        I told you about that weird behaviour when file in zip has a name "Zaż" or something like that? I absolutely have no f** idea why ZipArchive return it name in some sick encoding and than mb_detect_encoding can’t recognize that encoding so it returing false. If we don’t consider that case we’ll end with uploading error. I’ve already test that case. So because of that I used that conditional statement. When mb_detect_encoding detect that file name is UTF8 or ASCII than we don’t need to do anything. If it detect something else, than we must convert it to UTF8. And if $mb_detect_encoding is false we must force ASCII encoding as an source encoding, and convert it to UTF8. In the last case it will drop all the weirdo characters which are making problems, but there will be no errors.
        I know that maybe this is not the most clean and beautiful solution, but it’s ZipArchive’s fault. We could try to use some other zip class, but its that worth it?

        In attachment file which making problems. Test it yourself.
          • 11055 ☆ A M B ☆
          • 3,112 Posts
          uhm...
          Did you upload this to this SMF forum as Zaż or Za &#380; (I give a space)?
            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
            @goldsky :
            Thanks for your reply. You write
            - [!easy2!]: will show basic &gid=`1`, folders and thumbnails
            - [!easy2? &tag=`dog`!] : all the dirs (only 1 level deep) & files which are tagged ’dog’
            - [!easy2? &tag=`dog` &showonly=`files`!] or =`folders`

            Where are you picking up the tags? Are these different from the image area tags I’m creating? If not, then I’ve overlooked some of the things you’ve implemented smiley
            Matt
              • 10608
              • 36 Posts
              Quote from: baadje at Jun 07, 2010, 05:21 AM

              Hello there,

              In the config you can set a width and height to a file. When uploading a ZIP-file this function doesn’t work?

              Maybe i can help with the translation to dutch..

              Greets,

              baadje
              Maybe I can also help with Dutch translation. I reworked nederlands-utf8 translation for beta 4.
                • 18913
                • 654 Posts
                @goldsky wrote :

                http://smoothgallery.jondesign.net/forums/viewtopic.php?id=2685
                That’s the smoothgallery’s bug. Smiley

                Thanks for tracking that down - I’m sorry I didn’t find that myself.

                That fix did the trick, though I’d note that the remedy needs to be applied to both jd.gallery.js and jd.gallery.v2.js

                Thanks!
                  • 18913
                  • 654 Posts
                  Okay, I’ve figured out my landing page problem.

                  It would appear that in the snippet’s PHP file, where
                  private function _imagefile()

                  is declared, that there is no setting of the landingpage value. So it always thinks it’s unset. By adding
                  this line to the code
                  $landingpage = $this->e2gsnip_cfg['landingpage'];

                  my landing page is now correctly used.
                    • 11055 ☆ A M B ☆
                    • 3,112 Posts
                    You may want to update to the revision 173, if you don’t follow the SVN: http://code.google.com/p/easy2modx/issues/detail?id=16

                    note in this revision:
                    + bug fix in the &tag and &fid restrictive address-bar access
                    + bug fix in the _imagefile()
                    + additional UTF-8 options, to separate between the PHP’s default utf8_encode/utf8_decode, with developing one.
                    + added some language key differences.
                    + Correct FURL or not links

                    I will dump the RC1 version into the repository, so we don’t hijack this thread further more. laugh
                      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 Jun 07, 2010, 10:22 AM

                      @goldsky :
                      Thanks for your reply. You write
                      - [!easy2!]: will show basic &gid=`1`, folders and thumbnails
                      - [!easy2? &tag=`dog`!] : all the dirs (only 1 level deep) & files which are tagged ’dog’
                      - [!easy2? &tag=`dog` &showonly=`files`!] or =`folders`

                      Where are you picking up the tags? Are these different from the image area tags I’m creating? If not, then I’ve overlooked some of the things you’ve implemented smiley
                      Matt
                      Yes, absolutely different with your snippet.

                      Edit folder/file, you will see Tag:
                      Snippet call is [!easy2? &tag=`what`!]
                        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.