/*
Copyright 2006-2007 Oliver Seidel (email : oliver.seidel@deliciousdays.com)
/*
WHAT's NEW in cforms II - v7.2
*) feature: system {variables} can now be used for the "default values"
*) feature: "jump to error" (javascript) can now be turned off
*) feature: added option to turn off CSS (styling) completely
*) feature: added support for full CAPTCHA customization
*) bugfix: fixed hidden field support for Ajax
*) bugfix: added CharSet=utf-8 to SMTP mailer support
*) bugfix: fixed support for complex field labels,e.g. "Your Name*"
*) bugfix: frozen widget panel corrected
*) bugfix: minor XHTML tweak to fix STRICT compliance
*) bugfix: corrected extra
when using cform's "WP COMMENT FEATURE"
*) other: modified handling of unset/unknown {variables}, in v7x unset variables would be printed as such
*) other: adjusted tracked time of submissions to reflect blog settings (offset)
*) other: Show Message "below form" can be activated in "form HIDE mode"
*) other: removed rawurldecode() for hidden fields
WHAT's NEW in cforms II - v7.11
*) critical fix: some server / browser combos caused the site to stall
WHAT's NEW in cforms II - v7.1
*) feature: 4 additional themes (monospace light&dark, fancy white/blue)
*) bugfix: WP comment feature - broken in v7.0
*) bugfix: WP comment feature - success message now being displayed when sending email
*) bugfix: WP comment feature - comment label points to right input field
*) bugfix: fixed and enhanced dynamic form feature
*) bugfix: fixed upload path config error (upload was still working though)
*) bugfix: fixed possible issues with existing WP jQuery (1.1.4) library
*) other: more CSS theme enhancements
*) other: WP 2.3.2 certififed
*) other: Turkish language pack available
WHAT's NEW in cforms II - v7.0
*) feature: much enhanced error display (optional)
with direct links to erroneous entries,
updated theme CSS (new styles),
& embedded custom error messages!
*) feature: "hidden fields" now supported, optionally referencing custom field data via variables (e.g. {meta_data} )!
*) feature: added alternative NAMES and ID's for all INPUT FIELDS derived from their field label (default is e.g.: cf_field_12)
*) feature: added optional support for T-A-F specific {VARIABLES} in non-TAF forms/contexts
*) bugfix: fixed an old non-AJAX post-id bug (caused issues with variables {Title} )
*) bugfix: table start and textarea data had extra
in the form email
*) bugfix: form backup/restore routine would miss a field
*) bugfix: fixed a multi-select-box resizing bug after form submission (Opera)
*) critical bugfix: fixes checkbox group / next item issue (would prevent the next item to be included in the email)
*) other: major CSS theme revamping (checked for IE,FF & Opera compat.)
*) other: quite a bit of cleaning up
*) other: adjusted CSS for radio buttons to meet checkbox groups'
*) other: changed default FROM: address to what has been configured in WP's settings
WHAT's NEW in cforms II - v6.5
*) feature: two additional CSS Themes: dark_XL & grey_blocks
*) feature: input field Wizard Mode, hopefully supporting easier field configuration
*) feature: enhanced "Add new field" functionality, supporting multiple new fields with one click
*) feature: added "read-only" ("disabled" would not allow to extract the field value)
*) feature: added an upload dir URL option, in case the upload directory is outside of ../wp-content/..
*) critical bugfix: if multiple upload fields are present and only some are being used, attachments may not be copied to the local server dir
*) bugfix: if submission entry (w/ multiple attachments) was deleted (via 'Tracking' page) only the first attachment was physically removed from the server
*) bugfix: dashboard would show cforms DB error if tracking tables were N/A
*) bugfix: fixed a MySQL error that would occur when using a LIMIT & tracking turned off
*) bugfix: fixed multiple upload field ID bug, all fields would have the same Element ID
*) other: enhanced widget layout / UI
*) other: T-A-F preset now explicitly turns on auto confirmation
*) improved admin UI (input field attributes & CSS fixes esp. for IE6/7)
WHAT's NEW in cforms II - v6.41
***) update 6/12: fixed form submission hide-bug
*) feature: introducing a limit of accepted form submissions, handy for registrations!
*) feature: PHPmailer 2.0 supporting SSL & TLS connections to external SMTP servers (e.g smtp.gmail.com)
*) bugfix: quotes and single quotes when using regexp / single line input fields
*) bugfix: if field is "EMAIL" AND "REQUIRED" it would loose the "REQUIRED" status after first validation attempt.
*) bugfix: semi-critical bug related to the use of CAPTCHA & NON-AJAX submission method
*) bugfix: fixed a label bug that would prevent the form from validating (W3C), introduced in v6.3
*) bugfix: fixed Drop-Down/Select-Box, now displaying the first entry as the default: necessary when checking 'REQUIRED'
*) other: unknown variables {xyz} would be removed, they're now left intact, supporting the use of:
in your HTML notification messages!
*) other: enhanced the default styling for the admin email ('included form data block')
*) other: a few form CSS enhancements
*) other: admin user interface enhancements (resizable message boxes)
WHAT's NEW in cforms II - v6.3
*) feature: slightly enhanced the "redirection options" - adding "hide form"
*) feature: added new input field: masked password field
*) feature: added setWeekStartDay for "date picker"
*) bugfix: fixed IIS support for TinyMCE dialog (some IIS caused path issues)
*) other: slight CSS changes/enhancements (backward compatible)
*) other: Japanese localization now available
WHAT's NEW in cforms II - v6.2
*) feature: added detection for typical errors
*) feature: added fieldset information in tracking display to maintain context of input fields
*) bugfix: fixed the T-A-F preset
*) bugfix: fixed TinyMCE compatiblity issues with WP2.0.2
*) bugfix: fixed wp_get_current_user() issue with WP2.0.2
*) bugfix: fixed tracking issue and {variable} bug when using fields with the same field label
now, this works (example: checkbox group) and will be recorded properly:
size#size1#size2#size3
size#size4#size5#size6
size#size6#size7#size8
*) other: reimplemented 'dashboard" support using activity box hook (no more JS)
*) other: changed behaviour of an email field. The "Email" flag doesn't anmore imply "Required"
*) other: Danish translation available!
*) other: Russian translation available!
WHAT's NEW in cforms II - v6.1
*) other: more forgiving to IIS servers with 'a very special set of ENV variables'
fixing a potential menu 'display bug'
*) other: combined WPMU and normal WP admin JS / to also cater to 'normal' WP installs
specific prototype/jQuery usage
*) other: made cforms.js editbale to cater to specific IIS reqs (URI=...)
*) bugfix: form name would escape single quotes
*) bugfix: proper support for blogs with a URI prefix, e.g. /blog/wp-content/...
*) bugfix: added user rights check for dashboard display
WHAT's NEW in cforms II - v6.0
*) new: TinyMCE: enhanced visual appearance of form placeholder in TinyMCE editor
*) new: TinyMCE: much improved TinyMCE & std editor button/insert dialog
(now with direct form select & fully localize-able )
*) new: completely revamped admin UI JS core for drag&drop (fixing some IE issues)
*) new: preset forms for "quick starts" (basic, T-A-F, WP Comment and custom err)
*) new: if no 'required' text is given (empty), then HTML will be entirely omitted
*) bugfix: CAPTCHA: finally fixed PHP/GD bug where image would not be shown
*) bugfix: Date Picker/CSS : fixed nasty IE 6 'select box' bug
*) bugfix: Date Picker/CSS : had a fix background color
*) bugfix: Date Picker/CSS : wasn't working with some themes
*) bugfix: Date Picker : wrong default setting for "date format"
*) bugfix: fixed {Page} Variable - won't cut of last character anymore
*) bugfix: fixed many structural HTML errors in the admin UI and other clean-up
*) bugfix: hopefully fixed admin menu "non-shows" for good
*) other: complete overhaul of the translation strings (major clean up)
*) other: enhanced cforms uninstall/cleanup routine
*) other: CSS adjustments for some themes; counteracting too aggressive WP themes
killing the cform layouts
*) other: made several SQL calls more robust and less likely to cause SQL errors
*) other: enhanced dashboard support
*) Enhanced the "simple example" for custom forms on help page (showing a more
flexible and elegant way of handling custom form field arrays!)
cforms II - v5.52 (bugfix release)
*) bugfix: Date Picker: fixed critical bug appearing on non "forms pages"
*) bugfix: Date Picker: fixed semi critical bug when showing multiple forms on the same page
*) bugfix: Dashboard feature: fixed SQL error in case no forms have been submitted yet
*) other: XHTML strict: fixed "name" attribut in form tag for compliance
cforms II - v5.51 (bugfix release)
*) bugfix: removed some debug code (echo) in T-A-F (disable/enable)
*) bugfix: fixed empty tag
*) bugfix: fixed admin menu for Windows IIS web server
*) bugfix: minor version display fix
*) other: JS file for "popup date picker" now only loaded when feature is enabled
*) other: renamed JS functions in "popup date picker" code (to avoid possible incompatiblities)
*) other: select boxes & upload fields now also show a "required" txt label
cforms II - v5.5
*) feature: special regexp use: compare two input fields for equal content (e.g. email verification)
*) feature: 'Tell-A-Friend' enable all posts/pages per click
*) feature: 'Tell-A-Friend' default behaviour for new posts/pages
*) feature: Fancy Javascript date picker
*) feature: "WP Comment/Message to author" Feature
*) feature: added dashboad support (showing last 5 entries)
*) other: since 2.3 comes with update support,
I removed local update notification code (saves a few kb)
*) bugfix: corrected form layout when no FIELDSETS are being used
*) bugfix: radio button fix, in case no label/li ID's are enabled
*) bugfix: made some changes to session mgmt in favour of keeping form content
when hitting the browsers back button
*) bugfix: fixed use of special character "." as an empty trailing line in TXT messages
*) other: tuned code a bit, hopefully with a performance gain
*) bugfix: fixed weird caching phenomena when deleting of forms
*) bugfix: fixed non ajax regexp processing
cforms II - v5.4
*) feature: added Tell-A-Friend functionality, see Help documentation
*) feature: added filter option for displaying data records on "Tracking" page
*) feature: added support for individual input field CSS customization
ie. unique - ID's, see "Styling" page
*) feature: added ajax captcha reset
*) feature: added individual error messages (HTML enabled), see Help
*) feature: added HTML support for field labels (field names), see examples on Help page
*) feature: added HTML support for the general error and success message
(HTML gets stripped for popup alert() boxes!)
*) other: changed {Page} variable to reflect query params (/?p=123)
if using the default permalink structure
*) other: changed session_start() call in favour of gzip compression
*) other: forcing chronological order of data records when downloading as CSV
*) bugfix: fixed group check box bug (in ajax)
*) bugfix: fixed special characters (e.g. Umlauts) in subject line
*) bugfix: minor CSS bugs
*) bugfix: check box select bug on "Tracking" page
*) bugfix: fixed copying of attachment(s) to specified server dir, when Tracking is turned off
*) bugfix: fixed sorting bug on 'Tracking' page for Internet Explorer
cforms II - v5.3
*) bugfix: admin HTML with non auto conf. TXT email would cause flawed HTML CC email
*) bugfix: fixed mailer error messsages for ajax (they would not show)
*) other: improved/simplified UI
*) other: lots of clean up and making UI around email messaging more obvious, hopefully
cforms II - v5.2
*) feature: support for alternative SMTP server
!! Note: Due to a obvious WP bug, class-smtp.php needs to be renamed to class.smtp.php
*) feature: post processing of submitted data (see documentation)
*) enhancement: simplified, and this made non-HTML (=TXT) emails more robust
*) enhancement: improved layout of textarea data (HTML) in admin emails
*) bugfix: stopped leaking HTML in TXT part of message
*) bugfix: fixed CC: feature for non-Ajax submissions
*) other: re-implemented ajax support now utilizing POST to
avoid any input limitations (# of characters)
*) other: more robust email address/name processing
cforms II - v5.1
*) re-introduced feature: FROM: address can again be changed via UI, BE CAREFUL!
*) feature: added hook for outside processing/manipulation of form data
*) bugfix: Outlook (especially 2007) requires special HTML formatting
*) other: bit of code clean up here and there
cforms II - v5.0
*) NOTE: The extra settings for form ID's (in email messages) are obsolete,
this feature is now available via the default variable {ID} - see Help!
*) NOTE: The special input field "Email subject" is now obsolete, since both
message body and SUBJECT fully support default and custom variables
*) feature: added a couple of CSS Themes
*) feature: multiple upload fields in the same form now supported
*) feature: 3rd party email tracking support, e.g. readnotify & didtheyreadit
*) feature: basic widget support (make sure to double check Theme CSS!)
*) feature: alternative form action supported (please read config info!)
*) feature: BCC to copy additional admin(s)
*) feature: additional themes: blue & green
*) feature: full [additional] HTML formatting support for email messages
*) bugfix: BACKUP & RESTORE fixed (not all fields were backed-up prev.)
*) bugfix: "spacing between labels & data" error when number < than length(field name)
*) bugfix: more CSS corrections
*) bugfix: the use of single & double quotes fixed in FIELDSETS
*) bugfix: one more single quote bug remedied in form labels
*) bugfix: DB tracking of user verification input now consistent w/ and w/o Ajax mode
*) bugfix: critical CAPTCHA issue resolved when more than one CAPTCHA fields are
displayed on the same page
*) bugfix: a mail server error would cause a bogus redirect and on top "hide" the actual
error making any troubleshooting virtually impossible
*) bugfix: critical javascript error when using more than 9 forms
*) bugfix: regexp in non-ajax mode cause an error when using a slash '/'
*) other: layout enhancements for all CSS Themes
*) other: default variables fixed for auto confirmation message (subject & message)
*) other: code clean up & major admin usability/accessibility improvements
*) other: fixed leading _ in form object ID's
*) other: now validates for XHTML 1.0 "Strict", too
v4.8 (bugfixes mostly)
*) other: added optional credit text - if you're happy with cforms you may want to
leave it enabled
*) feature: added a configurable SPACE between labels & data in the form email
*) feature: file uploads (form attachments) can now optionally be exlcuded from the email
they can be downloaded via "Tracking" (if enabled!) or accessed directly on the server
*) bugfix: properly escaped subject lines (when using visitor defined subject)
*) bugfix: fixed single quotes in field names
*) bugfix: text-only fields would falsely be added to the Tracking Tables
*) bugfix: non Ajax method: possible formatting issues with 1st fieldset in email
*) bugfix: non Ajax method: DB tracking of check boxes corrupted
*) bugfix: Ajax method: fixed possible "Multi-Recipients" bug
*) bugfix: non Ajax method: added a missing error message for failed attempts email forms
*) bugfix: DB Tracking: multi-line fields are now consistently stored (no extra
)
*) other: a few more form themes (wide & big, no border)
*) other: slightly enhanced email formatting
*) other: added seperate USER CAPability for tracking only! (use w/ Role Manager plugin!)
v4.7 (bugfixes only)
*) bugfix: field names would not show correctly when upgrading from 3.x to 4.6+
*) bugfix: simple CSS changes to support Opera Browsers (tested on 9+)
*) other: made some captcha mods for better readability
v4.6 (bugfixes & features)
*) new feature: page redirect on successful form submission
*) new feature: customizable admin form email (header, subject)
*) new feature: customizable auto confirmation message
(input field reference) & pre-defined variables
*) bugfix: multiple, sequentially arranged check box groups would "collapse"
*) bugfix: fixed adding/duplicating new forms with WP2.2 (WP caching issue)
*) bugfix: db tracking in non-Ajax mode showed inconsistent input field names
*) other: made the DB tracking tables creation process more flexible, hopefully
avoiding "CURRENT_TIMESTAMP" err msgs in the future!
v4.5 (maintenance, bug fixes and enhancements)
*) NOTE: the format for check box groups has been enhanced, see HELP!
*) feature: (optional) ID's for labels for even greater level of customization!
*) bugfix: "Subject for Email" could not be saved "Is Required"
*) other: "Subject for Email", user definable subject is now appended
*) other: "Subject for Email" is now part of the email form submission body
*) other: form structure re-done! XHTML'fied; much more robust now
*) other: streamlined CSS
*) other: added a warning msg re: "Show messages" settings
v4.1 (features)
*) feature: support for shown but disabled form element
*) feature: "user message" positioning, now optionally at the bottom of the form
*) feature: "multi-select" via check boxes, grouped check boxes
*) feature: new special field: subject field
*) other: revised and cleaned up Help! section
v4 (feature & bugfix)
*) feature: captcha support for additional SPAM protection
*) feature: select & configure stylesheets via admin UI
*) bugfix: IE margin-bottom hover bug
*) bugfix: deleting form fields (on the general form config page) was broken due a
new bug that was introduced as part of the localization effort
*) other: change the INSERT queries using LAST_INSERT_ID() due to overly sensitive
SQL servers.
v3.5 (mostly maintenance)
*) feature: slightly enhanced Tracking page ("delete" now also removes attachments)
tracking data view now permits selective deletion of submission entries
*) feature: text fields can optionally be auto cleared on focus (if browser is JS enabled)
*) feature: attachments (uploads) are now stored on the server and can be accessed
via the "Tracking" page
*) feature: added optional ID tracking to forms (& emails sent out)
*) bugfix: editor button wouldn't show due to wrong image path
*) bugfix: order of fields on the "Tracking" page fixed, to ensure an absolute order
NOTE: as part of the install/update either deactivate/reactive the plugin or delete
the existing Tracking tables, to make use of the new table structure)
*) bugfix: due to a WP bug, the use of plugin_basename had to be adjusted
*) bugfix: fixed support for non-utf8 blogs ( mb_convert_encoding etc.)
*) other: code cleanup (big thanks to Sven!) to allow proper localization
current languages supported:
English, default
German, provided by Sven Wappler
*) other: changed data counter (column 1) on the Tracking page to reflect unique
form submission ID, that a visitor could possibly reference.
v3.4
*) feature: multi-select fields
*) feature: dynamic forms (on the fly form creation)
*) bugfix: minor display bug on admin page: "add new field" button
*) bugfix: fixed a CSS bug to better support 3 column WP themes
(w/ middle column not floated)
v3.3
*) feature: "file upload field" can now be mandatory
*) feature: additional select box for more intuitive form selection
*) drop down "-" option for multi recipients
*) bugfix: select (drop down) boxes did not save values for non ajax method
*) bugfix: when using "multi-recipients" field & first entry used, email would
still go out to everyone
*) bugfix: charsets other than UTF-8 caused issues with special characters in emails
*) other: added form name as hover text for form buttons
v3.2.2
*) feature: most attachment types (images, docs etc) are now recognized
*) bugfix: not really a bug, but no "extra" attachments anymore
*) bugfix: more special characters in response messages
v3.2
*) feature: file upload; only works with non-ajax send method (chosen autoamtically)
due to HTML constraints. ajax support does NOT need to be explicitly disabled
*) feature: select boxes (drop downs) now can be "required" -> to support situations,
where you don't want a default value to kick in, but want the visito to make a choice!
see HELP! section for more info on how to use this new feature
*) feature: checkboxes : now can be "required" -> for "I have read the above" type
scenarious, where the user has to comply/agree to a statement
*) feature: radio buttons, you can now click on the labels to toggle the selection
*) feature: radio & select boxes (drop down): now accept a "display value" & a "submit value"
see HELP! section for more info
*) feature: "submit button" is now disabled after sending to prevent multiple
submissions in case the web servers response is delayed (Ajax!)
*) feature: download supports both CSV and TXT (tab delimited)
*) bugfix: time correction in email (now considers blog time/date configuration)
*) bugfix: failure and success msgs would not show special characters properly
*) bugfix: “database tables found msg” would always show when settings were saved
*) bugfix: labels (left of an input field) would not display special chars correctly
*) other: renamed a few functions to avoid conflicts with other plugins
*) other: modified checkboxes: text to the right is by default "clickable"
*) other: W3C XHTML compliance now fully supported even when using REG EXPRESSIONS!
v3
*) bugfix: changed the priority of the plugin: fixes layout issues due to wpautop
*) bugfix: fixed ajax (email) issues with CC: and Visitor verification fields
*) bugfix: fixed a few minor layout issues
*) UI: new admin uinterface
*) feature: full support for for role-manager support, see here for a current release:
http://www.im-web-gefunden.de/wordpress-plugins/role-manager/
*) feature: database tracking of form input & download as a CSV file
*) feature: backup and restore individual form settings (doesn't affect plugin-wide settings)
*) feature: erase all cforms data before deactivating/uninstalling the plugin
*) feature: added a new special field: "textonly" to add fully customizable paragraphs to your forms
*) feature: verification question to counteract spam
*) feature: custom regular expressions for single line input fields
usage: separate regexp via pipe '|' symbol: fieldname|defaultval|regexp
e.g. Phone|+49|^\+?[0-9- \(\)]+$
*) new menu structure (now top level menu!)
*) admin code clean up
*) verification codes accept answers case insensitive
v2.5
*) feature: multiple email recipients ("form admins"): mass sending & selective sending by
(visitor)
*) CFORMS.CSS includes custom settings for form #2 (to see it in action, create a second
form (#2) with one FIELDSET and a few input fields)
*) feature: order of fields; fields can now be sorted via drag & drop
*) feature: forms can be duplicated
*) Fully integrated with TinyMCE & code editor. FF: hover over form placeholder and form
object will be displayed. IE: select form placeholder and click on the cforms editor
button
*) feature: default values for line & multi line input fields: use a "|" as a delimiter
*) UI: "Update Settings" returns directly to config section
*) bugfix: quotes and single quotes in input fields fixed
*) bugfix: adding/deleting fields will respect (=save) other changes made
*) UI: all form fields can now be deleted up until the last field
*) feature: CC optional for visitor / if CC'ed not auto confirmatin will be sent add'l
*) feature: enhanced email layout - supporting defined fieldset
*) feature: REPLY-TO set for emails to both form admins & visitors (CC'ed)
*) non ajax form submisssion: page reloads and now jumps directly to form (& success msg)
*) code clean up and a handful of minor big fixes
v2.1.1
*) bugfix: IE not showing AJAX / popup message stati
*) bugfix: send button jumping to the left after submitting
*) check boxes: text can now be displayed both to the left and right
v2.1
*) fieldsets are now supported: CSS: .cformfieldsets addresses all sets,
cformfieldsetX (with X=1,2,3...) individual ones.
*) form code clean-up: more standardized with a minimum on necessary elements and
got rid of all the legacy DIVs
*) javascript has been "outsourced" making your html so much nicer :)
v2
!!) when upgrading to v2:
!) please edit each form on your plugins config page to verify that the email
field is checked with "Is Email" to ensure email verification
*) additional form fields: checkboxes, radio buttons and select fields
*) please note the expected "Field Name" entry format, separating input field items
form the field name: i.e. radio buttons: field-name#button1#button2#button3#...
*) ajax support can be optionally turned off
*) a form can now have as few input fields as two
*) more flexibilty in choosing email entry field. NOTE: if you have multiple email
fields in your form, only the first will be used for sending the auto confirmation to
*) "valid email required" placeholder added to indicate required input format for email fields
*) optional popup window for user messages (may be helpful for very long forms)
*) code cleanup
v1.90
*) email header correction: "From:" doesn't claim to be visitor's email
address anymore this should fix most paranoid mail server
v1.81
*) form name added for either email filtering or simply better differentiation
*) admin email: can now be just "xx@yy.zz" or "abc " (from name removed)
*) changes to email header: simplified and "WP compliant"
*) added to cforms.css: success and failure styles
*) bug fix related to the use of a single forms (#2 and up) and insertion of ajax code
*) FINALLY fixed "CR"s for multi-line response messages (success & failure fields)
v1.71
*) HTML bug resolved & localization for "waiting message"
*) default value for email recipient is now the blog admins' email address
*) added a function call to insert form anywhere on your blog
*) added new version support
v1.6
*) bug fixes: email/form functionality w/ standard send mechanism
v1.5
*) clean up, external css, multiple forms support & user auto confirmation