We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9995
    • 1,613 Posts
    phpthumb doesn't work?
    <img src="[*banner01:phpthumb=`w=940&h=250&zc=c`*]" height="250" width="940" alt="[*pagetitle*]" />


    <img src="" ...

    When I add the snippet php:phpthumb it works.

    (btw, its possible to add chunks with the same name)

    [ed. note: fourroses666 last edited this post 10 years, 7 months ago.]
      Evolution user, I like the back-end speed and simplicity smiley
      • 2762
      • 1,198 Posts
      my phpthumb works fine with this kind of call

      <img src="[[phpthumb? &input=`[*thumbnail*]` &options=`w=336,h=280,zc=1`]]" alt="[*pagetitle*]"/>


      but seems working only with image tvs with relative path like /assets/images/myimage.jpg
      image tv with absolute path, like www.mydomain.com/assets/images/myimage.jpg, phpthumb output a "noimage.jpg"
        Free MODx Graphic resources and Templates www.tattoocms.it
        -----------------------------------------------------

        MODx IT  www.modx.it
        -----------------------------------------------------

        bubuna.com - Web & Multimedia Design
      • Actually, a relative path would be "assets/images/myimage.jpg", an absolute path would include the web root marker "/assets/images/myimage.jpg", while a full URL has the protocol and domain, "http://domain.com/assets/images/myimage.jpg".

        Do not confuse URLs with paths. PhpThumb requires a path to the image file, not a URL. There is no path like "http://domain.com...", and a leading slash like "/assets/images..." as a path indicates the start of the server's file system, not the web root. Your actual full path may be "/users/mydomain/www/assets/images..."

        When working with MODx, almost every relative path and URL will be relative to the main MODx index.php file. The exception will be .css and .js files that are loaded by the browser independently of the page. In that case, relative would mean relative to the .css or .js file. For example, it is common for URLs to background images in .css files to look like "../images/bg.png" - go up one folder from the .css file itself, then go into the images folder. [ed. note: sottwell last edited this post 10 years, 7 months ago.]
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 9995
          • 1,613 Posts
          @banzai, seems to work indeed! Thanks.

          I think the phx:phpthumb version doesn't have any problems with relative/full URL paths thow.
          Good to know when I do use the full paths (which I sometime do for TEmailer custom TV's).
          Maybe someone knows how to fix that?



          [ed. note: fourroses666 last edited this post 10 years, 7 months ago.]
            Evolution user, I like the back-end speed and simplicity smiley
            • 36416
            • 589 Posts
            Quote from: banzai at Sep 24, 2013, 12:15 PM
            (...)
            but seems working only with image tvs with relative path like /assets/images/myimage.jpg
            image tv with absolute path, like www.mydomain.com/assets/images/myimage.jpg, phpthumb output a "noimage.jpg"

            Check phpThumb.config.php parameter:

            $PHPTHUMB_CONFIG['allow_local_http_src']         = false; // If true, 'src' parameter can be "http://<thishostname>/path/image.ext" instead of just "/path/image.ext"; if false then display warning message to encourage more efficient local-filename calling.
            
              • 36416
              • 589 Posts
              BTW, a truly impressive release - thanks Yama and Dmitry! Is the DBAPI work finished?


              One more thing: could you please stop (re)writing .htaccess files - not everyone runs Apache, or some of us need publicly accessible assets/cache subdirectories (an example: adaptive images rewritting assets/cache/thumbs source files).

              https://github.com/modxcms/evolution/blob/master/manager/processors/cache_sync.class.processor.php#L304

                • 17496
                • 9 Posts
                Hello. Im setup MODx Evolution 1.0.12
                Why might this happen? :-(

                Error : Missing argument 9 for ditto::render(), called in /home4/nuclide/public_html/www1.site.com/manager/includes/document.parser.class.inc.php(1005) : eval()'d code on line 1026 and defined
                ErrorType[num] :	WARNING[2]
                File :	/home4/nuclide/public_html/www1.site.com/assets/snippets/ditto/classes/ditto.class.inc.php
                Line :	259
                Source :	 function render($resource, $template, $removeChunk,$dateSource,$dateFormat,$ph=array(),$phx=1,$x=0,$stop) {
                Basic info
                REQUEST_URI :	/install/
                Resource :	[1]Title page
                Current Snippet :	Ditto
                Referer :	
                User Agent :	Mozilla/5.0 (Windows NT 6.2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.76 Safari/537.36
                IP :	0.0.0.0
                Benchmarks
                MySQL :	0,0114 s (12 Requests)
                PHP :	0,0577 s
                Total :	0,0691 s
                Memory :	4,6365814209 mb
                
                Backtrace
                
                1	DocumentParser->executeParser()
                index.php on line 140
                2	DocumentParser->prepareResponse()
                manager/includes/document.parser.class.inc.php on line 1568
                3	DocumentParser->parseDocumentSource()
                manager/includes/document.parser.class.inc.php on line 1658
                4	DocumentParser->evalSnippets()
                manager/includes/document.parser.class.inc.php on line 1450
                5	DocumentParser->_get_snip_result()
                manager/includes/document.parser.class.inc.php on line 1061
                6	DocumentParser->evalSnippet()
                manager/includes/document.parser.class.inc.php on line 1147
                7	eval()
                manager/includes/document.parser.class.inc.php on line 1005
                8	ditto->render()
                manager/includes/document.parser.class.inc.php(1005) : eval()'d code on line 1026
                [ed. note: loshenov last edited this post 10 years, 7 months ago.]
                  • 17496
                  • 9 Posts
                  The question was solved rollback to version 1.0.10 and the new update to 1.0.12.
                    • 9995
                    • 1,613 Posts
                    Just noticed there is some translation missing at Users and Roles tab;

                      Evolution user, I like the back-end speed and simplicity smiley
                    • Quote from: banzai at Sep 24, 2013, 12:15 PM
                      my phpthumb works fine with this kind of call

                      <img src="[[phpthumb? &input=`[*thumbnail*]` &options=`w=336,h=280,zc=1`]]" alt="[*pagetitle*]">


                      but seems working only with image tvs with relative path like /assets/images/myimage.jpg
                      image tv with absolute path, like www.mydomain.com/assets/images/myimage.jpg, phpthumb output a "noimage.jpg"

                      There probably was a bug with phpthumb in 1.0.12. It checked for !file_exists(MODX_BASE_PATH . $input) but later on it used only $input as filename. Should be fixed with https://github.com/dmi3yy/evolution/pull/136