Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
p01-contact : simply add contact forms in your pages
Hi all,

There is the 1.0 beta to try! Smile
The choice I made is to bring this script to the creation of any type of forms. It is therefore inherently more complex, but hopefully always as easy to use.

This release is a beta version, don't use it in any production site.

There is some new things :
  • The forms actions are now separated functions and files, called by p01-contact main object, like "plugin plugins". There is actually one action available : "send_mail" (send a mail with form answers to recipients), but anything can be developped now (polls, newsletters, comments...).

  • You can hide every fields by using "?", like : subject? = hidden subject
    An hidden field is invisible for user but its data can be used.

  • Multipart/alternative mail content. The send_mail action send a plain text and an html version of the mail.

  • Checklists can be defined as blacklist or whitelist.

  • New translations.

p01-contact forms actions principe :

To create a new action "my_new_action" :
- Create a function "my_new_action($form)" in the new file :
Code:
p01-contact/actions/my_new_action.php
$form is a p01contact_form object who contain every data of the sended form. There is actually no documentation (but all is commented), so you need to search by yourself for now.
- Set the action (where you call $p01contact, before parsing) with :
Code:
$p01contact->set_action('my_new_action');

p01-contact analyse tags, create forms, check sended datas, etc... and call one action.

The 1.0 :
I will launch the 1.0 release after your returns on the action system, when the most important bugs will be fixed and when the languages still partially translated (Spanish,
Swedish, Lithuanian) will be complete.

I hope you will like it!
Reply
Russian language

p.s. The name of the sender is displayed in the incorrect coding
Version 1.0b
Reply
Russian language for p01-contact 1.0b
Reply
Hi,

Thanks for the translation, it's included in the trunk.

About the encoding problem, what is displayed? A name or the "Anonymous" sentence? Could you show me the mail headers From/Reply-To/Return-Path?
What is displayed in debug mode?
I really don't understand this errors, everything is UTF-8, and all is working when i try (cf. attachment).
Reply
what is displayed? A name or the "Anonymous" sentence?
displayed name - for example Евгений

show me the mail headers From/Reply-To/Return-Path?
To: eugene[a]mail.ru
Subject: =?utf-8?B?0KLQtdC80LA=?=
From: Евгений <post[a]mail.ru>
Reply-To: Евгений <post[a]mail.ru>

Debug mode
Code:
p01-contact (not) sent mail :
(To: eugene@XXX.ru)
(Subject: =?utf-8?B?0J/RgNC+0LLQtdGA0LrQsCBUZXN0?=)
From: Евгений Eugene
Reply-To: Евгений Eugene
Return-Path: Евгений Eugene
MIME-Version: 1.0
Content-type: multipart/alternative; boundary="----p01contact_boundary--b497be281f21d8bcbd8ce60830804153"
X-Mailer: PHP/5.2.14

------p01contact_boundary--b497be281f21d8bcbd8ce60830804153
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Сообщение отправлено с сайта r1e.ru

Ваше сообщение :
Сообщение Message


Это сообщение было отправлено со страницы /contacts/
If this mail should not be for you, please contact the administrator

------p01contact_boundary--b497be281f21d8bcbd8ce60830804153
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit

Сообщение отправлено с сайта r1e.ru

Ваше сообщение :

Сообщение Message


Это сообщение было отправлено со страницы /contacts/
If this mail should not be for you, please contact the administrator


------p01contact_boundary--b497be281f21d8bcbd8ce60830804153--

p01-contact debug
$_POST :
array(2) {
  ["p01-contact_fields"]=>
  array(5) {
    [0]=>
    string(21) "Евгений Eugene"
    [1]=>
    string(13) "post@XXXX.biz"
    [2]=>
    string(21) "Проверка Test"
    [3]=>
    string(26) "Сообщение Message"
    [4]=>
    string(6) "zmm4Aw"
  }
  ["p01-contact_form"]=>
  array(2) {
    ["id"]=>
    string(1) "1"
    ["token"]=>
    string(55) "b68d8740b22363fabd94d96e2323193d4d493b5202a926.48046541"
  }
}
$p01contact :
P01contact Object
(
    [default_email] =>
    [default_lang] => en
    [securimage_url] => http://r1e.ru/plugins/p01-contact/captcha/
    [action] => send_mail
    [version:private] => 1.0
    [error:private] =>
    [forms:private] => Array
        (
            [1] => P01contact_form Object
                (
                    [P01contact] => P01contact Object
*RECURSION*
                    [id:private] => 1
                    [status:private] => Тестовый режим
                    [targets:private] => Array
                        (
                            [0] => eugene@XXX.ru
                        )

                    [fields:private] => Array
                        (
                            [0] => P01contact_field Object
                                (
                                    [form:private] => P01contact_form Object
*RECURSION*
                                    [id:private] => 0
                                    [type:private] => name
                                    [title:private] =>
                                    [value:private] => Евгений Eugene
                                    [required:private] => 1
                                    [hidden:private] =>
                                    [locked:private] =>
                                    [error:private] =>
                                )

                            [1] => P01contact_field Object
                                (
                                    [form:private] => P01contact_form Object
*RECURSION*
                                    [id:private] => 1
                                    [type:private] => email
                                    [title:private] =>
                                    [value:private] => post@XXXX.biz
                                    [required:private] => 1
                                    [hidden:private] =>
                                    [locked:private] =>
                                    [error:private] =>
                                )

                            [2] => P01contact_field Object
                                (
                                    [form:private] => P01contact_form Object
*RECURSION*
                                    [id:private] => 2
                                    [type:private] => subject
                                    [title:private] =>
                                    [value:private] => Проверка Test
                                    [required:private] => 1
                                    [hidden:private] =>
                                    [locked:private] =>
                                    [error:private] =>
                                )

                            [3] => P01contact_field Object
                                (
                                    [form:private] => P01contact_form Object
*RECURSION*
                                    [id:private] => 3
                                    [type:private] => message
                                    [title:private] =>
                                    [value:private] => Сообщение Message
                                    [required:private] => 1
                                    [hidden:private] =>
                                    [locked:private] =>
                                    [error:private] =>
                                )

                            [4] => P01contact_field Object
                                (
                                    [form:private] => P01contact_form Object
*RECURSION*
                                    [id:private] => 4
                                    [type:private] => captcha
                                    [title:private] =>
                                    [value:private] => zmm4Aw
                                    [required:private] => 1
                                    [hidden:private] =>
                                    [locked:private] =>
                                    [error:private] =>
                                )

                        )

                )

        )

)

May be it's mail.ru problem
Reply
Thanks for this details.
I don't see any problem in debug mode... All seems to be encoded correctly.
Could you try with another mail box? Or, even, send me a copy? (Activate the askcopy field, and use my address in email field)
But even if it's relative to the webmail, i suppose you can (have already) receive mails with russian names?
Reply
send test mail from p01-contact form to contact[a]nliautaud.fr - is it your e-mail?

Could you try with another mail box?
later

But even if it's relative to the webmail, i suppose you can (have already) receive mails with russian names?
from other mail - all ok
look at pic
Reply
I really don't know.
I receive the same mail without problem, and you have problems only with these.
So it's partially mail-reader relative.

If someone understand...
Reply
may be mail.ru shows Sender and Subject in different coding
Reply
I found an error in p01-contact_gs.php

Code:
function admin_email()
{
    $data = getXML(GSDATAOTHERPATH . 'user.xml');
    return $data->EMAIL;
}

In version 2.04B :
Code:
function admin_email()
{
    $data = getXML(GSUSERSPATH . 'admin.xml');
    return $data->EMAIL;
}
'admin.xml' is just for my utilisation...
Reply
Hi!

Still have problems with P01 plugin. It doesn't work. I'm always receiving message "The message have already been sent." and nothing happens. Do you have any ideas?

Here's a link to the form: http://multimed.bytom.pl/index.php?id=telefon

No other plugin installed. Server configuration OK - confirmed by hosting company.

Thanks a lot!

Best regards,
Bartosz
Reply
madvic Wrote:Hello,

The p01-contact don't works with the plugin exec-php.

Thanks

I find a solution :

http://get-simple.info/forum/post/9387/#p9387
Reply
Hi, all.
First, I just noticed that my plugin was downloaded more than a thousand times. I'm glad you like it.

madvic Wrote:I found an error in p01-contact_gs.php
Thanks!

madvic Wrote:I find a solution : http://get-simple.info/forum/post/9387/#p9387
Good news, bravo.

barlew Wrote:I'm always receiving message "The message have already been sent." and nothing happens.
This indicates a token problem, a verification value saved in session. Check if you can access and manipulate $_SESSION, and compare the two tokens versions :
Code:
echo $_POST['p01-contact_form']['token'];
echo $_SESSION['p01-contact_token'];
You should have two identical values, like :
Code:
7ddb371fd9795e4342c82fb29132d3c24d517d97502de5.49937571
7ddb371fd9795e4342c82fb29132d3c24d517d97502de5.49937571
Reply
Quote:This indicates a token problem, a verification value saved in session. Check if you can access and manipulate $_SESSION, and compare the two tokens versions :
Code:
echo $_POST['p01-contact_form']['token'];
echo $_SESSION['p01-contact_token'];
You should have two identical values, like :
Code:
7ddb371fd9795e4342c82fb29132d3c24d517d97502de5.49937571
7ddb371fd9795e4342c82fb29132d3c24d517d97502de5.49937571

Thank you for advice! The question is how to do this? I mean how to display those tokensSmile
Regards,
Bartosz
Reply
Write the two lines indicated above in your template, between <?php and ?>.
The template file is located in :
Code:
http://domain.tld/GetSimple/theme/your_theme/template.php

(Todo : add tokens in debug mode)
Reply
OK. I received one token only (left-top corner, where I put the code echo...)

Code:
0926771ea91ff84bea15a4335d99c57a4d529170a71851.63694003

and two warnings below:

Code:
Warning: Unknown: open(/tmp/sess_a505234c392f43f0c990b47e99127e87, O_RDWR) failed: No such file or directory (2) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0

Any ideas?

Best regards,
Bartosz
Reply
You can't access to sessions.
Some hosts disable sessions by default, try to create a /tmp directory in server root (like for free.fr hosting in france) or ask to your host.
Reply
It was enough to create /tmp folder in GetSimple root Smile Now everything is fine.
Thank you for your support and great plugin!

Best regards,
Bartosz
Reply
I've attached a Polish translation of P01-Contact as my small contribution.
Best regards,
Bartosz
Reply
barlew Wrote:It was enough to create /tmp folder in GetSimple root Smile Now everything is fine.
Thank you for your support and great plugin!
barlew Wrote:I've attached a Polish translation of P01-Contact as my small contribution.
Great, thanks, nice, thanks!
(The translation will be included in the next development release)
Reply
How can I put the contact form in the sidebar.
I tried putting (% contact %) in the sidebar but it does not work.

Please help - I am not an expert in php so please make it simple - (like the name "getsimple" says.)
Reply
Alexa Wrote:How can I put the contact form in the sidebar.
I tried putting (% contact %) in the sidebar but it does not work.

Please help - I am not an expert in php so please make it simple - (like the name "getsimple" says.)

Have you installed the exec-php Plugin ?
if true : http://get-simple.info/forum/topic/1407/execphp/
Reply
<?php echo $p01contact->parse('(% contact %)');?>
Reply
Is there any reason why this plugin wouldn't work with an email address with a .info extension? The admin email address for the GetSimple installation ends in .info. It works if I put any other email address in the configuration field. If I leave the field blank, or type in the .info email address the form reports that there is no recipient set. If I put the .info email address in the tag in the GetSimple template file the form says it's sent but the email never arrives. To test I put another email address in as an additional address in the template file. The form contents were delivered to this address and the headers showed it also sent to the .info address except that instead of .info it was .inf - so I'm thinking something in the script is truncating the extension. Help, please.
Reply
Quote:Is there any reason why this plugin wouldn't work with an email address with a .info extension?
After a quick look through the source, yes. It's also going to fail on .mobi and .museum at least, and reject a number of valid usernames. For a quick fix for your particular problem go through the code looking for anywhere it says {2,3} in a regexp and change them to {2,6}, Mr O'Reilly will still have problems getting responses though.

It's not really possible to validate email addresses in a simple regexp, from RFC-2822 you need...
Code:
(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])
...To cover everything.
Reply




Users browsing this thread: 6 Guest(s)