├── LICENSE ├── faqtoidmail.php ├── README.md ├── faqtoid.css └── faqtoid.js /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 patrick-roberts 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /faqtoidmail.php: -------------------------------------------------------------------------------- 1 | 23 | 24 | 25 | 26 | Support Message 27 | 40 | 41 | 42 | EOT; 43 | function format($k, $v) { 44 | return "\n

$k " . stripslashes(trim($v)); 45 | } 46 | while (list($key, $value) = each($_POST)) 47 | if ($key != 'email') { 48 | if (preg_match('/href=/i', $value)) 49 | die; 50 | if ($key == 'message') 51 | $message .= preg_replace('/[\r\n]+/', '

', stripslashes(trim($value))) . "\n


\n"; 52 | else 53 | $message .= format($key, $value); 54 | } 55 | $message .= format('Remote IP', $_SERVER['REMOTE_ADDR']); 56 | $message .= format('Mail script', 'http' . ($_SERVER['HTTPS'] ? 's' : '') . "://${_SERVER['HTTP_HOST']}${_SERVER['REQUEST_URI']}"); 57 | $message .= ''; 58 | #$message .= "\nUser-agent: ${_SERVER['HTTP_USER_AGENT']}\nReferrer: ${_SERVER['HTTP_REFERER']}"; 59 | preg_match('/^(www\.)?(.*)/i', strtolower($_SERVER['HTTP_HOST']), $matches); 60 | $subject = "${matches[2]} Message";# . date('M ' /*'Y-m-d H:i:s'*/); # set the subject here, for convenience & security 61 | $headers = "From: $email\r\nMIME-Version: 1.0\r\nContent-Type: text/html; charset=iso-8859-1\r\n"; 62 | $result = mail($recipient, $subject, $message, $headers); 63 | echo json_encode(array('success' => $result)); 64 | } else 65 | echo json_encode(array('error' => 'invalid email')); 66 | } else 67 | echo json_encode(array('success' => 0)); 68 | ?> 69 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NO LONGER MAINTAINED. PLEASE DON'T EMAIL ME. 2 | 3 | # FAQtoid: Automate Support 4 | 5 | ## Free Website Help System 6 | 7 | FAQtoid is a simple free all-in-one help system for your website or web application. It reduces your support costs by giving visitors the tools to help themselves. 8 | 9 | * **FAQ with Live Search** 10 | Users see answers as they type. 11 | * **Tours** 12 | Walk users through the parts of each page. 13 | * **Video Gallery** 14 | Users can watch videos while staying on the webpage that a video explains. 15 | * **Smart Email Form** 16 | Handles crazy and junk messages. Automatically includes detailed information about your user, what they were trying to do, and any errors on the page. 17 | 18 | All without forcing your user to leave what they were doing and go to a separate isolated help page. 19 | 20 | See what happened when your user had a problem. When the user emails you, FAQtoid includes the contents of all forms on the page, cookies, localStorage, previous page, browser version, OS, and more. Forward the information to your programmer and he can fix bugs in a fraction of the time. 21 | 22 | Filters crazy messages. Blocks swear words, messages too short to be real, and duplicate messages. Converts all caps messages to normal punctuation. 23 | 24 | 25 | ### Get FAQtoid for Your Website 26 | 27 | Free and open source under the MIT license. 28 | 29 | Works on desktops, tablets, and phones. Compatible with all major browsers including IE8. Also works in Cordova/PhoneGap apps. 30 | 31 | Easy to setup. No programming required for FAQs, tours, and videos. Simply paste HTML into your webpage. (The optional smart mail form unavoidably involves uploading one PHP script to your server.) 32 | 33 | 34 | ### Questions or Suggestions? 35 | 36 | me@patrickroberts.ca 37 | 38 | 39 | ### Installation 40 | 41 | 1. Save the .js and .css files to your site. 42 | 2. Between the tags of your webpage add: 43 | `` 44 | `` 45 | `` 46 | 3. In your HTML body add `` or `
` 47 | 48 | 49 | ### How to Show FAQtoid 50 | 51 | `` makes a button that shows the FAQtoid window. Or you can add `class=showFaqtoid` to make any element show FAQtoid when clicked. 52 | 53 | You can also place FAQtoid in the page: `
` Paste that anywhere in the body of a page. 54 | 55 | 56 | ### How to Add FAQs 57 | 58 | Paste the following anywhere inside the `...` tags of your page. Repeat a `
...
` section for each question and answer. 59 | 60 |
61 |
62 |
A question?
63 |
64 | Its answer. 65 |
66 |
67 |
68 |
Why so many questions?
69 |
70 | Because it's easier than fixing bugs. 71 |
72 |
73 |
74 | 75 | ### How to Add Tours 76 | 77 | You can define a tour anywhere in each page: 78 | 79 |
    80 |
  1. This will show centered on page. 81 |
  2. This will show pointing to the first element matching the css selector in data-for. 82 |
83 | 84 | `data-auto=on` causes the tour to start automatically the first time anyone visits the page. 85 | 86 | FAQtoid has its own "Show Instructions" button if you define a tour. You can also make your own tour starting buttons: `` 87 | 88 | 89 | ### Options 90 | 91 | To customize FAQtoid add any of these attributes to the FAQtoid script Tag: 92 | 93 | * data-videos: Comma separated series of youtube video ids. Example value: `ea-XjlC6YKA,fcFl6BgK_vw,XM3r0ouxq2c` 94 | * data-faqs: URL to file of questions and answers. See below for format. Defaults to faqtoids.txt. 95 | * data-mailscript: URL to post messages to. Omit to have only the FAQ search. Names of parameters sent: email, message, ... 96 | * data-sidebar: Some HTML to insert beside the mail form. 97 | 98 | For example, to add tutorial videos to your FAQtoid: `