The language of the Contactform

Creating and modifying plugins.
Post Reply
Davy
Regular
Posts: 109
Joined: Fri Oct 13, 2006 2:06 pm
Location: The Netherlands

The language of the Contactform

Post by Davy »

Hey!

I really love tweaking Serendipity! :D So I edit the event_contactform-plugin: I've changed all the filenames, so contactform.php will be contactform2.php. I've also changed the PHP-files included in the plugin, so they link correctly. Well, that works super.

But now the problem: The Contactform and Contactform2 plugins are using the same lang_en.inc.php! :( The language file of Contactform2 is totally ignored. Is there something I'm missing?

Oh! Something else: The plugin is always called 'Contact Form', even if I change the PHP-file.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: The language of the Contactform

Post by garvinhicking »

Hi!

The best thing would be to create your very own plugin. Just copy the whole serendipity_event_contactform to serendipity_event_contactform2. Renamge the serendipity_event_contactform.php file to serendipity_event_contactform2.php, then edit that file and rename all occurences of "serendipity_event_contactform" to "serendipity_event_contactform2".

Then you can have your own language fiels more easily.

Best 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/
Davy
Regular
Posts: 109
Joined: Fri Oct 13, 2006 2:06 pm
Location: The Netherlands

MySQL-database

Post by Davy »

Interesting, the 'Contact Form2' is called 'Contact Form' in the database and Spartacus. So it seems like it doesn't get the language-file.
But... It is getting the file when I delete the one in the contactform-folder.
So: This two plugins are using the same file (always).
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: MySQL-database

Post by garvinhicking »

Hi!

Yes, because the plugins use the same constants! If you have installed both contact form plugins, only the languages from the first are used.

You will need to rename all PLUIGIN_BLABLA_ constants to "PLUGIN2_BLABLA" for distinct constant names. Also replace them in the PHP code then.

Best 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