Plugin Directory

Changeset 832961


Ignore:
Timestamp:
01/04/2014 06:02:49 PM (12 years ago)
Author:
misanthrop
Message:

Created version 2.3.0

Location:
wp-download-codes
Files:
16 added
4 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • wp-download-codes/trunk

  • wp-download-codes/trunk/README.txt

    r743997 r832961  
    44Tags: download, download code, code generator
    55Requires at least: 2.5
    6 Tested up to: 3.4
    7 Stable tag: 2.2.0
     6Tested up to: 3.8
     7Stable tag: 2.3.0
    88
    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.
     9The plugin enables to generation and management of download codes for all types of files (zip, mp3, ...).
    1010
    1111== Description ==
    1212
    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.
     13The plugin enables to generation and management of download codes for different types of files (zip, mp3, ...).
     14It 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.
     15Of course there can be other use cases because the file download is not restricted to soundfiles.
    1416
    1517With the plugin you can:
    1618
    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).
    1820*   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.
    2022*   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.
    2224*   Analyze the use of the download codes.
    2325
     
    28301. Create a folder within the `wp-content` directory and upload one or several zip files via FTP.
    29311. 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.
     321. Go to the 'Settings' page and set the zip folder specified above. Alternatively, you can define an absolute path to the download folder.
     331. 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'.)
     341. Create new or import existing download codes for the release via 'Manage Codes' and make them final.
    33351. 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).
     361. 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).
    3537
    3638== Frequently Asked Questions ==
     39
     40= How can I influence the characters used to create the random codes from? =
     41
     42Go 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
     46Go to 'Manage Codes', select the release, click 'View report', select one or several downloads and click 'Clear Selected Downloads' at the bottom.
    3747
    3848= Can I have download forms for several releases? =
     
    4454Most 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.
    4555
    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?
    4757
    48 Yes, you can override the content type header which by default sends the MIMI content type of the download file. If this does not work in your environment, you can specify alternative fixed headers like application/download.
     58Yes, 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.
    4959
    5060== Screenshots ==
     
    5262
    5363== 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.
    5471
    5572= 2.2.0 =
  • wp-download-codes/trunk/resources/js/wp-download-codes.js

    r405656 r832961  
    1313
    1414$(document).ready(function() {
    15 
    16     // add lightbox DOM elements
     15    // Add lightbox DOM elements
    1716    $("body").append('<div id="lightbox"><div class="close"></div><div id="lightbox-content" class="content"></div><textarea id="lightbox-textarea"></textarea></div>');
    1817    $("body").append('<div id="overlay" class="overlay"></div>');   
    1918
    20     // open lightbox to list download codes
     19    // Open lightbox to list download codes
    2120    $("a.action-list").click(function() {
    2221        var lightbox = $(this).attr("rel");
     
    2423    });
    2524   
    26     // open lightbox to list downloads
     25    // Open lightbox to list downloads
    2726    $("a.action-report").click(function() {
    2827        var lightbox = $(this).attr("rel");
     
    3029    });
    3130   
    32     // add confirm step before deleting release
     31    // Add confirm step before deleting release
    3332    $("a.action-delete").click(function() {
    3433        return confirm("Are you absolutely sure? This cannot be undone!");
    3534    });
    3635   
    37     // add confirm step before finalizing codes
     36    // Add confirm step before finalizing codes
    3837    $("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.)");
    4039    });
    4140   
    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
    4355    $("#lightbox .close").click(closeLightbox);
    4456});
     
    6072        $("#lightbox-textarea").hide();
    6173    }
     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    });
    6283    return false;
    6384}
  • wp-download-codes/trunk/wp-download-codes.php

    r743982 r832961  
    66Description: 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.
    77
    8 Version: 2.2.0
     8Version: 2.3.0
    99Author: misanthrop, spalmer
    1010Author URI: http://www.misantropolis.de, http://quoperative.com
    1111
    12     Copyright 2009-2013 Armin Fischer  (email : misantropolis@gmail.com)
     12    Copyright 2009-2014 Armin Fischer  (email : misantropolis@gmail.com)
    1313   
    1414    This program is free software; you can redistribute it and/or modify
     
    3333define( DC_ALLOWED_DOWNLOADS, 3 );
    3434define( DC_FILE_TYPES, 'zip, mp3' );
    35 define( DC_CODE_CHARS, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890' );
     35define( DC_CODE_CHARS, 'ABCDEFGHIJKLMNPQRSTUVWXYZ123456789' );
    3636define( DC_HEADER_CONTENT_TYPE, 'Default (MIME Type)');
    3737
    3838/**
    39  * Inclusion of administration, template and general functions.
     39 * Include helper functions
    4040 */
    41 
    42 include( 'dc_administration.php' );
    43 include( 'dc_template.php' );
    44 include( 'dc_functions.php' );
     41include( 'includes/helpers/db.php' );
     42include( 'includes/helpers/file.php' );
     43include( 'includes/helpers/messages.php' );
     44include( 'includes/helpers/options.php' );
     45include( 'includes/helpers/string.php' );
    4546
    4647/**
    47  * Addition of dc functions to hooks.
     48 * Include admin related functions
    4849 */
     50include( 'includes/admin/main.php' ); // Successively includes further admin libraries
    4951
     52/**
     53 * Include functionality for shortcode handling
     54 */
     55include( 'includes/shortcode.php' );
     56
     57/**
     58 * Include functionality to process downloads
     59 */
     60include( 'includes/download.php' );
     61
     62/**
     63 * Add dc functions to hooks
     64 */
    5065if (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' );
    5371}
    5472else {
    55    // Send headers for file downloads
    56    add_action( 'send_headers', 'dc_headers' );
     73    // Send headers for file downloads
     74    add_action( 'send_headers', 'dc_send_download_headers' );
    5775}
    5876
    59 // Shortcode for [download-code id="..."]
    60 add_shortcode( 'download-code', 'dc_download_form' );
     77// Handle shortcode for [download-code id="..."]
     78add_shortcode( 'download-code', 'dc_embed_download_code_form' );
    6179
    62 // Activation of plugin
     80// Activate plugin
    6381register_activation_hook( __FILE__, 'dc_init' );
    6482
    65 // Uninstallation of plugin
     83// Uninstall plugin
    6684if ( function_exists('register_uninstall_hook') )
    6785    register_uninstall_hook(__FILE__, 'dc_uninstall');
Note: See TracChangeset for help on using the changeset viewer.