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.0.1 |
Comparing to | |
See all releases |
Code changes from version 1.2.1 to 2.0.1
- custom-contact-forms-db.php +113 -12
- custom-contact-forms-images.php +1 -1
- custom-contact-forms.css +51 -16
- custom-contact-forms.php +271 -39
- image.php +1 -1
- readme.txt +19 -9
custom-contact-forms-db.php
CHANGED
@@ -8,11 +8,12 @@ if (!class_exists('CustomContactFormsDB')) {
|
|
8 |
class CustomContactFormsDB {
|
9 |
var $forms_table;
|
10 |
var $fields_table;
|
11 |
-
|
12 |
function CustomContactFormsDB() {
|
13 |
global $wpdb;
|
14 |
$this->forms_table = $wpdb->prefix . 'customcontactforms_forms';
|
15 |
$this->fields_table = $wpdb->prefix . 'customcontactforms_fields';
|
|
|
16 |
$this->createTables();
|
17 |
$this->insertFixedFields();
|
18 |
$this->updateTables();
|
@@ -24,7 +25,7 @@ if (!class_exists('CustomContactFormsDB')) {
|
|
24 |
|
25 |
function decodeOption($option, $strip_slashes = 1, $decode_html_chars = 1) {
|
26 |
if ($strip_slashes == 1) $option = stripslashes($option);
|
27 |
-
if ($decode_html_chars == 1) $option =
|
28 |
return $option;
|
29 |
}
|
30 |
|
@@ -55,21 +56,67 @@ if (!class_exists('CustomContactFormsDB')) {
|
|
55 |
PRIMARY KEY ( `id` )
|
56 |
) ENGINE = MYISAM AUTO_INCREMENT=1 ";
|
57 |
$wpdb->query($sql2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
}
|
59 |
return true;
|
60 |
}
|
61 |
|
|
|
|
|
|
|
|
|
62 |
function updateTables() {
|
63 |
global $wpdb;
|
64 |
if (!$this->columnExists('user_field', $this->fields_table))
|
65 |
$wpdb->query("ALTER TABLE `" . $this->fields_table . "` ADD `user_field` INT( 1 ) NOT NULL DEFAULT '1'");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
|
67 |
$this->insertFixedFields();
|
68 |
}
|
69 |
-
|
70 |
function insertFixedFields() {
|
71 |
if (!$this->fieldSlugExists('captcha'))
|
72 |
-
$this->insertField('captcha', 'Type the
|
73 |
|
74 |
}
|
75 |
|
@@ -79,20 +126,32 @@ if (!class_exists('CustomContactFormsDB')) {
|
|
79 |
return (!empty($test[0]) && $test[0]->COLUMN_NAME == $column);
|
80 |
}
|
81 |
|
82 |
-
function insertForm($form_slug, $form_title, $form_action, $form_method, $submit_button_text, $custom_code) {
|
83 |
global $wpdb;
|
84 |
-
if ($this->formSlugExists($
|
85 |
-
$wpdb->insert($this->forms_table, array('form_slug' => $this->formatSlug($form_slug), 'form_title' => $this->encodeOption($form_title), 'form_action' => $this->encodeOption($form_action), 'form_method' => $form_method, 'submit_button_text' => $this->encodeOption($submit_button_text), 'custom_code' => $this->encodeOption($custom_code)));
|
86 |
return true;
|
87 |
}
|
88 |
|
89 |
function insertField($field_slug, $field_label, $field_type, $field_value, $field_maxlength, $user_field) {
|
90 |
global $wpdb;
|
91 |
-
if ($this->fieldSlugExists($field_slug)) return false;
|
92 |
$wpdb->insert($this->fields_table, array('field_slug' => $this->formatSlug($field_slug), 'field_label' => $this->encodeOption($field_label), 'field_type' => $field_type, 'field_value' => $this->encodeOption($field_value), 'field_maxlength' => $this->encodeOption($field_maxlength), 'user_field' => $user_field));
|
93 |
return true;
|
94 |
}
|
95 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
function fieldsTableExists() {
|
97 |
global $wpdb;
|
98 |
return ($wpdb->get_var("show tables like '". $this->fields_table . "'") == $this->fields_table);
|
@@ -103,13 +162,18 @@ if (!class_exists('CustomContactFormsDB')) {
|
|
103 |
return ($wpdb->get_var("show tables like '". $this->forms_table . "'") == $this->forms_table);
|
104 |
}
|
105 |
|
106 |
-
function
|
|
|
|
|
|
|
|
|
|
|
107 |
global $wpdb;
|
108 |
if (empty($form_slug)) return false;
|
109 |
$test = $this->selectForm('', $form_slug);
|
110 |
if (!empty($test) and $test->id != $fid) // if form_slug is different then make sure it is unique
|
111 |
return false;
|
112 |
-
$wpdb->update($this->forms_table, array('form_slug' => $this->formatSlug($form_slug), 'form_title' => $this->encodeOption($form_title), 'form_action' => $this->encodeOption($form_action), 'form_method' => $form_method, 'submit_button_text' => $this->encodeOption($submit_button_text), 'custom_code' => $this->encodeOption($custom_code)), array('id' => $fid));
|
113 |
return true;
|
114 |
}
|
115 |
|
@@ -117,12 +181,27 @@ if (!class_exists('CustomContactFormsDB')) {
|
|
117 |
global $wpdb;
|
118 |
if (empty($field_slug)) return false;
|
119 |
$test = $this->selectField('', $field_slug);
|
120 |
-
if (!empty($test) and $test->id != $fid) // if
|
121 |
return false;
|
122 |
$wpdb->update($this->fields_table, array('field_slug' => $this->formatSlug($field_slug), 'field_label' => $this->encodeOption($field_label), 'field_type' => $field_type, 'field_value' => $this->encodeOption($field_value), 'field_maxlength' => $this->encodeOption($field_maxlength)), array('id' => $fid));
|
123 |
return true;
|
124 |
}
|
125 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
function deleteForm($fid) {
|
127 |
global $wpdb;
|
128 |
$wpdb->query("DELETE FROM " . $this->forms_table . " WHERE id='$fid'");
|
@@ -135,6 +214,12 @@ if (!class_exists('CustomContactFormsDB')) {
|
|
135 |
return true;
|
136 |
}
|
137 |
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
function selectAllForms() {
|
139 |
global $wpdb;
|
140 |
return $wpdb->get_results("SELECT * FROM " . $this->forms_table . " ORDER BY form_slug ASC");
|
@@ -145,12 +230,23 @@ if (!class_exists('CustomContactFormsDB')) {
|
|
145 |
return $wpdb->get_results("SELECT * FROM " . $this->fields_table . " ORDER BY field_slug ASC");
|
146 |
}
|
147 |
|
|
|
|
|
|
|
|
|
|
|
148 |
function selectForm($fid, $form_slug) {
|
149 |
global $wpdb;
|
150 |
-
$extra = (!empty($
|
151 |
return $wpdb->get_row("SELECT * FROM " . $this->forms_table . " WHERE id='$fid' $extra");
|
152 |
}
|
153 |
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
function selectField($fid, $field_slug) {
|
155 |
global $wpdb;
|
156 |
$extra = (!empty($field_slug)) ? " or field_slug = '$field_slug'" : '';
|
@@ -198,6 +294,11 @@ if (!class_exists('CustomContactFormsDB')) {
|
|
198 |
return (!empty($test));
|
199 |
}
|
200 |
|
|
|
|
|
|
|
|
|
|
|
201 |
function formSlugExists($slug) {
|
202 |
$test = $this->selectForm('', $slug);
|
203 |
return (!empty($test));
|
8 |
class CustomContactFormsDB {
|
9 |
var $forms_table;
|
10 |
var $fields_table;
|
11 |
+
var $styles_table;
|
12 |
function CustomContactFormsDB() {
|
13 |
global $wpdb;
|
14 |
$this->forms_table = $wpdb->prefix . 'customcontactforms_forms';
|
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();
|
25 |
|
26 |
function decodeOption($option, $strip_slashes = 1, $decode_html_chars = 1) {
|
27 |
if ($strip_slashes == 1) $option = stripslashes($option);
|
28 |
+
if ($decode_html_chars == 1) $option = html_entity_decode($option);
|
29 |
return $option;
|
30 |
}
|
31 |
|
56 |
PRIMARY KEY ( `id` )
|
57 |
) ENGINE = MYISAM AUTO_INCREMENT=1 ";
|
58 |
$wpdb->query($sql2);
|
59 |
+
} if(!$this->stylesTableExists()) {
|
60 |
+
// Title, input, textarea, label, form, submit
|
61 |
+
$sql3 = "CREATE TABLE `".$this->styles_table."` (
|
62 |
+
`id` INT( 11 ) NOT NULL AUTO_INCREMENT ,
|
63 |
+
`style_slug` VARCHAR( 30 ) NOT NULL ,
|
64 |
+
`input_width` VARCHAR( 10 ) NOT NULL DEFAULT '200px',
|
65 |
+
`textarea_width` VARCHAR( 10 ) NOT NULL DEFAULT '200px',
|
66 |
+
`textarea_height` VARCHAR( 10 ) NOT NULL DEFAULT '100px',
|
67 |
+
`form_borderwidth` VARCHAR( 10 ) NOT NULL DEFAULT '0px',
|
68 |
+
`label_width` VARCHAR( 10 ) NOT NULL DEFAULT '110px',
|
69 |
+
`form_width` VARCHAR( 10 ) NOT NULL DEFAULT '500px',
|
70 |
+
`submit_width` VARCHAR( 10 ) NOT NULL DEFAULT '80px',
|
71 |
+
`submit_height` VARCHAR( 10 ) NOT NULL DEFAULT '35px',
|
72 |
+
`label_fontsize` VARCHAR( 10 ) NOT NULL DEFAULT '1em',
|
73 |
+
`title_fontsize` VARCHAR( 10 ) NOT NULL DEFAULT '1.2em',
|
74 |
+
`field_fontsize` VARCHAR( 10 ) NOT NULL DEFAULT '1em',
|
75 |
+
`submit_fontsize` VARCHAR( 10 ) NOT NULL DEFAULT '1.1em',
|
76 |
+
`field_bordercolor` VARCHAR( 10 ) NOT NULL DEFAULT 'blue',
|
77 |
+
`form_borderstyle` VARCHAR( 30 ) NOT NULL DEFAULT 'dashed',
|
78 |
+
`form_bordercolor` VARCHAR( 20 ) NOT NULL DEFAULT 'black',
|
79 |
+
`field_fontcolor` VARCHAR( 20 ) NOT NULL DEFAULT '#000000',
|
80 |
+
`label_fontcolor` VARCHAR( 20 ) NOT NULL DEFAULT '#333333',
|
81 |
+
`title_fontcolor` VARCHAR( 20 ) NOT NULL DEFAULT '#333333',
|
82 |
+
`submit_fontcolor` VARCHAR( 20 ) NOT NULL DEFAULT '#333333',
|
83 |
+
`form_fontfamily` VARCHAR( 150 ) NOT NULL DEFAULT 'Verdana, Tahoma, Arial',
|
84 |
+
PRIMARY KEY ( `id` )
|
85 |
+
) ENGINE = MYISAM AUTO_INCREMENT=1 ";
|
86 |
+
$wpdb->query($sql3);
|
87 |
}
|
88 |
return true;
|
89 |
}
|
90 |
|
91 |
+
function formatStyle($style) {
|
92 |
+
return str_replace(';', '', $style);
|
93 |
+
}
|
94 |
+
|
95 |
function updateTables() {
|
96 |
global $wpdb;
|
97 |
if (!$this->columnExists('user_field', $this->fields_table))
|
98 |
$wpdb->query("ALTER TABLE `" . $this->fields_table . "` ADD `user_field` INT( 1 ) NOT NULL DEFAULT '1'");
|
99 |
+
if (!$this->columnExists('form_style', $this->forms_table))
|
100 |
+
$wpdb->query("ALTER TABLE `" . $this->forms_table . "` ADD `form_style` INT( 10 ) NOT NULL DEFAULT '0'");
|
101 |
+
if (!$this->columnExists('field_backgroundcolor', $this->styles_table))
|
102 |
+
$wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `field_backgroundcolor` VARCHAR( 20 ) NOT NULL DEFAULT '#efefef'");
|
103 |
+
if (!$this->columnExists('field_borderstyle', $this->styles_table))
|
104 |
+
$wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `field_borderstyle` VARCHAR( 20 ) NOT NULL DEFAULT 'solid'");
|
105 |
+
if (!$this->columnExists('form_margin', $this->styles_table))
|
106 |
+
$wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `form_margin` VARCHAR( 20 ) NOT NULL DEFAULT '6px'");
|
107 |
+
if (!$this->columnExists('form_padding', $this->styles_table))
|
108 |
+
$wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `form_padding` VARCHAR( 20 ) NOT NULL DEFAULT '4px'");
|
109 |
+
if (!$this->columnExists('title_margin', $this->styles_table))
|
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 |
|
126 |
return (!empty($test[0]) && $test[0]->COLUMN_NAME == $column);
|
127 |
}
|
128 |
|
129 |
+
function insertForm($form_slug, $form_title, $form_action, $form_method, $submit_button_text, $custom_code, $form_style) {
|
130 |
global $wpdb;
|
131 |
+
if ($this->formSlugExists($this->formatSlug($form_slug))) return false;
|
132 |
+
$wpdb->insert($this->forms_table, array('form_slug' => $this->formatSlug($form_slug), 'form_title' => $this->encodeOption($form_title), 'form_action' => $this->encodeOption($form_action), 'form_method' => $form_method, 'submit_button_text' => $this->encodeOption($submit_button_text), 'form_style' => $form_style, 'custom_code' => $this->encodeOption($custom_code)));
|
133 |
return true;
|
134 |
}
|
135 |
|
136 |
function insertField($field_slug, $field_label, $field_type, $field_value, $field_maxlength, $user_field) {
|
137 |
global $wpdb;
|
138 |
+
if ($this->fieldSlugExists($this->formatSlug($field_slug))) return false;
|
139 |
$wpdb->insert($this->fields_table, array('field_slug' => $this->formatSlug($field_slug), 'field_label' => $this->encodeOption($field_label), 'field_type' => $field_type, 'field_value' => $this->encodeOption($field_value), 'field_maxlength' => $this->encodeOption($field_maxlength), 'user_field' => $user_field));
|
140 |
return true;
|
141 |
}
|
142 |
|
143 |
+
function insertStyle($style) {
|
144 |
+
global $wpdb;
|
145 |
+
if (empty($style) or empty($style[style_slug]) or $this->styleSlugExists($this->formatSlug($style[style_slug]))) return false;
|
146 |
+
$style[style_slug] = $this->formatSlug($style[style_slug]);
|
147 |
+
foreach ($style as $key => $value) {
|
148 |
+
if ($key != 'style_slug')
|
149 |
+
$style[$key] = $this->formatStyle($this->encodeOption($value));
|
150 |
+
}
|
151 |
+
$wpdb->insert($this->styles_table, $style);
|
152 |
+
return true;
|
153 |
+
}
|
154 |
+
|
155 |
function fieldsTableExists() {
|
156 |
global $wpdb;
|
157 |
return ($wpdb->get_var("show tables like '". $this->fields_table . "'") == $this->fields_table);
|
162 |
return ($wpdb->get_var("show tables like '". $this->forms_table . "'") == $this->forms_table);
|
163 |
}
|
164 |
|
165 |
+
function stylesTableExists() {
|
166 |
+
global $wpdb;
|
167 |
+
return ($wpdb->get_var("show tables like '". $this->styles_table . "'") == $this->styles_table);
|
168 |
+
}
|
169 |
+
|
170 |
+
function updateForm($form_slug, $form_title, $form_action, $form_method, $submit_button_text, $custom_code, $form_style, $fid) {
|
171 |
global $wpdb;
|
172 |
if (empty($form_slug)) return false;
|
173 |
$test = $this->selectForm('', $form_slug);
|
174 |
if (!empty($test) and $test->id != $fid) // if form_slug is different then make sure it is unique
|
175 |
return false;
|
176 |
+
$wpdb->update($this->forms_table, array('form_slug' => $this->formatSlug($form_slug), 'form_title' => $this->encodeOption($form_title), 'form_action' => $this->encodeOption($form_action), 'form_method' => $form_method, 'form_style' => $form_style, 'submit_button_text' => $this->encodeOption($submit_button_text), 'custom_code' => $this->encodeOption($custom_code)), array('id' => $fid));
|
177 |
return true;
|
178 |
}
|
179 |
|
181 |
global $wpdb;
|
182 |
if (empty($field_slug)) return false;
|
183 |
$test = $this->selectField('', $field_slug);
|
184 |
+
if (!empty($test) and $test->id != $fid) // if field_slug is different then make sure it is unique
|
185 |
return false;
|
186 |
$wpdb->update($this->fields_table, array('field_slug' => $this->formatSlug($field_slug), 'field_label' => $this->encodeOption($field_label), 'field_type' => $field_type, 'field_value' => $this->encodeOption($field_value), 'field_maxlength' => $this->encodeOption($field_maxlength)), array('id' => $fid));
|
187 |
return true;
|
188 |
}
|
189 |
|
190 |
+
function updateStyle($style) {
|
191 |
+
global $wpdb;
|
192 |
+
if (empty($style[style_slug])) return false;
|
193 |
+
$test = $this->selectStyle('', $style[style_slug]);
|
194 |
+
if (!empty($test) and $test->id != $style[id]) // if style_slug is different then make sure it is unique
|
195 |
+
return false;
|
196 |
+
$style[style_slug] = $this->formatSlug($style[style_slug]);
|
197 |
+
foreach ($style as $key => $value) {
|
198 |
+
if ($key != 'style_slug')
|
199 |
+
$style[$key] = $this->formatStyle($this->encodeOption($value));
|
200 |
+
}
|
201 |
+
$wpdb->update($this->styles_table, $style, array('id' => $style[id]));
|
202 |
+
return true;
|
203 |
+
}
|
204 |
+
|
205 |
function deleteForm($fid) {
|
206 |
global $wpdb;
|
207 |
$wpdb->query("DELETE FROM " . $this->forms_table . " WHERE id='$fid'");
|
214 |
return true;
|
215 |
}
|
216 |
|
217 |
+
function deleteStyle($sid) {
|
218 |
+
global $wpdb;
|
219 |
+
$wpdb->query("DELETE FROM " . $this->styles_table . " WHERE id='$sid'");
|
220 |
+
return true;
|
221 |
+
}
|
222 |
+
|
223 |
function selectAllForms() {
|
224 |
global $wpdb;
|
225 |
return $wpdb->get_results("SELECT * FROM " . $this->forms_table . " ORDER BY form_slug ASC");
|
230 |
return $wpdb->get_results("SELECT * FROM " . $this->fields_table . " ORDER BY field_slug ASC");
|
231 |
}
|
232 |
|
233 |
+
function selectAllStyles() {
|
234 |
+
global $wpdb;
|
235 |
+
return $wpdb->get_results("SELECT * FROM " . $this->styles_table . " ORDER BY style_slug ASC");
|
236 |
+
}
|
237 |
+
|
238 |
function selectForm($fid, $form_slug) {
|
239 |
global $wpdb;
|
240 |
+
$extra = (!empty($form_slug)) ? " or form_slug = '$form_slug'" : '';
|
241 |
return $wpdb->get_row("SELECT * FROM " . $this->forms_table . " WHERE id='$fid' $extra");
|
242 |
}
|
243 |
|
244 |
+
function selectStyle($sid, $style_slug) {
|
245 |
+
global $wpdb;
|
246 |
+
$extra = (!empty($style_slug)) ? " or style_slug = '$style_slug'" : '';
|
247 |
+
return $wpdb->get_row("SELECT * FROM " . $this->styles_table . " WHERE id='$sid' $extra");
|
248 |
+
}
|
249 |
+
|
250 |
function selectField($fid, $field_slug) {
|
251 |
global $wpdb;
|
252 |
$extra = (!empty($field_slug)) ? " or field_slug = '$field_slug'" : '';
|
294 |
return (!empty($test));
|
295 |
}
|
296 |
|
297 |
+
function styleSlugExists($slug) {
|
298 |
+
$test = $this->selectStyle('', $slug);
|
299 |
+
return (!empty($test));
|
300 |
+
}
|
301 |
+
|
302 |
function formSlugExists($slug) {
|
303 |
$test = $this->selectForm('', $slug);
|
304 |
return (!empty($test));
|
custom-contact-forms-images.php
CHANGED
@@ -12,7 +12,7 @@ if (!class_exists('CustomContactFormsImages')) {
|
|
12 |
$textcolor = imagecolorallocate($src, 10, 0, 0);
|
13 |
imagestring($src, 14, 5, 1, $str, $textcolor);
|
14 |
imagecopyresampled($image, $src, 0, 0, 0, 0, 96, 24, 63, 18);
|
15 |
-
header('Content-Type: image/gif');
|
16 |
imagepng($image);
|
17 |
imagedestroy($image);
|
18 |
imagedestroy($src);
|
12 |
$textcolor = imagecolorallocate($src, 10, 0, 0);
|
13 |
imagestring($src, 14, 5, 1, $str, $textcolor);
|
14 |
imagecopyresampled($image, $src, 0, 0, 0, 0, 96, 24, 63, 18);
|
15 |
+
//header('Content-Type: image/gif');
|
16 |
imagepng($image);
|
17 |
imagedestroy($image);
|
18 |
imagedestroy($src);
|
custom-contact-forms.css
CHANGED
@@ -69,14 +69,17 @@ form.customcontactform-sidebar ul li input[type=text], form.customcontactform-si
|
|
69 |
width:90%;
|
70 |
font-size:12px;
|
71 |
}
|
|
|
72 |
/* ------------------ custom contact forms admin panel ---------------- */
|
73 |
#customcontactforms-admin {
|
74 |
vertical-align:top;
|
75 |
margin:1em 0 30px 25px;
|
76 |
}
|
77 |
-
|
|
|
78 |
font-size:1em;
|
79 |
}
|
|
|
80 |
#customcontactforms-admin .icon32 {
|
81 |
margin:-6px 6px 9px 5px;
|
82 |
}
|
@@ -90,20 +93,10 @@ form.customcontactform-sidebar ul li input[type=text], form.customcontactform-si
|
|
90 |
}
|
91 |
#customcontactforms-admin #instructions {
|
92 |
float:left;
|
93 |
-
height:
|
94 |
width:29em;
|
95 |
margin:20px 1em 1em 5px;
|
96 |
}
|
97 |
-
#customcontactforms-admin #upgrade {
|
98 |
-
width:900px;
|
99 |
-
background-color:#FFFFCC;
|
100 |
-
color:#000000;
|
101 |
-
padding:5px;
|
102 |
-
border:1px solid #999;
|
103 |
-
margin: 0 0 9px 0;
|
104 |
-
}
|
105 |
-
#customcontactforms-admin #upgrade .head { color:red; font-size:1.4em; margin:0px; }
|
106 |
-
#customcontactforms-admin #upgrade p:first-child { margin-top:0; }
|
107 |
#customcontactforms-admin #instructions p:first-child {
|
108 |
padding-top:0;
|
109 |
margin-top:0;
|
@@ -111,10 +104,40 @@ form.customcontactform-sidebar ul li input[type=text], form.customcontactform-si
|
|
111 |
#customcontactforms-admin #general-settings {
|
112 |
float:left;
|
113 |
clear:both;
|
114 |
-
height:
|
115 |
width:29em;
|
116 |
margin:20px 1em 1em 5px;
|
117 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
#customcontactforms-admin #general-settings form ul li.descrip {
|
119 |
font-style:italic;
|
120 |
padding-left:20px;
|
@@ -148,6 +171,11 @@ form.customcontactform-sidebar ul li input[type=text], form.customcontactform-si
|
|
148 |
#customcontactforms-admin #manage-fields {
|
149 |
width:1000px;
|
150 |
}
|
|
|
|
|
|
|
|
|
|
|
151 |
#customcontactforms-admin #manage-fixed-fields {
|
152 |
width:1000px;
|
153 |
}
|
@@ -162,11 +190,19 @@ form.customcontactform-sidebar ul li input[type=text], form.customcontactform-si
|
|
162 |
}
|
163 |
#customcontactforms-admin .attached_fields {
|
164 |
float:left;
|
165 |
-
width:
|
166 |
}
|
167 |
#customcontactforms-admin .attach_field {
|
|
|
|
|
|
|
|
|
168 |
float:right;
|
169 |
-
width:
|
|
|
|
|
|
|
|
|
170 |
}
|
171 |
#customcontactforms-admin label span {
|
172 |
font-weight:bold;
|
@@ -198,4 +234,3 @@ form.customcontactform-sidebar ul li input[type=text], form.customcontactform-si
|
|
198 |
.red { color:#F00; }
|
199 |
.bold { font-weight:bold; }
|
200 |
.italic { font-style:italic; }
|
201 |
-
.center { text-align:center; margin-left:auto; margin-right:auto; }
|
69 |
width:90%;
|
70 |
font-size:12px;
|
71 |
}
|
72 |
+
|
73 |
/* ------------------ custom contact forms admin panel ---------------- */
|
74 |
#customcontactforms-admin {
|
75 |
vertical-align:top;
|
76 |
margin:1em 0 30px 25px;
|
77 |
}
|
78 |
+
|
79 |
+
#customcontactforms-admin input, textarea, select {
|
80 |
font-size:1em;
|
81 |
}
|
82 |
+
|
83 |
#customcontactforms-admin .icon32 {
|
84 |
margin:-6px 6px 9px 5px;
|
85 |
}
|
93 |
}
|
94 |
#customcontactforms-admin #instructions {
|
95 |
float:left;
|
96 |
+
height:30em;
|
97 |
width:29em;
|
98 |
margin:20px 1em 1em 5px;
|
99 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
#customcontactforms-admin #instructions p:first-child {
|
101 |
padding-top:0;
|
102 |
margin-top:0;
|
104 |
#customcontactforms-admin #general-settings {
|
105 |
float:left;
|
106 |
clear:both;
|
107 |
+
height:45em;
|
108 |
width:29em;
|
109 |
margin:20px 1em 1em 5px;
|
110 |
}
|
111 |
+
#customcontactforms-admin #style-example {
|
112 |
+
float:left;
|
113 |
+
background:url(images/style-example.gif) no-repeat top left;
|
114 |
+
width:405px;
|
115 |
+
height:135px;
|
116 |
+
padding-left:20px;
|
117 |
+
margin:20px 0 0 10px;
|
118 |
+
border:0;
|
119 |
+
}
|
120 |
+
#customcontactforms-admin #create-styles {
|
121 |
+
clear:both;
|
122 |
+
height:38em;
|
123 |
+
width:1000px;
|
124 |
+
margin:20px 1em 1em 5px;
|
125 |
+
}
|
126 |
+
|
127 |
+
#customcontactforms-admin #manage-styles {
|
128 |
+
width:1000px;
|
129 |
+
}
|
130 |
+
|
131 |
+
#customcontactforms-admin #manage-styles label {
|
132 |
+
display:block;
|
133 |
+
}
|
134 |
+
|
135 |
+
#customcontactforms-admin #manage-styles input[type=text], #customcontactforms-admin #manage-styles select, #customcontactforms-admin #manage-styles textarea {
|
136 |
+
width:80px;
|
137 |
+
}
|
138 |
+
|
139 |
+
#customcontactforms-admin #create-styles .style_left { float:left; width:48% }
|
140 |
+
#customcontactforms-admin #create-styles .style_right { float:right; width:48%; clear:none }
|
141 |
#customcontactforms-admin #general-settings form ul li.descrip {
|
142 |
font-style:italic;
|
143 |
padding-left:20px;
|
171 |
#customcontactforms-admin #manage-fields {
|
172 |
width:1000px;
|
173 |
}
|
174 |
+
|
175 |
+
#customcontactforms-admin #manage-forms {
|
176 |
+
width:1000px;
|
177 |
+
margin-right:10px;
|
178 |
+
}
|
179 |
#customcontactforms-admin #manage-fixed-fields {
|
180 |
width:1000px;
|
181 |
}
|
190 |
}
|
191 |
#customcontactforms-admin .attached_fields {
|
192 |
float:left;
|
193 |
+
width:400px;
|
194 |
}
|
195 |
#customcontactforms-admin .attach_field {
|
196 |
+
float:left;
|
197 |
+
width:300px;
|
198 |
+
}
|
199 |
+
#customcontactforms-admin .actions {
|
200 |
float:right;
|
201 |
+
width: 80px; padding:0 18px 0 8px;
|
202 |
+
}
|
203 |
+
#customcontactforms-admin .attach_styles {
|
204 |
+
float:left;
|
205 |
+
width:300px;
|
206 |
}
|
207 |
#customcontactforms-admin label span {
|
208 |
font-weight:bold;
|
234 |
.red { color:#F00; }
|
235 |
.bold { font-weight:bold; }
|
236 |
.italic { font-style:italic; }
|
|
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: 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:
|
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
|
@@ -40,7 +40,7 @@ if (!class_exists('CustomContactForms')) {
|
|
40 |
|
41 |
function getAdminOptions() {
|
42 |
$admin_email = get_option('admin_email');
|
43 |
-
$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' => '', '
|
44 |
$customcontactOptions = get_option($this->adminOptionsName);
|
45 |
if (!empty($customcontactOptions)) {
|
46 |
foreach ($customcontactOptions as $key => $option)
|
@@ -73,6 +73,7 @@ if (!class_exists('CustomContactForms')) {
|
|
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 {
|
@@ -119,7 +120,7 @@ if (!class_exists('CustomContactForms')) {
|
|
119 |
function printAdminPage() {
|
120 |
$admin_options = $this->getAdminOptions();
|
121 |
if ($_POST[form_create]) {
|
122 |
-
parent::insertForm($_POST[form_slug], $_POST[form_title], $_POST[form_action], $_POST[form_method], $_POST[submit_button_text], $_POST[custom_code]);
|
123 |
} elseif ($_POST[field_create]) {
|
124 |
parent::insertField($_POST[field_slug], $_POST[field_label], $_POST[field_type], $_POST[field_value], $_POST[field_maxlength], 1);
|
125 |
} elseif ($_POST[general_settings]) {
|
@@ -132,7 +133,6 @@ if (!class_exists('CustomContactForms')) {
|
|
132 |
$admin_options[show_widget_archives] = $_POST[show_widget_archives];
|
133 |
$admin_options[show_widget_home] = $_POST[show_widget_home];
|
134 |
$admin_options[custom_thank_you] = $_POST[custom_thank_you];
|
135 |
-
$admin_options[thank_you_message] = $_POST[thank_you_message];
|
136 |
update_option($this->adminOptionsName, $admin_options);
|
137 |
} elseif ($_POST[field_edit]) {
|
138 |
parent::updateField($_POST[field_slug], $_POST[field_label], $_POST[field_type], $_POST[field_value], $_POST[field_maxlength], $_POST[fid]);
|
@@ -141,27 +141,26 @@ if (!class_exists('CustomContactForms')) {
|
|
141 |
} elseif ($_POST[form_delete]) {
|
142 |
parent::deleteForm($_POST[fid]);
|
143 |
} elseif ($_POST[form_edit]) {
|
144 |
-
parent::updateForm($_POST[form_slug], $_POST[form_title], $_POST[form_action], $_POST[form_method], $_POST[submit_button_text], $_POST[custom_code], $_POST[fid]);
|
145 |
} elseif ($_POST[form_add_field]) {
|
146 |
parent::addFieldToForm($_POST[field_id], $_POST[fid]);
|
147 |
} elseif ($_POST[disattach_field]) {
|
148 |
parent::disattachField($_POST[disattach_field_id], $_POST[fid]);
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
}
|
|
|
|
|
|
|
|
|
150 |
?>
|
151 |
<div id="customcontactforms-admin">
|
152 |
<div id="icon-themes" class="icon32"></div>
|
153 |
<h2>Custom Contact Forms</h2>
|
154 |
-
<div id="upgrade">
|
155 |
-
<p>Want to <i>change the appearance of your forms</i> with a simple to use manager? The Style Manager allows style every aspect of your form: <b>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!</b></p>
|
156 |
-
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
|
157 |
-
<input type="hidden" name="cmd" value="_s-xclick">
|
158 |
-
<input type="hidden" name="hosted_button_id" value="E7YXZBHN24R7S">
|
159 |
-
<p class="head center">Upgrade to the Pro Version for $4.99 USD:</p>
|
160 |
-
<input style="margin-left:400px;" type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
|
161 |
-
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
|
162 |
-
</form>
|
163 |
-
|
164 |
-
</div>
|
165 |
<div id="create-fields" class="postbox">
|
166 |
<h3 class="hndle"><span>Create A Form Field</span></h3>
|
167 |
<div class="inside">
|
@@ -223,6 +222,10 @@ if (!class_exists('CustomContactForms')) {
|
|
223 |
<label for="form_action">Form Action:</label>
|
224 |
<input type="text" name="form_action" value="" />
|
225 |
(If unsure, leave blank.)</li>
|
|
|
|
|
|
|
|
|
226 |
<li>
|
227 |
<label for="submit_button_text">Submit Button Text:</label>
|
228 |
<input type="text" maxlength="200" name="submit_button_text" />
|
@@ -338,7 +341,7 @@ if (!class_exists('CustomContactForms')) {
|
|
338 |
</tfoot>
|
339 |
</table>
|
340 |
<h3 class="manage-h3">Manage Forms</h3>
|
341 |
-
<table class="widefat post" id="manage-
|
342 |
<thead>
|
343 |
<tr>
|
344 |
<th scope="col" class="manage-column form-slug">Slug</th>
|
@@ -347,7 +350,7 @@ if (!class_exists('CustomContactForms')) {
|
|
347 |
<th scope="col" class="manage-column form-action">Form Action</th>
|
348 |
<th scope="col" class="manage-column form-submit">Button Text</th>
|
349 |
<th scope="col" class="manage-column form-submit">Custom Code</th>
|
350 |
-
<th scope="col" class="manage-column
|
351 |
</tr>
|
352 |
</thead>
|
353 |
<tbody>
|
@@ -357,6 +360,8 @@ if (!class_exists('CustomContactForms')) {
|
|
357 |
$form_methods = '<option>Post</option><option>Get</option>';
|
358 |
$form_methods = str_replace('<option>'.$forms[$i]->form_method.'</option>', '<option selected="selected">'.$forms[$i]->form_method.'</option>', $form_methods);
|
359 |
$add_fields = $this->getFieldsForm();
|
|
|
|
|
360 |
?>
|
361 |
<tr class="<?php if ($i % 2 == 0) echo 'evenrow'; ?>">
|
362 |
<form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
|
@@ -368,14 +373,10 @@ if (!class_exists('CustomContactForms')) {
|
|
368 |
<td><input class="width125" type="text" name="form_action" value="<?php echo $forms[$i]->form_action; ?>" /></td>
|
369 |
<td><input class="width125" type="text" name="submit_button_text" value="<?php echo $forms[$i]->submit_button_text; ?>" /></td>
|
370 |
<td><input type="text" class="width125" name="custom_code" value="<?php echo $forms[$i]->custom_code; ?>" /></td>
|
371 |
-
<td
|
372 |
-
<input type="submit" name="form_edit" value="Edit" />
|
373 |
-
<input type="submit" name="form_delete" value="Delete" /></td>
|
374 |
-
</form>
|
375 |
</tr>
|
376 |
<tr class="<?php if ($i % 2 == 0) echo 'evenrow'; ?>">
|
377 |
-
|
378 |
-
<td colspan="7"><div class="attached_fields">
|
379 |
<label><span>Attached Fields:</span></label>
|
380 |
<?php
|
381 |
$attached_fields = parent::getAttachedFieldsArray($forms[$i]->id);
|
@@ -401,14 +402,27 @@ if (!class_exists('CustomContactForms')) {
|
|
401 |
<input type="submit" name="form_add_field" value="Attach" />
|
402 |
<input type="hidden" name="fid" value="<?php echo $forms[$i]->id; ?>" />
|
403 |
<br />
|
404 |
-
<span class="red bold">*</span> Attach in the order you want fields to display. </div
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
405 |
</form>
|
406 |
</tr>
|
407 |
<?php
|
408 |
}
|
409 |
$remember_check = ($admin_options[remember_field_values] == 0) ? 'selected="selected"' : '';
|
410 |
$remember_fields = '<option value="1">Yes</option><option '.$remember_check.' value="0">No</option>';
|
411 |
-
|
|
|
|
|
412 |
?>
|
413 |
</tbody>
|
414 |
<tfoot>
|
@@ -420,7 +434,7 @@ if (!class_exists('CustomContactForms')) {
|
|
420 |
<th scope="col" class="manage-column form-action">Form Action</th>
|
421 |
<th scope="col" class="manage-column form-submit">Button Text</th>
|
422 |
<th scope="col" class="manage-column form-submit">Custom Code</th>
|
423 |
-
<th scope="col" class="manage-column
|
424 |
</tr>
|
425 |
</tr>
|
426 |
|
@@ -450,19 +464,15 @@ if (!class_exists('CustomContactForms')) {
|
|
450 |
<label for="custom_thank_you">Custom Thank You Page:</label>
|
451 |
<input name="custom_thank_you" value="<?php echo $admin_options[custom_thank_you]; ?>" type="text" maxlength="150" />
|
452 |
</li>
|
453 |
-
<li class="descrip">
|
454 |
|
455 |
<li>
|
456 |
<label for="remember_field_values">Remember Field Values:</label>
|
457 |
<select name="remember_field_values"><?php echo $remember_fields; ?></select>
|
458 |
</li>
|
459 |
<li class="descrip">Setting this to blank will have fields remember how they were last filled out.</li>
|
460 |
-
|
461 |
-
|
462 |
-
<label for="thank_you_message">Default Thank You Message:</label><br />
|
463 |
-
<textarea rows="6" cols="47" name="thank_you_message"><?php echo $admin_options[thank_you_message]; ?></textarea>
|
464 |
-
</li>
|
465 |
-
<li class="descrip">This thank you message is shown when a custom.</li>
|
466 |
<li class="show-widget">Show Sidebar Widget:</li>
|
467 |
<li>
|
468 |
<label>
|
@@ -504,8 +514,215 @@ if (!class_exists('CustomContactForms')) {
|
|
504 |
<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>
|
505 |
<p>4. Add a form to your sidebar, by dragging the Custom Contact Form widget in to your sidebar.</p>
|
506 |
<p>5. Configure the General Settings appropriately; this is important if you want to receive your web form messages!</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
507 |
</div>
|
508 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
509 |
</div>
|
510 |
<?php
|
511 |
}
|
@@ -553,9 +770,24 @@ if (!class_exists('CustomContactForms')) {
|
|
553 |
$this->startSession();
|
554 |
$admin_options = $this->getAdminOptions();
|
555 |
$form = parent::selectForm($fid, '');
|
556 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
557 |
$action = (!empty($form->form_action)) ? $form->form_action : get_permalink();
|
558 |
-
$out
|
559 |
$out .= parent::decodeOption($form->custom_code, 1, 1) . '<h4>' . parent::decodeOption($form->form_title, 1, 1) . '</h4>' . "\n" . '<ul>';
|
560 |
$fields = parent::getAttachedFieldsArray($fid);
|
561 |
$hiddens = '';
|
@@ -629,7 +861,7 @@ if (!class_exists('CustomContactForms')) {
|
|
629 |
$errors = $this->getAllErrors();
|
630 |
if (empty($errors)) {
|
631 |
$body .= 'Sender IP: ' . $_SERVER['REMOTE_ADDR'] . "\n";
|
632 |
-
$mailer = new CustomContactFormsMailer($admin_options[default_to_email], $admin_options[default_from_email], $admin_options[default_form_subject], $body);
|
633 |
$mailer->send();
|
634 |
if (!empty($admin_options[custom_thank_you])) {
|
635 |
header("Location: " . $admin_options[custom_thank_you]);
|
@@ -660,4 +892,4 @@ if (isset($customcontact)) {
|
|
660 |
add_filter('the_content', array(&$customcontact, 'contentFilter'));
|
661 |
}
|
662 |
add_action('admin_menu', 'CustomContactForms_ap');
|
663 |
-
?>
|
2 |
/*
|
3 |
Plugin Name: Custom Contact Forms
|
4 |
Plugin URI: http://taylorlovett.com/wordpress-plugins
|
5 |
+
Description: VERSION 2.0.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.0.1
|
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
|
40 |
|
41 |
function getAdminOptions() {
|
42 |
$admin_email = get_option('admin_email');
|
43 |
+
$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' => '', 'remember_field_values' => 0); // defaults
|
44 |
$customcontactOptions = get_option($this->adminOptionsName);
|
45 |
if (!empty($customcontactOptions)) {
|
46 |
foreach ($customcontactOptions as $key => $option)
|
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 {
|
120 |
function printAdminPage() {
|
121 |
$admin_options = $this->getAdminOptions();
|
122 |
if ($_POST[form_create]) {
|
123 |
+
parent::insertForm($_POST[form_slug], $_POST[form_title], $_POST[form_action], $_POST[form_method], $_POST[submit_button_text], $_POST[custom_code], $_POST[form_style]);
|
124 |
} elseif ($_POST[field_create]) {
|
125 |
parent::insertField($_POST[field_slug], $_POST[field_label], $_POST[field_type], $_POST[field_value], $_POST[field_maxlength], 1);
|
126 |
} elseif ($_POST[general_settings]) {
|
133 |
$admin_options[show_widget_archives] = $_POST[show_widget_archives];
|
134 |
$admin_options[show_widget_home] = $_POST[show_widget_home];
|
135 |
$admin_options[custom_thank_you] = $_POST[custom_thank_you];
|
|
|
136 |
update_option($this->adminOptionsName, $admin_options);
|
137 |
} elseif ($_POST[field_edit]) {
|
138 |
parent::updateField($_POST[field_slug], $_POST[field_label], $_POST[field_type], $_POST[field_value], $_POST[field_maxlength], $_POST[fid]);
|
141 |
} elseif ($_POST[form_delete]) {
|
142 |
parent::deleteForm($_POST[fid]);
|
143 |
} elseif ($_POST[form_edit]) {
|
144 |
+
parent::updateForm($_POST[form_slug], $_POST[form_title], $_POST[form_action], $_POST[form_method], $_POST[submit_button_text], $_POST[custom_code], $_POST[form_style], $_POST[fid]);
|
145 |
} elseif ($_POST[form_add_field]) {
|
146 |
parent::addFieldToForm($_POST[field_id], $_POST[fid]);
|
147 |
} elseif ($_POST[disattach_field]) {
|
148 |
parent::disattachField($_POST[disattach_field_id], $_POST[fid]);
|
149 |
+
} elseif ($_POST[style_create]) {
|
150 |
+
parent::insertStyle($_POST[style]);
|
151 |
+
} elseif ($_POST[style_edit]) {
|
152 |
+
parent::updateStyle($_POST[style]);
|
153 |
+
} elseif ($_POST[style_delete]) {
|
154 |
+
parent::deleteStyle($_POST[style][id]);
|
155 |
}
|
156 |
+
$styles = parent::selectAllStyles();
|
157 |
+
$style_options = '<option value="0">None</option>';
|
158 |
+
foreach ($styles as $style)
|
159 |
+
$style_options .= '<option value="'.$style->id.'">'.$style->style_slug.'</option>';
|
160 |
?>
|
161 |
<div id="customcontactforms-admin">
|
162 |
<div id="icon-themes" class="icon32"></div>
|
163 |
<h2>Custom Contact Forms</h2>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
<div id="create-fields" class="postbox">
|
165 |
<h3 class="hndle"><span>Create A Form Field</span></h3>
|
166 |
<div class="inside">
|
222 |
<label for="form_action">Form Action:</label>
|
223 |
<input type="text" name="form_action" value="" />
|
224 |
(If unsure, leave blank.)</li>
|
225 |
+
<li>
|
226 |
+
<label for="form_action">Form Style:</label>
|
227 |
+
<select name="form_style"><?php echo $style_options; ?></select>
|
228 |
+
(<a href="#styles">Click to create a style</a>)</li>
|
229 |
<li>
|
230 |
<label for="submit_button_text">Submit Button Text:</label>
|
231 |
<input type="text" maxlength="200" name="submit_button_text" />
|
341 |
</tfoot>
|
342 |
</table>
|
343 |
<h3 class="manage-h3">Manage Forms</h3>
|
344 |
+
<table class="widefat post" id="manage-forms" cellspacing="0">
|
345 |
<thead>
|
346 |
<tr>
|
347 |
<th scope="col" class="manage-column form-slug">Slug</th>
|
350 |
<th scope="col" class="manage-column form-action">Form Action</th>
|
351 |
<th scope="col" class="manage-column form-submit">Button Text</th>
|
352 |
<th scope="col" class="manage-column form-submit">Custom Code</th>
|
353 |
+
<th scope="col" class="manage-column form-submit">Style</th>
|
354 |
</tr>
|
355 |
</thead>
|
356 |
<tbody>
|
360 |
$form_methods = '<option>Post</option><option>Get</option>';
|
361 |
$form_methods = str_replace('<option>'.$forms[$i]->form_method.'</option>', '<option selected="selected">'.$forms[$i]->form_method.'</option>', $form_methods);
|
362 |
$add_fields = $this->getFieldsForm();
|
363 |
+
$this_style = parent::selectStyle($forms[$i]->form_style, '');
|
364 |
+
$sty_opt = str_replace('<option value="'.$forms[$i]->form_style.'">'.$this_style->style_slug.'</option>', '<option value="'.$forms[$i]->form_style.'" selected="selected">'.$this_style->style_slug.'</option>', $style_options);
|
365 |
?>
|
366 |
<tr class="<?php if ($i % 2 == 0) echo 'evenrow'; ?>">
|
367 |
<form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
|
373 |
<td><input class="width125" type="text" name="form_action" value="<?php echo $forms[$i]->form_action; ?>" /></td>
|
374 |
<td><input class="width125" type="text" name="submit_button_text" value="<?php echo $forms[$i]->submit_button_text; ?>" /></td>
|
375 |
<td><input type="text" class="width125" name="custom_code" value="<?php echo $forms[$i]->custom_code; ?>" /></td>
|
376 |
+
<td><select name="form_style"><?php echo $sty_opt; ?></select></td>
|
|
|
|
|
|
|
377 |
</tr>
|
378 |
<tr class="<?php if ($i % 2 == 0) echo 'evenrow'; ?>">
|
379 |
+
<td colspan="8"><div class="attached_fields">
|
|
|
380 |
<label><span>Attached Fields:</span></label>
|
381 |
<?php
|
382 |
$attached_fields = parent::getAttachedFieldsArray($forms[$i]->id);
|
402 |
<input type="submit" name="form_add_field" value="Attach" />
|
403 |
<input type="hidden" name="fid" value="<?php echo $forms[$i]->id; ?>" />
|
404 |
<br />
|
405 |
+
<span class="red bold">*</span> Attach in the order you want fields to display. </div>
|
406 |
+
<div class="actions">
|
407 |
+
<input type="hidden" name="fid" value="<?php echo $forms[$i]->id; ?>" />
|
408 |
+
<input type="submit" name="form_edit" value="Edit Form" />
|
409 |
+
<input type="submit" name="form_delete" value="Delete Form" />
|
410 |
+
</div>
|
411 |
+
<!--<div class="attach_styles">
|
412 |
+
<label for="attach_styles"><span>Form Style:</span> </label> <select name="attach_styles"><option>really long style name</option></select>
|
413 |
+
<input type="submit" value="Attach" name="attach_styles" /><br />
|
414 |
+
<span class="red bold">*</span> Create form styles at the bottom of the page, and use them to change your forms appearance.
|
415 |
+
</div>-->
|
416 |
+
</td>
|
417 |
</form>
|
418 |
</tr>
|
419 |
<?php
|
420 |
}
|
421 |
$remember_check = ($admin_options[remember_field_values] == 0) ? 'selected="selected"' : '';
|
422 |
$remember_fields = '<option value="1">Yes</option><option '.$remember_check.' value="0">No</option>';
|
423 |
+
$border_style_options = '<option>solid</option><option>dashed</option>
|
424 |
+
<option>grooved</option><option>double</option><option>dotted</option><option>ridged</option><option>none</option>
|
425 |
+
<option>inset</option><option>outset</option>';
|
426 |
?>
|
427 |
</tbody>
|
428 |
<tfoot>
|
434 |
<th scope="col" class="manage-column form-action">Form Action</th>
|
435 |
<th scope="col" class="manage-column form-submit">Button Text</th>
|
436 |
<th scope="col" class="manage-column form-submit">Custom Code</th>
|
437 |
+
<th scope="col" class="manage-column form-submit">Style</th>
|
438 |
</tr>
|
439 |
</tr>
|
440 |
|
464 |
<label for="custom_thank_you">Custom Thank You Page:</label>
|
465 |
<input name="custom_thank_you" value="<?php echo $admin_options[custom_thank_you]; ?>" type="text" maxlength="150" />
|
466 |
</li>
|
467 |
+
<li class="descrip">Upon filling out forms, users will be sent back to the form page if this is left blank.</li>
|
468 |
|
469 |
<li>
|
470 |
<label for="remember_field_values">Remember Field Values:</label>
|
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>
|
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. Add a form to your sidebar, by dragging the Custom Contact Form widget in to your sidebar.</p>
|
516 |
<p>5. Configure the General Settings appropriately; this is important if you want to receive your web form messages!</p>
|
517 |
+
<p>6. Create form styles to change your forms appearances. The image below explains how each style field can change the look of your forms.</p>
|
518 |
+
</div>
|
519 |
+
</div>
|
520 |
+
<div id="style-example"></div>
|
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">
|
524 |
+
<form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
|
525 |
+
<ul class="style_left">
|
526 |
+
<li>
|
527 |
+
<label for="style_slug">Style Slug:</label>
|
528 |
+
<input type="text" maxlength="30" name="style[style_slug]" />
|
529 |
+
(Must be unique)</li>
|
530 |
+
<li>
|
531 |
+
<label for="title_fontsize">Title Font Size:</label>
|
532 |
+
<input type="text" maxlength="20" value="1.2em" name="style[title_fontsize]" />
|
533 |
+
(ex: 10pt, 10px, 1em)</li>
|
534 |
+
<li>
|
535 |
+
<label for="title_fontcolor">Title Font Color:</label>
|
536 |
+
<input type="text" maxlength="20" value="#333333" value="#" name="style[title_fontcolor]" />
|
537 |
+
(ex: #FF0000 or red)</li>
|
538 |
+
<li>
|
539 |
+
<label for="label_width">Label Width:</label>
|
540 |
+
<input type="text" maxlength="20" value="110px" name="style[label_width]" />
|
541 |
+
(ex: 100px or 20%)</li>
|
542 |
+
<li>
|
543 |
+
<label for="label_fontsize">Label Font Size:</label>
|
544 |
+
<input type="text" maxlength="20" value="1em" name="style[label_fontsize]" />
|
545 |
+
(ex: 10px, 10pt, 1em)</li>
|
546 |
+
<li>
|
547 |
+
<label for="label_fontcolor">Label Font Color:</label>
|
548 |
+
<input type="text" maxlength="20" value="#333333" name="style[label_fontcolor]" />
|
549 |
+
(ex: #FF0000 or red)</li>
|
550 |
+
<li>
|
551 |
+
<label for="input_width">Text Field Width:</label>
|
552 |
+
<input type="text" maxlength="20" value="200px" name="style[input_width]" />
|
553 |
+
(ex: 100px or 100%)</li>
|
554 |
+
<li>
|
555 |
+
<label for="textarea_width">Textarea Field Width:</label>
|
556 |
+
<input type="text" maxlength="20" value="200px" name="style[textarea_width]" />
|
557 |
+
(ex: 100px or 100%)</li>
|
558 |
+
<li>
|
559 |
+
<label for="textarea_height">Textarea Field Height:</label>
|
560 |
+
<input type="text" maxlength="20" value="100px" name="style[textarea_height]" />
|
561 |
+
(ex: 100px or 100%)</li>
|
562 |
+
<li>
|
563 |
+
<label for="field_fontsize">Field Font Size:</label>
|
564 |
+
<input type="text" maxlength="20" value="1em" name="style[field_fontsize]" />
|
565 |
+
(ex: 10px, 10pt, 1em</li>
|
566 |
+
<li>
|
567 |
+
<label for="field_fontcolor">Field Font Color:</label>
|
568 |
+
<input type="text" maxlength="20" value="#333333" name="style[field_fontcolor]" />
|
569 |
+
(ex: 100px or 100%)</li>
|
570 |
+
<li>
|
571 |
+
<label for="field_borderstyle">Field Border Style:</label>
|
572 |
+
<select name="style[field_borderstyle]"><?php echo str_replace('<option>solid</option>', '<option selected="selected">solid</option>', $border_style_options); ?></select>
|
573 |
+
</li>
|
574 |
+
<li>
|
575 |
+
<label for="form_margin">Form Margin:</label>
|
576 |
+
<input type="text" maxlength="20" value="5px" name="style[form_margin]" />
|
577 |
+
(ex: 5px or 1em)</li>
|
578 |
+
<li>
|
579 |
+
<label for="label_margin">Label Margin:</label>
|
580 |
+
<input type="text" maxlength="20" value="4px" name="style[label_margin]" />
|
581 |
+
(ex: 5px or 1em)</li>
|
582 |
+
</ul>
|
583 |
+
<ul class="style_right">
|
584 |
+
<li>
|
585 |
+
<label for="input_width">Field Border Color:</label>
|
586 |
+
<input type="text" maxlength="20" value="#333333" name="style[field_bordercolor]" />
|
587 |
+
(ex: 100px or 100%)</li>
|
588 |
+
<li>
|
589 |
+
<label for="form_borderstyle">Form Border Style:</label>
|
590 |
+
<select name="style[form_borderstyle]"><?php echo str_replace('<option>solid</option>', '<option selected="selected">solid</option>', $border_style_options); ?></select>
|
591 |
+
</li>
|
592 |
+
<li>
|
593 |
+
<label for="form_bordercolor">Form Border Color:</label>
|
594 |
+
<input type="text" maxlength="20" value="#333333" name="style[form_bordercolor]" />
|
595 |
+
(ex: #00000 or red)</li>
|
596 |
+
<li>
|
597 |
+
<label for="form_borderwidth">Form Border Width:</label>
|
598 |
+
<input type="text" maxlength="20" value="1px" name="style[form_borderwidth]" />
|
599 |
+
(ex: 1px)</li>
|
600 |
+
<li>
|
601 |
+
<label for="form_borderwidth">Form Width:</label>
|
602 |
+
<input type="text" maxlength="20" value="500px" name="style[form_width]" />
|
603 |
+
(ex: 100px or 50%)</li>
|
604 |
+
<li>
|
605 |
+
<label for="form_borderwidth">Form Font Family:</label>
|
606 |
+
<input type="text" maxlength="150" value="Verdana, tahoma, arial" name="style[form_fontfamily]" />
|
607 |
+
(ex: Verdana, Tahoma, Arial)</li>
|
608 |
+
<li>
|
609 |
+
<label for="submit_width">Button Width:</label>
|
610 |
+
<input type="text" maxlength="20" value="80px" name="style[submit_width]" />
|
611 |
+
(ex: 100px or 30%)</li>
|
612 |
+
<li>
|
613 |
+
<label for="submit_height">Button Height:</label>
|
614 |
+
<input type="text" maxlength="20" value="35px" name="style[submit_height]" />
|
615 |
+
(ex: 100px or 30%)</li>
|
616 |
+
<li>
|
617 |
+
<label for="submit_fontsize">Button Font Size:</label>
|
618 |
+
<input type="text" maxlength="20" value="1.1em" name="style[submit_fontsize]" />
|
619 |
+
(ex: 10px, 10pt, 1em</li>
|
620 |
+
<li>
|
621 |
+
<label for="submit_fontcolor">Button Font Color:</label>
|
622 |
+
<input type="text" maxlength="20" value="#333333" name="style[submit_fontcolor]" />
|
623 |
+
(ex: #FF0000 or red)</li>
|
624 |
+
<li>
|
625 |
+
<label for="field_backgroundcolor">Field Background Color:</label>
|
626 |
+
<input type="text" maxlength="20" value="#efefef" name="style[field_backgroundcolor]" />
|
627 |
+
(ex: #FF0000 or red)</li>
|
628 |
+
<li>
|
629 |
+
<label for="form_padding">Form Padding:</label>
|
630 |
+
<input type="text" maxlength="20" value="5px" name="style[form_padding]" />
|
631 |
+
(ex: 5px or 1em)</li>
|
632 |
+
<li>
|
633 |
+
<label for="title_margin">Title Margin:</label>
|
634 |
+
<input type="text" maxlength="20" value="2px" name="style[title_margin]" />
|
635 |
+
(ex: 5px or 1em)</li>
|
636 |
+
<li>
|
637 |
+
<input type="submit" value="Create Style" name="style_create" />
|
638 |
+
</li>
|
639 |
+
</ul>
|
640 |
+
</form>
|
641 |
</div>
|
642 |
</div>
|
643 |
+
<h3 class="manage-h3">Manage Form Styles</h3>
|
644 |
+
<table class="widefat post" id="manage-styles" cellspacing="0">
|
645 |
+
<thead>
|
646 |
+
<tr>
|
647 |
+
<th scope="col" class="manage-column"></th>
|
648 |
+
<th scope="col" class="manage-column"></th>
|
649 |
+
<th scope="col" class="manage-column"></th>
|
650 |
+
<th scope="col" class="manage-column"></th>
|
651 |
+
<th scope="col" class="manage-column"></th>
|
652 |
+
<th scope="col" class="manage-column"></th>
|
653 |
+
</tr>
|
654 |
+
</thead>
|
655 |
+
<tbody>
|
656 |
+
<?php
|
657 |
+
$styles = parent::selectAllStyles();
|
658 |
+
$i = 0;
|
659 |
+
foreach ($styles as $style) {
|
660 |
+
?>
|
661 |
+
<tr class="<?php if ($i % 2 == 0) echo 'evenrow'; ?>">
|
662 |
+
<form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
|
663 |
+
<td><label>Slug:</label> <input type="text" maxlength="30" value="<?php echo $style->style_slug; ?>" name="style[style_slug]" /><br />
|
664 |
+
<label>Font Family:</label><input type="text" maxlength="20" value="<?php echo $style->form_fontfamily; ?>" name="style[form_fontfamily]" /><br />
|
665 |
+
<input type="submit" class="submit-styles" name="style_edit" value="Update Style" /><br />
|
666 |
+
<input type="submit" class="submit-styles" name="style_delete" value="Delete Style" />
|
667 |
+
</td>
|
668 |
+
|
669 |
+
<td>
|
670 |
+
<label>Form Width:</label><input type="text" maxlength="20" value="<?php echo $style->form_width; ?>" name="style[form_width]" /><br />
|
671 |
+
<label>Text Field Width:</label><input type="text" maxlength="20" value="<?php echo $style->input_width; ?>" name="style[input_width]" /><br />
|
672 |
+
<label>Textarea Width:</label><input type="text" maxlength="20" value="<?php echo $style->textarea_width; ?>" name="style[textarea_width]" /><br />
|
673 |
+
<label>Textarea Height:</label><input type="text" maxlength="20" value="<?php echo $style->textarea_height; ?>" name="style[textarea_height]" /><br />
|
674 |
+
<label>Label Margin:</label><input type="text" maxlength="20" value="<?php echo $style->label_margin; ?>" name="style[label_margin]" />
|
675 |
+
</td>
|
676 |
+
<td>
|
677 |
+
<label>Label Width:</label><input type="text" maxlength="20" value="<?php echo $style->label_width; ?>" name="style[label_width]" /><br />
|
678 |
+
<label>Button Width:</label><input type="text" maxlength="20" value="<?php echo $style->submit_width; ?>" name="style[submit_width]" /><br />
|
679 |
+
<label>Button Height:</label><input type="text" maxlength="20" value="<?php echo $style->submit_height; ?>" name="style[submit_height]" /><br />
|
680 |
+
<label>Field Background Color:</label><input type="text" maxlength="20" value="<?php echo $style->field_backgroundcolor; ?>" name="style[field_backgroundcolor]" /><br />
|
681 |
+
<label>Title Margin:</label><input type="text" maxlength="20" value="<?php echo $style->title_margin; ?>" name="style[title_margin]" /><br />
|
682 |
+
</td>
|
683 |
+
|
684 |
+
<td>
|
685 |
+
<label>Title Font Size:</label><input type="text" maxlength="20" value="<?php echo $style->title_fontsize; ?>" name="style[title_fontsize]" /><br />
|
686 |
+
<label>Label Font Size:</label><input type="text" maxlength="20" value="<?php echo $style->label_fontsize; ?>" name="style[label_fontsize]" /><br />
|
687 |
+
<label>Field Font Size:</label><input type="text" maxlength="20" value="<?php echo $style->field_fontsize; ?>" name="style[field_fontsize]" /><br />
|
688 |
+
<label>Button Font Size:</label><input type="text" maxlength="20" value="<?php echo $style->submit_fontsize; ?>" name="style[submit_fontsize]" /><br />
|
689 |
+
<label>Form Padding:</label><input type="text" maxlength="20" value="<?php echo $style->form_padding; ?>" name="style[form_padding]" /><br />
|
690 |
+
</td>
|
691 |
+
|
692 |
+
<td>
|
693 |
+
<label>Title Font Color:</label><input type="text" maxlength="20" value="<?php echo $style->title_fontcolor; ?>" name="style[title_fontcolor]" /><br />
|
694 |
+
<label>Label Font Color:</label><input type="text" maxlength="20" value="<?php echo $style->label_fontcolor; ?>" name="style[label_fontcolor]" /><br />
|
695 |
+
<label>Field Font Color:</label><input type="text" maxlength="20" value="<?php echo $style->field_fontcolor; ?>" name="style[field_fontcolor]" /><br />
|
696 |
+
<label>Button Font Color:</label><input type="text" maxlength="20" value="<?php echo $style->submit_fontcolor; ?>" name="style[submit_fontcolor]" /><br />
|
697 |
+
<label>Form Margin:</label><input type="text" maxlength="20" value="<?php echo $style->form_margin; ?>" name="style[form_margin]" /><br />
|
698 |
+
</td>
|
699 |
+
|
700 |
+
<td><label>Form Border Style:</label><select name="style[form_borderstyle]"><?php echo str_replace('<option>'.$style->form_borderstyle.'</option>', '<option selected="selected">'.$style->form_borderstyle.'</option>', $border_style_options); ?></select><br />
|
701 |
+
<label>Form Border Width:</label><input type="text" maxlength="20" value="<?php echo $style->form_borderwidth; ?>" name="style[form_borderwidth]" /><br />
|
702 |
+
<label>Form Border Color:</label><input type="text" maxlength="20" value="<?php echo $style->form_bordercolor; ?>" name="style[form_bordercolor]" /><br />
|
703 |
+
<label>Field Border Color:</label><input type="text" maxlength="20" value="<?php echo $style->field_bordercolor; ?>" name="style[field_bordercolor]" />
|
704 |
+
<label>Field Border Style:</label><select name="style[field_borderstyle]"><?php echo str_replace('<option>'.$style->field_borderstyle.'</option>', '<option selected="selected">'.$style->field_borderstyle.'</option>', $border_style_options); ?></select>
|
705 |
+
<input name="style[id]" type="hidden" value="<?php echo $style->id; ?>" />
|
706 |
+
</td>
|
707 |
+
|
708 |
+
</form>
|
709 |
+
</tr>
|
710 |
+
<?php
|
711 |
+
$i++;
|
712 |
+
}
|
713 |
+
?>
|
714 |
+
</tbody>
|
715 |
+
<tfoot>
|
716 |
+
<tr>
|
717 |
+
<th scope="col" class="manage-column"></th>
|
718 |
+
<th scope="col" class="manage-column"></th>
|
719 |
+
<th scope="col" class="manage-column"></th>
|
720 |
+
<th scope="col" class="manage-column"></th>
|
721 |
+
<th scope="col" class="manage-column"></th>
|
722 |
+
<th scope="col" class="manage-column"></th>
|
723 |
+
</tr>
|
724 |
+
</tfoot>
|
725 |
+
</table>
|
726 |
</div>
|
727 |
<?php
|
728 |
}
|
770 |
$this->startSession();
|
771 |
$admin_options = $this->getAdminOptions();
|
772 |
$form = parent::selectForm($fid, '');
|
773 |
+
$out = '';
|
774 |
+
$class = (!$is_sidebar) ? ' class="customcontactform"' : ' class="customcontactform-sidebar"';
|
775 |
+
if ($form->form_style != 0) {
|
776 |
+
$style = parent::selectStyle($form->form_style, '');
|
777 |
+
$class = ' class="'.$style->style_slug.'"';
|
778 |
+
$out .= '<style type="text/css">' . "\n";
|
779 |
+
$out .= '.' . $style->style_slug . " { width: ".$style->form_width."; padding:".$style->form_padding."; margin:".$style->form_margin."; border:".$style->form_borderwidth." ".$style->form_borderstyle." ".$style->form_bordercolor."; font-family:".$style->form_fontfamily."; }\n";
|
780 |
+
$out .= '.' . $style->style_slug . " ul { list-style-type:none; padding:0; margin:0; }\n";
|
781 |
+
$out .= '.' . $style->style_slug . " h4 { padding:0; margin:".$style->title_margin." ".$style->title_margin." ".$style->title_margin." 0; color:".$style->title_fontcolor."; font-size:".$style->title_fontsize."; } \n";
|
782 |
+
$out .= '.' . $style->style_slug . " label { padding:0; margin:".$style->label_margin." ".$style->label_margin." ".$style->label_margin." 0; display:block; color:".$style->label_fontcolor."; width:".$style->label_width."; font-size:".$style->label_fontsize."; } \n";
|
783 |
+
$out .= '.' . $style->style_slug . " input[type=text] { color:".$style->field_fontcolor."; margin:0 0 .4em 0; width:".$style->input_width."; font-size:".$style->field_fontsize."; background-color:".$style->field_backgroundcolor."; border:1px ".$style->field_borderstyle." ".$style->field_bordercolor."; } \n";
|
784 |
+
$out .= '.' . $style->style_slug . " .submit { color:".$style->submit_fontcolor."; width:".$style->submit_width."; height:".$style->submit_height."; font-size:".$style->submit_fontsize."; } \n";
|
785 |
+
$out .= '.' . $style->style_slug . " textarea { color:".$style->field_fontcolor."; width:".$style->textarea_width."; margin:0 0 .4em 0; height:".$style->textarea_height."; font-size:".$style->field_fontsize."; border:1px ".$style->field_borderstyle." ".$style->field_bordercolor."; } \n";
|
786 |
+
$out .= '</style>' . "\n";
|
787 |
+
|
788 |
+
}
|
789 |
$action = (!empty($form->form_action)) ? $form->form_action : get_permalink();
|
790 |
+
$out .= '<form method="'.strtolower($form->form_method).'" action="'.$action.'"'.$class.'>' . "\n";
|
791 |
$out .= parent::decodeOption($form->custom_code, 1, 1) . '<h4>' . parent::decodeOption($form->form_title, 1, 1) . '</h4>' . "\n" . '<ul>';
|
792 |
$fields = parent::getAttachedFieldsArray($fid);
|
793 |
$hiddens = '';
|
861 |
$errors = $this->getAllErrors();
|
862 |
if (empty($errors)) {
|
863 |
$body .= 'Sender IP: ' . $_SERVER['REMOTE_ADDR'] . "\n";
|
864 |
+
$mailer = new CustomContactFormsMailer($admin_options[default_to_email], $admin_options[default_from_email], $admin_options[default_form_subject], stripslashes($body));
|
865 |
$mailer->send();
|
866 |
if (!empty($admin_options[custom_thank_you])) {
|
867 |
header("Location: " . $admin_options[custom_thank_you]);
|
892 |
add_filter('the_content', array(&$customcontact, 'contentFilter'));
|
893 |
}
|
894 |
add_action('admin_menu', 'CustomContactForms_ap');
|
895 |
+
?>
|
image.php
CHANGED
@@ -12,4 +12,4 @@ if (!session_id())
|
|
12 |
session_start();
|
13 |
$_SESSION[captcha] = $str;
|
14 |
$image->createImageWithText($str);
|
15 |
-
?>
|
12 |
session_start();
|
13 |
$_SESSION[captcha] = $str;
|
14 |
$image->createImageWithText($str);
|
15 |
+
?>
|
readme.txt
CHANGED
@@ -2,34 +2,37 @@
|
|
2 |
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:
|
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 |
-
|
|
|
13 |
== Installation ==
|
14 |
1. Upload to /wp-content/plugins
|
15 |
2. Activate the plugin from your Wordpress Admin Panel
|
16 |
3. Configure the plugin, create fields, and create forms in the Settings page called Custom Contact Forms
|
17 |
4. Display those forms in posts and pages by inserting the code: [customcontact form=FORMID]
|
|
|
18 |
== Configuring and Using the Plugin ==
|
19 |
1. Create a form in the Custom Contact Forms setting page. To get to the settings page, click the Custom Contact Forms link in the admin panel sidebar
|
20 |
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.
|
21 |
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.
|
22 |
4. Add a form to your sidebar, by dragging the Custom Contact Form widget in to your sidebar.
|
23 |
5. Configure the General Settings appropriately; this is important if you want to receive your web form messages!
|
24 |
-
|
25 |
== Support ==
|
26 |
For questions, feature requests, and support concerning the Custom Contact Forms plugin, please email me at:
|
27 |
admin@taylorlovett.com
|
28 |
-
I respond to emails same-day!
|
29 |
-
|
30 |
-
Mark Lassarre
|
31 |
== Upgrade Notice ==
|
32 |
-
|
|
|
33 |
== Change Log ==
|
34 |
1.0.0:
|
35 |
* Plugin Release
|
@@ -53,4 +56,11 @@ Create forms styles, manage them, and attach them to forms! Coming soon.
|
|
53 |
* custom-contact-forms.php - Option to update to Custom Contact Forms Pro
|
54 |
1.2.1
|
55 |
* custom-contact-forms.php - Upgrade options changed
|
56 |
-
* custom-contact-forms-css.php - CSS bug corrected
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
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.1
|
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 |
+
|
12 |
== Description ==
|
13 |
+
VERSION 2.0.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!
|
14 |
+
|
15 |
== Installation ==
|
16 |
1. Upload to /wp-content/plugins
|
17 |
2. Activate the plugin from your Wordpress Admin Panel
|
18 |
3. Configure the plugin, create fields, and create forms in the Settings page called Custom Contact Forms
|
19 |
4. Display those forms in posts and pages by inserting the code: [customcontact form=FORMID]
|
20 |
+
|
21 |
== Configuring and Using the Plugin ==
|
22 |
1. Create a form in the Custom Contact Forms setting page. To get to the settings page, click the Custom Contact Forms link in the admin panel sidebar
|
23 |
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.
|
24 |
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.
|
25 |
4. Add a form to your sidebar, by dragging the Custom Contact Form widget in to your sidebar.
|
26 |
5. Configure the General Settings appropriately; this is important if you want to receive your web form messages!
|
27 |
+
|
28 |
== Support ==
|
29 |
For questions, feature requests, and support concerning the Custom Contact Forms plugin, please email me at:
|
30 |
admin@taylorlovett.com
|
31 |
+
I respond to emails same-day!
|
32 |
+
|
|
|
33 |
== Upgrade Notice ==
|
34 |
+
Required fields option will be added in mid-August 2010
|
35 |
+
|
36 |
== Change Log ==
|
37 |
1.0.0:
|
38 |
* Plugin Release
|
56 |
* custom-contact-forms.php - Option to update to Custom Contact Forms Pro
|
57 |
1.2.1
|
58 |
* custom-contact-forms.php - Upgrade options changed
|
59 |
+
* custom-contact-forms-css.php - CSS bug corrected
|
60 |
+
2.0.0
|
61 |
+
* custom-contact-forms.php - Style manager added
|
62 |
+
* custom-contact-forms.css - style manager styles added
|
63 |
+
* custom-contact-forms-db.php - Style manager db functions added
|
64 |
+
2.0.1
|
65 |
+
* custom-contact-forms.php - Duplicate form slug bug fixed, default style values added, stripslahses on form messages
|
66 |
+
* custom-contact-forms-db.php - default style values added
|