Plugin Settings
Version: 1.2.1
Author: Taylor Lovett
Author URI: http://www.taylorlovett.com
Contributors: Taylor Lovett
*/
/*
Copyright (C) 2010-2011 Taylor Lovett, taylorlovett.com (admin@taylorlovett.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
require_once('custom-contact-forms-db.php');
require_once('custom-contact-forms-mailer.php');
require_once('custom-contact-forms-images.php');
if (!class_exists('CustomContactForms')) {
class CustomContactForms extends CustomContactFormsDB {
var $adminOptionsName = 'customContactFormsAdminOptions';
var $widgetOptionsName = 'widget_customContactForms';
var $version = '1.1.0';
var $errors;
var $error_return;
var $fixed_fields = array('customcontactforms_submit', 'fid', 'form_page', 'captcha');
function CustomContactForms() {
parent::CustomContactFormsDB();
$this->errors = array();
}
function getAdminOptions() {
$admin_email = get_option('admin_email');
$customcontactAdminOptions = array('show_widget_home' => 1, 'show_widget_pages' => 1, 'show_widget_singles' => 1, 'show_widget_categories' => 1, 'show_widget_archives' => 1, 'default_to_email' => $admin_email, 'default_from_email' => $admin_email, 'default_form_subject' => 'Someone Filled Out Your Contact Form!', 'custom_thank_you' => '', 'thank_you_message' => 'Thank you for filling out our form. We will respond to your inquiry ASAP.', 'remember_field_values' => 0); // defaults
$customcontactOptions = get_option($this->adminOptionsName);
if (!empty($customcontactOptions)) {
foreach ($customcontactOptions as $key => $option)
$customcontactAdminOptions[$key] = $option;
}
update_option($this->adminOptionsName, $customcontactAdminOptions);
return $customcontactAdminOptions;
}
function init() {
$this->getAdminOptions();
$this->registerSidebar();
}
function registerSidebar() {
register_sidebar_widget(__('Custom Contact Form'), array($this, 'widget_customContactForms'));
register_widget_control('Custom Contact Form', array($this, 'customContactForms_control'), 300, 200);
}
function customContactForms_control() {
$option = get_option($this->widgetOptionsName);
if (empty($option)) $option = array('widget_form_id' => '0');
if ($_POST[widget_form_id]) {
$option[widget_form_id] = $_POST[widget_form_id];
update_option($this->widgetOptionsName, $option);
$option = get_option($this->widgetOptionsName);
}
$forms = parent::selectAllForms();
$form_options = '';
foreach ($forms as $form) {
$sel = ($option[widget_form_id] == $form->id) ? ' selected="selected"' : '';
$form_options .= '';
}
if (empty($form_options)) { ?>
Create a form in the Custom Contact Forms settings page.
Want to change the appearance of your forms with a simple to use manager? The Style Manager allows style every aspect of your form: Change form border style, form border width, form width, form font family, title font size, title font color, text field width, text field border color, text field font size, text field font color, submit button width/height, submit button font color, and more!
2. Create fields and attach those fields to the forms of your choice. * Attach the fields in the order that you want them to show up in the form. If you mess up you can detach and reattach them.
3. Display those forms in posts and pages by inserting the code: [customcontact form=FORMID]. Replace FORMID with the id listed to the left of the form slug next to the form of your choice above.
4. Add a form to your sidebar, by dragging the Custom Contact Form widget in to your sidebar.
5. Configure the General Settings appropriately; this is important if you want to receive your web form messages!