Contact page

Re: Contact page

Postby newtech1 on Thu Mar 12, 2009 1:15 pm

Here is what I have done for now.
I just changed some of the wording on the the submit story form and the language file to make it so the same form could be used for e-mails or to submit stories.

To make e-mail address required I did the following in the addsubmissionaction.class php file:

Deleted the following:
Code: Select all
$this->_userEmailAddress = $this->_request->getValue( "userEmailAddress" );


and replaced it with:
Code: Select all
                $this->_userEmailAddress = $this->_request->getValue( "userEmailAddress" );
            $val1 = new StringValidator();
            if( !$val1->validate( $this->_userEmailAddress )) {
                $errors["userEmailAddress"] = true;
                $message["userEmailAddress"] = $this->_locale->tr("error_submission_no_email");
            }
           

This requires adding 'error_submission_no_email' message in language file.

Also requires
Code: Select all
  {if $errors.userEmailAddress}<span style="background:red;color:white;font-weight:bold">&nbsp;!&nbsp;</span>&nbsp;{$message.userEmailAddress}</p>{/if}

being added in the submitform.template

Note: Users must select a category for the form to work, so I just put a note for them to select any category if they are just submitting an e-mail.

After doing all of the above I just put in the header of each template | Contact Us | with a link to the submit story template.
newtech1
 
Posts: 593
Joined: Thu Oct 13, 2005 12:02 am
Location: Seattle, WA, USA

Re: Contact page

Postby jondaley on Thu Mar 12, 2009 4:54 pm

Looks good. Except that you should use the emailvalidator rather than a string validator. The string validator only makes sure that it is non-empty and doesn't contain HTML.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Re: Contact page

Postby newtech1 on Thu Mar 12, 2009 7:01 pm

No idea how to put an e-mail validator, when I get time I will look around to figure it out.

The only main issue with the submissions plug-in is that even without the editing, the submission form does not work real well with some of the templates. It appears because the sumission form template has at the end the footer.template reference and it depends how the various templates use the footer.template. Or some other issue where the submission form will not always fall in the correct place of a template.
newtech1
 
Posts: 593
Joined: Thu Oct 13, 2005 12:02 am
Location: Seattle, WA, USA

Re: Contact page

Postby jondaley on Fri Mar 13, 2009 12:10 pm

Where you have "StringValidator" change that to "EmailValidator" and you'll be done, the validator already exists in the LT core code.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Re: Contact page

Postby newtech1 on Fri Mar 13, 2009 3:17 pm

When doing what is recommended I get a white page when submitting form.
Ther error message is:
PHP Fatal error: Class 'EmailValidator' not found in /html/blog/plugins/submissions/class/action/addsubmissionaction.class.php on line 36
Richard D'Andrea Dover
http://www.christianblogsites.com
newtech1
 
Posts: 593
Joined: Thu Oct 13, 2005 12:02 am
Location: Seattle, WA, USA

Re: Contact page

Postby jondaley on Sat Mar 14, 2009 7:33 am

You need an lt_include line for the emailvalidator.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Re: Contact page

Postby newtech1 on Fri Apr 10, 2009 10:35 pm

I am coming back to this topic. (This was the one plug-in besides gravatar I had editd).
Can you give show me the code to:
You need an lt_include line for the emailvalidator.
Richard D'Andrea Dover
http://www.christianblogsites.com
newtech1
 
Posts: 593
Joined: Thu Oct 13, 2005 12:02 am
Location: Seattle, WA, USA

Re: Contact page

Postby jondaley on Sat Apr 11, 2009 1:31 am

Just change:
lt_include( PLOG_CLASS_PATH."class/data/validator/stringvalidator.class.php" );
to:
lt_include( PLOG_CLASS_PATH."class/data/validator/emailvalidator.class.php" );
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Re: Contact page

Postby jondaley on Sat Apr 11, 2009 1:32 am

(or if you are still using a stringvalidator somewhere, you'll need to copy it, so you end up with both validators being included.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Re: Contact page

Postby jondaley on Sat Apr 18, 2009 5:53 pm

Due to changing my own site from a separate installation to a shared installation, I've needed to redo my contact page (which used to simply use php), but I can't let random people run php code on my server, so I needed to come up with a plugin.
The "contact" plugin is now available via sourceforge for lifetype 1.2.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Re: Contact page

Postby newtech1 on Tue Apr 21, 2009 11:25 am

Can you give more detailed instructions on this plug-in in the readme?
I have installed the plug in, but it appears some settings and details are missing.

Other than turning the plug-in on or off I do not see any other settings in admin. Shouldn't there be a setting for what e-mail address the form should go to, etc.
newtech1
 
Posts: 593
Joined: Thu Oct 13, 2005 12:02 am
Location: Seattle, WA, USA

Re: Contact page

Postby jondaley on Wed Apr 22, 2009 5:43 pm

It sends to the blog owner. You shouldn't really need to configure it? I was thinking about using a template file, so you could edit the template easier, but you can also just use the styles.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Previous

Return to Templates

cron