=== Plugin Name === Contributors: the_dead_one Donate link: http://tinyurl.com/yvgcs9 Tags: anonymous, posting, editing, users, post, form, admin, submit, submissions, unregistered users, uploads, downloads, categories, tags, custom fields, captcha, custom posting interface, plugin, custom, widget, akismet, ajax, recaptcha, subscribe-to-comments, geo-mashup Requires at least: 2.8.6 Tested up to: 3.0 Stable Tag: 0.13.9 This plugin can add themed custom posting and editing forms to your website that allows your readers (including non-registered) to contribute. == Description == This plugin allows you to add highly customisable forms that work with your Wordpress Theme to your website that allows non-registered users and/or subscribers (also configurable) to submit and edit posts and pages. New posts are kept in "draft" until an admin can publish them (also configurable). Likewise edits can be kept be automatically kept as revisions until an admin approves them. It can optionally use Akismet to check if submissions and contributions are spam. TDO Mini Forms can be used to create "outside-the-box" uses for Wordpress, from Contact Managers, Ad Managers, Collaborate Image Sites, Submit Links, etc. **0.13.9 is another compatibility fix for Wordpress 3.0. If you are running a Wordpress version prior to 3.0, you do not need to upgrade.** TDO Mini Forms has been used to turn Wordpress into a [Forum](http://thedeadone.net/software/tdo-forum-wordpress-theme/), [Contact Manager](http://www.slipfire.com/wp-crm-58.htm)! The plugin provides an extensive moderation view so administrators and editors can see posts and edits awaiting approval and publish or delete them. Administrators can also ban specific users and IPs from using the form. Administrators can also "Trust" specific users. This means that when they use the form, their posts are automatically published. This does not give them any other rights or permissions using the Wordpress software, it only affects usage of the form. This applies to user and IP bans as well. There is even an option to automatically trust users after so many approved submissions and edits. Administrators can configure the forms using drag and drop "widgets". They are based on the same model as Wordpress' built-in Theme widgets and it is possible to write your own. Registered users have access to a "Your Submissions" page which lists their current submissions and edits awaiting approval and links to their approved submissions. * [Demo Site]( http://thedeadone.net/forums ) = Features = * Submission and Editing of Posts and Pages * Integration with the GeoMashup plugin * Integration with Subcribe-to-Comments 2.1 plugin * Integration with Akismet and reCaptcha to prevent Spam * Highly customisable: Create your forms using a Widget interface and then hack it to make it work how you like! * Create as many forms as you like. * Import and Export form configurations * Put a form in your sidebar using a widget for your Theme or put the form in a page or post. * Submit posts with alternative permalinks (great for link sites) * Simple Question and/or Image Captcha. * Add Custom Fields to your Forms. * QuickTags support for Forms. * Upload Files and can be attached to posts. Uses Wordpress' core to create thumbnails if applicable. * Submitters can be notified if post approved or rejected. * Allow users to select category and tags. * Ban users and IPs. * Control what roles can access the form. * Can automatically create a page with form for you. * Can automatically modified author template tag with info about submitter. * Can, optionally, automatically allow submissions to be published. * Throttle number of submissions by user and/or IP * Optionally queue publishing of posts * Numerous widgets for your theme, including a list of the top submitters * And many more... == Installation == Download the zip and extract the files to a subdirectory, called tdo-mini-forms, of your plugin directory. i.e. `/path_to_wordpress/wp-content/plugins/tdo-mini-forms`. It is currently assumed that the "wp-load.php" of your Wordpress install can be accessed from the tdo-mini-forms folder using the relative path: `../../../wp-load.php` Also make sure that the files in the root of tdo-mini-forms can be accessed from the web as they are used to enable post submission. Once you've got it installed, active the plugin via the usual Wordpress plugin menu. Make sure you then configure it via the main TDOMF menu in the Wordpress Administration backend. You must assign a user as the "Default Author". This user must **not** have rights to publish or edit posts, i.e. they should be of the subscriber role. When posts are submitted from unregistered users, this "Default Author" user is set as the author of the post to keep Wordpress happy. The TDOMF options menu can automatically create a dummy user to set as the Default Author. This is the recommended approach. On the options menu, there is a button to automatically create a page with the necessary tag to display your form. There are also other options to help integrate with your theme on this page. For more information on Theme integration, please refer to the Frequently Asked Questions of this readme. = Upgrade Instructions from versions previous to 0.7 = Before installing the new version of TDO Mini Forms, delete the TDOMiniForms from your `.../wp-content/plugins/` folder. Now simply follow the installation instructions above. You will need to re-configure the plugin again, however previously submitted posts and other user information will be retained from your previous installation of the plugin. = Configuration = Please check the Frequently Asked Questions for answers to many of the common issues that arise. If you are using the wp-cache or wp-super-cache plugins, please make sure that any page that uses a TDO Mini Forms form are **not** cached. If you cache the form it'll may contain an old "key" and will cause "Bad Data" error messages and also you will not be able to preview or see admin messages. If you are using any plugins that will execute PHP code within post content/title or custom field, it is recommended to disable them or at the very least make sure that moderation is enabled and all submissions are scanned for malicious code. PHP code and Javascript tags can be submitted as part of input to any part of the form, in some cases Wordpress will strip them out. But custom fields, especially, will not be filtered automatically (this can be desirable, for example if you want people to post snippets of javascript code). = Creating a Form = To start, go to "Options" menu under the main "TDO Mini Forms" menu in your admin dashboard. Make sure you've set a valid Default Author (who does not have publish rights). Go through the general options and make sure everything is okay. By default, TDO Mini Forms must have at least one form. You can have multiple forms, with various different options in your configuration. You can even copy an existing Form. When you visit any of the Form specific menus, the forms are listed at the top of this menu, so choose go to "Form Options" and select Form 1 if this is the first time you have configured TDO Mini Forms. Read through the options and configure as appropriate. You can automatically create a page on your blog to hold the form from here. Now move on to the "Create". From here you can configure what is on the Form and how it is processed by dragging and dropping "widgets" from the "Available Widgets" pool to "Your Form" and then configuring the widgets by clicking on the left icon for the widget. It is important to remember that widgets are processed from top down, so they will appear on your form in that order and they will be executed in that order when the form input is previewed, validated and submitted. This can mean that one widget can overwrite a submitted posts settings from another widget (for example multiple Categories widgets can overwrite the default category and themselves). At this stage, try using the form and making sure it works the way you want. If you're happy with the generated Form and the submitted posts it creates, then you are finished. However if you want to tweak stuff, change some of the messages, re-arrange fields you can move onto the Form Hacker. You must be careful with the Form Hacker as it is quite powerful and there is very little debugging or error reporting going on. You can totally change how your Form appears and even behaves using the Form Hacker. See the following section "Using the Form Hacker" for more on using the Form Hacker. = Using the Form Hacker = With version 0.12, the Form Hacker was added to TDO Mini Forms. Previously a lot of people would modify the source code of TDO Mini Forms to modify a single piece of text used in the form or re-arrange the fields in your form. Currently the Form Hacker does not allow you to modify the Error message, the Upload Files widget and inline Form and the Custom Field widget preview (FYI: you can do this from within the Custom Field widget configuration). What Form Hacker does allow you to do is to completely modify the code displayed for a Form. Parts of the Form are often generated on the fly; the Form Hacker gives you access to modifying that actual code as it supports using PHP code within. It is quite powerful but can also be very easy to screw up, so be careful. It also allows you to modify any of Form's general messages such as permission or throttling messages. To use PHP code is fairly easy, for example: `` This will display your blog's title in the form. The Form Hacker has a number of "macros". These are special strings that are automatically expanded when the Form is displayed. Some of these macros are used to automatically generate the Form Key (which is used for security). The %%WIDGET:widget-name%% macro can be used to let individual widgets do their thing while you hack everything else. A list of macros can be found by clicking on "Show Help" link at the top of the page. **Please be aware that if you use the Form Hacker and you later change the setings of your form (modify widgets or options), these changes are not reflected automatically in the Form Hacker. You must re-edit the hacked form to pick up the new changes.** = Getting even more out of your Form = You can now attach additionally PHP code to your form using the "Append to Content" widget. If you drag and drop this widget to your Form, you can use it to add anything you like to the post content, however you can also insert PHP code that will get called when the submission is being processed (and any outputted info gets added to the post content). For some examples, on the support forums, the Append to Content widget has been used to use the value set in [Custom Field as the Title]( http://thedeadone.net/forum/?p=418#comment-1542 ) and to use the [Submitter's username as Title]( http://thedeadone.net/forum/?p=269#comment-1459 ) == Frequently Asked Questions == Here are some useful topics from the [Support Forms]( http://thedeadone.net/forum ) * [Using a form outside of Wordpress]( http://thedeadone.net/forum/?p=3161#comment-4421 ) * [Custom validation to prevent duplicate post titles]( http://thedeadone.net/forum/?p=2814#comment-4406 ) * [Hacking TDOMF to redirect to a custom URL]( http://thedeadone.net/forum/?p=3131#comment-4402 ) * [Creating your own validation routine]( http://thedeadone.net/forum/?p=2224#comment-4315 ) * [How to add and process you're own inputs on a form]( http://thedeadone.net/forum/?p=1905#comment-4093 ) * [Figure the category using alphanumeric categorizations from title of post and add it]( http://thedeadone.net/forum/?p=1618#comment-3611 ) * [Dynamically displaying a form based on a checkbox]( http://thedeadone.net/forum/?p=1458#comment-3484 ) * [Additional Default Categories]( http://thedeadone.net/forum/?p=334#comment-2637 ) * [Potential Solution to not Saving Hacked Forms]( http://thedeadone.net/forum/?p=1230#comment-2571 ) * [Another Custom Title Example]( http://thedeadone.net/forum/?p=1230#comment-2680 ) * [Appending the Excerpt to the Content]( http://thedeadone.net/forum/?p=1306#comment-2862 ) * [Overwriting Default Category]( http://thedeadone.net/forum/?p=1613#comment-3613 ) = Plugin clashes and "Server 500 Errors" using Wordpress 2.6.2 = A number of users experinced random 500 errors using TDO Mini Forms and conflicts with other plugins under Wordpress 2.6.2. If you experince a 500 error, please check your host's error logs. If you don't know how to do that, contant your host. There are two things check. Are you using PHP4? If you can, try using PHP5 instead. (You can check via phpinfo() or by the error message that appears at the top of any of the TDO-Mini-Form admin menus). [Someone found this solution for their blog hosted on 1and1]( http://wordpress.org/support/topic/204256?replies=16#post-860103 ) and it requires modifying your .htaccess to use PHP5 instead of PHP4. This may not be applicable to other hosts. The second thing to check is your .htaccess. If you are completely locked out of your blog by the 500 error, try deleting your .htaccess file (normally in the root of your wordpress install). Then you should be able to access the admin UI of your blog (normally at "yourbloguri/wp-admin"). You must then recreate your .htaccess by resetting your permalink structure in the admin UI and re-apply any other changes to your .htaccess (wp-super-cache for example requires changes in your .htaccess). = Where is the best place to get support for this plugin? = You can use the [TDOMF Support Forum]( http://thedeadone.net/forum ) or you can post on [Wordpress.org's Support Form]( http://wordpress.org/tags/tdo-mini-forms#postform ). Please avoid emailing me directly. I got a lot of email, so I have a tendency to attach low priorities to these emails, unless it is directly related to some query on the forum that I have shown an interest in. = Where do I get the latest updates and news on TDO Mini Forms? = [TDO Mini Forms News]( http://thedeadone.net/index.php?tag=tdomf ) and here is the [RSS Feed]( http://thedeadone.net/index.php?tag=tdomf&feed=rss2 ). You can also follow me on twitter [@thedeadone](https://twitter.com/thedeadone). I'll be posting updates about TDO Mini Forms with the tag #tdomf. = How do I add a form to a page or post? = You can use the button in the options menu to create a page automatically. Or instead you can add: `[tdomf_form1]` to any post or page. The plugin will replace this with your Form 1. If you have multiple forms, each form has an ID. Just replace the '1' with the correct form ID. You can add it to your template directly using this template tag: `` If it's an edit form, you'll have to supply the post id: `` = How do I display the submitter info? = There are options to automatically modify the the_author tag with submitter information if available and also to append submitter information to the end of the post. If thats not good enough for you, you can use the template tag: `` = What template tags are available? = (Replace '1' with the ID of the form you are interested in and replace '100' with the post id of the post or page you wish to edit. If not editing a page, leave out or set to 'false'.) ` Link to form ` `` `` These tags must be used within the loop: `` `` `` The tdomf_get_the_submitter_email template tag can be used to get the gravatar icon for a submitter. = I want to add custom fields! = With v0.9, you can! There is now a Custom Field widget avaliable to add to your form. Currenly only text fields and text areas are supported but future versions will support check boxes, drop down lists, radio groups, etc. = I want to allow my readers to attach a image to a submission? = With v0.8, you can allow users to upload files. You can specify what files can be uploaded and how big. You can also optionally have the upload files automatically added to the post as an image, link or a Wordpress attachment. To add the option to upload files, as admin, go into the TDOMF menu and then the widgets menu. On that page you can drap and drop widgets. Just drag and drop the "Upload Files" widget. More from the Support Forums: * [Programatically limit the size of an uploaded image]( http://thedeadone.net/forum/?p=1332#comment-3889 ) * [Styling the appearance of the Thumbnail using the Append widget]( http://thedeadone.net/forum/?p=1306#comment-2862 ) * [How to integrate with lightbox]( http://thedeadone.net/forum/?p=323#comment-3582 ) * [Getting the image thumbnails from a post using Template Tags]( http://thedeadone.net/forum/?p=1700 ) * [Thumbnail to Custom Field]( http://thedeadone.net/forum/?p=1700 ) = I want to allow only certain people to access the form = The best way to do this is to use Wordpress roles. Create a role using the [Role Manager Plugin](http://redalt.com/Resources/Plugins/Role+Manager "Role Manager Plugin"). This plugin has nothing to do with me. Make sure it is not the default role and that it can't `edit_other_posts` or `publish_posts`. Then you can use the TDOMF options page to set that as the only role that can access the form. If you don't want people to have to register, you might try looking at this plugin: [Wordpress OpenID Plugin](http://verselogic.net/projects/wordpress/wordpress-openid-plugin/ "Wordpress OpenID Plugin"). This plugin has nothing to do with me. This plugin allows people to use an OpenID identity to login to your Wordpress site. If the user has an account on Wordpress.com, LiveJournal, Yahoo and numerous other sites, they can log in using that account and once they have logged in, you can assign them to the right role. Another suggestion, but much less secure and not recommended, is to have the page where you have the form, password protected and only send the page link and password to the people you want to access the form. = I want submissions, even from unregistered users, be published automatically! = You can disable moderation in the options menu for a specific form and all posts will be published. However such posts get passed through Wordpress' kses filters automatically to remove nasty scripts. = When people submit posts with YouTube embedded code, it gets stripped! = Enable moderation and it'll work. If you disable moderation, posts get passed through kses to remove nasty scripts before being published. This removes YouTube code. If you have to approve posts, you can make sure no-one has snuck in something tricky. Alternativily you can use a custom field. Add the Custom Field widget to your form, set it as a URL and ask your submitters to add the URL of the YouTube video they want to include. Then in your theme, you can use the Custom Fields template tags to automatically display the YouTube video underneath the submitted post. Or you can use another plugin that gives you tags to support YouTube and have the Custom Field append the YouTube link with the tags to your post. See also [How to submitting YouTube with v0.13+]( http://thedeadone.net/forum/?p=3156#comment-4423 ) on the support forums. = Can we use TinyMCE, FckEditor, Niced for writing posts? = I have spent some time exploring the use of TinyMCE (and to a lesser degree FckEditor) for TDO Mini Forms. Both libraries provide a WYSIWYG or "Rich Text" editors in place of your bog-standard text area. Wordpress' write screen using a heavily modified version of TinyMCE. There is no direct integration support for these toolkits. However you can easily integrate TinyMCE without modifying any of TDO Mini Forms. [I've written up a short tutorial on how you might integrate TinyMCE with the a TDO Mini Form's Form]( http://thedeadone.net/how-to/tinymce-tdomf/ ) = I want to add add tags to QuickTags such as embed video, etc.? = Right now there is no user interface for adding your own tags to quicktags. Feel free, however, to modify `tdomf-quicktags.js.php` to add any tags you want. = I want to display some information about the upload files? = In later versions, proper template tag support will be added. However, for the moment you can use: `// Gets the name of the first uploaded file for post $post_ID get_post_meta($post_ID, "_tdomf_download_name_0"); // Gets the type of the first uploaded file for post $post_ID get_post_meta($post_ID, "_tdomf_download_type_0"); // Gets the download count of the first uploaded file for post $post_ID get_post_meta($post_ID, "_tdomf_download_count_0"); // Gets the path to the first uploaded file for post $post_ID get_post_meta($post_ID, "_tdomf_download_path_0"); // Gets the command output for the first uploaded file for post $post_ID (if avaliable) get_post_meta($post_ID, "_tdomf_download_cmd_output_0"); // Gets the URI for the thumbnail (if it exists) get_post_meta($post_ID, "_tdomf_download_thumburi_0"); // Gets the name of the second uploaded file for post $post_ID get_post_meta($post_ID, "_tdomf_download_name_1"); // And so on...` = Styling TDO Mini Form Posts = Styling and formatting of posts is really outside the scope of this plugin. Some nominal features in TDO Mini Forms allow you to append content to the Post's content area but this has limited application. Wordpress core gives more than enough options to do this. Custom Fields, Title, Categories, Tags, etc. can be displayed in myriad ways using [Template Tags](http://codex.wordpress.org/Template_Tags ), without having to modify your post content using TDO Mini Forms. You can style TDO Mini Forms differently to normally posts in your Theme (within the [loop](http://codex.wordpress.org/The_Loop )): `
This post was submitted by TDO Mini Forms, so use a TDO Mini Forms format, etc.
Default Post Formatting
` = Modifying tdomf-style-form.css has no effect on form! = TDO Mini Forms uses the wp_head action in your theme to add a link to the stylesheet. Check for the existance of a line like this in your header.php: `do_action('wp_head');` You can also manually add like this: `` = Uploading a bmp file causes errors! = If you have the options for attachments and thumbnail generation turned on for Upload Files and you try to upload a *.bmp (bitmap) image, you'll get an error like this: `Warning: imageantialias(): supplied argument is not a valid Image resource...` Wordpress does not support bitmaps for thumbnails so you cannot use bitmaps for thumbnail generation. = I can't upload files! : safe_mode and open_basedir issues = First step, make sure you can upload with the normal Wordpress admin UI. If you can't then your not going to be able to upload with TDOMF until that is sorted. If you do and you get an error with something like this `Warning: mkdir() [function.mkdir]: open_basedir restriction in effect` or `Warning: mkdir(): [function.mkdir]: SAFE MODE Restriction in effect` Then you host has restricted where you can create and upload files. Safe mode is particularly bad because it'll fail in unexpected ways. Ultimately the best solution is not to use safe mode or open_basedir but you may not have the option to do that. The best solution is to use a folder to store uploads that does not break safe mode. If you can upload with the normal wordpress interface then you can use something like