VERSION HISTORY for what's new and current bugfixes.
Author: Oliver Seidel
Version: 9.1
Author URI: http://www.deliciousdays.com
*/
/*
Copyright 2006-2008 Oliver Seidel (email : oliver.seidel@deliciousdays.com)
WHAT's NEW in cformsII - v9.1
README:
v9.0 introduces a completely new method of storing its settings,
***** please make a WP database backup first (!) *****
and then migrate your settings (cforms will guide you!)
*) feature: timing of forms: added start and end date for forms availability
*) feature: optionally include field names/header info when downloading data sets (CSV, TAB, XML)
*) feature: new custom function to control application logic during run-time
my_cforms_logic() filter function, see my-functions.php
for now only page redirection is being supported, more to come in the future
*) feature: revamped the code driving the deletion of forms (allowing also allowing the first form to be deleted)
*) bugfix: PHPMailer support for attachments (couldn't attach files to email)
*) bugfix: "Cannot use string offset as an array in lib_aux.php on line 12"
*) bugfix: minor bug in rendering nonAjax action path in form tag
*) bugfix: fixed paging on the tracking page
*) bugfix: fixed issue with cforms WP comment feature and additional fields (on top of
the default comment fields) not showing up in notification email
*) bugfix: fixed CC:me field bug (for Ajax submission)
*) bugfix: form submission tracking : fixed dashboard & RSS link to actual form details
*) bugfix: fixed RSS support (mime types and general compatiblity issues)
*) bugfix: JS bug could have caused hiccups when refreshing CAPTCHA image
*) bugfix: fixed restore bug "Error: Specified file failed upload test."
*) other: added delete warning when deleting a form
*) other: line breaks (CRs) in nonAjax confirmation msg are now translated to
*/
$localversion = '9.1';
load_plugin_textdomain('cforms');
### db settings
global $wpdb;
$wpdb->cformssubmissions = $wpdb->prefix . 'cformssubmissions';
$wpdb->cformsdata = $wpdb->prefix . 'cformsdata';
### button stuff
if( !class_exists('buttonsnap') )
require_once (dirname(__FILE__) . '/buttonsnap.php');
global $cformsSettings;
require_once (dirname(__FILE__) . '/lib_aux.php');
require_once (dirname(__FILE__) . '/editor.php');
### http://trac.wordpress.org/ticket/3002
$plugindir = $cformsSettings['global']['plugindir'];
$cforms_root = $cformsSettings['global']['cforms_root'];
### need this for captchas
add_action('template_redirect', 'start_cforms_session');
function start_cforms_session() {
@session_cache_limiter('private, must-revalidate');
@session_cache_expire(0);
@session_start();
}
### do a couple of things necessary as part of plugin activation
$dummy = __('Please go to the cforms admin page and run the update process.', 'cforms');
add_action('admin_notices', create_function('', 'global $plugindir, $cformsSettings; if ($cformsSettings[\'global\'][\'update\']) echo \'
\' . sprintf( __(\'Please go to the cforms admin page and run the update process.\', \'cforms\') ,\'admin.php?page=\'.$plugindir.\'/cforms-global-settings.php\') . \'
cforms contact form by delicious:days
'; ### either show message above or below $usermessage_text = check_default_vars($usermessage_text,$no); $usermessage_text = check_cust_vars($usermessage_text,$track,$no); if( substr($cformsSettings['form'.$no]['cforms'.$no.'_showpos'],1,1)=='y' && !($success&&$cformsSettings['form'.$no]['cforms'.$no.'_redirect']==2)) $content .= $tt . '' . $nl; return $content; } ### some css for positioning the form elements function cforms_style() { global $wp_query, $cforms_root, $localversion, $cformsSettings; ### add content actions and filters $page_obj = $wp_query->get_queried_object(); $onPages = str_replace(' ','',stripslashes(htmlspecialchars( $cformsSettings['global']['cforms_include'] ))); $onPagesA = explode(',', $onPages); if( $onPages=='' || in_array($page_obj->ID,$onPagesA) ){ echo "\n\n"; if( $cformsSettings['global']['cforms_no_css']<>'1' ) echo ''."\n"; echo ''."\n"; if( $cformsSettings['global']['cforms_datepicker']=='1' ){ $nav = $cformsSettings['global']['cforms_dp_nav']; $dformat = str_replace(array('M','EE','E'),array('m','dddd','ddd'),stripslashes($cformsSettings['global']['cforms_dp_date'])); echo ''."\n"; echo ''."\n"; } echo ''."\n\n"; } } function findlast( $haystack,$needle,$offset=NULL ){ if( ($pos = strpos( strrev($haystack) , strrev($needle) , $offset)) === false ) return false; return strlen($haystack) - $pos - strlen($needle); } ### replace placeholder by generated code function cforms_insert( $content ) { global $post, $cformsSettings; $newcontent=''; $last=0; if ( ($a=strpos($content,'',$a); $Fid = substr($content,$a+10,($b-$a-10)); $Fname = ''; if ( ($fQ=strpos($Fid,'"'))!==false ) $Fname = sanitize_title_with_dashes(substr( $Fid, $fQ+1, strpos($Fid,'"',$fQ+1)-$fQ-1 )); $newcontent .= substr($content,$last,$p_offset-$last); if( $Fname !== '' ) $newcontent .= cforms('',$fns[$Fname]); else $newcontent .= cforms('',$Fid); $p_open_after = strpos($content,'',$b); $p_close_after = strpos($content,'
',$b); ### wrapped in? $b = ($p_close_after < $p_open_after || ($p_close_after!==false && $p_open_after===false)) ? $p_close_after+1 : $b; //add'l +3 covered by $last = $b+3; !! :-) $a = strpos($content,'