Changeset 832961
- Timestamp:
- 01/04/2014 06:02:49 PM (12 years ago)
- Location:
- wp-download-codes
- Files:
-
- 16 added
- 4 deleted
- 4 edited
-
branches/2.2.0 (deleted)
-
trunk (modified) (1 prop)
-
trunk/README.txt (modified) (4 diffs, 1 prop)
-
trunk/dc_administration.php (deleted)
-
trunk/dc_functions.php (deleted)
-
trunk/dc_template.php (deleted)
-
trunk/includes (added)
-
trunk/includes/admin (added)
-
trunk/includes/admin/admin-menu.php (added)
-
trunk/includes/admin/download-code-settings.php (added)
-
trunk/includes/admin/help.php (added)
-
trunk/includes/admin/main.php (added)
-
trunk/includes/admin/manage-codes.php (added)
-
trunk/includes/admin/manage-releases.php (added)
-
trunk/includes/download.php (added)
-
trunk/includes/helpers (added)
-
trunk/includes/helpers/db.php (added)
-
trunk/includes/helpers/file.php (added)
-
trunk/includes/helpers/messages.php (added)
-
trunk/includes/helpers/options.php (added)
-
trunk/includes/helpers/string.php (added)
-
trunk/includes/shortcode.php (added)
-
trunk/resources/js/wp-download-codes.js (modified) (4 diffs)
-
trunk/wp-download-codes.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-download-codes/trunk
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/wp-download-codes/branches/2.2.0 743983-832267
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
wp-download-codes/trunk/README.txt
- Property svn:mergeinfo changed
/wp-download-codes/branches/2.2.0/README.txt (added) merged: 743994,743997
r743997 r832961 4 4 Tags: download, download code, code generator 5 5 Requires at least: 2.5 6 Tested up to: 3. 47 Stable tag: 2. 2.06 Tested up to: 3.8 7 Stable tag: 2.3.0 8 8 9 The plugin enables to generation and management of download codes for .zip files. It was written to enable the free download of records and CDs with dedicated codes printed on the cover of the releases or on separate download cards.9 The plugin enables to generation and management of download codes for all types of files (zip, mp3, ...). 10 10 11 11 == Description == 12 12 13 The plugin enables to generation and management of download codes for .zip files. It was written to enable the free download of records and CDs with dedicated codes printed on the cover of the releases or on separate download cards. 13 The plugin enables to generation and management of download codes for different types of files (zip, mp3, ...). 14 It was mainly written to enable the download of digital-only releases or of soundfiles complementary to Vinyl records or CDs using dedicated download codes. Such codes could be printed on the release covers or on separate download cards or simply distributed via email. 15 Of course there can be other use cases because the file download is not restricted to soundfiles. 14 16 15 17 With the plugin you can: 16 18 17 * Create and manage **releases**, which are items bundled as zips (e.g. digital versions of vinyl albums) to be downloaded with download codes.19 * Create and manage **releases**, which can be standalone files or items bundled as zips (e.g. digital versions of vinyl albums). 18 20 * Specify the allowed number of downloads for each release. 19 * Create alphanumeric **download codes** for each release using a prefix for each code. The number of characters can be specified for each code.21 * Create alphanumeric **download codes** for each release/file using a prefix for each code. The number of characters can be specified for each code. 20 22 * Review downloads codes and set them to "final" when you want to use and distribute them. 21 * Export final download codes in a plain list .23 * Export final download codes in a plain list from which they can be used for example to print the codes on download cards using the mail merge functionality of your favorite office suite. 22 24 * Analyze the use of the download codes. 23 25 … … 28 30 1. Create a folder within the `wp-content` directory and upload one or several zip files via FTP. 29 31 1. Optionally protect the folder via CHMOD in order to avoid unauthorized downloads using direct file links. 30 1. Go to the 'Settings' page and enter the zip folder specified above.31 1. Create a new release and assign a valid zip file to it.32 1. Create download codes for the release via 'Manage codes' and make them final.32 1. Go to the 'Settings' page and set the zip folder specified above. Alternatively, you can define an absolute path to the download folder. 33 1. Create a new release and assign a valid file to it. (The file extension like 'zip' or 'mp3' must be listed in the allowed file extensions under 'Settings'.) 34 1. Create new or import existing download codes for the release via 'Manage Codes' and make them final. 33 35 1. Put `[download-code id="xyz"]` in a page or post, where "xyz" is the ID of the respective release. Alternatively, you can write `[download-code]` without an ID to allow any download code. In the latter case, the download code should be assigned directly to a release. 34 1. Since version 2.1 you can provide your users with a direct link to the download code form using the "yourcode" query parameter (e.g. http://yourwordpressblog.com/download/?yourcode=XYZ).36 1. Optionally provide your users with a direct link to the download code form using the "yourcode" query parameter (e.g. http://yourwordpressblog.com/download/?yourcode=DOWNLOADCODEXYZ). 35 37 36 38 == Frequently Asked Questions == 39 40 = How can I influence the characters used to create the random codes from? = 41 42 Go to 'Settings' and modify the list of allowed characters. 43 44 = How can I reset one or several download codes which have already been used? = 45 46 Go to 'Manage Codes', select the release, click 'View report', select one or several downloads and click 'Clear Selected Downloads' at the bottom. 37 47 38 48 = Can I have download forms for several releases? = … … 44 54 Most providers do not allow an upload quota which is sufficient to upload larger zip files. Therefore, an option using an upload form has not been considered yet. 45 55 46 = Can I influence the request headers which are being sent for each download file? =56 = Can I influence the request headers which are being sent for each download file? 47 57 48 Yes, you can override the content type header which by default sends the MIM Icontent type of the download file. If this does not work in your environment, you can specify alternative fixed headers like application/download.58 Yes, you can override the content type header which by default sends the MIME content type of the download file. If this does not work in your environment, you can specify alternative fixed headers like application/download. 49 59 50 60 == Screenshots == … … 52 62 53 63 == Changelog == 64 65 = 2.3.0 = 66 * Increased maximum number of download codes which can be created for one group from 9999 to 99999. 67 * Introduced new feature to import existing codes for a release (in case users want to migrate their codes or create codes outside the plugin). 68 * Modified the default constant for the allowed characters in order to avoid misleading ambiguities between 'O' (the character) and '0' (the number). 69 * Improved the resetting of codes. 70 * Improved deletion of releases. 54 71 55 72 = 2.2.0 = - Property svn:mergeinfo changed
-
wp-download-codes/trunk/resources/js/wp-download-codes.js
r405656 r832961 13 13 14 14 $(document).ready(function() { 15 16 // add lightbox DOM elements 15 // Add lightbox DOM elements 17 16 $("body").append('<div id="lightbox"><div class="close"></div><div id="lightbox-content" class="content"></div><textarea id="lightbox-textarea"></textarea></div>'); 18 17 $("body").append('<div id="overlay" class="overlay"></div>'); 19 18 20 // open lightbox to list download codes19 // Open lightbox to list download codes 21 20 $("a.action-list").click(function() { 22 21 var lightbox = $(this).attr("rel"); … … 24 23 }); 25 24 26 // open lightbox to list downloads25 // Open lightbox to list downloads 27 26 $("a.action-report").click(function() { 28 27 var lightbox = $(this).attr("rel"); … … 30 29 }); 31 30 32 // add confirm step before deleting release31 // Add confirm step before deleting release 33 32 $("a.action-delete").click(function() { 34 33 return confirm("Are you absolutely sure? This cannot be undone!"); 35 34 }); 36 35 37 // add confirm step before finalizing codes36 // Add confirm step before finalizing codes 38 37 $("a.action-finalize").click(function() { 39 return confirm("Are you absolutely sure? Codes cannot be deleted after they're finalized. ");38 return confirm("Are you absolutely sure? Codes cannot be deleted after they're finalized. (Only the whole release can be deleted including all codes.)"); 40 39 }); 41 40 42 // close button on lightbox 41 // Add confirm step if more than 500 download codes shall be created 42 $("form#form-manage-codes").submit(function() { 43 // Get number of download codes to be created 44 var numberOfCodes = $('#new-quantity').val(); 45 46 // Check if number of codes exceeds 500 47 if ($.isNumeric(numberOfCodes) && numberOfCodes >= 500) { 48 return confirm("Are you sure that you want to create that many codes?"); 49 } 50 51 return true; 52 }); 53 54 // Close button on lightbox 43 55 $("#lightbox .close").click(closeLightbox); 44 56 }); … … 60 72 $("#lightbox-textarea").hide(); 61 73 } 74 75 // Enable select/deselect all in download reports 76 $("input.cb-select-all").click(function() { 77 var relatedId = $(this).attr("rel"); 78 var checked = $(this).prop('checked'); 79 $("input.cb-related-" + relatedId).each(function () { 80 $(this).prop('checked', checked); 81 }); 82 }); 62 83 return false; 63 84 } -
wp-download-codes/trunk/wp-download-codes.php
r743982 r832961 6 6 Description: The plugin enables to generation and management of download codes for .zip files. It was written to enable the free download of records and CDs with dedicated codes printed on the cover of the releases or on separate download cards. 7 7 8 Version: 2. 2.08 Version: 2.3.0 9 9 Author: misanthrop, spalmer 10 10 Author URI: http://www.misantropolis.de, http://quoperative.com 11 11 12 Copyright 2009-201 3Armin Fischer (email : misantropolis@gmail.com)12 Copyright 2009-2014 Armin Fischer (email : misantropolis@gmail.com) 13 13 14 14 This program is free software; you can redistribute it and/or modify … … 33 33 define( DC_ALLOWED_DOWNLOADS, 3 ); 34 34 define( DC_FILE_TYPES, 'zip, mp3' ); 35 define( DC_CODE_CHARS, 'ABCDEFGHIJKLMN OPQRSTUVWXYZ01234567890' );35 define( DC_CODE_CHARS, 'ABCDEFGHIJKLMNPQRSTUVWXYZ123456789' ); 36 36 define( DC_HEADER_CONTENT_TYPE, 'Default (MIME Type)'); 37 37 38 38 /** 39 * Inclu sion of administration, template and general functions.39 * Include helper functions 40 40 */ 41 42 include( 'dc_administration.php' ); 43 include( 'dc_template.php' ); 44 include( 'dc_functions.php' ); 41 include( 'includes/helpers/db.php' ); 42 include( 'includes/helpers/file.php' ); 43 include( 'includes/helpers/messages.php' ); 44 include( 'includes/helpers/options.php' ); 45 include( 'includes/helpers/string.php' ); 45 46 46 47 /** 47 * Addition of dc functions to hooks.48 * Include admin related functions 48 49 */ 50 include( 'includes/admin/main.php' ); // Successively includes further admin libraries 49 51 52 /** 53 * Include functionality for shortcode handling 54 */ 55 include( 'includes/shortcode.php' ); 56 57 /** 58 * Include functionality to process downloads 59 */ 60 include( 'includes/download.php' ); 61 62 /** 63 * Add dc functions to hooks 64 */ 50 65 if (is_admin()) { 51 // Create administration menu 52 add_action( 'admin_menu', 'dc_admin_menu' ); 66 // Initialize scripts and stylesheets 67 add_action( 'admin_init', 'dc_admin_init' ); 68 69 // Create administration menu 70 add_action( 'admin_menu', 'dc_admin_menu' ); 53 71 } 54 72 else { 55 // Send headers for file downloads56 add_action( 'send_headers', 'dc_headers' );73 // Send headers for file downloads 74 add_action( 'send_headers', 'dc_send_download_headers' ); 57 75 } 58 76 59 // Shortcode for [download-code id="..."]60 add_shortcode( 'download-code', 'dc_ download_form' );77 // Handle shortcode for [download-code id="..."] 78 add_shortcode( 'download-code', 'dc_embed_download_code_form' ); 61 79 62 // Activat ion ofplugin80 // Activate plugin 63 81 register_activation_hook( __FILE__, 'dc_init' ); 64 82 65 // Uninstall ation ofplugin83 // Uninstall plugin 66 84 if ( function_exists('register_uninstall_hook') ) 67 85 register_uninstall_hook(__FILE__, 'dc_uninstall');
Note: See TracChangeset
for help on using the changeset viewer.