contactform/staticpage plugins

Found a bug? Tell us!!
Post Reply
JWalker
Regular
Posts: 177
Joined: Mon Sep 12, 2005 4:14 pm
Location: Botevgrad, Bulgaria
Contact:

contactform/staticpage plugins

Post by JWalker »

I think there is bad interaction between serendipity_event_contactform and serendipity_event_staticpage:

serendipity_event_staticpage always puts 'contactform' string in the link for the contact form that is shown in the sidebar. Par example http://www.your_site.com/s9y/index.php?serendipity[subpage]=contactform. This is at line 490 of serendipity_event_staticpage.php file.

But when some other string is entered in PLUGIN_CONTACTFORM_PAGETITLE (pagetitle) -- this is in serendipity_event_contactform configuration -- the link ended with 'contactform' does not work (obviously). If, par example, 'backfeed' is entered, then the working link is http://www.your_site.com/s9y/index.php?serendipity[subpage]=backfeed.

So serendipity_event_staticpage.php, line 490, should be changed to get the actual value of 'pagetitle' property from serendipity_event_contactform.

serendipity_event_contactform only:

1) serendipity_event_contactform.php, line 19:

Code: Select all

$propbag->add('configuration', array('permalink', 'pagetitle', 'email', 'intro', 'articleformat'));
'sent' config item is omitted:

Code: Select all

$propbag->add('configuration', array('permalink', 'pagetitle', 'email', 'intro', 'sent', 'articleformat'));
2) When 'Format as article' is chosen, PLUGIN_CONTACTFORM_TITLE and above 'pagetitle' value both appear above the form. I think, in 'Format as article' mode, PLUGIN_CONTACTFORM_TITLE should be opened only.

3) When tested contactform with UTF-8 enabled for the blog, after a message was sent successfully or not sent by some reason this warning appears:

Code: Select all

Warning: mb_send_mail() [function.mb-send-mail]: Unsupported charset ""UTF-8"" - will be regarded as ascii in D:\biz\apps\s9y\include\functions.inc.php on line 310
Ivan Cenov
OKTO-7 Co., Botevgrad
Bulgaria
falk
Regular
Posts: 512
Joined: Tue Sep 27, 2005 10:16 am
Location: DD
Contact:

Post by falk »

Puh, you are a realy bughunter ;-).

I fix the contactform problem at Line 490 ;-). Thank you.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: contactform/staticpage plugins

Post by garvinhicking »

Hi!
1) serendipity_event_contactform.php, line 19:

Code: Select all

$propbag->add('configuration', array('permalink', 'pagetitle', 'email', 'intro', 'articleformat'));
'sent' config item is omitted:

Code: Select all

$propbag->add('configuration', array('permalink', 'pagetitle', 'email', 'intro', 'sent', 'articleformat'));
Thank you, I fixed that!
2) When 'Format as article' is chosen, PLUGIN_CONTACTFORM_TITLE and above 'pagetitle' value both appear above the form. I think, in 'Format as article' mode, PLUGIN_CONTACTFORM_TITLE should be opened only.
Hm, I don't think so -- the pagetitle should IMHO also be outputted. I know at least one person explicitly requested this when the plugin was created. You could disable the formatting at that place and create your custom plugin_contactform.tpl template if you'd like that customizatio?
3) When tested contactform with UTF-8 enabled for the blog, after a message was sent successfully or not sent by some reason this warning appears:

Code: Select all

Warning: mb_send_mail() [function.mb-send-mail]: Unsupported charset ""UTF-8"" - will be regarded as ascii in D:\biz\apps\s9y\include\functions.inc.php on line 310
Hm, I've never heard about that. We actually pass "UTF-8" only, not within double quotes -- and the mb_send_mail() function should be able to interpret that?

Which PHP version are you running, this is more a PHP issue?!

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/
JWalker
Regular
Posts: 177
Joined: Mon Sep 12, 2005 4:14 pm
Location: Botevgrad, Bulgaria
Contact:

Re: contactform/staticpage plugins

Post by JWalker »

garvinhicking wrote: Which PHP version are you running, this is more a PHP issue?!
PHP 5.0.2, MySQL 4.1.14, Apache 2.0.54

I checked php.ini : nothing about UTF-8
In httpd.conf:
AddDefaultCharset WINDOWS-1251
Ivan Cenov
OKTO-7 Co., Botevgrad
Bulgaria
JWalker
Regular
Posts: 177
Joined: Mon Sep 12, 2005 4:14 pm
Location: Botevgrad, Bulgaria
Contact:

I found it !

Post by JWalker »

In the file functions.inc.php, line 308:

Code: Select all

$headers[] = 'Content-Type: text/plain; charset="' . LANG_CHARSET .'"';
removed " around LANG_CHARSET :

Code: Select all

$headers[] = 'Content-Type: text/plain; charset=' . LANG_CHARSET .'';
and the message disappeared.

P.S. Not tested with windows-1251 though.
Ivan Cenov
OKTO-7 Co., Botevgrad
Bulgaria
MySchizoBuddy
Regular
Posts: 340
Joined: Sun Jun 12, 2005 5:28 am

Post by MySchizoBuddy »

the contactform has serendipity_Entry_Date and other classes like serendipity_title etc.
But i don't see them in the contactform.tpl file.
I removed them from the staticpages.tpl and saticpages_aboutpages.tpl. but it still shows up.
Image
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

MSB: Yeah, the current contactform plugin has hard-coded class names within the PHP file and not within the template.

I just fixed it in version 1.6.

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/
MySchizoBuddy
Regular
Posts: 340
Joined: Sun Jun 12, 2005 5:28 am

Post by MySchizoBuddy »

Thanks garvin :)
Image
MySchizoBuddy
Regular
Posts: 340
Joined: Sun Jun 12, 2005 5:28 am

Post by MySchizoBuddy »

can i add more fields in the contact form

Code: Select all

<input type="text" id="serendipity_commentform_Relatedurl" name="serendipity[url]" value="{$commentform_url}" />
what should i put in the name and value field
Image
falk
Regular
Posts: 512
Joined: Tue Sep 27, 2005 10:16 am
Location: DD
Contact:

Post by falk »

Yes, i think so. But you must add your new filds in the $commentInfo array in the plugin for name and $serendipity['smarty']->assign(... for values, too.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

And of course you need to create new DB columns to store the new functions, and to patch up all saveComment() functions and so on.

Short version: It's hard to do without patching much stuff.

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/
MySchizoBuddy
Regular
Posts: 340
Joined: Sun Jun 12, 2005 5:28 am

Post by MySchizoBuddy »

Ohhhhh
I guess i'll leave it to default then.
:P
what if i don't care if it stored in the database or not. as long as i get the email its fine
Image
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Well, that would be the same effort. You'll need to patch up several functions - free additional comment fields need to be put inside the Core, there's no abstraction available for that, I'm sorry.

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/
Post Reply