We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7455
    • 2,204 Posts
    Quote from: TobyL at May 18, 2007, 01:16 AM

    I’ve had a look through the PHx code. The problem as I see it is that PHx doesn’t distinguish between tags with a modifier and tags without modifiers. Ideally PHx should leave tags without a modifier alone and let modx->parseDocumentSource() (or any snippets that use them) handle them. I made some changes to the PHx code that does this for [+placeholder+] style place holders at least. This seems to alleviate pixelschute’s problem.



    I tried this hack but it does not work in my case. looks like the plugin is not working anymore the phx tags are not processed at all.
    is there another way to fix this? or maybe somone could atach a hacked/working phx parser that works well togetter with eform on one page, for me to use?

    Dimmy
      follow me on twitter: @dimmy01
      • 28559
      • 23 Posts
      So I was going to post something similar to this until I read this thread.... I too am using modx .96 and PHx 2.1.2 and I can’t get the &from=`[.email.]` or &subject=`[.name.]`to work as well.

      it seams about a month since the last post. so has anyone come up with a viable work arround or updated PHx or something?

      thanks
      SteveO
      • Quote from: SteveoSupremo at Jul 11, 2007, 06:48 PM

        So I was going to post something similar to this until I read this thread.... I too am using modx .96 and PHx 2.1.2 and I can’t get the &from=`[.email.]` or &subject=`[.name.]`to work as well.

        it seams about a month since the last post. so has anyone come up with a viable work arround or updated PHx or something?

        thanks
        SteveO

        Not ideal, but I have created a work around specific to eForm when PHx is enabled. This should be considered temporary until a proper fix is formally released.

        I added the following code around line # 94 of the eForm snippet itself (not the eForm include file)


        if( $params[from]{0} == ’(’ ) $params[from] = str_replace( array(’((’,’))’), array(’[+’,’+]’), $params[from] ); // pixelchutes PHx workaround

        NOTE: This implementation is specific ONLY to the &from parameter. It can easily be modified to account for multiple parameters.

        Then, simply pass placeholder names like ((this)) instead of [+that+] when passing as an eForm parameter.

        This is not a *solution* to the problem, rather an eForm specific work around. I recommend modifying the eform snippet description to denote that you have modified it from its original state, something like this:

        Quote from: "eForm

        <strong>*custom* 1.4.4</strong> Robust form parser/processor with validation, multiple sending options, chunk/page support for forms and reports, and file uploads.
          Mike Reid - www.pixelchutes.com
          MODx Ambassador / Contributor
          [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
          ________________________________
          Where every pixel matters.
          • 28559
          • 23 Posts
          Thanks pixelchutes

          if( $params[from]{0} == '(' ) $params[from] = str_replace( array('((','))'), array('[+','+]'), $params[from] ); // pixelchutes PHx workaround


          worked well I did mod it a little more to include
          if( $params[from]{0} == '(' ) $params[from] = str_replace( array('((','))'), array('[+','+]'), $params[from] ); // pixelchutes PHx workaround
          if( $params[fromname]{0} == '(' ) $params[fromname] = str_replace( array('((','))'), array('[+','+]'), $params[fromname] ); // pixelchutes PHx workaround


          I just need to figure out how to get it to work in the subject as well

          THanks again
          SteveO
            • 7455
            • 2,204 Posts
            MM I did a bit more drastic thing and changed the eform.inc.php, so that instead of [+placeholder+] it looks for ++placeholder++ works great on all places so validationmessage should also be called ++validationmessage++ same goes for all the placeholders used in the call like
            &to=`++email++` &from=`++email1++` & fromname=`++name++` &subject=`++name++ wants to show you this awesome page`


            and placeholders used in reports and chunks etc.

            This is not a permanent solution but just until there is a PHx version that leaves them in place.

            greets Dim
              follow me on twitter: @dimmy01
              • 7455
              • 2,204 Posts
              Quote from: SteveoSupremo at Jul 11, 2007, 08:26 PM

              Thanks pixelchutes

              if( $params[from]{0} == '(' ) $params[from] = str_replace( array('((','))'), array('[+','+]'), $params[from] ); // pixelchutes PHx workaround


              worked well I did mod it a little more to include
              if( $params[from]{0} == '(' ) $params[from] = str_replace( array('((','))'), array('[+','+]'), $params[from] ); // pixelchutes PHx workaround
              if( $params[fromname]{0} == '(' ) $params[fromname] = str_replace( array('((','))'), array('[+','+]'), $params[fromname] ); // pixelchutes PHx workaround


              I just need to figure out how to get it to work in the subject as well

              THanks again
              SteveO

              try this:

              $params[subject] = str_replace( array(’((’,’))’), array(’[+’,’+]’), $params[subject] );

              I use this in my snippet:

              if( $params[to]{0} == '(' ) $params[to] = str_replace( array('((','))'), array('[+','+]'), $params[to] ); // PHx workaround
              if( $params[from]{0} == '(' ) $params[from] = str_replace( array('((','))'), array('[+','+]'), $params[from] ); // PHx workaround
              if( $params[fromname]{0} == '(' ) $params[fromname] = str_replace( array('((','))'), array('[+','+]'), $params[fromname] ); // PHx workaround
              if( $params[replyto]{0} == '(' ) $params[replyto] = str_replace( array('((','))'), array('[+','+]'), $params[replyto] ); // PHx workaround
              $params[subject] = str_replace( array('((','))'), array('[+','+]'), $params[subject] ); // PHx workaround
              


              greets Dimmy
                follow me on twitter: @dimmy01
                • 5689
                • 289 Posts
                Thanks for these solutions, guys. A year and a half later, and they’re still necessary! I suppose it’s frustrating the PHx still hasn’t fixed this, but at least there’s people on top of things. laugh
                  I&#39;m learning more about MODx all the time and loving it.
                • Quote from: Compeek at Jul 06, 2009, 09:48 PM

                  Thanks for these solutions, guys. A year and a half later, and they’re still necessary! I suppose it’s frustrating the PHx still hasn’t fixed this, but at least there’s people on top of things. laugh

                  @Compeek,

                  You may prefer to use this simplified version (now comes standard with eForm 1.4.4.6):

                  // pixelchutes PHx workaround
                  foreach( $params as $key=>$val ) $params[ $key ] = str_replace( array(’((’,’))’), array(’[+’,’+]’), $val );
                    Mike Reid - www.pixelchutes.com
                    MODx Ambassador / Contributor
                    [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
                    ________________________________
                    Where every pixel matters.