We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20909
    • 19 Posts
    Thanks for this great Plugin!

    But I don’t understand how to custimize the configuration.

    What I want is the following:
    The plugin must only run on images with the class attribute set to "imgcaption". How to make it?

    In other words, for every image with the class="imgcaption" the plugin must make thumbnail and thickbox-gallery when clicking on the image.

    I have tried with the setting of "bind_config_to_css_selector", but it won’t work...

    Here is my thickbox.config.php:
    <?php
    $dr_global["path"] = "
    assets/images/
    ";
    
    $dr_local["header"]["all"]  = 	'
    <script type="text/javascript" src="'.DIRECTRESIZE_PATH.'libs/frameworks/jquery.js"></script>
    <script type="text/javascript" src="'.DIRECTRESIZE_PATH.'libs/thickbox/thickbox-compressed.js"></script>
    <link rel="stylesheet" href="'.DIRECTRESIZE_PATH.'libs/thickbox/thickbox.css" type="text/css" media="screen" />
    <script type="text/javascript">
    	var tb_pathToImage = "'.DIRECTRESIZE_PATH.'libs/thickbox/loadingAnimation.gif";
    </script>
    ';
    
    $dr_local["tpl_thumb"]["all"] = <<<HTML
    [+dr.shortcut.source2thumb+]
    HTML;
    
    $dr_local["tpl_lightbox"]["all"] = <<<HTML
    <a href="[+dr.big.src+]" title="[+dr.source.title+]" class="thickbox">
    	[+dr.shortcut.tpl_thumb+]
    </a>
    HTML;
    
    // Custom Configuration
    $dr_local["bind_config_to_css_selector"] = "img.imgcaption"; 
    $dr_global["bindings_priority"] = "css";
    
    ?>
    


    I hope someone can help me.
      • 27749
      • 53 Posts
      Hi,
      for class teamMember I use something this which works:

      $dr_local["bind_config_to_css_selector"]["teamMember"] = "img.teamMember";
      $dr_local["thumb_resize_method"]["teamMember"] = 0;
      $dr_local["thumb_use_defaults"]["teamMember"] = 1;
      $dr_local["thumb_width"]["teamMember"] = 100;
      $dr_local["thumb_height"]["teamMember"] = 100;
      $dr_local["thumbonly"]["teamMember"] = true;
      $dr_local["tpl_thumb"]["teamMember"] = "[+dr.shortcut.source2thumb+]";
      $dr_local["tpl_thumb"]["teamMember"] = <<<HTML
      <img src="[+dr.thumb.src+]" alt="[+dr.source.alt+]" title="[+dr.source.alt+]" />
      HTML;
      
        • 20909
        • 19 Posts
        Thanks a lot.

        But I can still not get it to work.

        Here is my new config file thickbox.config.php:
        <?php
        $dr_global["path"] = "
        assets/images/
        ";
        
        $dr_local["bind_config_to_css_selector"][ "caption"] = "img.imgcaption"; 
        
        $dr_local["header"]["caption"]  = 	'
        <script type="text/javascript" src="'.DIRECTRESIZE_PATH.'libs/frameworks/jquery.js"></script>
        <script type="text/javascript" src="'.DIRECTRESIZE_PATH.'libs/thickbox/thickbox-compressed.js"></script>
        <link rel="stylesheet" href="'.DIRECTRESIZE_PATH.'libs/thickbox/thickbox.css" type="text/css" media="screen" />
        <script type="text/javascript">
        	var tb_pathToImage = "'.DIRECTRESIZE_PATH.'libs/thickbox/loadingAnimation.gif";
        </script>
        ';
        
        $dr_local["tpl_thumb"]["caption"] = <<<HTML
        [+dr.shortcut.source2thumb+]
        HTML;
        
        $dr_local["tpl_lightbox"]["caption"] = <<<HTML
        <a href="[+dr.big.src+]" title="[+dr.source.title+]" class="thickbox">
        	[+dr.shortcut.tpl_thumb+]
        </a>
        HTML;
        
        ?>


        Perhaps I have missed how the configuration does really work.

        Do you know what is wrong in my config?
          • 19164
          • 1,215 Posts
          Seems that everything is ok. I tried this configuration and it’s works as you want.

          Are images in assets/images/ folder or subfolders?
            DirectResize 0.9 beta. PHPThumb, sets of configurations, configuration, binded to specific path. No backward compatibility. | DirectResize 0.9. PHPThumb, наборы параметров, параметры, привязанные к определенным путям. Без обратной совместимости.

            Unfortunately, DirectResize project is closed. If you want to continue development, PM me for access to project page on Google Code. К сожалению, проект DirectResize закрыт. Если вы желаете продолжить разработки, обращайтесь через ПМ для получения доступа к репозиторию на Google Code.

            [PLUGIN] DirectResize - as Maxigallery but for single images :: Download :: [url=http://modxcms.com/forums/index.php/topic,21490]
            • 20909
            • 19 Posts
            Hi Mealler,

            Yes, the image-path is correct. When I change it to something totally different, none of the images are being made to a "gallery".

            Perhaps I didn’t explain it accurate enough:

            For resized images NOT having class=imgcaption, the direct-resize plugin does not make a thickbox of the image. But still makes the image clickable and it then opens in the original big-format in a new window.

            For resized images HAVING class=imgcaption, the direct-resize plugin works excellent smiley

            For all other images (NOT resized, NOT having class=imgcaption) the plugin does not make the images clickable. But in a way the plugin did perform a change as the source to the images is changed to something like
            images/f9dcbf718322ab0dd5b9751064a52c05/thumb_forside-57x57.jpg



            I will be on vacation the next 24 days actually tongue

            But I will try to give some answers nevertheless, but perhaps it will take some time.

            THank you for your efforts!
              • 18830
              • 161 Posts
              On this page I’m using Ditto and DirectREsize in combination with jQuery based PrettyGallery to show several gallies on one page. This works fine - but when you start with any photo you can click through all photos from all galleries.

              The template I use looks like this:

              <?php
              
              $tpl = <<<HTML
              <li>
              <a href="/[+dr.bigPath+]" rel="prettyPhoto[id]">
              <img src="/[+dr.thumbPath+]" width="[+dr.thumbWidth+]" height="[+dr.thumbHeight+]"  alt="[+dr.title+]" title="[+dr.title+]"/></a></li>
              HTML;
              
              $lightbox_mode = 2;
              $allow_from="assets/images";
              $resize_method = 0;
              ?>
              


              As you can see, there is a rel="prettyPhoto[id]" at the link element, and this ID should be unique for any gallery. But the MODx-Like [+id+] does not work - it returns nothing. Has anybody any idea what I can do? Okay, I could use JavaScript, but is there a serverside solution? Thank you.
                • 23934
                • 11 Posts
                Hi there.

                I have a problem. I installed this plugin, after inserting an image and publishing the doc I have this modx parse error:

                « MODx Parse Error »
                MODx encountered the following error while attempting to parse the requested resource:
                « PHP Parse Error »
                 
                PHP error debug
                  Error: 	Function eregi_replace() is deprecated	 
                  Error type/ Nr.: 	- 8192	 
                  File: 	C:\wamp\www\assets\plugins\directresize\directResize.php	 
                  Line: 	459	 
                  Line 459 source: 	$currentImgPath = eregi_replace("^.+src=('|\")","",$imgs[0][$n]);


                My HTML code for image is:
                <img src="assets/images/covers/1991-charly/xls21cd Charly (CD).jpg" alt="cd" width="128" height="128" />


                What is wrong?
                  • 38755
                  • 43 Posts
                  Looks like you’re using PHP 5.3, which introduces several new deprecations. There are a bunch of places in phpthumb that need to be updated with non-deprecated functions (in this case all the ereg* ones need to be replaced by preg* counterparts).

                  I just went through this myself, thankfully quentinwolf on the phpthumb forums had already gone to the trouble to make the replacements. See this link for the info and download (I believe you’ll need to register with the forum first):

                  http://support.silisoftware.com/phpBB3/viewtopic.php?f=4&t=142&p=617#p611

                  I’m attaching the zip of the modified files here too, for convenience. It’s suggested to make a backup of the assets/snippets/phpthumb directory and then replace the relevant files with those in the zip. There is an ereg in the phpThumb.config.php file, so be sure to copy the fix into your own config.

                  Hope this all makes sense and helps!
                    • 23934
                    • 11 Posts
                    Quote from: protocreate at Aug 19, 2009, 07:50 AM

                    Looks like you’re using PHP 5.3, which introduces several new deprecations. There are a bunch of places in phpthumb that need to be updated with non-deprecated functions (in this case all the ereg* ones need to be replaced by preg* counterparts).

                    I just went through this myself, thankfully quentinwolf on the phpthumb forums had already gone to the trouble to make the replacements. See this link for the info and download (I believe you’ll need to register with the forum first):

                    http://support.silisoftware.com/phpBB3/viewtopic.php?f=4&t=142&p=617#p611

                    I’m attaching the zip of the modified files here too, for convenience. It’s suggested to make a backup of the assets/snippets/phpthumb directory and then replace the relevant files with those in the zip. There is an ereg in the phpThumb.config.php file, so be sure to copy the fix into your own config.

                    Hope this all makes sense and helps!
                    Thank you! It’s strange, I haven’t assests/snippets/phpthumb folder.
                      • 8376
                      • 5 Posts
                      Hi,

                      I’m using DirectResize 0.9 and am having trouble enabling $PHPTHUMB_CONFIG[’high_security_enabled’] = true.

                      In Safari 4 (at least on WinXP) it results in a phpThumb error message ’ERROR: invalid hash’. Strangely, it works fine in IE, FF, Opera & Chrome. Any ideas?

                      The server is running PHP 5.2.8. Cheers.