We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26435
    • 1,193 Posts
    ScottyDelicious Reply #151, 19 years ago
    Quote from: pixelchutes at Sep 04, 2007, 11:48 AM

    Aahh...but I am not passing userphoto


    I could not upload your photo. Please check the permissions of the "userimages" folder.

    WTF?
    That is unexpected. I will have to check the code related to that but I think it says something about if empty or if == ’’, but it sounds like it may not be catching it properly. I will refactor it tonight when I get home and make sure it works.

    Thanks for all your help on this.

    -sD-
    Dr. Scotty Delicious, Scientist DFPA.
      Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
      All of the above... in no specific order.


      I send pointless little messages
      • 26435
      • 1,193 Posts
      ScottyDelicious Reply #152, 19 years ago
      Quote from: pixelchutes at Sep 04, 2007, 11:54 AM

      ...In the example, disableDeleteProfile would be a SNIPPET parameter only. Such parameters cannot be altered/hi-jacked, regardless of GET/POST request unless the snippet author somehow allows them to be overwritten. Really, it’d be a PHP boolean declared at run time...
      Coolio... Consider it an added option for the next version and thanks for the clarifications.

      -sD-
      Dr. Scotty Delicious, Scientist DFPA.
        Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
        All of the above... in no specific order.


        I send pointless little messages
        • 23491 ☆ A M B ☆
        • 1,056 Posts
        And Thank You for your continued hard work!!

          Mike Reid - www.pixelchutes.com
          MODx Ambassador / Contributor
          [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
          ________________________________
          Where every pixel matters.
          • 23491 ☆ A M B ☆
          • 1,056 Posts
          It appears that &customTable automatically prepends the "modx_" (or whatever db table prefix set in config) table prefix to the custom table.

          Is there a way to optionally remove this prefix for custom tables? Whether a parameter, or by passing the entire table name, etc?

          I realize that, by default, WLPE creates an extended table (w/ the prefix) for you, but an option on this control would also be useful... I am using WLPE to interface w/ SMF smiley Rather cool setup via WLPE, actually.

          Also, I tried submitting text containing quotes/apostrophes to a custom table field, and it doesn’t seem to be capturing as on might expect:

          I submitted:


          "Hello here’s a test"

          Only thing that made it to the database was:


          \"

          As a result, I see nothing in the INPUT when I Try editing the profile (Here’s the HTML, NOTE: the triple quote):


          <input id="wlpeUserProfileTimeZone" type="text" name="time_zone" value=""" />

          This is some code I wrote for my previous "extended" scenarios:
          //<?php
          $modx->db->escape( stripslashes( htmlentities( trim( $form_field  ), ENT_QUOTES ) ) )
          

            Mike Reid - www.pixelchutes.com
            MODx Ambassador / Contributor
            [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
            ________________________________
            Where every pixel matters.
            • 26435
            • 1,193 Posts
            ScottyDelicious Reply #155, 19 years ago
            Quote from: pixelchutes at Sep 04, 2007, 01:12 PM

            It appears that &customTable automatically prepends the "modx_" (or whatever db table prefix set in config) table prefix to the custom table.
            Yes. It uses $modx->getFullTableName();
            Quote from: pixelchutes at Sep 04, 2007, 01:12 PM

            Is there a way to optionally remove this prefix for custom tables? Whether a parameter, or by passing the entire table name, etc?
            Why? Are you wanting to pull from an external db?
            I think that is beyond the scope of WebLoginPE at this point.

            Quote from: pixelchutes at Sep 04, 2007, 01:12 PM

            Also, I tried submitting text containing quotes/apostrophes to a custom table field, and it doesn’t seem to be capturing as on might expect:

            I submitted:


            "Hello here’s a test"

            Only thing that made it to the database was:


            \"

            As a result, I see nothing in the INPUT when I Try editing the profile (Here’s the HTML, NOTE: the triple quote):


            <input id="wlpeUserProfileTimeZone" type="text" name="time_zone" value=""" />

            This is some code I wrote for my previous "extended" scenarios:
            //<?php
            $modx->db->escape( stripslashes( htmlentities( trim( $form_field  ), ENT_QUOTES ) ) )
            


            Yeah, I think all i have is a $modx->db->escape()
            I would love to use the code you posted if that is ok with you.

            -sD-
            Dr. Scotty Delicious, Scientist DFPA.
              Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
              All of the above... in no specific order.


              I send pointless little messages
              • 23491 ☆ A M B ☆
              • 1,056 Posts
              That is fine by me.

              No, I am not accessing an external db, rather a custom table within the MODx database instance. In fact, we have quite a few tables, some for staging, that do not use the "modx_" prefix, and this is by design.

              In my example, I will be interfacing with SMF Forum and WLPE. But, since WLPE requires custom tables to use the defined prefix, I will have to keep a small modified version smiley

              Thanks
                Mike Reid - www.pixelchutes.com
                MODx Ambassador / Contributor
                [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
                ________________________________
                Where every pixel matters.
                • 26435
                • 1,193 Posts
                ScottyDelicious Reply #157, 19 years ago
                Quote from: pixelchutes at Sep 04, 2007, 01:54 PM

                That is fine by me.

                No, I am not accessing an external db, rather a custom table within the MODx database instance. In fact, we have quite a few tables, some for staging, that do not use the "modx_" prefix, and this is by design.

                In my example, I will be interfacing with SMF Forum and WLPE. But, since WLPE requires custom tables to use the defined prefix, I will have to keep a small modified version smiley

                Thanks
                It is very strange as a developer to hear all the interesting ways people are using your software. I never would have planned for half the stuff you come up with!
                I am not sure about the best way to proceed with having the db prefix optional, but I guess it will end up being another parameter flag like &customTablePrefix=`0` (defaults to 1/true).

                Any suggestions?

                -sD-
                Dr. Scotty Delicious, Scientist DFPA.
                  Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                  All of the above... in no specific order.


                  I send pointless little messages
                  • 23491 ☆ A M B ☆
                  • 1,056 Posts
                  Well, you could do one of two things:

                  1. Another Param smiley (as you suggested)
                  2. (ugly) Force customTable to always require fully qualified table names
                  3. (uglier) A "placeholder"

                  e.g.

                  &customTable=`{prefix}my_extra_table`
                  


                  I think an optional param to REMOVE the default prefix is easy to implement, and a clean/seamless impact on existing installs.
                  By all means, if you feel it is outside the scope of WLPE, I have no problem managing a modified version for our needs.

                  Thanks to your code structure, it’s only one line of code and all other references are covered smiley

                  On a similar note: CustomTable function (line 311) tries to create the table for you if it doesn’t exist. I really like this feature!

                  However, I did receive an error trying to create the table that already existed...you may want to alter the CREATE statement SQL to
                  CREATE TABLE IF NOT EXISTS ...


                  I’m not sure how the CREATE/ALTER portion of your code will be impacted as a result of the param, but may need to consider...
                    Mike Reid - www.pixelchutes.com
                    MODx Ambassador / Contributor
                    [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
                    ________________________________
                    Where every pixel matters.
                    • 26435
                    • 1,193 Posts
                    ScottyDelicious Reply #159, 19 years ago
                    Quote from: pixelchutes at Sep 04, 2007, 02:13 PM


                    However, I did receive an error trying to create the table that already existed...you may want to alter the CREATE statement SQL to
                    CREATE TABLE IF NOT EXISTS ...


                    I’m not sure how the CREATE/ALTER portion of your code will be impacted as a result of the param, but may need to consider...
                    Excellent!
                    Thanks, I will try adding that and see what happens. I want this to be as universally usable as possible, you know?

                    -sD-
                    Dr. Scotty Delicious, Scientist DFPA.
                      Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                      All of the above... in no specific order.


                      I send pointless little messages
                      • 6726
                      • 7,075 Posts
                      I started testing this baby out and I must say : wow shocked I am impressed and happy with all the new doors it opens !
                      Hopefully I’ll have valuable feedback, or will be able to help others with using it... it’s on my top ten MODx resources already grin

                      And when I see the dynamics of this thread, reminds me of why I love this community so much, such creative energy and such talent !
                      (it’s virtual group hug time I guess wink )

                      Thanks Scotty for this and thanks for all who help !
                        .: COO - Commerce Guys - Community Driven Innovation :.


                        MODx est l&#39;outil id