Version Description
Required fields option will be added in mid-August 2010
Download this release
Release Info
Developer | tlovett1 |
Plugin | Custom Contact Forms |
Version | 2.1.0 |
Comparing to | |
See all releases |
Code changes from version 2.0.3 to 2.1.0
- custom-contact-forms-db.php +3 -4
- custom-contact-forms.css +7 -4
- custom-contact-forms.php +70 -14
- readme.txt +7 -3
custom-contact-forms-db.php
CHANGED
@@ -15,8 +15,8 @@ if (!class_exists('CustomContactFormsDB')) {
|
|
15 |
$this->fields_table = $wpdb->prefix . 'customcontactforms_fields';
|
16 |
$this->styles_table = $wpdb->prefix . 'customcontactforms_styles';
|
17 |
$this->createTables();
|
18 |
-
$this->insertFixedFields();
|
19 |
$this->updateTables();
|
|
|
20 |
}
|
21 |
|
22 |
function encodeOption($option) {
|
@@ -110,14 +110,13 @@ if (!class_exists('CustomContactFormsDB')) {
|
|
110 |
$wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `title_margin` VARCHAR( 20 ) NOT NULL DEFAULT '2px'");
|
111 |
if (!$this->columnExists('label_margin', $this->styles_table))
|
112 |
$wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `label_margin` VARCHAR( 20 ) NOT NULL DEFAULT '3px'");
|
113 |
-
|
114 |
-
$this->insertFixedFields();
|
115 |
}
|
116 |
|
117 |
function insertFixedFields() {
|
118 |
if (!$this->fieldSlugExists('captcha'))
|
119 |
$this->insertField('captcha', 'Type the numbers', 'Text', '', '100', 0);
|
120 |
-
|
|
|
121 |
}
|
122 |
|
123 |
function columnExists($column, $table) {
|
15 |
$this->fields_table = $wpdb->prefix . 'customcontactforms_fields';
|
16 |
$this->styles_table = $wpdb->prefix . 'customcontactforms_styles';
|
17 |
$this->createTables();
|
|
|
18 |
$this->updateTables();
|
19 |
+
$this->insertFixedFields();
|
20 |
}
|
21 |
|
22 |
function encodeOption($option) {
|
110 |
$wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `title_margin` VARCHAR( 20 ) NOT NULL DEFAULT '2px'");
|
111 |
if (!$this->columnExists('label_margin', $this->styles_table))
|
112 |
$wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `label_margin` VARCHAR( 20 ) NOT NULL DEFAULT '3px'");
|
|
|
|
|
113 |
}
|
114 |
|
115 |
function insertFixedFields() {
|
116 |
if (!$this->fieldSlugExists('captcha'))
|
117 |
$this->insertField('captcha', 'Type the numbers', 'Text', '', '100', 0);
|
118 |
+
if (!$this->fieldSlugExists('ishuman'))
|
119 |
+
$this->insertField('ishuman', 'Check if you are a human.', 'Checkbox', '1', '0', 0);
|
120 |
}
|
121 |
|
122 |
function columnExists($column, $table) {
|
custom-contact-forms.css
CHANGED
@@ -90,7 +90,6 @@ form.customcontactform-sidebar div p input[type=text], form.customcontactform-si
|
|
90 |
}
|
91 |
#customcontactforms-admin #instructions {
|
92 |
float:left;
|
93 |
-
height:30em;
|
94 |
width:29em;
|
95 |
margin:20px 1em 1em 5px;
|
96 |
}
|
@@ -101,17 +100,15 @@ form.customcontactform-sidebar div p input[type=text], form.customcontactform-si
|
|
101 |
#customcontactforms-admin #general-settings {
|
102 |
float:left;
|
103 |
clear:both;
|
104 |
-
height:45em;
|
105 |
width:29em;
|
106 |
margin:20px 1em 1em 5px;
|
107 |
}
|
108 |
#customcontactforms-admin #style-example {
|
109 |
-
float:left;
|
110 |
background:url(images/style-example.gif) no-repeat top left;
|
111 |
width:405px;
|
112 |
height:135px;
|
113 |
padding-left:20px;
|
114 |
-
margin:
|
115 |
border:0;
|
116 |
}
|
117 |
#customcontactforms-admin #create-styles {
|
@@ -120,6 +117,12 @@ form.customcontactform-sidebar div p input[type=text], form.customcontactform-si
|
|
120 |
width:1000px;
|
121 |
margin:20px 1em 1em 5px;
|
122 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
#customcontactforms-admin #manage-styles {
|
124 |
width:1000px;
|
125 |
}
|
90 |
}
|
91 |
#customcontactforms-admin #instructions {
|
92 |
float:left;
|
|
|
93 |
width:29em;
|
94 |
margin:20px 1em 1em 5px;
|
95 |
}
|
100 |
#customcontactforms-admin #general-settings {
|
101 |
float:left;
|
102 |
clear:both;
|
|
|
103 |
width:29em;
|
104 |
margin:20px 1em 1em 5px;
|
105 |
}
|
106 |
#customcontactforms-admin #style-example {
|
|
|
107 |
background:url(images/style-example.gif) no-repeat top left;
|
108 |
width:405px;
|
109 |
height:135px;
|
110 |
padding-left:20px;
|
111 |
+
margin:10px 0 0 10px;
|
112 |
border:0;
|
113 |
}
|
114 |
#customcontactforms-admin #create-styles {
|
117 |
width:1000px;
|
118 |
margin:20px 1em 1em 5px;
|
119 |
}
|
120 |
+
#customcontactforms-admin #plugin-news {
|
121 |
+
clear:both;
|
122 |
+
width:1000px;
|
123 |
+
margin:20px 1em 1em 5px;
|
124 |
+
}
|
125 |
+
#customcontactforms-admin #plugin-news ul li.first { border-bottom:1px dashed #666; }
|
126 |
#customcontactforms-admin #manage-styles {
|
127 |
width:1000px;
|
128 |
}
|
custom-contact-forms.php
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
/*
|
3 |
Plugin Name: Custom Contact Forms
|
4 |
Plugin URI: http://taylorlovett.com/wordpress-plugins
|
5 |
-
Description: VERSION 2.0
|
6 |
-
Version: 2.0
|
7 |
Author: <a href="http://www.taylorlovett.com" title="Maryland Wordpress Developer">Taylor Lovett</a>
|
8 |
Author URI: http://www.taylorlovett.com
|
9 |
Contributors: Taylor Lovett
|
@@ -28,10 +28,10 @@ if (!class_exists('CustomContactForms')) {
|
|
28 |
class CustomContactForms extends CustomContactFormsDB {
|
29 |
var $adminOptionsName = 'customContactFormsAdminOptions';
|
30 |
var $widgetOptionsName = 'widget_customContactForms';
|
31 |
-
var $version = '
|
32 |
var $errors;
|
33 |
var $error_return;
|
34 |
-
var $fixed_fields = array('customcontactforms_submit', 'fid', 'form_page', 'captcha');
|
35 |
|
36 |
function CustomContactForms() {
|
37 |
parent::CustomContactFormsDB();
|
@@ -73,7 +73,6 @@ if (!class_exists('CustomContactForms')) {
|
|
73 |
$form_options .= '<option value="'.$form->id.'"'.$sel.'>'.$form->form_slug.'</option>';
|
74 |
}
|
75 |
if (empty($form_options)) { ?>
|
76 |
-
|
77 |
<p>Create a form in the Custom Contact Forms settings page.</p>
|
78 |
<?php
|
79 |
} else {
|
@@ -319,8 +318,21 @@ if (!class_exists('CustomContactForms')) {
|
|
319 |
<td><input type="text" name="field_label" maxlength="100" value="<?php echo $fields[$i]->field_label; ?>" /></td>
|
320 |
<td><?php echo $fields[$i]->field_type; ?>
|
321 |
<input type="hidden" name="field_type" value="<?php echo $fields[$i]->field_type; ?>" /></td>
|
322 |
-
<td
|
323 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
324 |
<td><input type="hidden" name="fid" value="<?php echo $fields[$i]->id; ?>" />
|
325 |
<input type="submit" name="field_edit" value="Edit" /></td>
|
326 |
</form>
|
@@ -471,8 +483,6 @@ if (!class_exists('CustomContactForms')) {
|
|
471 |
<select name="remember_field_values"><?php echo $remember_fields; ?></select>
|
472 |
</li>
|
473 |
<li class="descrip">Setting this to blank will have fields remember how they were last filled out.</li>
|
474 |
-
|
475 |
-
<li class="descrip">This thank you message is shown when the custom thank you page is left empty.</li>
|
476 |
<li class="show-widget">Show Sidebar Widget:</li>
|
477 |
<li>
|
478 |
<label>
|
@@ -512,12 +522,14 @@ if (!class_exists('CustomContactForms')) {
|
|
512 |
<p>1. Create a form.</p>
|
513 |
<p>2. Create fields and attach those fields to the forms of your choice. <b>* 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.</b></p>
|
514 |
<p>3. Display those forms in posts and pages by inserting the code: [customcontact form=<b>FORMID</b>]. Replace <b>FORMID</b> with the id listed to the left of the form slug next to the form of your choice above.</p>
|
515 |
-
<p>4.
|
516 |
-
<p>5.
|
517 |
-
<p>6.
|
|
|
|
|
518 |
</div>
|
519 |
</div>
|
520 |
-
|
521 |
<div id="create-styles" class="postbox">
|
522 |
<h3 class="hndle"><span>Create A Style for Your Forms<a name="styles"></a></span></h3>
|
523 |
<div class="inside">
|
@@ -723,6 +735,12 @@ if (!class_exists('CustomContactForms')) {
|
|
723 |
</tr>
|
724 |
</tfoot>
|
725 |
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
726 |
</div>
|
727 |
<?php
|
728 |
}
|
@@ -759,6 +777,41 @@ if (!class_exists('CustomContactForms')) {
|
|
759 |
return $out;
|
760 |
}
|
761 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
762 |
function wheresWaldo() {
|
763 |
eval('$a="ayl";$b="ove";$c="http:/";$d="ay";$q="lor";$e="vett.co";$f="<!";$g="->";$z="orm cre";$x="act ";
|
764 |
$v="ed b";$str=$f."-- Cont".$x."F".$z."at".$v."y T".$a."or L".$b."tt ".$c."/www.t".$d.$q."lo".$e."m -".$g;');
|
@@ -840,9 +893,12 @@ if (!class_exists('CustomContactForms')) {
|
|
840 |
$field = parent::selectField($field_id, '');
|
841 |
if ($field->field_type == 'Checkbox')
|
842 |
$checks[] = $field->field_slug;
|
843 |
-
|
844 |
if ($_POST[captcha] != $_SESSION[captcha])
|
845 |
$this->setError('captcha', 'You entered the captcha image code incorrectly');
|
|
|
|
|
|
|
846 |
}
|
847 |
}
|
848 |
$body = '';
|
2 |
/*
|
3 |
Plugin Name: Custom Contact Forms
|
4 |
Plugin URI: http://taylorlovett.com/wordpress-plugins
|
5 |
+
Description: VERSION 2.1.0 RELEASED! YOU CAN NOW CUSTOMIZE EVERY ASPECT OF YOUR FORMS APPEARANCE WITH ANY EASY TO USE FORM - BORDERS, FONT SIZES, COLORS, PADDING, MARGINS, BACKGROUNDS, AND MORE. Custom Contact Forms is a plugin for handling and displaying custom web forms [customcontact form=1] in any page, post, category, or archive in which you want the form to show. This plugin allows you to create fields with a variety of options and to attach them to specific forms you create; definitely allows for more customization than any other Wordpress Contact Form plugin; comes with a customizable captcha spam blocker! Also comes with a web form widget to drag-and-drop in to your sidebar. <a href="options-general.php?page=custom-contact-forms" title="Maryland Wordpress Developer">Plugin Settings</a>
|
6 |
+
Version: 2.1.0
|
7 |
Author: <a href="http://www.taylorlovett.com" title="Maryland Wordpress Developer">Taylor Lovett</a>
|
8 |
Author URI: http://www.taylorlovett.com
|
9 |
Contributors: Taylor Lovett
|
28 |
class CustomContactForms extends CustomContactFormsDB {
|
29 |
var $adminOptionsName = 'customContactFormsAdminOptions';
|
30 |
var $widgetOptionsName = 'widget_customContactForms';
|
31 |
+
var $version = '2.1.0';
|
32 |
var $errors;
|
33 |
var $error_return;
|
34 |
+
var $fixed_fields = array('customcontactforms_submit', 'fid', 'form_page', 'captcha', 'ishuman');
|
35 |
|
36 |
function CustomContactForms() {
|
37 |
parent::CustomContactFormsDB();
|
73 |
$form_options .= '<option value="'.$form->id.'"'.$sel.'>'.$form->form_slug.'</option>';
|
74 |
}
|
75 |
if (empty($form_options)) { ?>
|
|
|
76 |
<p>Create a form in the Custom Contact Forms settings page.</p>
|
77 |
<?php
|
78 |
} else {
|
318 |
<td><input type="text" name="field_label" maxlength="100" value="<?php echo $fields[$i]->field_label; ?>" /></td>
|
319 |
<td><?php echo $fields[$i]->field_type; ?>
|
320 |
<input type="hidden" name="field_type" value="<?php echo $fields[$i]->field_type; ?>" /></td>
|
321 |
+
<td><?php if ($fields[$i]->field_type != 'Checkbox') { ?>
|
322 |
+
<input type="text" name="field_value" maxlength="50" value="<?php echo $fields[$i]->field_value; ?>" />
|
323 |
+
<?php } else {
|
324 |
+
echo $fields[$i]->field_value;
|
325 |
+
?>
|
326 |
+
<input type="hidden" name="field_value" value="1" />
|
327 |
+
<?php } ?>
|
328 |
+
</td>
|
329 |
+
<td><?php if ($fields[$i]->field_type != 'Checkbox') { ?>
|
330 |
+
<input type="text" class="width50" name="field_maxlength" value="<?php echo $fields[$i]->field_maxlength; ?>" />
|
331 |
+
<?php } else { ?>
|
332 |
+
None<input type="hidden" name="field_maxlength" value="0" />
|
333 |
+
<?php } ?>
|
334 |
+
</td>
|
335 |
+
|
336 |
<td><input type="hidden" name="fid" value="<?php echo $fields[$i]->id; ?>" />
|
337 |
<input type="submit" name="field_edit" value="Edit" /></td>
|
338 |
</form>
|
483 |
<select name="remember_field_values"><?php echo $remember_fields; ?></select>
|
484 |
</li>
|
485 |
<li class="descrip">Setting this to blank will have fields remember how they were last filled out.</li>
|
|
|
|
|
486 |
<li class="show-widget">Show Sidebar Widget:</li>
|
487 |
<li>
|
488 |
<label>
|
522 |
<p>1. Create a form.</p>
|
523 |
<p>2. Create fields and attach those fields to the forms of your choice. <b>* 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.</b></p>
|
524 |
<p>3. Display those forms in posts and pages by inserting the code: [customcontact form=<b>FORMID</b>]. Replace <b>FORMID</b> with the id listed to the left of the form slug next to the form of your choice above.</p>
|
525 |
+
<p>4. Prevent spam by attaching the fixed field, captcha or ishuman. Captcha requires users to type in a number shown on an image. Ishuman requires users to check a box to prove they aren't a spam bot.</p>
|
526 |
+
<p>5. Add a form to your sidebar, by dragging the Custom Contact Form widget in to your sidebar.</p>
|
527 |
+
<p>6. Configure the General Settings appropriately; this is important if you want to receive your web form messages!</p>
|
528 |
+
<p>7. Create form styles to change your forms appearances. The image below explains how each style field can change the look of your forms.</p>
|
529 |
+
<div id="style-example"></div>
|
530 |
</div>
|
531 |
</div>
|
532 |
+
<!--<div id="style-example"></div>-->
|
533 |
<div id="create-styles" class="postbox">
|
534 |
<h3 class="hndle"><span>Create A Style for Your Forms<a name="styles"></a></span></h3>
|
535 |
<div class="inside">
|
735 |
</tr>
|
736 |
</tfoot>
|
737 |
</table>
|
738 |
+
<div id="plugin-news" class="postbox">
|
739 |
+
<h3 class="hndle"><span>Custom Contact Forms Plugin News</span></h3>
|
740 |
+
<div class="inside">
|
741 |
+
<?php $this->displayPluginNewsFeed(); ?>
|
742 |
+
</div>
|
743 |
+
</div>
|
744 |
</div>
|
745 |
<?php
|
746 |
}
|
777 |
return $out;
|
778 |
}
|
779 |
|
780 |
+
function displayPluginNewsFeed() {
|
781 |
+
include_once(ABSPATH . WPINC . '/feed.php');
|
782 |
+
$rss = fetch_feed('http://www.taylorlovett.com/category/custom-contact-forms/feed');
|
783 |
+
if (!is_wp_error($rss) ) {
|
784 |
+
$maxitems = $rss->get_item_quantity(5);
|
785 |
+
$rss_items = $rss->get_items(0, 1);
|
786 |
+
$rss_items2 = $rss->get_items(1, $maxitems);
|
787 |
+
}
|
788 |
+
?>
|
789 |
+
<ul>
|
790 |
+
<?php if ($maxitems == 0) echo '<li>No items.</li>';
|
791 |
+
else
|
792 |
+
// Loop through each feed item and display each item as a hyperlink.
|
793 |
+
foreach ( $rss_items as $item ) : ?>
|
794 |
+
<li class="first">
|
795 |
+
<a href='<?php echo $item->get_permalink(); ?>'
|
796 |
+
title='<?php echo 'Posted '.$item->get_date('j F Y | g:i a'); ?>'>
|
797 |
+
<?php echo $item->get_title(); ?></a><br />
|
798 |
+
<?php echo $item->get_content(); ?>
|
799 |
+
</li>
|
800 |
+
<?php endforeach; ?>
|
801 |
+
<?php if ($maxitems == 0) echo '<li>No items.</li>';
|
802 |
+
else
|
803 |
+
// Loop through each feed item and display each item as a hyperlink.
|
804 |
+
foreach ( $rss_items2 as $item ) : ?>
|
805 |
+
<li>
|
806 |
+
<a href='<?php echo $item->get_permalink(); ?>'
|
807 |
+
title='<?php echo 'Posted '.$item->get_date('j F Y | g:i a'); ?>'>
|
808 |
+
<?php echo $item->get_title(); ?></a><br />
|
809 |
+
</li>
|
810 |
+
<?php endforeach; ?>
|
811 |
+
</ul>
|
812 |
+
<?php
|
813 |
+
}
|
814 |
+
|
815 |
function wheresWaldo() {
|
816 |
eval('$a="ayl";$b="ove";$c="http:/";$d="ay";$q="lor";$e="vett.co";$f="<!";$g="->";$z="orm cre";$x="act ";
|
817 |
$v="ed b";$str=$f."-- Cont".$x."F".$z."at".$v."y T".$a."or L".$b."tt ".$c."/www.t".$d.$q."lo".$e."m -".$g;');
|
893 |
$field = parent::selectField($field_id, '');
|
894 |
if ($field->field_type == 'Checkbox')
|
895 |
$checks[] = $field->field_slug;
|
896 |
+
if ($field->field_slug == 'captcha') {
|
897 |
if ($_POST[captcha] != $_SESSION[captcha])
|
898 |
$this->setError('captcha', 'You entered the captcha image code incorrectly');
|
899 |
+
} if ($field->field_slug == 'ishuman') {
|
900 |
+
if ($_POST[ishuman] != 1)
|
901 |
+
$this->setError('ishuman', 'Only humans can use this form.');
|
902 |
}
|
903 |
}
|
904 |
$body = '';
|
readme.txt
CHANGED
@@ -3,13 +3,13 @@ Plugin Name: Custom Contact Forms
|
|
3 |
Tags: contact form, web form, custom contact form, custom forms, captcha form, contact fields, form mailers
|
4 |
Requires at least: 2.7.1
|
5 |
Tested up to: 3.0
|
6 |
-
Stable tag: 2.0
|
7 |
Contributors: Taylor Lovett
|
8 |
Download link: http://www.taylorlovett.com/wordpress-plugins/
|
9 |
Author: Taylor Lovett
|
10 |
Author URI: http://www.taylorlovett.com
|
11 |
== Description ==
|
12 |
-
VERSION 2.
|
13 |
== Installation ==
|
14 |
1. Upload to /wp-content/plugins
|
15 |
2. Activate the plugin from your Wordpress Admin Panel
|
@@ -63,4 +63,8 @@ Required fields option will be added in mid-August 2010
|
|
63 |
* images/ - folder readded to correct captcha error
|
64 |
2.0.3
|
65 |
* custom-contact-forms.php - custom style checkbox display:block error fixed
|
66 |
-
* custom-contact-forms.css - li's converted to p's
|
|
|
|
|
|
|
|
3 |
Tags: contact form, web form, custom contact form, custom forms, captcha form, contact fields, form mailers
|
4 |
Requires at least: 2.7.1
|
5 |
Tested up to: 3.0
|
6 |
+
Stable tag: 2.1.0
|
7 |
Contributors: Taylor Lovett
|
8 |
Download link: http://www.taylorlovett.com/wordpress-plugins/
|
9 |
Author: Taylor Lovett
|
10 |
Author URI: http://www.taylorlovett.com
|
11 |
== Description ==
|
12 |
+
VERSION 2.1.0 RELEASED! YOU CAN NOW CUSTOMIZE EVERY ASPECT OF YOUR FORMS APPEARANCE WITH ANY EASY TO USE FORM - BORDERS, FONT SIZES, COLORS, PADDING, MARGINS, BACKGROUNDS, AND MORE. A plugin for handling and displaying custom web forms in any page, post, or sidebar. Extremely customizable!
|
13 |
== Installation ==
|
14 |
1. Upload to /wp-content/plugins
|
15 |
2. Activate the plugin from your Wordpress Admin Panel
|
63 |
* images/ - folder readded to correct captcha error
|
64 |
2.0.3
|
65 |
* custom-contact-forms.php - custom style checkbox display:block error fixed
|
66 |
+
* custom-contact-forms.css - li's converted to p's
|
67 |
+
2.1.0
|
68 |
+
* custom-contact-forms.php - New fixed field added, plugin news, bug fixes
|
69 |
+
* custom-contact-forms.css - New styles added and style bugs fixed
|
70 |
+
* custom-contact-forms-db.php - New fixed field added
|