DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:conform

conform Plugin

Compatible with DokuWiki

doesn't work with Hrun 2014

plugin Simple HTML forms with HTML e-mail output

Last updated on
2008-10-29
Provides
Syntax, Helper

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Similar to bureaucracy, contact, contactmodern, form

Tagged with email, form, poll

Download and Installation

Download and install the plugin using the Plugin Manager using the following URL. Refer to Plugins on how to install plugins manually.

Warning

This plugin should currently only be used on closed wikis, because it could easily be abused as a spam gateway. Counter measurements are planned for future releases.

Usage

Fully loaded example:

In main DokuWiki config you will need to allow the “page” (specified by the “ID” in the URL, so namespace:anothernamespace:page, etc). And then allow e-mail to where you desire (In the example: toenail@fingernail.co.za and peanut@butter.co.za), this prevents the service from being abused on a public wiki. (Although, please heed the warning above, this is still not suitable for public wikis yet, just the initial design is heading that way).

<CONFORM>
MailTo "toenail@fingernail.co.za, peanut@butter.co.za";
MailSubject "BigEvilCorp - Leave Form";
Textbox EmployeeName "Employee Name" 180;
Constraint EmployeeName "Fill in the the Employee Name" minLength="2";
Textbox PracticeOrDepartment "Practice Or Department" 180;
Constraint PracticeOrDepartment "Practice or Department" minLength="2";
Textbox Position "Employee Position" 180;
Constraint Position "Fill in the Employee's position" minLength="3";
Select TypeOfLeave "Type of leave requested" "Annual Leave,Sick Leave" 180;
Textarea ReasonRequestedOther "Specify Other If Selected Above" 10 320;
Radio ReplacementArranged "Replacement/Locum Arranged" "Yes,No,Not required";
Textbox name "Your name" 180;
Static "A combobox declared by a list";
Select country "Your country" "Biscuit, Tea, Coffee" 180;
Static "A combobox declared by a name";
Line;
Checkbox news "We advice you to subscribe to our newsletter" 1;
Checkbox news2 "We advice you to subscribe to our newsletter" 0;
Line;
Radio zahlmethode "Payment:" "Mastercard,Visa,Cash, Paypal";
Line;
Textarea comments "**Comments**" 10 320;
Textbox zip "zip" 180;
Textbox mail "e-mail" 180;
Textbox max7 "max 7" 180;
Textbox min7 "min 7" 180;
Textbox greptest "greptest" 180;
Textbox testint "Int test" 180;
Textbox testfloat "Float test" 180;
Textbox functiontest "Function test" 180;
Constraint min7 "Mind. 7 digits!" minLength="7";
Constraint max7 "Max. 7 digits!" maxLength="7";
Submit "Submit" 200;
Textbox zipzip "zip" 180;
RowsStart 3;
Textbox DaysWorked3 "Day's Worked" 90;
RowsEnd;
RowsStart 10;
Textbox DaysWorked "Day's Worked" 90;
Textbox FromTime "Start Time" 90;
Textbox EndTime "End Time" 90;
Textbox NumberOfHours "Number Of Hours" 90;
Textbox RatePerHour "Rate Per Hour" 90;
RowsEnd;
Textbox meow "zip" 290;
RowsStart 3;
Textbox DaysWorked2 "Day's Worked" 90;
Textbox FromTime2 "Start Time" 90;
Textbox EndTime2 "End Time" 90;
RowsEnd;
</CONFORM>

A sample form:
A sample form

A sample e-mail:
A sample email

TODO

  • Setup an 'amounts' keywords that pushes financial amounts to the right.
  • Fix characters allowed in the keywords, because users can stop $_POST from functioning.
  • Setup a something to stop spam bots.

UTF-8 charset in e-mail

This addition improves the look of e-mails containing international characters.

--- syntax.php.org      2008-10-03 07:28:00.000000000 +0200
+++ syntax.php  2009-03-04 14:30:36.000000000 +0100
@@ -373,6 +373,7 @@
                if ( $_SESSION["conform_emailed"] == false )
                {
                    $emailform  = "<html><body>";
+                   $emailform .= "<META http-equiv=Content-Type content=\"text/html; charset=utf-8\">";
                    $emailform .= "<style>";
                    $emailform .= "body { padding: 0; border-spacing: 0; border-collapse: collapse; }";
                    $emailform .= "table.conform { border: 1px solid #000000; padding: 0px; margin: 5px; border-spacing: 0; }";

— Daniel Lindgren 090304

Errors

I kept getting 2 errors; I use the latest version of DokuWiki (“lemming”) and monobook, and always these errors appear:

  • Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\website\wiki\lib\tpl\monobook\main.php:545) in C:\website\wiki\lib\plugins\conform\syntax.php on line 233
  • Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\website\wiki\lib\tpl\monobook\main.php:545) in C:\website\wiki\lib\plugins\conform\syntax.php on line 233

I solved these errors by deleting “sessions_start();” on line 233

Theo, 22/03/10

Confirmation

If you add this line:

$form .= "<p style=\"color : red;\"><b>Your message has been sent!</b></p>";

after this line (385) in the syntax.php

$_SESSION["conform_emailed"] = true;

You'll get a confirmation after clicking submit.

Theo – 24-03-2010

Fails to work on Hrun version

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/filtermy/public_html/lib/tpl/THEME/main.php:18) in /home/filtermy/public_html/lib/plugins/conform/syntax.php on line 233

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/filtermy/public_html/lib/tpl/THEME/main.php:18) in /home/filtermy/public_html/lib/plugins/conform/syntax.php on line 233

Conform not allowed on this page! Please ask the admin to rectify this!
plugin/conform.txt · Last modified: 2016-01-24 19:23 by Aleksandr