Plugins tab and either disable the plugin, or toggle its status (disable/enable) to revive cforms!', 'cforms') ?>
1 && $_REQUEST['no']<>'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 = get_option('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;
}
}
### new field added (will actually be added below!)
if( isset($_REQUEST['AddField']) && isset($_REQUEST['field_count_submit']) )
{
$field_count = $_POST['field_count_submit'] + $_POST['AddFieldNo'];
update_option('cforms'.$no.'_count_fields', $field_count);
}
### 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['AddField']) || array_search("X", $_REQUEST) ) {
require_once(dirname(__FILE__) . '/lib_options_sub.php');
}
### delete field if we find one and move the rest up
$deletefound = 0;
if(strlen(get_option('cforms'.$no.'_count_field_' . $field_count)) > 0) {
$temp_count = 1;
while($temp_count <= $field_count) {
if(isset($_REQUEST['DeleteField' . $temp_count])) {
$deletefound = 1;
update_option('cforms'.$no.'_count_fields', ($field_count - 1));
}
if($deletefound && $temp_count<$field_count) {
$temp_val = get_option('cforms'.$no.'_count_field_' . ($temp_count+1));
update_option('cforms'.$no.'_count_field_' . ($temp_count), $temp_val);
}
$temp_count++;
} ### while
if($deletefound == 1) { ### now delete
delete_option('cforms'.$no.'_count_field_' . $field_count);
$field_count--;
}
} ### 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 ( get_option('cforms'.$no.'_fromemail') == '' )
update_option('cforms'.$no.'_fromemail', '"'.get_option('blogname').'" ');
### check if HTML needs to be enabled
$fd=get_option('cforms'.$no.'_formdata');
if( strlen($fd)<=2 ) {
$fd .= ( get_option('cforms'.$no.'_header_html')<>'' )?'1':'0';
$fd .= ( get_option('cforms'.$no.'_cmsg_html')<>'' )?'1':'0';
update_option('cforms'.$no.'_formdata',$fd);
}
?>
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)"'); ?>