| 1 |
<?php |
| 2 |
/** |
| 3 |
* Menu page for the s2Member plugin ( File Download Options page ). |
| 4 |
* |
| 5 |
* Copyright: © 2009-2011 |
| 6 |
* {@link http://www.websharks-inc.com/ WebSharks, Inc.} |
| 7 |
* ( coded in the USA ) |
| 8 |
* |
| 9 |
* Released under the terms of the GNU General Public License. |
| 10 |
* You should have received a copy of the GNU General Public License, |
| 11 |
* along with this software. In the main directory, see: /licensing/ |
| 12 |
* If not, see: {@link http://www.gnu.org/licenses/}. |
| 13 |
* |
| 14 |
* @package s2Member\Menu_Pages |
| 15 |
* @since 3.0 |
| 16 |
*/ |
| 17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"])) |
| 18 |
exit ("Do not access this file directly."); |
| 19 |
/**/ |
| 20 |
if (!class_exists ("c_ws_plugin__s2member_menu_page_down_ops")) |
| 21 |
{ |
| 22 |
/** |
| 23 |
* Menu page for the s2Member plugin ( File Download Options page ). |
| 24 |
* |
| 25 |
* @package s2Member\Menu_Pages |
| 26 |
* @since 110531 |
| 27 |
*/ |
| 28 |
class c_ws_plugin__s2member_menu_page_down_ops |
| 29 |
{ |
| 30 |
public function __construct () |
| 31 |
{ |
| 32 |
echo '<div class="wrap ws-menu-page">' . "\n"; |
| 33 |
/**/ |
| 34 |
echo '<div id="icon-plugins" class="icon32"><br /></div>' . "\n"; |
| 35 |
echo '<h2>s2Member® File Download Options</h2>' . "\n"; |
| 36 |
/**/ |
| 37 |
echo '<table class="ws-menu-page-table">' . "\n"; |
| 38 |
echo '<tbody class="ws-menu-page-table-tbody">' . "\n"; |
| 39 |
echo '<tr class="ws-menu-page-table-tr">' . "\n"; |
| 40 |
echo '<td class="ws-menu-page-table-l">' . "\n"; |
| 41 |
/**/ |
| 42 |
echo '<form method="post" name="ws_plugin__s2member_options_form" id="ws-plugin--s2member-options-form">' . "\n"; |
| 43 |
echo '<input type="hidden" name="ws_plugin__s2member_options_save" id="ws-plugin--s2member-options-save" value="' . esc_attr (wp_create_nonce ("ws-plugin--s2member-options-save")) . '" />' . "\n"; |
| 44 |
echo '<input type="hidden" name="ws_plugin__s2member_amazon_cf_files_distros_auto_config_status" id="ws-plugin--s2member-amazon-cf-files-distros-auto-config-status" value="' . esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distros_auto_config_status"]) . '" />' . "\n"; |
| 45 |
echo '<input type="hidden" name="ws_plugin__s2member_configured" id="ws-plugin--s2member-configured" value="1" />' . "\n"; |
| 46 |
/**/ |
| 47 |
do_action ("ws_plugin__s2member_during_down_ops_page_before_left_sections", get_defined_vars ()); |
| 48 |
/**/ |
| 49 |
if (apply_filters ("ws_plugin__s2member_during_down_ops_page_during_left_sections_display_restrictions", true, get_defined_vars ())) |
| 50 |
{ |
| 51 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_before_restrictions", get_defined_vars ()); |
| 52 |
/**/ |
| 53 |
echo '<div class="ws-menu-page-group" title="Basic Download Restrictions">' . "\n"; |
| 54 |
/**/ |
| 55 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-restrictions-section">' . "\n"; |
| 56 |
echo '<h3>File Download Restrictions ( required, if providing access to protected files )</h3>' . "\n"; |
| 57 |
echo '<p>If your Membership offering allows access to restricted files, you\'ll want to configure these options.</p>' . "\n"; |
| 58 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_during_restrictions", get_defined_vars ()); |
| 59 |
/**/ |
| 60 |
echo '<div class="ws-menu-page-hr"></div>' . "\n"; |
| 61 |
/**/ |
| 62 |
echo '<p><strong>Upload restricted files to this security-enabled directory:</strong><br /><code>' . esc_html (c_ws_plugin__s2member_utils_dirs::doc_root_path ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '</code></p>' . "\n"; |
| 63 |
echo '<p>- Now, you can link to any protected file, using this special format:<br /> <code>' . esc_html (site_url ("/?s2member_file_download=example-file.zip")) . '</code><br /> <small><em><strong>s2member_file_download</strong> = file, relative to the /' . esc_html (c_ws_plugin__s2member_utils_dirs::basename_dir_app_data ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/ directory. In other words, just the file name.</em></small></p>' . "\n"; |
| 64 |
echo '<p>- Or, use: <code>[s2File download="example-file.zip" /]</code> <em>( easier Shortcode if you prefer )</em><br /> <small><em><strong>Shortcode equivalent:</strong> <code>[s2File /]</code> produces the entire URL for you, easier.</em></small></p>' . "\n"; |
| 65 |
/**/ |
| 66 |
echo '<div class="ws-menu-page-hr"></div>' . "\n"; |
| 67 |
/**/ |
| 68 |
echo '<p>s2Member will allow access to these protected files, based on the configuration you specify below. Repeated downloads of the same exact file are NOT tabulated against the totals below. Once a file has been downloaded, future downloads of the same exact file, by the same exact Member will not be counted against them. In other words, if a Member downloads the same file three times, the system only counts that as one unique download. In addition, multiple variations of popular media formats are only counted once. This is because many site owners provide multiple download options to their Users/Members, for compatibility purposes. Files that have the same exact name, with one of these extensions, will only be counted ONE time: <code>' . esc_html (implode (",", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["streaming_file_extns"])) . '</code>.</p>' . "\n"; |
| 69 |
echo '<p>s2Member will automatically detect links, anywhere in your content, and/or anywhere in your theme files, that contain <code>s2member_file_download</code> or <code>s2member-files</code>. Whenever a logged-in Member clicks a link that contains <code>s2member_file_download</code> or <code>s2member-files</code>, the system will politely ask the user to confirm the download using a very intuitive JavaScript confirmation prompt, which contains specific details about your configured download limitations. This way your Members will be aware of how many files they\'ve downloaded in the current period; and they\'ll be able to make a conscious decision about whether to proceed with a specific download or not. If you want to suppress this JavaScript confirmation prompt, you can add this to the end of your links: <code>&s2member_skip_confirmation</code>. Shortcode alternative: <code>[s2File skip_confirmation="yes" /]</code>.</p>' . "\n"; |
| 70 |
echo '<p><em>* The above only applies to Users who are logged in as Members. For all other visitors in the general public, the <code>?s2member_file_download</code> links will redirect them your Membership Options Page, so that new visitors can signup, in order to gain access, by becoming a Member. You may also want to have a look down below at s2Member\'s "Advanced Download Restrictions", which provides a greater degree of flexibility.</em></p>' . "\n"; |
| 71 |
/**/ |
| 72 |
echo '<div class="ws-menu-page-hr"></div>' . "\n"; |
| 73 |
/**/ |
| 74 |
echo '<table class="form-table" style="margin-top:0;">' . "\n"; |
| 75 |
echo '<tbody>' . "\n"; |
| 76 |
/**/ |
| 77 |
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++) |
| 78 |
{ |
| 79 |
echo '<tr>' . "\n"; |
| 80 |
/**/ |
| 81 |
echo '<th style="padding-top:0;">' . "\n"; |
| 82 |
echo '<label for="ws-plugin--s2member-level' . $n . '-file-downloads-allowed">' . "\n"; |
| 83 |
echo ($n === $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]) ? 'File Downloads ( Highest Level #' . $n . ' ):' . "\n" : 'File Downloads ( Level #' . $n . ' Or Higher ):' . "\n"; |
| 84 |
echo '</label>' . "\n"; |
| 85 |
echo '</th>' . "\n"; |
| 86 |
/**/ |
| 87 |
echo '</tr>' . "\n"; |
| 88 |
echo '<tr>' . "\n"; |
| 89 |
/**/ |
| 90 |
echo '<td>' . "\n"; |
| 91 |
echo '<input type="text" name="ws_plugin__s2member_level' . $n . '_file_downloads_allowed" id="ws-plugin--s2member-level' . $n . '-file-downloads-allowed" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_file_downloads_allowed"]) . '" style="width:200px;" maxlength="9" /> every <input type="text" name="ws_plugin__s2member_level' . $n . '_file_downloads_allowed_days" id="ws-plugin--s2member-level' . $n . '-file-downloads-allowed-days" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_file_downloads_allowed_days"]) . '" style="width:200px;" maxlength="3" onkeyup="if(this.value > 365){ alert(\'( 365 days is the maximum ).\\nThis keeps the logs optimized.\'); this.value = 365; }" /> day(s).<br />' . "\n"; |
| 92 |
echo 'Only this many unique downloads will be permitted every X day(s), at ' . (($n === $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]) ? 'highest Level #' . $n : 'Level #' . $n . ' or higher') . '.<br />' . "\n"; |
| 93 |
echo '<em>* To allow UNLIMITED downloads, use: <code>999999999</code> ( i.e. <code>999999999</code> = unlimited ).</em>' . "\n"; |
| 94 |
echo '</td>' . "\n"; |
| 95 |
/**/ |
| 96 |
echo '</tr>' . "\n"; |
| 97 |
/**/ |
| 98 |
echo ($n < $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]) ? '<tr><td><div class="ws-menu-page-hr" style="margin:10px 0 10px 0;"></div></td></tr>' : ''; |
| 99 |
} |
| 100 |
/**/ |
| 101 |
echo '</tbody>' . "\n"; |
| 102 |
echo '</table>' . "\n"; |
| 103 |
echo '</div>' . "\n"; |
| 104 |
/**/ |
| 105 |
echo '</div>' . "\n"; |
| 106 |
/**/ |
| 107 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_after_restrictions", get_defined_vars ()); |
| 108 |
} |
| 109 |
/**/ |
| 110 |
if (apply_filters ("ws_plugin__s2member_during_down_ops_page_during_left_sections_display_limit_exceeded_page", true, get_defined_vars ())) |
| 111 |
{ |
| 112 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_before_limit_exceeded_page", get_defined_vars ()); |
| 113 |
/**/ |
| 114 |
echo '<div class="ws-menu-page-group" title="Download Limit Exceeded Page">' . "\n"; |
| 115 |
/**/ |
| 116 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-limit-exceeded-page-section">' . "\n"; |
| 117 |
echo '<h3>Download Limit Exceeded Page ( required, if providing access to protected files )</h3>' . "\n"; |
| 118 |
echo '<p>This Page will be shown when/if a Member reaches their download limit, based on your configuration of <strong>Basic Download Restrictions</strong> above. This Page should be created by you, in WordPress®. This Page should provide an informative message to the Member, describing your file access restrictions. Just tell them a little bit about your policy on file downloads, and why they might have reached this Page.</p>' . "\n"; |
| 119 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_during_limit_exceeded_page", get_defined_vars ()); |
| 120 |
/**/ |
| 121 |
echo '<table class="form-table">' . "\n"; |
| 122 |
echo '<tbody>' . "\n"; |
| 123 |
echo '<tr>' . "\n"; |
| 124 |
/**/ |
| 125 |
echo '<th>' . "\n"; |
| 126 |
echo '<label for="ws-plugin--s2member-file-download-limit-exceeded-page">' . "\n"; |
| 127 |
echo 'Download Limit Exceeded Page:' . "\n"; |
| 128 |
echo '</label>' . "\n"; |
| 129 |
echo '</th>' . "\n"; |
| 130 |
/**/ |
| 131 |
echo '</tr>' . "\n"; |
| 132 |
echo '<tr>' . "\n"; |
| 133 |
/**/ |
| 134 |
echo '<td>' . "\n"; |
| 135 |
echo '<select name="ws_plugin__s2member_file_download_limit_exceeded_page" id="ws-plugin--s2member-file-download-limit-exceeded-page">' . "\n"; |
| 136 |
echo '<option value="">— Select —</option>' . "\n"; |
| 137 |
foreach (($ws_plugin__s2member_temp_a = array_merge ((array)get_pages ())) as $ws_plugin__s2member_temp_o) |
| 138 |
echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '"' . (($ws_plugin__s2member_temp_o->ID == $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"]) ? ' selected="selected"' : '') . '>' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n"; |
| 139 |
echo '</select><br />' . "\n"; |
| 140 |
echo 'We recommend the following title: <code>Download Limit Exceeded</code>.' . "\n"; |
| 141 |
echo '</td>' . "\n"; |
| 142 |
/**/ |
| 143 |
echo '</tr>' . "\n"; |
| 144 |
echo '</tbody>' . "\n"; |
| 145 |
echo '</table>' . "\n"; |
| 146 |
echo '</div>' . "\n"; |
| 147 |
/**/ |
| 148 |
echo '</div>' . "\n"; |
| 149 |
/**/ |
| 150 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_after_limit_exceeded_page", get_defined_vars ()); |
| 151 |
} |
| 152 |
/**/ |
| 153 |
if (apply_filters ("ws_plugin__s2member_during_down_ops_page_during_left_sections_display_advanced_restrictions", true, get_defined_vars ())) |
| 154 |
{ |
| 155 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_before_advanced_restrictions", get_defined_vars ()); |
| 156 |
/**/ |
| 157 |
echo '<div class="ws-menu-page-group" title="Advanced Download Restrictions">' . "\n"; |
| 158 |
/**/ |
| 159 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-restrictions-section">' . "\n"; |
| 160 |
echo '<h3>Advanced Download Restrictions ( optional, for greater flexibility )</h3>' . "\n"; |
| 161 |
echo '<p>By default, s2Member uses your Basic Download Restrictions, as configured above. However, you can force s2Member to allow File Downloads, using an extra query string parameter: <code>&s2member_file_download_key=[Key]</code>. A File Download `Key` is passed through this parameter; it tells s2Member to allow the download of this particular file, regardless of Membership Level; and WITHOUT checking any Basic Restrictions, that you may or may not have configured above. The creation of a File Download `Key`, requires a small PHP code snippet. In order to use PHP scripting inside your Posts/Pages, you\'ll need to install this handy plugin ( <a href="http://wordpress.org/extend/plugins/php-execution-plugin/" target="_blank" rel="external">PHP Execution</a> ). There is also a Shortcode equivalent, which does NOT require PHP at all, as seen below.</p>' . "\n"; |
| 162 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_during_advanced_restrictions", get_defined_vars ()); |
| 163 |
/**/ |
| 164 |
echo '<div class="ws-menu-page-hr"></div>' . "\n"; |
| 165 |
/**/ |
| 166 |
echo '<p>' . esc_html (site_url ("/?s2member_file_download=example-file.zip")) . '<code>&s2member_file_download_key=<?php echo s2member_file_download_key("example-file.zip"); ?></code><br /> <small><em><strong>s2member_file_download_key</strong> = <?php echo s2member_file_download_key("file, relative to the /' . esc_html (c_ws_plugin__s2member_utils_dirs::basename_dir_app_data ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/ directory"); ?></em></small></p>' . "\n"; |
| 167 |
/**/ |
| 168 |
echo '<div class="ws-menu-page-hr"></div>' . "\n"; |
| 169 |
/**/ |
| 170 |
echo '<p>' . esc_html (site_url ("/?s2member_file_download=example-file.zip")) . '<code>&s2member_file_download_key=[s2Key file_download="example-file.zip" /]</code><br /> <small><em><strong>Shortcode equivalent:</strong> <code>[s2Key file_download="example-file.zip" /]</code></em></small></p>' . "\n"; |
| 171 |
/**/ |
| 172 |
echo '<div class="ws-menu-page-hr"></div>' . "\n"; |
| 173 |
/**/ |
| 174 |
echo '<p><code>[s2File download="example-file.zip" download_key="true" /]</code> <em>( Key is auto-generated in this case )</em><br /> <small><em><strong>Shortcode equivalent:</strong> <code>[s2File /]</code> produces the entire URL, no need to generate a Key yourself.</em></small></p>' . "\n"; |
| 175 |
/**/ |
| 176 |
echo '<div class="ws-menu-page-hr"></div>' . "\n"; |
| 177 |
/**/ |
| 178 |
echo '<p>The function <a href="http://www.primothemes.com/forums/viewtopic.php?f=40&t=12453#src_doc_s2member_file_download_key%28%29" target="_blank" rel="external">s2member_file_download_key()</a>, is part of the s2Member API. It produces a time-sensitive File Download Key that is unique to each and every visitor. Each Key it produces <em>( at the time it is produced )</em>, will be valid for the current day, and only for a specific IP address and User-Agent string; as detected by s2Member. This makes it possible for you to create links on your site, which provide access to protected file downloads; and without having to worry about one visitor sharing their link with another. So let\'s take a quick look at what <code>s2member_file_download_key()</code> actually produces.</p>' . "\n"; |
| 179 |
echo '<p><code>s2member_file_download_key("example-file.zip")</code> = a site-specific hash of: <code>date("Y-m-d").$_SERVER["REMOTE_ADDR"].$_SERVER["HTTP_USER_AGENT"].$file</code></p>' . "\n"; |
| 180 |
echo '<p>When <code>s2member_file_download_key = <em>a valid Key</em></code>, it works independently from Member Level Access. That is, a visitor does NOT have to be logged in to receive access; they just need a valid Key. Using this advanced technique, you could extend s2Member\'s file protection routines, or even combine them with Specific Post/Page Access, and more. The possibilities are limitless really.</p>' . "\n"; |
| 181 |
/**/ |
| 182 |
echo '</div>' . "\n"; |
| 183 |
/**/ |
| 184 |
echo '</div>' . "\n"; |
| 185 |
/**/ |
| 186 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_after_advanced_restrictions", get_defined_vars ()); |
| 187 |
} |
| 188 |
/**/ |
| 189 |
if (apply_filters ("ws_plugin__s2member_during_down_ops_page_during_left_sections_display_inline_extensions", true, get_defined_vars ())) |
| 190 |
{ |
| 191 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_before_inline_extensions", get_defined_vars ()); |
| 192 |
/**/ |
| 193 |
echo '<div class="ws-menu-page-group" title="Inline File Extensions">' . "\n"; |
| 194 |
/**/ |
| 195 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-inline-extensions-section">' . "\n"; |
| 196 |
echo '<h3>Inline File Extensions ( optional, for content-disposition )</h3>' . "\n"; |
| 197 |
echo '<p>There are two ways to serve files. Inline, or as an Attachment. By default, s2Member will serve all of your protected files, as downloadable attachments. Meaning, visitors will be given a file download prompt. Otherwise known as <code>Content-Disposition: attachment</code>. In some cases though, you may wish to serve files inline. For example, PDF files and images should usually be served inline. When you serve a file inline, it is displayed in your browser immediately, rather than your browser prompting you to download the file as an attachment.</p>' . "\n"; |
| 198 |
echo '<p>Using the field below, you can list all of the extensions that you want s2Member to serve inline ( ex: <code>htm,html,pdf,jpg,jpeg,jpe,gif,png,mp3,mp4,flv,ogg,webm</code> ). Please understand, some files just cannot be displayed inline. For instance, there is no way to display an <code>exe</code> file inline. So only specify extensions that can, and should be displayed inline by a web browser. Alternatively, if you would rather handle this on a case-by-case basis, you can simply add the following to the end of your download links: <code>&s2member_file_inline=yes</code>. Shortcode alternative: <code>[s2File download="example-file.zip" inline="yes" /]</code>.</p>' . "\n"; |
| 199 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_during_inline_extensions", get_defined_vars ()); |
| 200 |
/**/ |
| 201 |
echo '<table class="form-table">' . "\n"; |
| 202 |
echo '<tbody>' . "\n"; |
| 203 |
echo '<tr>' . "\n"; |
| 204 |
/**/ |
| 205 |
echo '<th>' . "\n"; |
| 206 |
echo '<label for="ws-plugin--s2member-file-download-inline-extensions">' . "\n"; |
| 207 |
echo 'Default Inline File Extensions ( comma-delimited ):' . "\n"; |
| 208 |
echo '</label>' . "\n"; |
| 209 |
echo '</th>' . "\n"; |
| 210 |
/**/ |
| 211 |
echo '</tr>' . "\n"; |
| 212 |
echo '<tr>' . "\n"; |
| 213 |
/**/ |
| 214 |
echo '<td>' . "\n"; |
| 215 |
echo '<input type="text" name="ws_plugin__s2member_file_download_inline_extensions" id="ws-plugin--s2member-file-download-inline-extensions" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_inline_extensions"]) . '" /><br />' . "\n"; |
| 216 |
echo 'Inline extensions, comma-delimited. Ex: <code>htm,html,pdf,jpg,jpeg,jpe,gif,png,mp3,mp4,flv,ogg,webm</code>' . "\n"; |
| 217 |
echo '</td>' . "\n"; |
| 218 |
/**/ |
| 219 |
echo '</tr>' . "\n"; |
| 220 |
echo '</tbody>' . "\n"; |
| 221 |
echo '</table>' . "\n"; |
| 222 |
echo '</div>' . "\n"; |
| 223 |
/**/ |
| 224 |
echo '</div>' . "\n"; |
| 225 |
/**/ |
| 226 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_after_inline_extensions", get_defined_vars ()); |
| 227 |
} |
| 228 |
/**/ |
| 229 |
if (apply_filters ("ws_plugin__s2member_during_down_ops_page_during_left_sections_display_remote_authorization", true, get_defined_vars ())) |
| 230 |
{ |
| 231 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_before_remote_authorization", get_defined_vars ()); |
| 232 |
/**/ |
| 233 |
echo '<div class="ws-menu-page-group" title="Remote Auth / Podcasting">' . "\n"; |
| 234 |
/**/ |
| 235 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-remote-authorization-section">' . "\n"; |
| 236 |
echo '<h3>Remote Header Authorization ( optional )</h3>' . "\n"; |
| 237 |
echo '<p>This can be enabled on a case-by-case basis. Just add this to the end of your download links: <code>&s2member_file_remote=yes</code>. Shortcode alternative: <code>[s2File download="example-file.zip" remote="yes" /]</code>.</p>' . "\n"; |
| 238 |
echo '<p>Remote Header Authorization allows access to file downloads through an entirely different approach. Instead of asking the Member to log into your site through a browser, a Member will be prompted automatically, to log in through HTTP Header Authorization prompts; which is the same technique used in more traditional security systems via .htaccess files. In other words, Remote Header Authorization makes it possible for your Members to access files through remote applications that may NOT use a browser. This is often the case when a Member needs to access protected files through a software client like iTunes®; typical with podcasts. See <a href="http://www.primothemes.com/forums/viewtopic.php?f=4&t=837&p=28558#p28558" target="_blank" rel="external">tutorial here</a> for details about how to setup a Podcast for iTunes®.</p>' . "\n"; |
| 239 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_during_remote_authorization", get_defined_vars ()); |
| 240 |
echo '</div>' . "\n"; |
| 241 |
/**/ |
| 242 |
echo '</div>' . "\n"; |
| 243 |
/**/ |
| 244 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_after_remote_authorization", get_defined_vars ()); |
| 245 |
} |
| 246 |
/**/ |
| 247 |
if (apply_filters ("ws_plugin__s2member_during_down_ops_page_during_left_sections_display_amazon_s3", true, get_defined_vars ())) |
| 248 |
{ |
| 249 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_before_amazon_s3", get_defined_vars ()); |
| 250 |
/**/ |
| 251 |
echo '<div class="ws-menu-page-group" title="Amazon® S3/CDN Storage Option"' . (($GLOBALS["ws_plugin__s2member_cf_auto_configure_distros_error"]) ? ' default-state="open"' : '') . '>' . "\n"; |
| 252 |
/**/ |
| 253 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-amazon-s3-section">' . "\n"; |
| 254 |
echo '<h3>Amazon® S3/CDN Storage & Delivery ( optional )</h3>' . "\n"; |
| 255 |
echo '<a href="http://aws.amazon.com/s3/" target="_blank"><img src="' . esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/amazon-logo.png" class="ws-menu-page-right" style="width:250px; height:100px; border:0;" alt="." /></a>' . "\n"; |
| 256 |
echo '<p>Please note, all of this is optional. s2Member can be configured here to ONLY use Amazon® S3 <em>( i.e. without Amazon® CloudFront )</em>. Or, s2Member can be configured to use BOTH Amazon® S3 and Amazon® CloudFront together. If you want to use Amazon® S3 Storage, but you don\'t care about Amazon® CloudFront, feel free to leave the entire Amazon® CloudFront section empty. The configuration options in the Amazon® CloudFront section are ONLY required if you are planning to use both Amazon® S3 and Amazon® CloudFront together.</p>' . "\n"; |
| 257 |
echo '<p>Amazon® Simple Storage Service ( <a href="http://aws.amazon.com/s3/" target="_blank" rel="external">Amazon® S3</a> ). Amazon® S3 is storage for the Internet. It is designed to make web-scale computing easier for developers. Amazon® S3 provides a simple web services interface that can be used to store and retrieve any amount of data, at any time, from anywhere on the web. It gives developers access to the same highly scalable, reliable, secure, fast, inexpensive infrastructure that Amazon® uses to run its own global network of web sites. s2Member has been integrated with Amazon® S3, so that <em>( if you wish )</em>, instead of using the <code>/' . esc_html (c_ws_plugin__s2member_utils_dirs::basename_dir_app_data ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/</code> directory, you can store all of your protected files inside an Amazon® S3 Bucket.</p>' . "\n"; |
| 258 |
echo '<p>If you configure the options below, s2Member will assume all protected files are inside your Amazon® S3 Bucket; and the <code>/' . esc_html (c_ws_plugin__s2member_utils_dirs::basename_dir_app_data ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/</code> directory is no longer used at all. That being said, all other aspects of s2Member\'s File Download protection remain the same. The only thing that changes, is the location of your protected files. In other words, Basic Download Restrictions, Download Keys, Inline Extensions, Custom Capability and/or Membership Level Files will all continue to work just as before. The only difference is that s2Member will use your Amazon® S3 Bucket as a CDN <em>( i.e. Content Delivery Network )</em> instead of the local <code>/' . esc_html (c_ws_plugin__s2member_utils_dirs::basename_dir_app_data ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/</code> directory.</p>' . "\n"; |
| 259 |
echo '<p>s2Member assumes that you\'re creating a new Amazon® S3 Bucket, specifically for this installation; and that your Bucket is NOT available publicly. In other words, if you type this URL into your browser <em>( i.e. <code>http://your-bucket-name.s3.amazonaws.com/</code> )</em>, you should get an error that says: <code>Access Denied</code>. That\'s good, that\'s exactly what you want. You can create your Amazon® S3 Bucket using the <a href="https://console.aws.amazon.com/s3/home" target="_blank" rel="external">Amazon® interface</a>. Or, some people prefer to use this popular Firefox® extension ( <a href="http://www.s3fox.net/" target="_blank" rel="external">S3 Fox Organizer</a> ).</p>' . "\n"; |
| 260 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_during_amazon_s3", get_defined_vars ()); |
| 261 |
/**/ |
| 262 |
echo '<div class="ws-menu-page-hr"></div>' . "\n"; |
| 263 |
/**/ |
| 264 |
echo '<p><em><strong>Dev Note w/Technical Details:</strong> s2Member uses "Query String Authentication", provided by the Amazon® S3 API. Documented for developers <a href="http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?RESTAuthentication.html" target="_blank" rel="external">here</a>. To put it simply, s2Member will generate S3 authenticated redirect URLs ( internally ); which allow Customers temporary access to specific files inside your S3 Bucket. s2Member\'s Query String Authentication through Amazon® S3 gives a Customer 30 seconds to connect to the file inside your S3 Bucket ( i.e. the automatic redirection URL ). This connection period of 30 seconds is largely irrelevant when used in combination with s2Member. It just needs to be a low value, to further prevent any possibility of S3 authenticated link sharing. If you need to change this connection timeout of <code>30 seconds</code> for some reason ( not likely ), you can use this WordPress® Filter: <code>ws_plugin__s2member_amazon_s3_file_expires_time</code>. If you need help, please check the s2Member Forums.</em></p>' . "\n"; |
| 265 |
echo '<p><em><strong>Linking To Protected Files:</strong> Nothing changes. s2Member\'s integration with Amazon® S3 serves protected files through the same links that all s2Member site owners use. For example, you might use: <code>' . esc_html (site_url ("/?s2member_file_download=example-file.zip")) . '</code>, where <strong>s2member_file_download</strong> = the file, relative to the root of your Amazon® S3 Bucket. In other words, just the file name in most cases. s2Member will redirect Users/Members to a digitally signed Amazon® S3 URL, which allows them access to a particular file via Amazon® S3. For further details, please review this section of your Dashboard: <code>s2Member -> Download Options -> Basic Download Restrictions</code>. Also see: <code>s2Member -> Download Options -> Advanced Mod-Rewrite Linkage</code>.</em></p>' . "\n"; |
| 266 |
echo '<p><em><strong>Content Type, Disposition & Inline Files:</strong> The query string parameter <code>&s2member_file_inline=yes</code> DOES work for files served directly through Amazon® S3. s2Member DOES have control over the <code>Content-Type</code> and <code>Content-Disposition</code> headers for files being served through Amazon® S3. However, Amazon® CloudFront servers do NOT automatically determine the MIME type for the objects they serve. If you integrate both Amazon® S3 and CloudFront, s2Member will NOT have control over headers. Therefore, when you upload a file to your Amazon® S3 Bucket, you should set its Content-Type header. Again, with the Amazon® S3/CloudFront combination, you MUST configure headers yourself ( such as <code>Content-Type: video/webm</code>, or <code>Content-Disposition: inline|attachment</code> ) that you want Amazon® CloudFront to send for a particular file. It\'s quite easy. You do this by setting <code>Properties -> Metadata ( i.e. headers )</code> on a per-file basis, from inside your Amazon® S3 Management Console. In short, when you upload a file to your Amazon® S3 Bucket, if you want that file to be served a certain way, be sure to configure its <code>Properties -> Metadata</code> accordingly.</em></p>' . "\n"; |
| 267 |
/**/ |
| 268 |
echo '<div class="ws-menu-page-hr"></div>' . "\n"; |
| 269 |
/**/ |
| 270 |
echo '<table class="form-table" style="margin-top:0;">' . "\n"; |
| 271 |
echo '<tbody>' . "\n"; |
| 272 |
echo '<tr>' . "\n"; |
| 273 |
/**/ |
| 274 |
echo '<th style="padding-top:0;">' . "\n"; |
| 275 |
echo '<label for="ws-plugin--s2member-amazon-s3-files-bucket">' . "\n"; |
| 276 |
echo 'Amazon® S3 File Bucket ( where protected files are ):' . "\n"; |
| 277 |
echo '</label>' . "\n"; |
| 278 |
echo '</th>' . "\n"; |
| 279 |
/**/ |
| 280 |
echo '</tr>' . "\n"; |
| 281 |
echo '<tr>' . "\n"; |
| 282 |
/**/ |
| 283 |
echo '<td>' . "\n"; |
| 284 |
echo '<input type="text" name="ws_plugin__s2member_amazon_s3_files_bucket" id="ws-plugin--s2member-amazon-s3-files-bucket" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_s3_files_bucket"]) . '" /><br />' . "\n"; |
| 285 |
echo 'Your Amazon® S3 Bucket will be used, instead of the <code>/' . esc_html (c_ws_plugin__s2member_utils_dirs::basename_dir_app_data ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/</code> directory.' . "\n"; |
| 286 |
echo '</td>' . "\n"; |
| 287 |
/**/ |
| 288 |
echo '</tr>' . "\n"; |
| 289 |
echo '<tr>' . "\n"; |
| 290 |
/**/ |
| 291 |
echo '<th>' . "\n"; |
| 292 |
echo '<label for="ws-plugin--s2member-amazon-s3-files-access-key">' . "\n"; |
| 293 |
echo 'Amazon® Access Key ( Access Key ID ):' . "\n"; |
| 294 |
echo '</label>' . "\n"; |
| 295 |
echo '</th>' . "\n"; |
| 296 |
/**/ |
| 297 |
echo '</tr>' . "\n"; |
| 298 |
echo '<tr>' . "\n"; |
| 299 |
/**/ |
| 300 |
echo '<td>' . "\n"; |
| 301 |
echo '<input type="text" name="ws_plugin__s2member_amazon_s3_files_access_key" id="ws-plugin--s2member-amazon-s3-files-access-key" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_s3_files_access_key"]) . '" /><br />' . "\n"; |
| 302 |
echo 'See: <code>Amazon® Web Services Account -> Security Credentials -> Access Credentials</code>.' . "\n"; |
| 303 |
echo '</td>' . "\n"; |
| 304 |
/**/ |
| 305 |
echo '</tr>' . "\n"; |
| 306 |
echo '<tr>' . "\n"; |
| 307 |
/**/ |
| 308 |
echo '<th>' . "\n"; |
| 309 |
echo '<label for="ws-plugin--s2member-amazon-s3-files-secret-key">' . "\n"; |
| 310 |
echo 'Amazon® Secret Key ( Secret Access Key ):' . "\n"; |
| 311 |
echo '</label>' . "\n"; |
| 312 |
echo '</th>' . "\n"; |
| 313 |
/**/ |
| 314 |
echo '</tr>' . "\n"; |
| 315 |
echo '<tr>' . "\n"; |
| 316 |
/**/ |
| 317 |
echo '<td>' . "\n"; |
| 318 |
echo '<input type="password" name="ws_plugin__s2member_amazon_s3_files_secret_key" id="ws-plugin--s2member-amazon-s3-files-secret-key" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_s3_files_secret_key"]) . '" /><br />' . "\n"; |
| 319 |
echo 'See: <code>Amazon® Web Services Account -> Security Credentials -> Access Credentials</code>.' . "\n"; |
| 320 |
echo '</td>' . "\n"; |
| 321 |
/**/ |
| 322 |
echo '</tr>' . "\n"; |
| 323 |
echo '</tbody>' . "\n"; |
| 324 |
echo '</table>' . "\n"; |
| 325 |
echo '</div>' . "\n"; |
| 326 |
/**/ |
| 327 |
echo '</div>' . "\n"; |
| 328 |
/**/ |
| 329 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_after_amazon_s3", get_defined_vars ()); |
| 330 |
} |
| 331 |
/**/ |
| 332 |
if (apply_filters ("ws_plugin__s2member_during_down_ops_page_during_left_sections_display_amazon_cf", true, get_defined_vars ())) |
| 333 |
{ |
| 334 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_before_amazon_cf", get_defined_vars ()); |
| 335 |
/**/ |
| 336 |
echo '<div class="ws-menu-page-group" title="Amazon® S3/CloudFront CDN Storage Option"' . (($GLOBALS["ws_plugin__s2member_cf_auto_configure_distros_error"]) ? ' default-state="open"' : '') . '>' . "\n"; |
| 337 |
/**/ |
| 338 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-amazon-cf-section">' . "\n"; |
| 339 |
echo '<h3>Amazon® S3/CloudFront CDN Storage & Delivery ( optional )</h3>' . "\n"; |
| 340 |
echo '<a href="http://aws.amazon.com/cloudfront/" target="_blank"><img src="' . esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/amazon-logo.png" class="ws-menu-page-right" style="width:250px; height:100px; border:0;" alt="." /></a>' . "\n"; |
| 341 |
echo '<p>Please note, all of this is optional. s2Member can be configured to ONLY use Amazon® S3 <em>( i.e. without Amazon® CloudFront )</em>. Or, s2Member can be configured to use BOTH Amazon® S3 and Amazon® CloudFront together. If you don\'t want to use Amazon® CloudFront, please leave this entire section empty. The configuration options in this section are ONLY required if you are planning to use both Amazon® S3 and Amazon® CloudFront together.</p>' . "\n"; |
| 342 |
echo '<p>Amazon® Simple Storage Service ( <a href="http://aws.amazon.com/s3/" target="_blank" rel="external">Amazon® S3</a> ) combined with <a href="http://aws.amazon.com/cloudfront/" target="_blank" rel="external">Amazon® CloudFront</a>. Amazon® CloudFront is a web service for content delivery. It integrates with other Amazon® Web Services <em>( i.e. Amazon® S3 Storage )</em> to give developers and businesses an easy way to distribute content to end users with low latency, and with high data transfer speeds. Amazon® CloudFront delivers your static and streaming content using a global network of edge locations. Requests for your Amazon® S3 Bucket Objects <em>( i.e. your protected files )</em> are automatically routed to the nearest edge location, so content is delivered with the best possible performance. s2Member has been integrated with both Amazon® S3 and with Amazon® CloudFront. So <em>( if you wish )</em>, instead of using the <code>/' . esc_html (c_ws_plugin__s2member_utils_dirs::basename_dir_app_data ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/</code> directory, you can store all of your protected files inside an Amazon® S3 Bucket and serve them via Amazon® CloudFront. But again, please understand, the configuration options in this section are ONLY required if you\'re going to use both Amazon® S3 & CloudFront together.</p>' . "\n"; |
| 343 |
echo '<p><strong>One of the great things about Amazon® CloudFront</strong>, is its ability to <strong>stream/seek media files</strong> in the truest sense of the word. For sites delivering protected <em>FLV/MP4/OGG/WEBM</em> and other streaming audio/video file types over the <em>RTMP</em> protocol, Amazon® CloudFront is our recommendation. Once you\'ve successfully configured s2Member to use both Amazon® S3 and Amazon® CloudFront together, please review the section below regarding <code>JW Player® & RTMP Protocol Examples</code>. s2Member will automatically serve your protected files over the <em>RTMP</em> protocol using an Amazon® CloudFront Streaming Distribution.</p>' . "\n"; |
| 344 |
echo '<p>If you configure the options below, s2Member will assume all protected files are inside your Amazon® S3 Bucket; and the <code>/' . esc_html (c_ws_plugin__s2member_utils_dirs::basename_dir_app_data ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/</code> directory is no longer used at all. That being said, all other aspects of s2Member\'s File Download protection remain the same. The only thing that changes, is the location of your protected files. In other words, Basic Download Restrictions, Download Keys, Custom Capability and/or Membership Level Files will all continue to work just as before. The only difference is that s2Member will use your Amazon® S3 Bucket, automatically connecting it to both of the Amazon® CloudFront Distributions, which s2Member auto-configures for you <em>( see below )</em>. In this way, s2Member uses Amazon® CloudFront as a CDN <em>( i.e. Content Delivery Network )</em> for your protected files.</p>' . "\n"; |
| 345 |
echo '<p>s2Member assumes that you\'re creating a new Amazon® S3 Bucket, specifically for this installation; and that your Bucket is NOT available publicly. In other words, if you type this URL into your browser <em>( i.e. <code>http://your-bucket-name.s3.amazonaws.com/</code> )</em>, you should get an error that says: <code>Access Denied</code>. That\'s good, that\'s exactly what you want. You can create your Amazon® S3 Bucket using the <a href="https://console.aws.amazon.com/s3/home" target="_blank" rel="external">Amazon® interface</a>. Or, some people prefer to use this popular Firefox® extension ( <a href="http://www.s3fox.net/" target="_blank" rel="external">S3 Fox Organizer</a> ). You will also need to enable CloudFront inside your Web Services account at Amazon®. Don\'t worry about creating or configuring any CloudFront Distributions, s2Member will auto-create and auto-configure those for you, allowing you to serve protected files.</p>' . "\n"; |
| 346 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_during_amazon_cf", get_defined_vars ()); |
| 347 |
/**/ |
| 348 |
echo '<div class="ws-menu-page-hr"></div>' . "\n"; |
| 349 |
/**/ |
| 350 |
echo '<p><em><strong>Dev Note w/Technical Details:</strong> s2Member\'s auto-configuration routines for Amazon® CloudFront (below), are designed to create & configure various components on your Amazon® Web Services account, which are all requirements for you to <a href="http://docs.amazonwebservices.com/AmazonCloudFront/2010-11-01/DeveloperGuide/index.html?HowToPrivateContent.html" target="_blank" rel="external">serve protected files through the Amazon® S3/CloudFront combination</a>. These components include: an Origin Access Identity, read permissions for the Origin Access Identity, and two private content Distributions. One private content Distribution for file downloads, and another private content Distribution for streaming media files; both connected to and sourced by your Amazon® S3 Bucket. In addition, s2Member will automatically configure an ACL & Policy ( i.e. permissions ) on your Amazon® S3 Bucket to make sure your protected object/files are NOT available to the public.</em></p>' . "\n"; |
| 351 |
echo '<p><em><strong>Linking To Protected Files:</strong> Streamed files are special, but nothing else changes. s2Member\'s integration with Amazon® S3/CloudFront serves protected files through the same links that all s2Member site owners use. For example, you might use: <code>' . esc_html (site_url ("/?s2member_file_download=example-file.zip")) . '</code>, where <strong>s2member_file_download</strong> = the file, relative to the root of your Amazon® S3 Bucket. In other words, just the file name in most cases. s2Member will redirect Users/Members to a digitally signed Amazon® CloudFront URL, which allows them access to a particular file via Amazon® CloudFront. For further details, please review this section of your Dashboard: <code>s2Member -> Download Options -> Basic Download Restrictions</code>. Also see: <code>s2Member -> Download Options -> Advanced Mod-Rewrite Linkage</code>. For streaming audio/video files, please review the section below: <code>JW Player® & RTMP Protocol Examples</code>.</em></p>' . "\n"; |
| 352 |
echo '<p><em><strong>Content Type, Disposition & Inline Files:</strong> An IMPORTANT issue. The query string parameter <code>&s2member_file_inline=yes</code> does NOTHING for files served via Amazon® CloudFront. s2Member has NO control over the <code>Content-Type</code> and/or <code>Content-Disposition</code> headers for a file being served through Amazon® CloudFront, and CloudFront servers do NOT automatically determine the MIME type for the objects they serve. Therefore, when you upload a file to your Amazon® S3 Bucket, you should set its Content-Type header. That is, you MUST configure headers yourself ( such as <code>Content-Type: video/webm</code>, or <code>Content-Disposition: inline|attachment</code> ) that you want Amazon® CloudFront to send for a particular file. It\'s quite easy. You do this by setting <code>Properties -> Metadata ( i.e. headers )</code> on a per-file basis, from inside your Amazon® S3 Management Console. In short, when you upload a file to your Amazon® S3 Bucket, if you want that file to be served a certain way, be sure to configure its <code>Properties -> Metadata</code> accordingly.</em></p>' . "\n"; |
| 353 |
echo (stripos (PHP_OS, "win") === 0 && (stripos ($_SERVER["HTTP_HOST"], "localhost") !== false || strpos ($_SERVER["HTTP_HOST"], "127.0.0.1") !== false || (defined ("LOCALHOST") && LOCALHOST))) ? '<p><em><strong>Localhost Developers:</strong> s2Member\'s Amazon® CloudFront integration requires the <a href="http://php.net/manual/en/function.openssl-sign.php" target="_blank" rel="external">openssl_sign()</a> function in PHP so it can digitially sign CloudFront® URLs. This function is sometimes problematic on localhost servers such as WAMP & EasyPHP. We recommend installing <a href="http://www.slproweb.com/products/Win32OpenSSL.html" target="_blank" rel="external">this lightweight alternative for Windows®</a> while you\'re developing. s2Member will automatically find it here: <code>C:\OpenSSL-Win[32/64]\bin\openssl.exe</code>.' . ((file_exists ("c:\openssl-win32\bin\openssl.exe") || file_exists ("c:\openssl-win64\bin\openssl.exe")) ? ' <strong class="ws-menu-page-hilite">( s2Member has detected that OpenSSL-Win[32/64] IS installed in the correct location, thank you! )</strong>' : ' <strong class="ws-menu-page-hilite">( s2Member has detected that OpenSSL-Win[32/64] is NOT currently available )</strong>') . '</em></p>' . "\n" : ''; |
| 354 |
/**/ |
| 355 |
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distros_auto_config_status"] === "configured") |
| 356 |
echo '<p><em class="ws-menu-page-hilite"><strong>Your Amazon® CloudFront Distributions are: ( ALREADY configured! )</strong></em>' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_downloads_cname"]) ? '<br /><em class="ws-menu-page-hilite">Downloads Distribution CNAME:</em> <em><code>' . esc_html ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_downloads_cname"]) . ' —» ' . esc_html ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_downloads_dname"]) . '</code></em>' : '') . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_streaming_cname"]) ? '<br /><em class="ws-menu-page-hilite">Streaming Distribution CNAME:</em> <em><code>' . esc_html ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_streaming_cname"]) . ' —» ' . esc_html ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_streaming_dname"]) . '</code></em>' : '') . '</p>' . "\n"; |
| 357 |
/**/ |
| 358 |
else if (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distros_auto_config_status"]) |
| 359 |
echo '<p><em class="ws-menu-page-hilite"><strong>Your Amazon® CloudFront Distributions are: ( NOT yet auto-configured ).</strong></em></p>' . "\n"; |
| 360 |
/**/ |
| 361 |
echo '<div class="ws-menu-page-hr"></div>' . "\n"; |
| 362 |
/**/ |
| 363 |
echo '<table class="form-table" style="margin-top:0;">' . "\n"; |
| 364 |
echo '<tbody>' . "\n"; |
| 365 |
echo '<tr>' . "\n"; |
| 366 |
/**/ |
| 367 |
echo '<th style="padding-top:0;">' . "\n"; |
| 368 |
echo '<label for="ws-plugin--s2member-amazon-cf-files-private-key-id">' . "\n"; |
| 369 |
echo 'Amazon® CloudFront Key Pair ID ( your Key Pair ID ):' . "\n"; |
| 370 |
echo '</label>' . "\n"; |
| 371 |
echo '</th>' . "\n"; |
| 372 |
/**/ |
| 373 |
echo '</tr>' . "\n"; |
| 374 |
echo '<tr>' . "\n"; |
| 375 |
/**/ |
| 376 |
echo '<td>' . "\n"; |
| 377 |
echo '<input type="text" name="ws_plugin__s2member_amazon_cf_files_private_key_id" id="ws-plugin--s2member-amazon-cf-files-private-key-id" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_private_key_id"]) . '" data-s-prev-config-value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_private_key_id"]) . '" /><br />' . "\n"; |
| 378 |
echo 'See: <code>Amazon® Web Services Account -> Security Credentials -> Key Pairs</code>.' . "\n"; |
| 379 |
echo '</td>' . "\n"; |
| 380 |
/**/ |
| 381 |
echo '</tr>' . "\n"; |
| 382 |
echo '<tr>' . "\n"; |
| 383 |
/**/ |
| 384 |
echo '<th>' . "\n"; |
| 385 |
echo '<label for="ws-plugin--s2member-amazon-cf-files-private-key-entry">' . "\n"; |
| 386 |
echo 'Amazon® CloudFront Private Key ( contents of your <code>pk-[***].pem</code> file ):' . "\n"; |
| 387 |
echo '</label>' . "\n"; |
| 388 |
echo '</th>' . "\n"; |
| 389 |
/**/ |
| 390 |
echo '</tr>' . "\n"; |
| 391 |
echo '<tr>' . "\n"; |
| 392 |
/**/ |
| 393 |
echo '<td>' . "\n"; |
| 394 |
echo '<input type="hidden" name="ws_plugin__s2member_amazon_cf_files_private_key" id="ws-plugin--s2member-amazon-cf-files-private-key" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_private_key"]) . '" data-s-prev-config-value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_private_key"]) . '" />' . "\n"; |
| 395 |
echo '<textarea name="ws_plugin__s2member_amazon_cf_files_private_key_entry" id="ws-plugin--s2member-amazon-cf-files-private-key-entry" rows="3" wrap="off" spellcheck="false" style="font-family:Consolas, monospace;">' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_private_key"]) . '</textarea><br />' . "\n"; |
| 396 |
echo 'See: <code>Amazon® Web Services Account -> Security Credentials -> Key Pairs</code>.<br />' . "\n"; |
| 397 |
echo '<em>* Note, s2Member needs your <strong>Private Key file</strong>, NOT your Public Key file.</em>' . "\n"; |
| 398 |
echo '</td>' . "\n"; |
| 399 |
/**/ |
| 400 |
echo '</tr>' . "\n"; |
| 401 |
echo '<tr>' . "\n"; |
| 402 |
/**/ |
| 403 |
echo '<th>' . "\n"; |
| 404 |
echo '<label for="ws-plugin--s2member-amazon-cf-files-auto-configure-distros">' . "\n"; |
| 405 |
echo 'Auto-Configure your Amazon® S3/CloudFront combination?' . "\n"; |
| 406 |
echo '</label>' . "\n"; |
| 407 |
echo '</th>' . "\n"; |
| 408 |
/**/ |
| 409 |
echo '</tr>' . "\n"; |
| 410 |
echo '<tr>' . "\n"; |
| 411 |
/**/ |
| 412 |
echo '<td>' . "\n"; |
| 413 |
echo '<input type="checkbox" name="ws_plugin__s2member_amazon_cf_files_auto_configure_distros" id="ws-plugin--s2member-amazon-cf-files-auto-configure-distros" value="' . esc_attr (wp_create_nonce ("ws-plugin--s2member-amazon-cf-files-auto-configure-distros")) . '"' . (($GLOBALS["ws_plugin__s2member_cf_auto_configure_distros_error"]) ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--s2member-amazon-cf-files-auto-configure-distros"><strong>Yes</strong>, automatically configure my Amazon® CloudFront Distributions & Amazon® S3 ACLs for me.</label><br />' . "\n"; |
| 414 |
echo '<em>s2Member will auto-configure and/or delete & re-configure your Amazon® CloudFront Distributions for you.</em>' . "\n"; |
| 415 |
echo '</td>' . "\n"; |
| 416 |
/**/ |
| 417 |
echo '</tr>' . "\n"; |
| 418 |
echo '<tr>' . "\n"; |
| 419 |
/**/ |
| 420 |
echo '<td>' . "\n"; |
| 421 |
echo '<input type="checkbox" name="ws_plugin__s2member_amazon_cf_files_auto_configure_distros_w_cnames" id="ws-plugin--s2member-amazon-cf-files-auto-configure-distros-w-cnames" value="' . esc_attr (wp_create_nonce ("ws-plugin--s2member-amazon-cf-files-auto-configure-distros-w-cnames")) . '"' . (($GLOBALS["ws_plugin__s2member_cf_auto_configure_distros_error"] && ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_downloads_cname"] || $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_streaming_cname"])) ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--s2member-amazon-cf-files-auto-configure-distros-w-cnames"><strong>Yes</strong>, I want s2Member to auto-configure using custom CNAMES that I\'ll setup.</label><br />' . "\n"; |
| 422 |
echo '<em>* Optional, do NOT check this box unless you know what you\'re doing. This requires DNS changes.</em>' . "\n"; |
| 423 |
echo '</td>' . "\n"; |
| 424 |
/**/ |
| 425 |
echo '</tr>' . "\n"; |
| 426 |
echo '</tbody>' . "\n"; |
| 427 |
echo '</table>' . "\n"; |
| 428 |
/**/ |
| 429 |
echo '<div id="ws-plugin--s2member-amazon-cf-files-auto-configure-distro-cnames" style="display:none;">' . "\n"; |
| 430 |
echo '<table class="form-table">' . "\n"; |
| 431 |
echo '<tbody>' . "\n"; |
| 432 |
echo '<tr>' . "\n"; |
| 433 |
/**/ |
| 434 |
echo '<th>' . "\n"; |
| 435 |
echo '<label for="ws-plugin--s2member-amazon-cf-files-downloads-distro-cname">' . "\n"; |
| 436 |
echo 'Amazon® CloudFront CNAME for File Downloads ( optional ):' . "\n"; |
| 437 |
echo '</label>' . "\n"; |
| 438 |
echo '</th>' . "\n"; |
| 439 |
/**/ |
| 440 |
echo '</tr>' . "\n"; |
| 441 |
echo '<tr>' . "\n"; |
| 442 |
/**/ |
| 443 |
echo '<td>' . "\n"; |
| 444 |
echo '<input type="text" name="ws_plugin__s2member_amazon_cf_files_distro_downloads_cname" id="ws-plugin--s2member-amazon-cf-files-downloads-distro-cname" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_downloads_cname"]) . '" /><br />' . "\n"; |
| 445 |
echo 'Example: <code>s2-file-downloads.' . esc_html (c_ws_plugin__s2member_utils_urls::parse_url (site_url (), PHP_URL_HOST)) . '</code>.<br />' . "\n"; |
| 446 |
echo '<em>* Optional, do NOT fill this in unless you know what you\'re doing. This requires DNS changes.</em>' . "\n"; |
| 447 |
echo '</td>' . "\n"; |
| 448 |
/**/ |
| 449 |
echo '</tr>' . "\n"; |
| 450 |
echo '<tr>' . "\n"; |
| 451 |
/**/ |
| 452 |
echo '<th>' . "\n"; |
| 453 |
echo '<label for="ws-plugin--s2member-amazon-cf-files-streaming-distro-cname">' . "\n"; |
| 454 |
echo 'Amazon® CloudFront CNAME for Streaming Files ( optional ):' . "\n"; |
| 455 |
echo '</label>' . "\n"; |
| 456 |
echo '</th>' . "\n"; |
| 457 |
/**/ |
| 458 |
echo '</tr>' . "\n"; |
| 459 |
echo '<tr>' . "\n"; |
| 460 |
/**/ |
| 461 |
echo '<td>' . "\n"; |
| 462 |
echo '<input type="text" name="ws_plugin__s2member_amazon_cf_files_distro_streaming_cname" id="ws-plugin--s2member-amazon-cf-files-streaming-distro-cname" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_streaming_cname"]) . '" /><br />' . "\n"; |
| 463 |
echo 'Example: <code>s2-streaming-files.' . esc_html (c_ws_plugin__s2member_utils_urls::parse_url (site_url (), PHP_URL_HOST)) . '</code>.<br />' . "\n"; |
| 464 |
echo '<em>* Optional, do NOT fill this in unless you know what you\'re doing. This requires DNS changes.</em>' . "\n"; |
| 465 |
echo '</td>' . "\n"; |
| 466 |
/**/ |
| 467 |
echo '</tr>' . "\n"; |
| 468 |
echo '</tbody>' . "\n"; |
| 469 |
echo '</table>' . "\n"; |
| 470 |
echo '</div>' . "\n"; |
| 471 |
echo '</div>' . "\n"; |
| 472 |
/**/ |
| 473 |
echo '</div>' . "\n"; |
| 474 |
/**/ |
| 475 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_after_amazon_cf", get_defined_vars ()); |
| 476 |
} |
| 477 |
/**/ |
| 478 |
if (apply_filters ("ws_plugin__s2member_during_down_ops_page_during_left_sections_display_rtmp_streaming", true, get_defined_vars ())) |
| 479 |
{ |
| 480 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_before_rtmp_streaming", get_defined_vars ()); |
| 481 |
/**/ |
| 482 |
echo '<div class="ws-menu-page-group" title="JW Player® & RTMP Protocol Examples">' . "\n"; |
| 483 |
/**/ |
| 484 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-rtmp-streaming-section">' . "\n"; |
| 485 |
echo '<h3>JW Player® & RTMP Protocol Examples</h3>' . "\n"; |
| 486 |
echo '<a href="http://www.longtailvideo.com/players/" target="_blank"><img src="' . esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/jwplayer-logo.png" class="ws-menu-page-right" style="width:179px; height:58px; border:0;" alt="." /></a>' . "\n"; |
| 487 |
echo '<p>While it is possible to serve audio/video files protected by s2Member, without needing to integrate Amazon® S3 or CloudFront; we DO highly recommend that you integrate both Amazon® S3 and Amazon® CloudFront in order to maximize speed and compatibility across various viewing platforms. That being said, there are code samples below that will serve audio/video files both with and without Amazon® S3/CloudFront. You can also check the <a href="' . esc_attr (c_ws_plugin__s2member_readmes::parse_readme_value ("Forum URI")) . '" target="_blank" rel="external">s2Member Support Forums</a> for tips/tricks if you like.</p>' . "\n"; |
| 488 |
echo '<p><strong>One of the great things about Amazon® CloudFront</strong>, is its ability to <strong>stream/seek media files</strong> in the truest sense of the word. For sites delivering protected <em>FLV/MP4/OGG/WEBM</em> and other streaming audio/video file types over the <em>RTMP</em> protocol, Amazon® CloudFront is our recommendation. Once you\'ve successfully configured s2Member to use both Amazon® S3 and Amazon® CloudFront together, please review the code samples below. s2Member can automatically serve your protected files over the <em>RTMP</em> protocol using an Amazon® CloudFront Streaming Distribution.</p>' . "\n"; |
| 489 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_during_rtmp_streaming", get_defined_vars ()); |
| 490 |
/**/ |
| 491 |
echo '<div class="ws-menu-page-hr"></div>' . "\n"; |
| 492 |
/**/ |
| 493 |
echo '<p style="font-size:110%;"><a href="#" onclick="jQuery(\'p#ws-plugin--s2member-rtmp-streaming-details-jwplayer-standard-mp4\').toggle(); return false;" class="ws-dotted-link">JW Player® ( MP4 file, via Rewrite URLs. Amazon® S3/CloudFront NOT required )</a></p>' . "\n"; |
| 494 |
echo '<p id="ws-plugin--s2member-rtmp-streaming-details-jwplayer-standard-mp4" style="display:none;">Download <a href="http://www.longtailvideo.com/players/" target="_blank" rel="external">JW Player® here</a>, and upload <code>/jwplayer/</code> to your website\'s root directory.<br />This does NOT require s2Member to be integrated with Amazon® S3/CloudFront.<br />Also see: <code>s2Member -> Download Options -> Advanced Mod Rewrite Linkage</code>.<br /><br />' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/jwplayer-standard-mp4.x-php")) . '</p>' . "\n"; |
| 495 |
/**/ |
| 496 |
echo '<p style="font-size:110%;"><a href="#" onclick="jQuery(\'p#ws-plugin--s2member-rtmp-streaming-details-jwplayer-streaming-mp4\').toggle(); return false;" class="ws-dotted-link">JW Player® ( RTMP streaming MP4, via s2Member\'s Amazon® S3/CloudFront integration )</a></p>' . "\n"; |
| 497 |
echo '<p id="ws-plugin--s2member-rtmp-streaming-details-jwplayer-streaming-mp4" style="display:none;">Download <a href="http://www.longtailvideo.com/players/" target="_blank" rel="external">JW Player® here</a>, and upload <code>/jwplayer/</code> to your website\'s root directory.<br />This requires s2Member to be integrated with Amazon® S3/CloudFront.<br />Also see: <a href="http://www.primothemes.com/forums/viewtopic.php?f=40&t=12455" target="_blank" rel="external">s2Member Codex -> API Functions</a>.<br /><br />' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/jwplayer-streaming-mp4.x-php")) . '</p>' . "\n"; |
| 498 |
/**/ |
| 499 |
echo '<p style="font-size:110%;"><a href="#" onclick="jQuery(\'p#ws-plugin--s2member-rtmp-streaming-details-jwplayer-streaming-mp4-sca\').toggle(); return false;" class="ws-dotted-link">JW Player® ( RTMP streaming MP4, via s2Member\'s JSON/Shortcode alternative )</a></p>' . "\n"; |
| 500 |
echo '<p id="ws-plugin--s2member-rtmp-streaming-details-jwplayer-streaming-mp4-sca" style="display:none;">Download <a href="http://www.longtailvideo.com/players/" target="_blank" rel="external">JW Player® here</a>, and upload <code>/jwplayer/</code> to your website\'s root directory.<br />This requires s2Member to be integrated with Amazon® S3/CloudFront.<br />Also see: <a href="http://www.primothemes.com/forums/viewtopic.php?f=40&t=12455" target="_blank" rel="external">s2Member Codex -> API Functions</a>.<br /><br />' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/jwplayer-streaming-mp4-sca.x-php")) . '</p>' . "\n"; |
| 501 |
/**/ |
| 502 |
echo '<p style="font-size:110%;"><a href="#" onclick="jQuery(\'p#ws-plugin--s2member-rtmp-streaming-details-jwplayer-streaming-mp4-webm\').toggle(); return false;" class="ws-dotted-link">JW Player® ( RTMP streaming MP4, advanced w/ multiple HTML5 fallbacks )</a></p>' . "\n"; |
| 503 |
echo '<p id="ws-plugin--s2member-rtmp-streaming-details-jwplayer-streaming-mp4-webm" style="display:none;">Download <a href="http://www.longtailvideo.com/players/" target="_blank" rel="external">JW Player® here</a>, and upload <code>/jwplayer/</code> to your website\'s root directory.<br />This requires s2Member to be integrated with Amazon® S3/CloudFront.<br />Also see: <a href="http://www.primothemes.com/forums/viewtopic.php?f=40&t=12455" target="_blank" rel="external">s2Member Codex -> API Functions</a>.<br /><br />' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/jwplayer-streaming-mp4-webm.x-php")) . '</p>' . "\n"; |
| 504 |
/**/ |
| 505 |
echo '</div>' . "\n"; |
| 506 |
/**/ |
| 507 |
echo '</div>' . "\n"; |
| 508 |
/**/ |
| 509 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_after_rtmp_streaming", get_defined_vars ()); |
| 510 |
} |
| 511 |
/**/ |
| 512 |
if (apply_filters ("ws_plugin__s2member_during_down_ops_page_during_left_sections_display_rewrite_linkage", true, get_defined_vars ())) |
| 513 |
{ |
| 514 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_before_rewrite_linkage", get_defined_vars ()); |
| 515 |
/**/ |
| 516 |
echo '<div class="ws-menu-page-group" title="Advanced Mod-Rewrite Linkage">' . "\n"; |
| 517 |
/**/ |
| 518 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-rewrite-linkage-section">' . "\n"; |
| 519 |
echo '<h3>Advanced Mod-Rewrite Linkage</h3>' . "\n"; |
| 520 |
echo '<p>s2Member automatically creates <code>mod_rewrite</code> rules inside your <code>/' . esc_html (c_ws_plugin__s2member_utils_dirs::basename_dir_app_data ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/</code> directory, which provide additional flexibility in the way protected files can be served to your Customers. With s2Member\'s <code>mod_rewrite</code> rules, it is now possible to link directly to a protected file, avoiding the use of query string variables <em>( it\'s completely optional though, i.e. NOT required )</em>.</p>' . "\n"; |
| 521 |
echo '<p>This new flexibility may come in handy for site owners serving files through media playback devices that have issues with query string variables. For instance, it is now possible to link to an s2Member-protected file directly, like this: <code>... /wp-content/plugins/' . esc_html (c_ws_plugin__s2member_utils_dirs::basename_dir_app_data ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/example-file.zip</code> instead of <code>... /?s2member_file_download=example-file.zip</code>. Either way works, but the direct link might be easier for some.</p>' . "\n"; |
| 522 |
echo '<p>It is also possible to pass query string parameters through a direct link:<br /><code>... /wp-content/plugins/' . esc_html (c_ws_plugin__s2member_utils_dirs::basename_dir_app_data ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/example-file.zip?s2member_file_inline=yes&s2member_file_download_key=[key]</code>.</p>' . "\n"; |
| 523 |
echo '<p>That being said, s2Member\'s <code>mod_rewrite</code> rules allow for more advanced control over s2Member-specific parameters.</p>' . "\n"; |
| 524 |
echo '<p>For example, you could just do this for inline files:<br /><code>... /wp-content/plugins/' . esc_html (c_ws_plugin__s2member_utils_dirs::basename_dir_app_data ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '<strong class="ws-menu-page-hilite">/s2member-file-inline</strong>/example-file.zip</code></p>' . "\n"; |
| 525 |
echo '<p>Or, if you really want to get advanced, you could do something like this:<br /><code>... /wp-content/plugins/' . esc_html (c_ws_plugin__s2member_utils_dirs::basename_dir_app_data ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '<strong class="ws-menu-page-hilite">/s2member-file-inline-[yes|no]/s2member-file-download-key-[key]</strong>/example-file.zip</code><br /><code>... /wp-content/plugins/' . esc_html (c_ws_plugin__s2member_utils_dirs::basename_dir_app_data ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '<strong class="ws-menu-page-hilite">/s2member-file-inline-yes/s2member-file-download-key-xS54df5ER4d5x</strong>/example-file.zip</code><br /><code>... /wp-content/plugins/' . esc_html (c_ws_plugin__s2member_utils_dirs::basename_dir_app_data ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '<strong class="ws-menu-page-hilite">/s2member-file-inline-yes/s2member-skip-confirmation</strong>/example-file.zip</code></p>' . "\n"; |
| 526 |
echo '<p>Or even this, if you\'re using Remote Header Authorization:<br /><code>... /wp-content/plugins/' . esc_html (c_ws_plugin__s2member_utils_dirs::basename_dir_app_data ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '<strong class="ws-menu-page-hilite">/s2member-file-remote</strong>/example-file.zip</code></p>' . "\n"; |
| 527 |
echo '<p>Specifying storage location option dynamically:<br /><code>... /wp-content/plugins/' . esc_html (c_ws_plugin__s2member_utils_dirs::basename_dir_app_data ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '<strong class="ws-menu-page-hilite">/s2member-file-storage-[local|s3|cf]</strong>/example-file.zip</code><br /><code>... /wp-content/plugins/' . esc_html (c_ws_plugin__s2member_utils_dirs::basename_dir_app_data ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '<strong class="ws-menu-page-hilite">/s2member-file-storage-cf</strong>/example-cloudfront-file.zip</code><br /><code>... /wp-content/plugins/' . esc_html (c_ws_plugin__s2member_utils_dirs::basename_dir_app_data ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '<strong class="ws-menu-page-hilite">/s2member-file-storage-s3/s2member-file-inline</strong>/example-s3-file.html</code></p>' . "\n"; |
| 528 |
echo '<p><em>* Note, the order of your s2Member-specific parameters with Advanced Mod-Rewrite Linkage is irrelevant. Feel free to add/remove, or even change the order. Everything discussed here is also Multisite compatible. Everything discussed here is also compatible when/if combined with Amazon® S3/CDN Storage. However, NONE of this will work on servers that do NOT support <code>mod_rewrite</code>. Almost all web servers do though.</em></p>' . "\n"; |
| 529 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_during_rewrite_linkage", get_defined_vars ()); |
| 530 |
echo '</div>' . "\n"; |
| 531 |
/**/ |
| 532 |
echo '</div>' . "\n"; |
| 533 |
/**/ |
| 534 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_after_rewrite_linkage", get_defined_vars ()); |
| 535 |
} |
| 536 |
/**/ |
| 537 |
if (apply_filters ("ws_plugin__s2member_during_down_ops_page_during_left_sections_display_shortcode_attrs", true, get_defined_vars ())) |
| 538 |
{ |
| 539 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_before_shortcode_attrs", get_defined_vars ()); |
| 540 |
/**/ |
| 541 |
echo '<div class="ws-menu-page-group" title="Shortcode Attributes & API Functions ( Explained )">' . "\n"; |
| 542 |
/**/ |
| 543 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-shortcode-attrs-section">' . "\n"; |
| 544 |
echo '<h3>Shortcode Attributes & API Functions ( Explained In Full Detail )</h3>' . "\n"; |
| 545 |
echo '<p>s2Member makes <a href="http://codex.wordpress.org/Shortcode_API#Overview" target="_blank" rel="external">Shortcodes</a> available to you, which allow you to generate File Download URLs and/or File Download Keys. Like most Shortcodes for WordPress®, s2Member reads Attributes in your Shortcode. Many site owners like to know exactly how these Shortcode Attributes work. Below, is a brief overview of each possible Shortcode Attribute.</p>' . "\n"; |
| 546 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_during_shortcode_attrs", get_defined_vars ()); |
| 547 |
/**/ |
| 548 |
echo '<div class="ws-menu-page-hr"></div>' . "\n"; |
| 549 |
/**/ |
| 550 |
echo '<h4 style="margin:0;"><code>[s2File /]</code> Shortcode Attributes:</h4>' . "\n"; |
| 551 |
echo '<p style="margin:0;"><strong>See also:</strong> API Function <a href="http://www.primothemes.com/forums/viewtopic.php?f=40&t=12453#src_doc_s2member_file_download_url()" target="_blank" rel="external">s2member_file_download_url()</a> for PHP integration.</p>' . "\n"; |
| 552 |
echo '<table class="form-table" style="margin-top:0;">' . "\n"; |
| 553 |
echo '<tbody>' . "\n"; |
| 554 |
echo '<tr style="padding-top:0;">' . "\n"; |
| 555 |
/**/ |
| 556 |
echo '<td style="padding-top:0;">' . "\n"; |
| 557 |
echo '<ul>' . "\n"; |
| 558 |
echo '<li><code>download="file.zip"</code> Location of the file, relative to the <code>/' . esc_html (c_ws_plugin__s2member_utils_dirs::basename_dir_app_data ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/</code> directory; or, relative to the root of your Amazon® S3 Bucket, when applicable.</li>' . "\n"; |
| 559 |
echo '<li><code>download_key="no"</code> Defaults to <code>no</code>. If <code>download_key="1|on|yes|true|ip-forever|universal"</code>, s2Member will return a URL with an s2Member-generated File Download Key. You don\'t need to generate the File Download Key yourself, s2Member does it for you. If you set <code>download_key="ip-forever"</code>, the File Download Key that s2Member generates will last forever, for a specific IP Address; otherwise, by default, all File Download Keys expire after 24 hours automatically. If you set <code>download_key="universal"</code>, s2Member will generate a File Download Key that is good for anyone/everyone forever, with NO restrictions on who/where/when a file is accessed <em>( e.g. be careful with this one )</em>.</li>' . "\n"; |
| 560 |
echo '<li><code>stream="no"</code> Defaults to <code>no</code>. If <code>stream="1|on|yes|true"</code>, s2Member will return a URL containing a parameter/directive, which forces the File Download to take place over the RTMP protocol. This ONLY works when/if s2Member is configured to run with both Amazon® S3/CloudFront. Please note however, it\'s better to use the example code provided in the section above, regarding: <code>JW Player® and the RTMP Protocol</code>. Also note, if <code>get_streamer_json="1|on|yes|true"</code>, s2Member will automatically force <code>stream="true"</code> for you.</li>' . "\n"; |
| 561 |
echo '<li><code>inline=""</code> Defaults to <code>[empty]</code>. If <code>inline="1|on|yes|true"</code>, s2Member will serve the file inline, instead of as an actual File Download. If empty, s2Member will look at your <code>Inline File Extensions</code> configuration above, and serve the file inline; if, and only if, its extension matches one found in your configuration. By default, s2Member serves all files as attachments <em>( i.e. downloads )</em>. Please read the section above regarding <code>Inline File Extensions</code> for further details. Also note, this Shortcode Attribute does NOTHING for files served via Amazon® CloudFront. See the tech-notes listed in the Amazon® CloudFront section for further details and workarounds.</li>' . "\n"; |
| 562 |
echo '<li><code>storage=""</code> Defaults to <code>[empty]</code>. If <code>storage="local|s3|cf"</code>, s2Member will serve the file from a specific source location, based on the value of this Shortcode Attribute. For example, if you\'ve configured Amazon® S3 and/or CloudFront; but, there are a few files that you want to upload locally to the <code>/' . esc_html (c_ws_plugin__s2member_utils_dirs::basename_dir_app_data ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/</code> directory; you can force s2Member to serve a file from local storage by setting <code>storage="local"</code> explicitly.</li>' . "\n"; |
| 563 |
echo '<li><code>remote="no"</code> Defaults to <code>no</code>. If <code>remote="1|on|yes|true"</code>, s2Member will authenticate access to the File Download via Remote Header Authorization, instead of through your web site. This is similar to <code>.htaccess</code> protection routines of yester-year</code>. Please check the <code>Remote Authorization and Podcasting</code> section for further details about how this works.</li>' . "\n"; |
| 564 |
echo '<li><code>ssl=""</code> Defaults to <code>[empty]</code>. If <code>ssl="1|on|yes|true"</code>, s2Member will generate a File Download URL with an SSL protocol <em>( i.e. the URL will start with <code>https://</code> or <code>rtmpe://</code> )</em>. If empty, s2Member will only generate a File Download URL with an SSL protocol, when/if the Post/Page/URL firing the Shortcode itself, is also being viewed over SSL. Otherwise, s2Member will use a non-SSL protocol by default.</li>' . "\n"; |
| 565 |
echo '<li><code>rewrite="no"</code> Defaults to <code>no</code>. If <code>rewrite="1|on|yes|true"</code>, s2Member will generate a File Download URL that takes full advantage of s2Member\'s Advanced Mod Rewrite functionality. If you\'re running an Apache web server, or another server that supports <code>mod_rewrite</code>, we highly recommend turning this on. s2Member\'s <code>mod_rewrite</code> URLs do NOT contain query string parameters, making them more portable/compatible with other software applications and/or plugins for WordPress®.</li>' . "\n"; |
| 566 |
echo '<li><code>rewrite_base=""</code> Defaults to <code>[empty]</code>. If <code>rewrite_base="' . esc_attr (site_url ("/")) . '"</code>, s2Member will generate a File Download URL that takes full advantage of s2Member\'s Advanced Mod Rewrite functionality, and it will use the rewrite base URL as a prefix. This could be useful on some WordPress® installations that use advanced directory structures. It could also be useful for site owners using virtual directories that point to <code>/' . esc_html (c_ws_plugin__s2member_utils_dirs::basename_dir_app_data ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/</code>. Note, if <code>rewrite_base</code> is set, s2Member will automatically force <code>rewrite="yes"</code> for you.</li>' . "\n"; |
| 567 |
echo '<li><code>skip_confirmation="no"</code> Defaults to <code>no</code>. If <code>skip_confirmation="1|on|yes|true"</code>, s2Member will generate a File Download URL which contains a directive, telling s2Member NOT to introduce any JavaScript confirmation prompts on your site, for this File Download URL. Please note, s2Member will automatically detect links, anywhere in your content, and/or anywhere in your theme files, that contain <code>s2member_file_download</code> or <code>s2member-files</code>. Whenever a logged-in Member clicks a link that contains <code>s2member_file_download</code> or <code>s2member-files</code>, the system will politely ask the User to confirm the download using a very intuitive JavaScript confirmation prompt, which contains specific details about your configured download limitations. This way your Members will be aware of how many files they\'ve downloaded in the current period; and they\'ll be able to make a conscious decision about whether to proceed with a specific download or not.</li>' . "\n"; |
| 568 |
echo '<li><code>url_to_storage_source="no"</code> Defaults to <code>no</code>. If <code>url_to_storage_source="1|on|yes|true"</code>, s2Member will generate a File Download URL which points directly to the storage source. This is only functional with Amazon® S3 and/or CloudFront integrations. If you create a URL that points directly to the storage source <em>( i.e. points directly to Amazon® S3 or CloudFront )</em>, s2Member will NOT be able to further authenticate the current User/Member; and, s2Member will NOT be able to count the File Download against the current User\'s account record, because the URL being generated does not pass back through s2Member at all, it points directly to the storage source. For this reason, if you set <code>url_to_storage_source="true"</code>, you should also set <code>check_user="true"</code> and <code>count_against_user="true"</code>, telling s2Member to authenticate the current User, and if authenticated, count this File Download URL against the current User\'s account record in real-time <em>( i.e. as the URL is being generated ) </em>, while it still has a chance to do so. This Shortcode Attribute is useful when you stream files over the RTMP protocol; where an <code>http://</code> URL is not feasible. It also helps in situations where a 3rd-party software application will not work as intended, with s2Member\'s internal redirection to Amazon® S3/CloudFront files. Important, when <code>check_user="true"</code> and/or <code>count_against_user="true"</code>, the Shortcode will return an empty and/or null object value in situations where the current User/Member does NOT have access to the file.</li>' . "\n"; |
| 569 |
echo '<li><code>count_against_user="no"</code> Defaults to <code>no</code>. If <code>count_against_user="1|on|yes|true"</code>, it will automatically force <code>check_user="true"</code> as well. In other words, s2Member will authenticate the current User, and if authenticated, count this File Download URL against the current User\'s account record in real-time <em>( i.e. as the URL is being generated ) </em>. This is off by default. By default, s2Member will simply generate a File Download URL, and upon a User/Member clicking the URL, s2Member will authenticate the User/Member at that time, count the File Download against their account record, and serve the File Download. In other words, under normal circumstances, there is no reason to set <code>check_user="true"</code> and/or <code>count_against_user="true"</code> when generating the URL itself. However, this is a useful Shortcode Attribute when <code>url_to_storage_source="true"</code>. Please note, when <code>check_user="true"</code> and/or <code>count_against_user="true"</code>, the Shortcode will return an empty and/or null object value in situations where the current User/Member does NOT have access to the file.</li>' . "\n"; |
| 570 |
echo '<li><code>check_user="no"</code> Defaults to <code>no</code>. If <code>check_user="1|on|yes|true"</code>, s2Member will authenticate the current User before allowing the File Download URL to be generated. This is off by default. By default, s2Member will simply generate a File Download URL, and upon a User/Member clicking the URL, s2Member will authenticate the User/Member at that time, and serve the File Download to the User/Member. In other words, under normal circumstances, there is no reason to set <code>check_user="true"</code> and/or <code>count_against_user="true"</code> when generating the URL itself. However, this IS a useful Shortcode Attribute when <code>url_to_storage_source="true"</code>. Please note, when <code>check_user="true"</code> and/or <code>count_against_user="true"</code>, the Shortcode will return an empty and/or null object value in situations where the current User/Member does NOT have access to the file.</li>' . "\n"; |
| 571 |
echo '<li><code>get_streamer_json="no"</code> Defaults to <code>no</code>. If <code>get_streamer_json="1|on|yes|true"</code>, the Shortcode will return a JSON object for JavaScript notation, making it possible to integrate the <code>[s2File /]</code> Shortcode into JavaScript routines that configure streaming media players. For further details, please review the section above: <code>JW Player® & RTMP Protocol Examples</code>. Note, if you set <code>get_streamer_json="true"</code>, s2Member will automatically force <code>url_to_storage_source="true"</code> and <code>stream="true"</code>. For that reason, you should carefully review the details and warning above regarding <code>url_to_storage_source</code>. If you set <code>get_streamer_json="true"</code>, you should also set <code>check_user="true"</code> and <code>count_against_user="true"</code>.</li>' . "\n"; |
| 572 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_during_shortcode_attrs_s2file_lis", get_defined_vars ()); |
| 573 |
echo '</ul>' . "\n"; |
| 574 |
echo '</td>' . "\n"; |
| 575 |
/**/ |
| 576 |
echo '</tr>' . "\n"; |
| 577 |
echo '</tbody>' . "\n"; |
| 578 |
echo '</table>' . "\n"; |
| 579 |
/**/ |
| 580 |
echo '<div class="ws-menu-page-hr"></div>' . "\n"; |
| 581 |
/**/ |
| 582 |
echo '<h4 style="margin:0;"><code>[s2Key /]</code> Shortcode Attributes:</h4>' . "\n"; |
| 583 |
echo '<p style="margin:0;"><strong>See also:</strong> API Function <a href="http://www.primothemes.com/forums/viewtopic.php?f=40&t=12453#src_doc_s2member_file_download_key()" target="_blank" rel="external">s2member_file_download_key()</a> for PHP integration.</p>' . "\n"; |
| 584 |
echo '<table class="form-table" style="margin-top:0;">' . "\n"; |
| 585 |
echo '<tbody>' . "\n"; |
| 586 |
echo '<tr style="padding-top:0;">' . "\n"; |
| 587 |
/**/ |
| 588 |
echo '<td style="padding-top:0;">' . "\n"; |
| 589 |
echo '<ul>' . "\n"; |
| 590 |
echo '<li><code>file_download="file.zip"</code> Location of the file, relative to the <code>/' . esc_html (c_ws_plugin__s2member_utils_dirs::basename_dir_app_data ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/</code> directory; or, relative to the root of your Amazon® S3 Bucket, when applicable.</li>' . "\n"; |
| 591 |
echo '<li><code>directive=""</code> Defaults to <code>[empty]</code>. If <code>directive="ip-forever|universal"</code>, s2Member will return a special File Download Key. If you set <code>directive="ip-forever"</code>, the File Download Key that s2Member generates will last forever, for a specific IP Address; otherwise, by default, all File Download Keys expire after 24 hours automatically. If you set <code>directive="universal"</code>, s2Member will generate a File Download Key that is good for anyone/everyone forever, with NO restrictions on who/where/when a file is accessed <em>( e.g. be careful with this one )</em>.</li>' . "\n"; |
| 592 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_during_shortcode_attrs_s2key_lis", get_defined_vars ()); |
| 593 |
echo '</ul>' . "\n"; |
| 594 |
echo '</td>' . "\n"; |
| 595 |
/**/ |
| 596 |
echo '</tr>' . "\n"; |
| 597 |
echo '</tbody>' . "\n"; |
| 598 |
echo '</table>' . "\n"; |
| 599 |
echo '</div>' . "\n"; |
| 600 |
/**/ |
| 601 |
echo '</div>' . "\n"; |
| 602 |
/**/ |
| 603 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_after_shortcode_attrs", get_defined_vars ()); |
| 604 |
} |
| 605 |
/**/ |
| 606 |
do_action ("ws_plugin__s2member_during_down_ops_page_after_left_sections", get_defined_vars ()); |
| 607 |
/**/ |
| 608 |
echo '<div class="ws-menu-page-hr"></div>' . "\n"; |
| 609 |
/**/ |
| 610 |
echo '<p class="submit"><input type="submit" class="button-primary" value="Save All Changes" /></p>' . "\n"; |
| 611 |
/**/ |
| 612 |
echo '</form>' . "\n"; |
| 613 |
/**/ |
| 614 |
echo '</td>' . "\n"; |
| 615 |
/**/ |
| 616 |
echo '<td class="ws-menu-page-table-r">' . "\n"; |
| 617 |
c_ws_plugin__s2member_menu_pages_rs::display (); |
| 618 |
echo '</td>' . "\n"; |
| 619 |
/**/ |
| 620 |
echo '</tr>' . "\n"; |
| 621 |
echo '</tbody>' . "\n"; |
| 622 |
echo '</table>' . "\n"; |
| 623 |
/**/ |
| 624 |
echo '</div>' . "\n"; |
| 625 |
} |
| 626 |
} |
| 627 |
} |
| 628 |
/**/ |
| 629 |
new c_ws_plugin__s2member_menu_page_down_ops (); |
| 630 |
?> |