We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14349
    • 44 Posts
    Whats the easiest way to get phpThumb installed with Revo?

    I got it working by just installing it from the phpthumb site in my assets/components area. Then in my picture src I use phpThumbs syntax for calling the images/sizes.

    So yes it works that way, but is there a way i’m "suppose" to do it? - I know phx is done with in revo and thats how you USED to make phpThumb calls.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      I don’t imagine it would be difficult to make a snippet to use the phpthumb class directly, but in MODx Evo or Revo there really isn’t any "right" way to use an external resource. If it works, you’re doing fine.
        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
        • 17499 ☆ A M B ☆
        • 872 Posts
        It is already installed and i use it for a custom TV (see attached as a package).

        You can use the phpThumb packaged with MODx.
        See the core/component/postthumb/elements/tv/posthumb.php to get the properties from the TV
        and core/components/postthumb/processors/web/phpthumb.php to see how i linked the TV to the MODx bundled phpThumb version

        Actually, i picked the method from the Gallery component.
          • 14951
          • 151 Posts
          Hey Lossendae,

          Do you happen to have any documentation on your Custom TV? This looks really useful!

          Does this work similar to an output filter (e.g. [[+myImageTV:postthumb=`&w=100&zc=1`]] ) Or something like that..?

          Very anxious to learn more about this!

          Thanks for any additional info!
          -Jared
            • 14349
            • 44 Posts
            Very good to know! I knew Gallery had it, so I poked around it too....

            I think think a word should be said about this in the documentation, phpThumb is super important to all of my Ecommerce sites.
              • 14951
              • 151 Posts
              For what it’s worth, I made a little snippet to accomplish what I described in my post above. It’s probably a dumb approach, so please feel free to improve it! (Just let me in on your nice improvements!) wink

              Basically this just lets you use PHPThumb as an output modifier like this example.
              [[+mytvImage:phpthumb=`&w=100&h=50&zc=1`]


              This is probably laughable to all of you programmers, but for any non-programmers / designers like me..I hope this will be usefull.

              Thanks!
              -Jared

                • 28215
                • 4,149 Posts
                jtech,

                You could use the PackMan extra to package that up and submit it to modxcms.com/extras, so it could be available to all from Package Management.
                  shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                  • 14951
                  • 151 Posts
                  Thanks SplittingRed!

                  I’ll be happy to do so.. going to try to refine the code a bit with some error checking and then I’ll submit it.

                  -Jared
                    • 28215
                    • 4,149 Posts
                    Great. You could also put it on GitHub and we could all collaborate on it, but no worries if not. Looking forward to it.
                      shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                      • 17499 ☆ A M B ☆
                      • 872 Posts
                      Quote from: jtech at Aug 12, 2010, 04:44 PM

                      Hey Lossendae,

                      Do you happen to have any documentation on your Custom TV? This looks really useful!

                      Does this work similar to an output filter (e.g. [[+myImageTV:postthumb=`&w=100&zc=1`]] ) Or something like that..?

                      Very anxious to learn more about this!

                      Thanks for any additional info!
                      -Jared

                      Hello jtech,

                      You can try the TV like that:



                      • Install the plugin
                      • create a TV with the name of your choice
                      • Choose postthumb as input and output
                      • the output let you choose the width and height of your thumbnail
                      • Associate the TV to your desired template and save it


                      The TV is a thumbnail maker with a crop utility.

                      It opens a window from which you can load the pics of your choice from the MODx browser.
                      It is also veeeeery buggy for now.

                      You will have to load the picture twice for the presized original picture to appear.
                      And sometimes reload it once again because the cropping tool’s playing badly for an unknown reason yet.

                      On the front end, the thumbnail only output the src of the image so you’ll have to use something like that:
                      [[*thumbnail:notempty=`<img src="[[*thumbnail]]" alt="[[*pagetitle]] thumbnail" class="thumb"/>`]]


                      The cropping tool is using Extjs, feel free to improve it.

                      I have also made another version, using Jquery and Jcrop, less buggy but not native. I think that i will release the jquery as default one until the native works properly.

                      Let me know if you need more informations.

                      edit: see attached an updated version with both jquery and native version embedded. Jquery is use by defaut and i added a few plugin options to let the user choose which version he want to use and if jquery should be loaded or not when he use the jquery version.

                      Screenshots: