Topic: contact page change [SOLVED]
i want maribo theme contact page change
name email Message
-> name tel Message
and
Hide email from users and try to fix email to a value
You are not logged in. Please login or register.
Showkase Support Forum → Showkase Support → contact page change [SOLVED]
i want maribo theme contact page change
name email Message
-> name tel Message
and
Hide email from users and try to fix email to a value
If you want to change the 'Email' input box to a 'Tel' input box, then please try the following:
(1) Change input box label
Open the 'showkase/_themes/base/pagetypes/contact.tpl' file in a plain text editor and change line 70 from:
<label for="email">Email <span class="required">*</span></label>
... to:
<label for="email">Tel <span class="required">*</span></label>
(2) Prevent 'Tel' input from being validated as an email address
Part #1:
Open the 'showkase/_themes/base/pagetypes/contact.tpl' file in a plain text editor and change line 71 from:
<input type="email" name="email" required="true" class="input-field">
... to:
<input type="text" name="email" required="true" class="input-field">
Part #2:
Open the 'showkase/admin/plugins/contact/master/contactcore/contact.js' file in a plain text editor and comment out lines 21 to 24 inclusive as follows:
// if($(this).attr("type")==="email" && !emailRegEx.test($.trim($(this).val()))) {
// $(this).addClass('invalid');
// valid = false;
// }
Part #3:
Open the 'showkase/admin/plugins/contact/master/contactcore/contact.php' file in a plain text editor and comment out lines 81 to 83 inclusive as follows:
// if(!PHPMailer::validateAddress($userEmail)) {
// throw new Exception ('Please enter a valid email');
// }
(3) Change full email body text for clarity
Open the 'showkase/admin/plugins/contact/master/contactcore/contact.php' file in a plain text editor and change lines 95 to 100 inclusive from:
$mailer->Body =
$userMessage
."\r\n\r\n"
.$userName
."\r\n\r\n"
.$userEmail;
... to:
$mailer->Body =
"Name: " . $userName
. "\r\n\r\n"
. "Tel: " . $userEmail
. "\r\n\r\n"
. "Message: " . $userMessage;
(4) Hardcode a specific user email address
Open the 'showkase/admin/plugins/contact/master/contactcore/contact.php' file in a plain text editor and change line 92 from:
$mailer->addReplyTo($userEmail, $userName);
... to:
$mailer->addReplyTo('email@address.com', $userName);
... changing 'email@address.com' to whatever email address you would like to use. (This is where the email address entered in an unmodified contact form would be used.)
(5) Hide the site email address
On the contact form settings page, scroll down to and expand 'Spam Prevention' and select the 'Hide email address' checkbox. This will obfuscate the site email address in the contact form page.
(6) Republish site
Update the files within your site with the modified versions by clicking the 'Publish' button.
I've tested this myself and it works fine.
Please note that the line numbers noted above refer to the current version of Showkase (v1.7.4).
I tried the test but it failed.
i want
tel : 111-1111-1111 or 111-111-111
error massage
Invalid address: 111-1111-1111
try to
test@teat.com
or
11111111111@test.com
Function works normally
Make sure that you have done all three parts in Step #2 above (otherwise the input will still be validated as an email address).
If you are unsure about commenting out the lines of code I noted above (in Step #2 - Part #2 and Step #2 - Part #3) by adding // to the beginning of each line to be commented out, then you can delete the lines instead.
Be sure to republish your site and clear your browser's cache after making the changes and before reloading your site's Contact Form page.
As I mentioned previously, I tested my instructions out myself before posting them yesterday and it worked fine for me.
I've just double-checked my instructions from scratch today, copying and pasting from my post above and it still works fine.
If you follow the instructions exactly, then it should work for you, too.
I solved
I did not do (4) Hardcode a specific user email address
It works fine when you edit and run it.
good
thx so much
I'm glad you've got it working.
Thank you for letting me know.
Showkase Support Forum → Showkase Support → contact page change [SOLVED]
Powered by PunBB, supported by Informer Technologies, Inc.