PmForm

(redirected from PmForm.Installation)

This group is used to document the Cookbook:PmForm recipe.

From PmWiki 2.3.22, the script and the template pages are included in the core, you don't need to download it separately. It is not enabled by default, you still need to enable and configure it, see below.

There are several steps for PmForm to work.

  1. Configure PmForm
    • For PmWiki 2.3.37 or more recent:
      1. Modify your local/config.php or other local customization file, enabling PmForm
        $EnablePmForm = 1;
    • For PmWiki 2.3.22 or more recent:
      1. Modify your local/config.php or other local customization file, enabling PmForm
        include_once("$FarmD/scripts/pmform.php");
    • For PmWiki 2.3.21 or older:
      1. Download pmform.zip and extract it to your PmWiki directory on your server
      2. Modify your local/config.php or other local customization file, enabling PmForm
        include_once("$FarmD/cookbook/pmform.php");
  2. add a line in your config.php file to define the reference for every unique (:pmform reference:) directive:
    $PmForm['reference'] = 'subject="Email from '.$WikiTitle.'" mailto=yourname@example.com form=#yourform fmt=#yourformpost from=myname@myexample.com';
  3. Create wiki page called Site.LocalTemplates if it doesn't exist already
  4. Modify Site.LocalTemplates, editing the form code creating the form (named #yourform from the config.php line above) and the output format (named #yourformpost from the config.php line above)
  5. Inserting the (:pmform reference:) directive into any wiki page where you want this specific form

If your wiki is sending you email forms with international characters, and the character encoding of the emails is wrong, you may also want to add the following to config.php:

# Fix for Subject header, if international characters:
$EnablePmFormMailSubjectEncode = 1;

# Fix for message body:
$PmFormMailHeaders = "Content-Type: text/plain; charset=utf-8\r\n";

Starting points:

  • Forms   Markup and Standard input controls to embed input forms into wiki pages
  • Basic Email Form with Honeypot and Captcha   a walkthrough creating a basic email form with honeypot & captcha (by Xes)
  • Comments   Add comments to current page, or a comment page
  • DataForms   Using PmForm to save data on wiki pages
  • GDPR Comments   Add comments to current page, or a comment page, GDPR compliant
  • GDPR MailForm   forms for sending electronic mail, GDPR compliant
  • HoneyPot   Implementing "honeypots" for spam-control in forms
  • MailForm   Using PmForm to send electronic mail from a form in a page

Unofficial user's notes about PmForms:

Notes

You need to put pmform.php direct into your cookbook/ directory, and Site.PmFormTemplates into your wikilib.d directory.

  • Xes: I don't recommend putting Site.PmFormTemplates directly in wikilib.d because that's part of the upgrade tree and should not be modified by users or recipes. I created my own xeslib.d directory and put Site.PmFormTemplates into it, adding this as the very FIRST line in my config.php:
    $WikiLibDirs = array(&$WikiDir,new PageStore('$FarmD/xeslib.d/{$FullName}'),new PageStore('$FarmD/wikilib.d/{$FullName}'));
    This is how you can create your own lib (library) directory ("lib.d") name for wiki page templates separate from user-overwritten wiki.d files.
  • ChrisK: Any installation of files into wikilib.d also runs into issues with using WikiFarms where the wikilib.d directory may not have permissions allowing it to be written to. It thus seems reasonable to move the Site.PmFormTemplates file to the wiki.d directory.

All relevant pages in the PmForm group:

Category: Forms
  0: 00.00 00.00 EnablePost = 1, keys=
  1: 00.00 00.00 config start
  2: 00.01 config end
  3: 00.05 MarkupToHTML begin
  4: 00.08 ReadApprovedUrls SiteAdmin.ApprovedUrls begin
  5: 00.08 ReadApprovedUrls SiteAdmin.ApprovedUrls end
  6: 00.08 FPLTemplate: Chain begin
  7: 00.08 FPLTemplate: FPLTemplateLoad
  8: 00.08 FPLTemplate: FPLTemplateDefaults
  9: 00.08 FPLTemplate: FPLTemplatePageList
 10: 00.08 MakePageList pre
 11: 00.08 PageListSources begin
 12: 00.08 PageStore::ls begin wiki.d/{$FullName}
 13: 00.09 PageStore::ls merge wiki.d/{$FullName}
 14: 00.09 PageStore::ls end wiki.d/{$FullName}
 15: 00.09 PageStore::ls begin $FarmD/wikilib.d/{$FullName}
 16: 00.09 PageStore::ls merge $FarmD/wikilib.d/{$FullName}
 17: 00.09 PageStore::ls end $FarmD/wikilib.d/{$FullName}
 18: 00.09 PageListSources end count=1
 19: 00.09 PageListSort pre ret=4 order=name
 20: 00.09 MakePageList items count=1, filters=
 21: 00.09 MakePageList post count=1, readc=0
 22: 00.09 PageListSort begin
 23: 00.09 PageListSort sort
 24: 00.09 PageListSort end
 25: 00.09 MakePageList end
 26: 00.09 FPLTemplate: FPLTemplatePmWikiOrg
 27: 00.09 MarkupToHTML begin
 28: 00.09 MarkupToHTML end
 29: 00.09 FPLTemplate: FPLTemplateSliceList
 30: 00.09 FPLTemplate: FPLTemplateFormat
 31: 00.09 MarkupToHTML begin
 32: 00.10 MarkupToHTML end
 33: 00.10 FPLTemplate: FPLTemplatePmWikiOrgPostFormat
 34: 00.10 FPLTemplate: Chain end
 35: 00.10 FPLTemplate: Chain begin
 36: 00.10 FPLTemplate: FPLTemplateLoad
 37: 00.10 FPLTemplate: FPLTemplateDefaults
 38: 00.10 FPLTemplate: FPLTemplatePageList
 39: 00.10 MakePageList pre
 40: 00.10 PageListSources begin
 41: 00.10 PageStore::ls begin wiki.d/{$FullName}
 42: 00.10 PageStore::ls merge wiki.d/{$FullName}
 43: 00.10 PageStore::ls end wiki.d/{$FullName}
 44: 00.10 PageStore::ls begin $FarmD/wikilib.d/{$FullName}
 45: 00.10 PageStore::ls merge $FarmD/wikilib.d/{$FullName}
 46: 00.10 PageStore::ls end $FarmD/wikilib.d/{$FullName}
 47: 00.10 PageListSources end count=7
 48: 00.10 PageListSort pre ret=4 order=name
 49: 00.10 MakePageList items count=7, filters=
 50: 00.10 MakePageList post count=7, readc=0
 51: 00.10 PageListSort begin
 52: 00.10 PageListSort sort
 53: 00.10 PageListSort end
 54: 00.10 MakePageList end
 55: 00.10 FPLTemplate: FPLTemplatePmWikiOrg
 56: 00.10 MarkupToHTML begin
 57: 00.11 MarkupToHTML end
 58: 00.11 FPLTemplate: FPLTemplateSliceList
 59: 00.11 FPLTemplate: FPLTemplateFormat
 60: 00.11 MarkupToHTML begin
 61: 00.11 MarkupToHTML end
 62: 00.11 FPLTemplate: FPLTemplatePmWikiOrgPostFormat
 63: 00.11 FPLTemplate: Chain end
 64: 00.11 FPLTemplate: Chain begin
 65: 00.11 FPLTemplate: FPLTemplateLoad
 66: 00.11 FPLTemplate: FPLTemplateDefaults
 67: 00.11 FPLTemplate: FPLTemplatePageList
 68: 00.11 MakePageList pre
 69: 00.11 PageListSources begin
 70: 00.11 PageStore::ls begin wiki.d/{$FullName}
 71: 00.12 PageStore::ls merge wiki.d/{$FullName}
 72: 00.12 PageStore::ls end wiki.d/{$FullName}
 73: 00.12 PageStore::ls begin $FarmD/wikilib.d/{$FullName}
 74: 00.12 PageStore::ls merge $FarmD/wikilib.d/{$FullName}
 75: 00.12 PageStore::ls end $FarmD/wikilib.d/{$FullName}
 76: 00.12 PageListSources end count=3
 77: 00.12 PageListSort pre ret=4 order=name
 78: 00.12 MakePageList items count=3, filters=
 79: 00.12 MakePageList post count=3, readc=0
 80: 00.12 PageListSort begin
 81: 00.12 PageListSort sort
 82: 00.12 PageListSort end
 83: 00.12 MakePageList end
 84: 00.12 FPLTemplate: FPLTemplatePmWikiOrg
 85: 00.12 MarkupToHTML begin
 86: 00.12 MarkupToHTML end
 87: 00.12 FPLTemplate: FPLTemplateSliceList
 88: 00.12 FPLTemplate: FPLTemplateFormat
 89: 00.13 MarkupToHTML begin
 90: 00.13 MarkupToHTML end
 91: 00.13 FPLTemplate: FPLTemplatePmWikiOrgPostFormat
 92: 00.13 FPLTemplate: Chain end
 93: 00.13 FPLTemplate: Chain begin
 94: 00.13 FPLTemplate: FPLTemplateLoad
 95: 00.13 FPLTemplate: FPLTemplateDefaults
 96: 00.13 FPLTemplate: FPLTemplatePageList
 97: 00.13 MakePageList pre
 98: 00.13 PageListSources begin
 99: 00.13 PageStore::ls begin wiki.d/{$FullName}
100: 00.14 PageStore::ls merge wiki.d/{$FullName}
101: 00.15 PageStore::ls end wiki.d/{$FullName}
102: 00.15 PageStore::ls begin $FarmD/wikilib.d/{$FullName}
103: 00.15 PageStore::ls merge $FarmD/wikilib.d/{$FullName}
104: 00.15 PageStore::ls end $FarmD/wikilib.d/{$FullName}
105: 00.15 PageListSources end count=22
106: 00.15 PageListSort pre ret=4 order=name
107: 00.15 MakePageList items count=22, filters=PageListTermsTargets
108: 00.15 MakePageList post count=21, readc=22
109: 00.15 PageListSort begin
110: 00.15 PageListSort sort
111: 00.15 PageListSort end
112: 00.15 MakePageList end
113: 00.15 FPLTemplate: FPLTemplatePmWikiOrg
114: 00.15 MarkupToHTML begin
115: 00.15 MarkupToHTML end
116: 00.15 FPLTemplate: FPLTemplateSliceList
117: 00.15 FPLTemplate: FPLTemplateFormat
118: 00.16 MarkupToHTML begin
119: 00.17 MarkupToHTML end
120: 00.17 FPLTemplate: FPLTemplatePmWikiOrgPostFormat
121: 00.17 FPLTemplate: Chain end
122: 00.17 MarkupToHTML end
123: 00.17 MarkupToHTML begin
124: 00.19 MarkupToHTML end
125: 00.19 MarkupToHTML begin
126: 00.19 MarkupToHTML end
127: 00.19 now