We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11858
    • 130 Posts
    I have phpThumb installed and all is working well - but only for placeholders!

    If I use this code as a template for a ditto call all is well:
    <img src="[+image:phpthumb=`zc=1&w=115&h=150`+]">
    


    however, if I use it like this in a normal page if fails to work
    <img src="[*image:phpthumb=`zc=1&w=115&h=150`*]">
    


    If I do this in a normal page:
    <img src="[*image:phpthumb=`zc=1&w=115&h=150`*]">
    <img src="[*image*]">
    


    the HTML output is this:
    <img src="">
    <img src="/assets/images/press/stories/image111529AM_1.jpg">
    


    So there is definitely a value in [*image*] and phpThumb isn’t outputting any code whatsoever when used with "[*somethingHere*]" but is ok with "[+somethingHere+]" in a template. Weird.

    Has anyone come across this before?

    Thanks

    Alex.
      • 33982 ☆ A M B ☆
      • 476 Posts
      It’s b/c it’s a function of PHx I believe. When using PHx plugins (as in this case, correct?), [+ ... +] is used instead of [* ... *]
        Precision Web Development ... SmashStack.com
        • 11858
        • 130 Posts
        Thanks for the reply Flinx. I’ve changed it to [+...+] and it still doesn’t work, outputs the same as in my original post. My code is:

        <img src="[+image:phpthumb=`zc=1&w=115&h=150`+]">
        <img src="[*image*]">
        

        And that outputs in html:
        <img src="">
        <img src="/assets/images/press/stories/image111529AM_1.jpg">
        


          • 33982 ☆ A M B ☆
          • 476 Posts
          What version of MODx are you using? MODx 1.0.0? I’ve had some problems here lately with PHx and MODx 1.0.0
            Precision Web Development ... SmashStack.com
            • 11858
            • 130 Posts
            I’ve upgraded from 1.0.0 to 1.0.2.
              • 33982 ☆ A M B ☆
              • 476 Posts
              I’ve upgraded from 1.0.0 to 1.0.2.

              Still having the problem huh? Odd...

              Truthfully I never use PHx directly in conjunction with PHP thumb. I just do a call to PHP thumb where it resides, i.e.:
              <img src="/assets/snippets/phpThumb/phpThumb.php?src=/[+image_01+]&w=65&h=65&zc=1&q=90" />
              


              The only time I use PHx with PHP Thumb is a conditional statement in the event the image T.V. is left blank...for example:
              [+phx:if=`[+image_01+]`:is=``:then=``:else=`
              <img src="/assets/snippets/phpThumb/phpThumb.php?src=/[+image_01+]&w=65&h=65&zc=1&q=90" />`+]
              


              Hope that helps...

                Precision Web Development ... SmashStack.com
                • 26931
                • 2,314 Posts
                Hat-rack,

                have you installed the PHX plugin on your site? Ditto got PHX functionality included, so it will work within a Ditto template, otherwise you need to install PHX if you want to use it sitewide

                *edit;
                following doze’s approach here: http://modxcms.com/forums/index.php/topic,41309.msg248604.html#msg248604

                this works for me outside of Ditto:
                <img src="[+phx:input=`[(base_url)][*myTV*]`:phpthumb=`&h=100&w=100&zc=1&q=95`+]"  />

                and inside of a Ditto template:
                <img src="[+phx:input=`[(base_url)][+myTV+]`:phpthumb=`&h=100&w=100&zc=1&q=95`+]"  />
                  • 33982 ☆ A M B ☆
                  • 476 Posts
                  Ha...yeh, I guess I had forgot to ask if you had installed PHx...i just assumed you had ... that definitely will be a good start. laugh
                    Precision Web Development ... SmashStack.com
                    • 11858
                    • 130 Posts
                    Ok, I’m a moron. PHx wasn’t installed, but it was before the 1.0.2 upgrade. So does upgrading from 1.0.0 to 1.0.2 wipe (some) plugins?
                      • 33982 ☆ A M B ☆
                      • 476 Posts
                      So does upgrading from 1.0.0 to 1.0.2 wipe (some) plugins?
                      Not sure...probably need to view the change log for PHx.
                        Precision Web Development ... SmashStack.com