We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25663 MODX Staff
    • 12,272 Posts
    I hope everyone had a great weekend. Carter (my 20-month old kiddo) had ear tubes put in on Friday and he’s happy as can be... after spending the weekend in the Hill Country (near Austin, TX) I’m ready to roll again and knock some stuff out ASAP.

    Raymond’s been busy as heck working on modules and hopefully we’ll see his work merged into the main trunk this week in time for yet another Tech Preview. One thing I think we really need to investigate is the TV function API calls... I put in the goofy hack to make them work for me, but I somehow suspect they’re just a bit off logic-wise. Perhaps we should make them work exactly like the getPageInfo API call, or create a new set to work with both the content and the TVs...

    I also think we need to try to abstract the Rich Text editors as plugins... they add a lot of weight to the install and they take forever to upload due to all their files. This only applies to folks that can’t ssh in and uncompress files on the server, but that’s a lot of our users...

    Thoughts, including other priority items for the next Tech Preview? I think we’re getting close to locking down features for the
      Ryan Thrash, MODX Co-Founder
      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
      • 32963
      • 1,732 Posts
      Hi Ryan,

      Welcome back man. I’m glad to hear that things are going great.

      As for the new TV stuff those might not make it intime for TP3. The next generation TVs will have to be carefully examined in order to make them execute as fast as possible.

      I’ve been looking at a few designs:

      We could store each TV as a separate column inside a table. This would make it faster to process and sort TVs but it would waste space and not offer much flexibility

      The other method is to store the TV as a data row (like what we are doing now). This method is a little slower and does not offer much database sorting by TVs but it’s very flexible and will not waste storage space. It also makes it much easier to use TVs on multiple objects.

      Any other thoughts?

        xWisdom
        www.xwisdomhtml.com
        The fear of the Lord is the beginning of wisdom:
        MODx Co-Founder - Create and do more with less.
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        Milk allergy. I went through that, although they didn’t do tubes when I was a kid, just a lot of ear and sinus infections and a lot of bloody noses until I was 16. When I turned 16 my mom said I didn’t have to drink milk any more. I didn’t like it and quit right away, and never had a problem after that. One of my kids was having the same problem and I finally learned about the common tendency to cow milk allergy (not lactose intolerace, that’s another issue). I got him off dairy, and he immediately cleared up, and after a year or so was able to occasionally have cheese or butter or a milk gravy without a problem. Of course, nowadays there is a huge variety of non-dairy milk substitute products from soy or rice. Funny thing is, while I was working on the problem I took the whole family off dairy to get a handle on it, and my husband stopped his constant slight cough, and suddenly didn’t feel the need to drink so much. After a few months, he decided that it wasn’t necessary for the whole family to be off milk, bought a 5-gallon bucket of ice cream and a gallon of milk, and within a week was coughing and getting drunk almost every night again. Michael, the youngest, was a bed-wetter until I got him completely off of corn, and he was only embarrassed once after that when I bought some new baking powder without realizing it had cornstarch in it. He was 9 or 10 at the time. Heh. Looks like you pushed my "grandma" button!
          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
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          About the Rich Text Editors. Would it be possible to do an "is_dir" to determine if it’s legal to set a Rich Text Editor value in the system settings table? By default, it would be "off" and the textarea would be used. Then if the user wants a Rich Text Editor he uploads it to the appropriate spot, (or have an upload script that uploads it and moves it to the proper spot) and sets the site settings accordingly. The drop-down would limit the possibilities to what modx is configured to handle, with "None" as the default. In fact, the drop-down to select the editor could do a "is_dir" check and pop up a dialog saying that editor is not available, would you like to install it, then initiate a file upload if the response is affirmative. I would hope that any user at this level would know how to find the necessary file on his machine. Probably best to upload a zip file and unzip it in place.

          I think that would minimize the changes needed to "modularize" the editors.

          Here’s an interesting class for handling archives:
            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
            • 25663 MODX Staff
            • 12,272 Posts
            Thanks a ton Susan... for the Carter-comments and for the file-handling routine. Looks like there are no dependencies other than relatively recent versions of PHP.

            Also found these the following info at http://us2.php.net/manual/en/function.fread.php in the comments:

            Here’s a function for sending a file to the client - it may look more complicated than necessary, but has a number of advantages over simpler file sending functions:

            - Works with large files, and uses only an 8KB buffer per transfer.

            - Stops transferring if the client is disconnected (unlike many scripts, that continue to read and buffer the entire file, wasting valuable resources) but does not halt the script

            - Returns TRUE if transfer was completed, or FALSE if the client was disconnected before completing the download - you’ll often need this, so you can log downloads correctly.

            - Sends a number of headers, including ones that ensure it’s cached for a maximum of 2 hours on any browser/proxy, and "Content-Length" which most people seem to forget.

            (tested on Linux (Apache) and Windows (IIS5/6) under PHP4.3.x)

            Note that the folder from which protected files will be pulled, is set as a constant in this function (/protected) ... Now here’s the function:

            <?php
            function send_file($name) {
              ob_end_clean();
              $path = "protected/".$name;
              if (!is_file($path) or connection_status()!=0) return(FALSE);
              header("Cache-Control: no-store, no-cache, must-revalidate");
              header("Cache-Control: post-check=0, pre-check=0", false);
              header("Pragma: no-cache");
              header("Expires: ".gmdate("D, d M Y H:i:s", mktime(date("H")+2, date("i"), date("s"), date("m"), date("d"), date("Y")))." GMT");
              header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
              header("Content-Type: application/octet-stream");
              header("Content-Length: ".(string)(filesize($path)));
              header("Content-Disposition: inline; filename=$name");
              header("Content-Transfer-Encoding: binary\n");
              if ($file = fopen($path, 'rb')) {
               while(!feof($file) and (connection_status()==0)) {
                 print(fread($file, 1024*8));
                 flush();
               }
               fclose($file);
              }
              return((connection_status()==0) and !connection_aborted());
            }
            ?>


            And here’s an example of using the function:

            <?php 
            if (!send_file("platinumdemo.zip")) { 
            die ("file transfer failed"); 
            // either the file transfer was incomplete 
            // or the file was not found 
            } else { 
            // the download was a success 
            // log, or do whatever else 
            } 
            ?> 


            This might be helpful as we look at handling our installer and file manager.
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
              • 25663 MODX Staff
              • 12,272 Posts
              FYI, there’s lots of good commentary in the link in my post above that I’m pretty certain might help us create a better installer.
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 28150
                • 155 Posts
                God only knows, but what about an upload and extract routine for plugins similar to what Mambo has? Instead of logging into an FTP system seperately, what if the backend allowed zip upload and extraction on its own?

                Difficult?
                  • 25663 MODX Staff
                  • 12,272 Posts
                  Should be doable and we need to figure out the best way to handle this in general. I think a significant overhaul will be in store for our initial non-tech preview release.
                    Ryan Thrash, MODX Co-Founder
                    Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                    • 32963
                    • 1,732 Posts

                    PHP does not have built-in zip support for unix. Only php 4.3 windows has built-in support for th zlib library.

                    Sometime I wonder what on earth the php guys were thinking when they choose not to add zlib support the php 4.3 for unix. Is this another one of those "It works best on windows" marketing thingy?

                    What we need is a library that will allow us to extract files on unix and windows without requiring any external library. The create_zip function from susan’s only supports creating a zip file.

                      xWisdom
                      www.xwisdomhtml.com
                      The fear of the Lord is the beginning of wisdom:
                      MODx Co-Founder - Create and do more with less.
                      • 25663 MODX Staff
                      • 12,272 Posts
                      I don’t think there’s a non-dependency solution... almost all require PHP compile with ZLIB support. I highly doubt that they are pursuing the "works best on windows" angle considering PHP was originally a Unix product and definitely has more development for it going on there. wink

                      Given that my local install is compiled to support both bzip and zlib, so it’s not a problem. It’d be interesting to see what hosts have what options enabled/compiled.
                        Ryan Thrash, MODX Co-Founder
                        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me