We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25373
    • 13 Posts
    hello,

    i am deeply sorry, i still don’t get it.

    is there any sample code where i can take inspiration from for doing what i need?

    thank you very much
    rgds
    Alex
      • 19164
      • 1,215 Posts
      Here an exampe. That what you need to add in your code to config file

      $tpl = <<<HTML
      <a href="[+dr.bigPath+]" rel="lightbox" title="[+dr.title+]">
      <img src="[+dr.thumbPath+]" width="[+dr.thumbWidth+]" height="[+dr.thumbHeight+]"  align="[+dr.align+]"  />
      </a>
      HTML;

      Config files are in \assets\plugins\directresize\configs\
        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]
        • 25373
        • 13 Posts
        this totally works now, thank you, and it was really easy.

        please add it to the documentation with an application example for next release,
        i suspect it will be useful for nuts like me.

        there is yet another problem, which i also experience when using slimbox effect with maxigallery,
        and this is that using slimbox explodes the div-construct (images overlapping div-box-borders.

        Anyway, thanks for your help!

        rgds
        Alex
          • 19164
          • 1,215 Posts
          I do not think about examples. All of this is easy if you know the basic template principles of MODx.
            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]
            • 4310
            • 2,310 Posts
            Just started using DirectResize, what a great little add on.
            Many thanks!
              • 6038
              • 228 Posts
              christianhanvey Reply #66, 18 years ago
              Hi, I get this parse error when i try to run a page with images in it:

              « MODx Parse Error »<br />MODx encountered the following error while attempting to parse the requested resource:<br />« PHP Parse Error »<br /> <br />PHP error debug<br />  Error: 	mkdir() [function.mkdir]: Unable to access /var/www/vhosts/fda.com/httpdocs/assets/drgalleries/13/	 <br />  Error type/ Nr.: 	Warning - 2	 <br />  File: 	/var/www/vhosts/fda.com/httpdocs/assets/plugins/directresize/directResize.php	 <br />  Line: 	654	 <br />  Line 654 source: 	if(!mkdir($modx->config[’base_path’].$path_to_gal, 0777)) { 	 <br /> <br />Parser timing<br />  MySQL: 	0.0352 s	(72 Requests)<br />  PHP: 	0.1646 s	 <br />  Total: 	0.1998 s	 


              I have chmod’d the drgalleries folder to 777, but it looks like it is telling me it cant make a new folder inside it.
              If I create the folder via ftp, and then chmod 777 that, the thumbnails get created - but obviously i dont want to have to do this for every page, or worry about it when new pages are created that require images.

              Im guessing its something to do with folder permissions on my server, and If anyone knows what i should do to fix it please let me know!
              Perhaps something to do with the ’owner’ or ’group’ of that folder??

              Thanks for any advice

              Environment:
              MODx 9.6.1
              PHP 5.2
              Apache 2
                • 36592
                • 970 Posts
                I suppose your server is running with the safe mode ’On’.

                From the document of mkdir() function of PHP...
                ( http://www.php.net/manual/en/function.mkdir.php )


                Note: When safe mode is enabled, PHP checks whether the directory in which the script is operating has the same UID (owner) as the script that is being executed.
                  • 19164
                  • 1,215 Posts
                  There is a bug with FTP commands in this version of DR. I’ll fix it later.
                    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]
                    • 6038
                    • 228 Posts
                    christianhanvey Reply #69, 18 years ago
                    Quote from: tkfm at Sep 19, 2008, 12:35 AM

                    I suppose your server is running with the safe mode ’On’.

                    You supposed correctly.
                    And it sucks.
                    I’ve already had to modify many core files to get round the fact that ini_set doesnt work, as the manager uses it to set paths for its own include files, but Safe Mode ON does not allow ’ini_set’s either. But the hosting was not my choice so I don’t have much say in that.

                    Do you think there is anyway I can get round my problem though? I could get a sysadmin to change the owner of the ’drgalleries’ for it to work maybe?
                      • 6038
                      • 228 Posts
                      christianhanvey Reply #70, 18 years ago
                      Quote from: Metaller at Sep 19, 2008, 01:58 AM

                      There is a bug with FTP commands in this version of DR. I’ll fix it later.

                      Hi Metaller,

                      I got the FTP to work for me, by modifying directResize.php - here is what i did...

                      I changed line 670
                      From:
                      	$changeDir = ftp_chdir($connect, $this->drconfig['ftp_base_dir'].$path_to_gal);

                      To:
                      	$changeDir = ftp_chdir($connect, $this->drconfig['ftp_base_dir'].DIRECTRESIZE_GALLERYDIR);


                      I changed line 672
                      From:
                      	$output = 'Could not change directory to: '.$this->drconfig['ftp_base_dir'].$path_to_gal;

                      To:
                      	$output = 'Could not change directory to: '.$this->drconfig['ftp_base_dir'].DIRECTRESIZE_GALLERYDIR;


                      I changed line 681
                      From:
                      	$setPerm = ftp_site($connect, 'CHMOD 0777 /'.$path_to_gal);

                      To:
                      	$setPerm = ftp_site($connect, 'CHMOD 0777 /'.$this->drconfig['ftp_base_dir'].$path_to_gal);



                      For anyone else who has to use php with safe mode on, this worked for me, with the above modifications to the code in DirectResize 0.8.0.2.
                      Of course I also had to create my own config file as outlined in the readme file with settings like the following included:
                      $use_ftp_commands = 1;
                      $ftp_server = ’yourhost.com.au’;
                      $ftp_user = ’yourusername’;
                      $ftp_pass = ’yourpassword’;
                      $ftp_base_dir = ’/path/to/modx/’;