VERSION HISTORY for what's new and current bugfixes. Author: Oliver Seidel Version: 9.0 Author URI: http://www.deliciousdays.com */ /* Copyright 2006-2008 Oliver Seidel (email : oliver.seidel@deliciousdays.com) WHAT's NEW in cformsII - v9.0 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: API function: get_cforms_entries( $fname, $from, $to, $sort, $limit ) (see HELP for further info: "APIs...") *) feature: optionally redisplay user input after form submission (non Ajax mode only) *) feature: complete cforms backup option (see under "global settings") *) feature: enhanced support for WP_CONTENT_DIR, WP_CONTENT_URL, WP_PLUGIN_DIR, WP_PLUGIN_URL, PLUGINDIR *) feature: supports now 'check-box-activation' in "plugins" (no more "all data erased error") *) bugfix: installing the preset would add unwanted carriage returns (would break cforms Backup feature) *) bugfix: fixed widget/sidebar form display (if more than the default form was displayed) *) bugfix: fixed checkbox 'false' text addition if set to be not selected *) bugfix: form name filter on tracking page would only return results for one form *) bugfix: several minor bugfixes re: tracking page (filter + view, delete & download) *) other: my-functions.php can now be moved to the /cforms-custom/ folder *) other: data tracking page: made trash can icon(s) more obvious, added close button *) other: upload field: file extensions are case insensitive now! *) other: upload field: spaces in file names are now converted to _ *) other: fixed a Javascript related security concern *) other: revamped form backup file (not compatible with pre v9.0 versions!) *) other: fixed GMAIL support for admin message layout *) other: tracking page layout more fluid (CSS: Show->Submissions) */ $localversion = '9.0'; 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 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,'