1) {
require_once(dirname(__FILE__) . '/lib_options_del.php');
} else {
### set paramters to default, if not exists
$noDISP='1';$no='';
if( isset($_REQUEST['switchform']) ) { ### only set when hitting form chg buttons
if( $_REQUEST['switchform']<>'1' )
$noDISP = $no = $_REQUEST['switchform'];
}
else if( isset($_REQUEST['go']) ) { ### only set when hitting form chg buttons
if( $_REQUEST['pickform']<>'1' )
$noDISP = $no = $_REQUEST['pickform'];
}
else{
if( isset($_REQUEST['noSub']) && (int)$_REQUEST['noSub']>1 ) ### otherwise stick with the current form
$noDISP = $no = $_REQUEST['noSub'];
}
}
### PRESETS
if ( isset($_REQUEST['formpresets']) )
require_once(dirname(__FILE__) . '/lib_options_presets.php');
### default: $field_count = what's in the DB
$field_count = $cformsSettings['form'.$no]['cforms'.$no.'_count_fields'];
### check if T-A-F action is required
$alldisabled=false;
$allenabled=0;
if( isset($_REQUEST['addTAF']) || isset($_REQUEST['removeTAF']) )
{
$posts = $wpdb->get_results("SELECT ID FROM $wpdb->posts");
if ( isset($_REQUEST['addTAF']) ){
foreach($posts as $post) {
if ( add_post_meta($post->ID, 'tell-a-friend', '1', true) )
$allenabled++;
}
} else if ( isset($_REQUEST['removeTAF']) ){
$wpdb->query("DELETE FROM $wpdb->postmeta WHERE meta_key = 'tell-a-friend'");
$alldisabled=true;
}
}
### Update Settings
if( isset($_REQUEST['Submit1']) || isset($_REQUEST['Submit2']) || isset($_REQUEST['Submit3']) || isset($_REQUEST['Submit4']) ||
isset($_REQUEST['Submit5']) || isset($_REQUEST['Submit6']) || isset($_REQUEST['Submit7']) || isset($_REQUEST['Submit8']) ||
isset($_REQUEST['Submit9']) || isset($_REQUEST['Submit10']) || isset($_REQUEST['AddField']) || array_search("X", $_REQUEST) ){
require_once(dirname(__FILE__) . '/lib_options_sub.php');
}
### new RSS key computed
if( isset($_REQUEST['cforms_rsskeysnew']) ) {
$cformsSettings['form'.$no]['cforms'.$no.'_rsskey'] = md5(rand());
update_option('cforms_settings',$cformsSettings);
}
### delete field if we find one and move the rest up
$deletefound = 0;
if(strlen($cformsSettings['form'.$no]['cforms'.$no.'_count_field_' . $field_count]) > 0) {
$temp_count = 1;
while($temp_count <= $field_count) {
if(isset($_REQUEST['DeleteField' . $temp_count])) {
$deletefound = 1;
$cformsSettings['form'.$no]['cforms'.$no.'_count_fields'] = ($field_count - 1);
}
if($deletefound && $temp_count<$field_count) {
$temp_val = $cformsSettings['form'.$no]['cforms'.$no.'_count_field_' . ($temp_count+1)];
$cformsSettings['form'.$no]['cforms'.$no.'_count_field_' . ($temp_count)] = $temp_val;
}
$temp_count++;
} ### while
if($deletefound == 1) { ### now delete
unset( $cformsSettings['form'.$no]['cforms'.$no.'_count_field_' . $field_count] );
$field_count--;
}
update_option('cforms_settings',$cformsSettings);
} ### if
### check possible errors
require_once(dirname(__FILE__) . '/lib_options_err.php');
###
### prep drop down box for form selection
###
$formlistbox = ' ';
### make sure at least the default FROM: address is set
if ( $cformsSettings['form'.$no]['cforms'.$no.'_fromemail'] == '' ){
$cformsSettings['form'.$no]['cforms'.$no.'_fromemail'] = '"'.get_option('blogname').'" ';
update_option('cforms_settings',$cformsSettings);
}
### check if HTML needs to be enabled
$fd = $cformsSettings['form'.$no]['cforms'.$no.'_formdata'];
if( strlen($fd)<=2 ) {
$fd .= ( $cformsSettings['form'.$no]['cforms'.$no.'_header_html']<>'' )?'1':'0';
$fd .= ( $cformsSettings['form'.$no]['cforms'.$no.'_cmsg_html']<>'' )?'1':'0';
$cformsSettings['form'.$no]['cforms'.$no.'_formdata'] = $fd;
update_option('cforms_settings',$cformsSettings);
}
### check for abspath.php
abspath_check();
?>
cforms allows you to insert one or more custom designed contact forms, which on submission (preferably via Ajax) will send the visitor info via email and optionally stores the feedback in the database.', 'cforms'),'?page='. $plugindir.'/cforms-help.php#inserting','onclick="setshow(18)"'); ?>
Here is a quick step by step quide to get you up and running quickly.', 'cforms'),'?page='. $plugindir.'/cforms-help.php#guide','onclick="setshow(17)"'); ?>