What's the simplest way to go about this? I'd like to add a phone field.
TIA
add field to contact form
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: add field to contact form
1. Edit your "plugin_contactform.tpl" file of the plugin.
2. Place your "phone address" field somewhere in that file, most preferably into the table where the other fields are shown:
3. Now edit the serendipity_event_contactform.php file.
4. Find this code:
and change this to:
Note the new line with "Phone" in it. This piece of code will show the persons phone number inside your contact mail.
5. Find this line a few lines later:
and change it to:
This line of code will make sure that if a person enters the phone number and makes something else wrong, the form will be filled with his previous phone number.
[quote="Anonymous"]What's the simplest way to go about this? I'd like to add a phone field.
6. Save the files and be happy
Regards,
Garvin
2. Place your "phone address" field somewhere in that file, most preferably into the table where the other fields are shown:
Code: Select all
<tr>
<td class="serendipity_commentsLabel"><label for="serendipity_commentform_phone">Phone</label></td>
<td class="serendipity_commentsValue"><input type="text" id="serendipity_commentform_phone" name="serendipity[phone]" value="{$commentform_phone}" /></td>
</tr>
4. Find this code:
Code: Select all
$text = sprintf(A_NEW_COMMENT_BLAHBLAH, $serendipity['blogTitle'], $title)
. "\n"
. "\n" . USER . ' ' . IP_ADDRESS . ': ' . $_SERVER['REMOTE_ADDR']
. "\n" . USER . ' ' . NAME . ': ' . $fromName
. "\n" . USER . ' ' . EMAIL . ': ' . $fromEmail
. "\n" . USER . ' ' . HOMEPAGE . ': ' . $fromUrl
. "\n"
. "\n" . COMMENTS . ': '
. "\n" . $comment
. "\n"
. "\n" . '----';
Code: Select all
$text = sprintf(A_NEW_COMMENT_BLAHBLAH, $serendipity['blogTitle'], $title)
. "\n"
. "\n" . USER . ' ' . IP_ADDRESS . ': ' . $_SERVER['REMOTE_ADDR']
. "\n" . USER . ' ' . NAME . ': ' . $fromName
. "\n" . USER . ' ' . EMAIL . ': ' . $fromEmail
. "\n" . USER . ' ' . HOMEPAGE . ': ' . $fromUrl
. "\n" . USER . ' Phone: ' . $serendipity['POST']['phone']
. "\n"
. "\n" . COMMENTS . ': '
. "\n" . $comment
. "\n"
. "\n" . '----';
5. Find this line a few lines later:
Code: Select all
'commentform_url' => htmlspecialchars(strip_tags($serendipity['POST']['url'])),
Code: Select all
'commentform_url' => htmlspecialchars(strip_tags($serendipity['POST']['url'])),
'commentform_phone' => htmlspecialchars(strip_tags($serendipity['POST']['phone'])),
[quote="Anonymous"]What's the simplest way to go about this? I'd like to add a phone field.
6. Save the files and be happy
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/