Browse by Month RSS Feed
  • September 2010
  • August 2010
  • July 2010
  • May 2010
  • April 2010
  • March 2010

  • Form Tools 1.4.3November 27, 2006
    Filed under: Form Tools @ 5:55 pm

    Here’s a list of what I plan on tackling in the next release. I really couldn’t guess at an ETA…

    1. Edit Form: Display tab

    • Add records in form_templates for submission_date, ip_address and submission_id in Add Form process. The goal is to provide full “normal” functionality over those fields, so the user can hide/show that info in whatever order they want in their submission listing pages.
    • Will need to add a new ‘is_system_field’ column to help differentiate the three special system fields from user’s custom fields.
    • - submission_id should go first and is UNCHECKED.
      - ip_address should be penultimate and is UNCHECKED
      - submission_date should go last and is CHECKED
    • Need to remove the “Include Submission ID on Submissions Page” option from database; we’ll now use the standard “Display” checkbox to store whether or not that system field is to be used.
    • Need to add “Show IP Address” radio buttons. Should be set to “no” by default. When set to “no”, all fields in the the IP Address row should be disabled. Setting to “yes” should enable them and let the user have the option of including it as a column on the submission listing page (The fact that it’s sortable is okay, I think – albeit of little value)
    • On Advanced tab, show the new three columns, but grey out the various values. Allow all three of them to be passed along with direct submissions.

    2. Emails

    • Add “Email subject” fields, including allowance for placeholders. Should be required, defaulted to “FORM NAME: Submission” as it is right now.
    • Rewrite email code to only submit content through headers when necessary; i.e. when both HTML and text are being sent in the same email.

    3. Minor Stuff / Reminders to self

    • Change wording of “display” column on the Display tab to “Column”. I think people are getting confused and checking all of them – at least on virtually every installation I’ve seen, people are doing this. It uglifies their data & makes it harder to read.
    • Group all tabs into a separate file. Long overdue!
    • Add a border-bottom: white rule for the currently selected tab. It shifts up + down a little when selecting different tabs.
    • Go through Mantis and clean up all the other pending bugs. There are about half a dozen minor issues to resolve, I believe. Nothing major.
    • EDIT: New “Smart Fill” option in Add Form process for generating the Display Names for all uploaded form fields.
    Comments (1)


    Removing index from arrayNovember 26, 2006
    Filed under: Code, PHP @ 6:01 pm

    I can't believe PHP doesn't have a built-in function for this...! Code snippet for removing a single index from an array (non-associative).

    array_splice($array, array_search("Index text", $array), 1);

    Comments (1)


    Misc. NewsNovember 25, 2006
    Filed under: Form Tools, Life @ 12:23 pm

    Busy busy busy. Despite one rather dumb mistake in Form Tools 1.4.2 (file overwritten by accident), the release appears to have been generally successful. It's great to finally weed out those bugs.

    Besides that, I just got another gig with 1-800-GOT-JUNK, which I'll be starting on as soon as I wrap up Boston Pizza and Probono Maps. Plus the Salvation Army and Beyond Petroleum gigs are creeping up fast. Erk. The moment I've finished this, I'm going to get that darn Boston Pizza stuff done.

    I've also started looking at the Flash Image Scroller code again. I want to add vertical scrolling - it's by far the most important improvement to work on. A lot of the code is already there, but I need to make a few modifications to allow for different text positions (underneath, to the right), which would be reasonable requests for vertical scrolling. Flash really is neat.

    Here's a quick update on where we stand with Form Tools these days.

    Form Tools News

    Language Packs

    I've managed to find a little time over the last few weeks to sketch out the Translation Management software for the language pack version of Form Tools. Right now it's very much in an early phase, but the database has been designed and a few of the pages written. Permitting versioning for the translations is proving to be quite the task, so I may have to scale back my original plan. The issue is, I want to be able to "freeze" translations for each version so that you can always go back and download the translations for an older version. So basically what we're talking about is designing a fully functional CVS for translations. It's an interesting problem.

    Next Version (1.4.3)

    As with the previous version, I'm going to continue focusing on bugs and minor improvements. The bulk of the problems that have arisen have all been solved in 1.4.2, but a couple remain - and at this point I can afford to be nit-picky and fix up those tiny little pending issues.

    Small issues aside, there still remains the Bane Of My Existence: the dreaded blank email bug. I have a solution which I think will fix it on significantly more servers. For the more technically inclined, here's the rub: Form Tools currently sends all email content via the 4th parameter of the mail() function: the headers. This was done since some emails are sent in both HTML+text, so you need to demarcate the end of one email type to the other. Sending the info via the headers should allow for this. I was under the impression that all servers allowed for this. Hah! Fat chance.

    So, I'm re-writing it to only use that methodology for the HTML+text email format. For the single-format emails, it will use the standard email content parameter (the 3rd).

    Tutorial on PayPal integration with Form Tools

    I've written something like a quarter of it. It should be REALLY handy once it's completed. At the rate I'm going, I should be finished by, ooh, 2013.

    Comments (0)


    Form Tools 1.4.2November 18, 2006
    Filed under: Form Tools @ 10:55 pm

    Instead of working on my other work, I've foolishly spent the day working on the next version of Form Tools. VERY bad. Still, other than a few minor things, it's looking good. I'll be releasing this later tonight. Here's the changelog.

    New Features

    • New Permissions tab for Edit Clients [017]. This lets administrators customize the permissions for a client's account; whether they can:
      • Log in (currently on the "main" tab)
      • Edit submissions
      • Delete submissions
      • Have the "Have a Question?" page appear
      • Be able to use the "download via Excel" option
      • Be able to view the printer-friendly page
    • New optional form_tools_redirect_url form field for "direct" submissions, which lets you override the default redirect URL for a form if it's included in the form submission [037]
    • Now remembers which submission listing page you last viewed and returns you to it after (for example) editing/deleting a submission. [022/006]

    Bug Fixes

    • Excel download option now correctly sorts on default sort option [023/024]
    • Clock offset now goes up to +- 18 hours [038]
    • With the previous release, Form Tools remembers the last Edit Form and Edit Client tab you were on and show it when returning to the page. This caused a small issue with certain sub-tabs - such as Edit File Field and Edit Field Options - not being correctly pre-filled when returning. Now fixed. [025]
    • Array form fields are now passed along correctly via the query string for "direct" submissions. New $g_query_str_multi_val_separator setting added to the library.php file which determines the delimiter for the array values (defaulted to ",") [034]
    • When adding form, the test value for array form fields appeared as "Array()": now correctly shows the content [036]
    • The navigation links on some systems didn't work. Usage of the SCRIPT_NAME deprecated in favour of cross-system-friendly PHP_SELF key in the $_SERVER hash. [027]
    • Now no longer tries to send email to user submitting form who didn't include an email address in the assigned field (caused error message on some systems) [028]
    • Deleting field wasn't deleting actual field in database on some systems. Fixed. [041]
    • Deleting a field that was being used as the default sort field now no longer causes errors. [005]
    • The single value zero (0) now appears correctly in generated Excel files [030]

    Minor changes

    • Minor formatting fix on Edit Form - Display tab which occurred when Form Field Display Names are quite long
    • ?id= query string value no longer passed along in login pages if not being used to determine custom login page appearance [035]
    • Text change on Add Form step 4 page [037]
    • When setting up a file upload field, the "Test Folder Permissions" check now also confirms that your installation of PHP has its temporary file upload folder configured properly [026]
    Comments (0)


    Function: check_upload_folder()November 18, 2006
    Filed under: Code, PHP @ 10:33 pm

    A catch-all function to check that a folder is able to handle file uploads. In addition to the standard check that the folder specified exists, is readable and is writable, it also checks your server's PHP installation to confirm that the temporary upload folder is in fact valid. Up until this point I've always naively assumed that the smart folks who set up servers know to configure that value properly. But a couple of chaps on the Form Tools forums found that their installations of PHP had invalid settings - or weren't set at all. Doh!

    /*------------------------------------------------------------------------------------------------*\
      Function:     check_upload_folder
      Description: examines a folder to check (a) it exists and (b) it has correct permissions.
                       This function also checks to see if the upload_temp_dir server setting has been
                       configured.
      Parameter:   the full path to the folder to be examined.
    \*------------------------------------------------------------------------------------------------*/

    function check_upload_folder($folder)
    {
      // first, check server's temporary file upload folder
      $upload_tmp_dir = ini_get("upload_tmp_dir");
     
      if (empty($upload_tmp_dir))
        return array(false, "Your server's installation of PHP doesn't appear to have the
           <b>upload_tmp_dir</b> setting configured. This setting determines where files
           are temporarily uploaded to before they are moved to the folder you are specifying
           here. This value needs to be set in order to allow this program to properly upload
           files. Please contact your hosting provider."
    );
     
      if (!is_dir($folder))
        return array(false, "Your server's installation of PHP has an invalid setting for
           the <b>upload_tmp_dir</b> value. \"$upload_tmp_dir\" is not a valid folder."
    );

      if (!is_writable($folder))
        return array(false, "This temporary upload folder specified by your PHP installation
           is not writable. Until this is fixed, files cannot be uploaded through any PHP program
           on your server. Please contact your hosting provider."
    );
     
      // now check the folder specified by   
      if (!is_dir($folder))
        return array(false, "This is not a valid folder.");

      if (!is_writable($folder))
        return array(false, "This folder is not writeable.");
     
      return array(true, "This folder has the correct permissions.");
    }

    Comments (0)


    Function: get_date()November 13, 2006
    Filed under: Code, PHP @ 12:35 pm

    Helpful wrapper function used in my Form Tools script for converting a MySQL datetime into a human readable format. Includes the option of specifying hour offset. It gets pretty annoying having to rethink this problem every time you need it, so here it is for reference.

    /*-----------------------------------------------------------------------------------------*\
      Function:    get_date
      Description: helper function to return a date according based on an offset and a display format.
      Parameters: $offset     - the GMT offset
                       $datetime - the mysql datetime to format
                       $format    - the format to use (PHP's date() function).
    \*-----------------------------------------------------------------------------------------*/

    function get_date($offset, $datetime, $format)
    {
      $year = substr($datetime,0,4);
      $mon  = substr($datetime,5,2);
      $day  = substr($datetime,8,2);
      $hour = substr($datetime,11,2);
      $min  = substr($datetime,14,2);
      $sec  = substr($datetime,17,2);

      return date($format, mktime($hour + $offset, $min, $sec, $mon, $day, $year));
    }

    Comments (0)

    Next Page »