Výměna e-mailu za stažení souboru

**Email Before Download**
„https://wordpress.org/plugins/email-before-download/“:https://wordpress.org/plugins/email-before-download/

Email Before Download presents your users with a form where they submit information, like their name and email address, prior to receiving a download.

This plugin integrates with the popular Contact Form 7 and WordPress Download Monitor plugins, allowing you to create any form you like and manage/monitor your file downloads.

!!! Můžou zmizet náhledové obrázky, zde „workaround“:https://wordpress.org/support/topic/featured-image-disappears-1

/—code php
// Around line 182 of wp-content/plugins/download-monitor/includes/class-wp-dlm.php, after this:
$current_support = get_theme_support( ‚post-thumbnails‘ );
// Put this:
if(is_array($current_support[0])) $current_support = $current_support[0];
// Then the code should be like this:
$current_support = get_theme_support( ‚post-thumbnails‘ );
if(is_array($current_support[0])) $current_support = $current_support[0];
\—

„Remove *The link to the file(s) has been e-mailed to you* »“:https://wordpress.org/support/topic/remove-the-link-to-the-files-has-been-e-mailed-to-you

„Custom Sender for Email Before Download »“:https://wordpress.org/plugins/custom-sender-for-email-before-download/

Manipulace s údaji v Contact Form 7 před a po odeslání

„WordPress Contact Form 7 Hook Unofficial Developer Documentation and Examples »“:http://xaviesteve.com/3298/wordpress-contact-form-7-hook-unofficial-developer-documentation-and-examples/

„Changing Form Data Before it is Saved »“:http://cfdbplugin.com/?page_id=747

„Contact Form 7 – form submit change field value »“:https://wordpress.org/support/topic/form-submit-change-field-value

„How to create a mail counter for Contact Form 7 »“:http://sevenspark.com/tutorials/how-to-create-a-counter-for-contact-form-7

„Extending the Contact Form 7 Plugin »“:http://kovshenin.com/2010/wordpress-extending-the-contact-form-7-plugin/

[private]

/—code php

### příklad použitý na http://u904.cz/mimoradna-nabidka-lifebook-a512/
### pocitadlo objednavek odeslanych z CF7

// Define the key to store in the database
define(‚CF7_COUNTER‘, ‚cf7-counter‘);
define(‚CF7_LASTORD‘, ‚cf7-lastord‘);
define(‚POCNAB‘, ‚200‘); // startovni pocet kusu

### Create the shortcode which will read the value from db option
function cf7db_reader(){
$val = get_option(CF7_COUNTER, POCNAB); // kdyz neexistuje option v db, vrati startovni pocet
return $val;
}
add_shortcode(‚CF7_show‘, ‚cf7db_reader‘);

### Action performed BEFORE the mail is sent by CF7
function wpcf7_change_mail($form) {
$formid = $form->id; // gets current form id
if ($formid == ‚384‘) {
$wpcf7 = WPCF7_ContactForm::get_current(); // get current FORM instance
$wpcf7data = WPCF7_Submission::get_instance(); // // get current SUBMISSION instance
if ($wpcf7data) {
$formData = $wpcf7data->get_posted_data();
}
// Reading a posted value in the form with PHP
$poc = $formData[‚pocet‘]; // nacte hodnotu z prave odeslaneho formulare
$val = get_option(CF7_COUNTER, POCNAB); // nacte aktualni hodnotu skladu, kdyz neexistuje option v db, vytvori a naplni ji startovnim poctem objednavku.

// nahrada dat v mailu
$mail = $wpcf7->prop(‚mail‘);

if($poc > $val): // objednano vic kusu, nez je na sklade, nahradim REPLACER textem
$mail[‚pocet‘] = $val; // snizim objednany pocet
// doplnim upozorneni do mailu
// Find/replace the „special“ tag as defined in your CF7 email body
$mail[‚body‘] = str_replace(‚REPLACER‘, „Jelikož jste objednali větší počet („.$poc.“ ks), než bylo aktuálně k dispozici skladem („.$val.“ ks), bude objednaný počet snížen na dostupné množství.\n“, $mail[‚body‘]);
else: // odstrani REPLACER string
$mail[‚body‘] = str_replace(‚REPLACER‘, „“, $mail[‚body‘]);
endif;

// Save the email body
$wpcf7->set_properties(array(„mail“ => $mail));

// return current cf7 instance
return $wpcf7;
}
}
add_action(‚wpcf7_before_send_mail‘, ‚wpcf7_change_mail‘);

### Action performed WHEN the mail is sent by CF7
function cf7_decrement_order_counter($form){
$formid = $form->id; // gets current form id
if ($formid == ‚384‘) {
// $wpcf7 = WPCF7_ContactForm::get_current(); // get current FORM instance
$wpcf7data = WPCF7_Submission::get_instance(); // // get current SUBMISSION instance
if ($wpcf7data) {
$formData = $wpcf7data->get_posted_data();
}
$poc = $formData[‚pocet‘]; // nacte hodnotu z prave odeslaneho formulare
$val = get_option(CF7_COUNTER, POCNAB) – $poc; // kdyz neexistuje option v db, vytvori a naplni ji startovnim poctem snizenym o odeslanou objednavku.
update_option(CF7_COUNTER, $val); // Update the settings with the new count
update_option(CF7_LASTORD, $poc); // Update the settings with the new count
}
}
add_action(‚wpcf7_mail_sent‘, ‚cf7_decrement_order_counter‘);

### zmena poctu objednanych kusu v databazi odeslanych formularu (Contact Form DB)
function change_cfdb_value($formData){
$formName = ‚A514‘;
if ($formData && $formName == $formData->title) {
$poc = $formData->posted_data[‚pocet‘];
$val = get_option(CF7_COUNTER, POCNAB);
if($poc > $val): // objednano vic kusu, nez je na sklade
$formData->posted_data[‚dodavka‘] = $val;
else:
$formData->posted_data[‚dodavka‘] = $poc;
endif;
}
return $formData;
}
add_filter(‚cfdb_form_data‘, ‚change_cfdb_value‘);

### Change content of Ordering Page
function formRemover($content) {
if(!is_feed() && !is_admin() && is_page(381)) {
$val = get_option(CF7_COUNTER);
if($val == 0):
$content = str_replace(‚

Tak neváhejte!

‚, ‚

Prodej byl ukončen.

‚, $content);
else:
$content = str_replace(‚

‚, ‚

Objednávkový formulář

Chyba: Kontaktní formulář nebyl nalezen.

‚, $content);
endif;
}
return $content;
}
add_filter (‚the_content‘, ‚formRemover‘);

### Change content of Thank You Page
function orderAlert($content) {
if(!is_feed() && !is_admin() && is_page(385)) {
$val = get_option(CF7_COUNTER, POCNAB);
$poc = get_option(CF7_LASTORD, 0);
$roz = $poc-$val;
if($val <= 0): $content = str_replace('REPLACER', '

Díky za objednávku.

Jelikož jste objednali větší počet kusů, než bylo aktuálně k dispozici skladem, byl Vámi objednaný počet snížen.

Na adresu, kterou jste uvedli ve formuláři, byl zaslán potvrzující e-mail.

‚, $content);
update_option(CF7_COUNTER, 0); // vynulovani pocitadla
update_option(CF7_LASTORD, 0); // vynulovani pocitadla
else:
$content = str_replace(‚REPLACER‘, ‚

Díky za objednávku.

Na adresu, kterou jste uvedli ve formuláři, byl zaslán potvrzující e-mail.

‚, $content);
endif;
}
return $content;
}
add_filter (‚the_content‘, ‚orderAlert‘);

### pridani odkazu na blog page k excerptum
function excerpt_read_more_link($output) {
global $post;
return $output . ‚Chyba: Kontaktní formulář nebyl nalezen.

‚, $content);
endif;
}
return $content;
}
add_filter (‚the_content‘, ‚formRemover‘);

### Change content of Thank You Page
function orderAlert($content) {
if(!is_feed() && !is_admin() && is_page(72)) {
$val = get_option(CF7_COUNTER, POCNAB);
$poc = get_option(CF7_LASTORD, 0);
$roz = $poc-$val;
if($val <= 0): $content = str_replace('REPLACER', '

Díky za objednávku.

Jelikož jste objednali větší počet kusů, než bylo aktuálně k dispozici skladem, byl Vámi objednaný počet snížen.

Na adresu, kterou jste uvedli ve formuláři, byl zaslán potvrzující e-mail.

‚, $content);
update_option(CF7_COUNTER, 0); // vynulovani pocitadla
update_option(CF7_LASTORD, 0); // vynulovani pocitadla
else:
$content = str_replace(‚REPLACER‘, ‚

Díky za objednávku.

Na adresu, kterou jste uvedli ve formuláři, byl zaslán potvrzující e-mail.

‚, $content);
endif;
}
return $content;
}
add_filter (‚the_content‘, ‚orderAlert‘);
\—

[/private]

Ve verzi CF7 4 a vyšší se způsob přebírání dat z formuláře změnil:
/—code php
/* WPCF7_ContactForm object no longer has a posted_data property. */
$posted_data = $contact_form->posted_data; // Tohle už nefunguje

/* Use WPCF7_Submission object’s get_posted_data() method to get it. */
$submission = WPCF7_Submission::get_instance();

if ( $submission ) {
$posted_data = $submission->get_posted_data();
}
\—

Jak změřit odeslání kontaktního formuláře CF7 v Google Analytics

V pluginu Contact Form 7 existuje pole *Additional Settings*, do kterého lze přidat kód pro měření

/—code php
on_sent_ok:“_gaq.push([‚_trackPageview‘, ‚/form-odeslan‘]);“
\—

a v nastavení cíle v GA se pak */form-odeslan* vloží do pole pro sledované URL (které ve skutečnosti neexistuje), match type = head match.

Viz též:
„Google Analytics Goals with Contact Form 7: The Right Way »“:http://www.bobzien.com/2010/10/22/google-analytics-goals-with-contact-form-7-the-right-way/
„Google Analytics’s tracking function »“:http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=55514
„Stránka pluginu Contact Form 7 »“:http://ideasilo.wordpress.com/2009/05/31/contact-form-7-1-10/

Kontaktní formulář, formulářové pluginy

**Contact Form 7**
„http://wordpress.org/extend/plugins/contact-form-7/“:http://wordpress.org/extend/plugins/contact-form-7/
„http://contactform7.com/“:http://contactform7.com/

Contact Form 7 can manage multiple contact forms, plus you can customize the form and the mail contents flexibly with simple markup. The form supports Ajax-powered submitting, CAPTCHA, control question, Akismet spam filtering and so on.
Můžete založit třeba sto různých formulářů se stovkou různých obsahů. Takže například jeden bude obsahovat textová pole a rozjížděcí menu, jiný zase check buttony a potvrzovací tlačítka nebo všechno dohromady. Uděláte si takový formulář, jaký budete chtít. Čeština k dispozici.

„Optimize and style Contact Form 7“:http://wpstorm.net/2009/06/optimize-style-contact-form-7-wordpress/

„How To Customize The Style Of Contact Form 7 To Match Your Website »“:https://www.elegantthemes.com/blog/tips-tricks/how-to-customize-the-style-of-contact-form-7-to-match-your-website

„Stylování Contact Form 7 do podoby ElegantThemes Contact Form »“:http://www.agentwp.com/style-contact-form-7-form-like-elegantthemes-contact-form

„Přidání funkcí onfocus a onblur“:http://www.sramekdesign.com/wordpress/hacking-contact-form-7-add-onfocus-and-onblur-function/

**Contact Form 7 to Database Extension**
„http://wordpress.org/extend/plugins/contact-form-7-to-database-extension/“:http://wordpress.org/extend/plugins/contact-form-7-to-database-extension/

„Changing Form Data Before it is Saved »“:http://cfdbplugin.com/?page_id=747

Saves form submissions to the database that come from Contact Form 7.

*Alternative*

**Save Contact Form 7**
„https://wordpress.org/plugins/save-contact-form-7/“:https://wordpress.org/plugins/save-contact-form-7/

Save Contact Form 7 data. Sort, search & export it in CSV+PDF. Unlike CFDB, the plugin itself is very smart and creates column name from your Contact Form 7 Field names.

**Jquery Validation For Contact Form 7**
„https://wordpress.org/plugins/jquery-validation-for-contact-form-7/“:https://wordpress.org/plugins/jquery-validation-for-contact-form-7/

This plugin adds jquery validation to your contact form 7. You will be able to validate extra validation rules like: url, date, credit card, phone number in the contact form 7 fields.

**Frontend Registration – Contact Form 7**

Frontend Registration – Contact Form 7

By using this plugin you can create front-end registration form by which registered user will be register as a subscriber role in WordPress.

**Contact Form 7 MailChimp Extension**
„https://wordpress.org/plugins/contact-form-7-mailchimp-extension/“:https://wordpress.org/plugins/contact-form-7-mailchimp-extension/
Simple way to integrate MailChimp mailing lists to Contact Form 7. Save your subscribers in a proper mailing list.

**Contact Form 7 – Success Page Redirects**
„https://wordpress.org/plugins/contact-form-7-success-page-redirects/“:https://wordpress.org/plugins/contact-form-7-success-page-redirects/
An add-on for Contact Form 7 that provides a straightforward method to redirect visitors to success pages or thank you pages.

**Contact Form 7 Modules**
„http://wordpress.org/plugins/contact-form-7-modules/“:http://wordpress.org/plugins/contact-form-7-modules/
Add useful modules such as hidden fields and „send all fields“ to the Contact Form 7 plugin. You can also choose to have the value of the hidden field dynamically populated in your form when you are contacted.

**Contact Form 7 Select Box Editor Button**
„https://wordpress.org/plugins/contact-form-7-select-box-editor-button/screenshots/“:https://wordpress.org/plugins/contact-form-7-select-box-editor-button/screenshots/
Add a contact form link into article text. For contact forms where the recipient can be chosen in a select box.

**Contact Form 7 Dynamic Text Extension**
„http://wordpress.org/plugins/contact-form-7-dynamic-text-extension/“:http://wordpress.org/plugins/contact-form-7-dynamic-text-extension/

CF7 DTX lets you create pre-populated fields based on other values. Some examples might include:

– Auto-filling a URL
– Auto-filling a Post ID, title, or slug
– Pre-populating a Product Number
– Referencing other content on the site
– Populating with post info
– Populating with user info
– Populating with custom fields
– Any value you can write a shortcode for

You can also choose to have the value of the hidden field dynamically populated in your form when you are contacted.

„Další nastavení (Bcc:, Google Analytics) »“:http://ideasilo.wordpress.com/2009/05/31/contact-form-7-1-10/

„Manipulace s údaji v Contact Form 7 před a po odeslání »“:https://wordpresso.ovx.cz/manipulace-s-udaji-v-contact-form-7-pred-a-po-odeslani/

„Honeypot Module for Contact Form 7 WordPress Plugin »“:https://wordpress.org/plugins/contact-form-7-honeypot/

„Fórum podpory »“:http://wordpress.org/support/plugin/contact-form-7

„Configuring Contact Form 7 to Work Perfectly With a Twentyten Child Theme »“:http://voodoopress.com/configuring-contact-form-7-to-work-perfectly-with-a-twentyten-child-theme/

„Když máte problém s odesíláním »“:http://buzztone.com.au/contact-form-7-email-issues/
„Další rady, co dělat při selhání »“:http://angstrey.com/index.php/2009/07/20/contact-form-7s-failed-to-send-your-message-error/

„FAQ »“:http://contactform7.com/faq/

*Alternativy:*

**Caldera Forms – Drag and drop responsive WordPress form builder**
„https://wordpress.org/plugins/caldera-forms/“:https://wordpress.org/plugins/caldera-forms/

Caldera Forms‘ visual editor simplifies form building for WordPress. Set up your form with multiple columns, add additional pages, and funnel user responses with conditional logic to get more robust data and relevant information from your customers and site visitors. Anti-spam, AJAX, notification emails, and database entry tracking are enabled by default.

*Visual Form Builder*
„https://wordpress.org/plugins/visual-form-builder/“:https://wordpress.org/plugins/visual-form-builder/

A plugin that allows you to build and manage all kinds of forms for your website in a single place. Drag-and-drop reordering, automatically stores form entries in your WordPress database, manage form entries in the WordPress dashboard, export entries to a CSV file, send form submissions to multiple emails, jQuery Form Validation.

**Intouch**
„http://wordpress.org/extend/plugins/intouch/“:http://wordpress.org/extend/plugins/intouch/
„http://adahas.com/work/intouch/“:http://adahas.com/work/intouch/

This is a plugin for WordPress which allows you to insert a custom build contact form, which on submission will send the information via email.
Features
* Customizable contact form with variable number of fields.
* Ability to specify mandatory fields.
* Can forwarded to any email address.
* Instant insertion using the Quicktag.
* Complete customization from admin panel.
* Instant submission using AJAX (for JavaScript supported browsers), and minimum overhead.
* Fall-back to standard HTML form submission, if JavaScript is not supported.
* Conforms to XHTML 1.0 Strict / XHTML 1.1
* Compatible to be served as application/xhtml+xml

**cforms II**
„http://www.deliciousdays.com/cforms-plugin“:http://www.deliciousdays.com/cforms-plugin

cforms is a plugin for WordPress, offering convenient deployment of multiple contact forms throughout your blog or even on the same page. The form submission utilizes AJAX, falls back, however, to a standard method in case AJAX/Javascript is not supported or disabled.

**Fast Secure Contact Form**
„http://wordpress.org/extend/plugins/si-contact-form/“:http://wordpress.org/extend/plugins/si-contact-form/

This plugin allows a webmaster to easily create and add contact forms to WordPress. The contact form will let the user send emails to a site’s admin, and also send a meeting request to talk over phone or video. An administration panel is present, where the webmaster can create and preview unlimited forms.

Features a super easy admin panel, multi-form feature, autoresponder, no templates to mess with, and an option to redirect visitors to any URL after the message is sent. Includes CAPTCHA and Akismet support to block all common spammer tactics. Spam is no longer a problem. You can add extra fields of any type: text, textarea, checkbox, checkbox-multiple, radio, select, select-multiple, attachment, date, time, hidden, password, and fieldset.

**Formidable Forms**
„http://wordpress.org/plugins/formidable/“:http://wordpress.org/plugins/formidable/

Quickly and easily build forms with a simple drag-and-drop interface and in-place editing. There are dozens of form-building plugins out there to create forms, but most are confusing and overly complicated. With Formidable, it is easy to create forms within a simple drag-and-drop interface.

„Přehled pluginů pro kontaktní formuláře »“:http://www.tripwiremagazine.com/2011/02/10-awesome-up-to-date-wordpress-plugins-to-build-contact-forms-fast.html