Plugin Directory

Changeset 2033571


Ignore:
Timestamp:
02/18/2019 07:38:02 PM (7 years ago)
Author:
misanthrop
Message:

Made minor improvements for empty "Hosting Type" values

Location:
wp-download-codes/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • wp-download-codes/trunk/README.txt

    r2032823 r2033571  
    33Donate link: http://wordpress.org/extend/plugins/wp-download-codes/
    44Tags: download, download code, code generator
    5 Requires at least: 2.5.0
     5Requires at least: 2.5.3
    66Tested up to: 5.0.3
    7 Stable tag: 2.5.3
     7Stable tag: 2.5.3.1
    88
    99The plugin enables to generation and management of download codes for all types of files (zip, mp3, ...).
     
    6666
    6767== Changelog ==
     68
     69= 2.5.3.1 =
     70* Made minor improvements for empty "Hosting Type" values
    6871
    6972= 2.5.3 =
  • wp-download-codes/trunk/includes/admin/manage-releases.php

    r2032823 r2033571  
    210210                echo '<td>' . $release-> ID . '</td>';
    211211                echo '<td>' . dc_get_hosting_types()[$release->hosting_type] . '</td>';
    212                 echo '<td>' . ( 'WP_DIRECT' == $release->hosting_type ? $release->filename : $release->url ) . '</td>';
     212                echo '<td>' . ( dc_is_default_hosting_type( $release->hosting_type ) ? $release->filename : $release->url ) . '</td>';
    213213                echo '<td>' . $release->codes . '</td><td>' . $release->downloads . '</td>';
    214214                echo '<td>';
  • wp-download-codes/trunk/includes/download.php

    r2032823 r2033571  
    3737        // Start download if maximum of allowed downloads is not reached
    3838        if ( $downloads->downloads < $release->allowed_downloads ) {
    39             if ( 'WP_DIRECT' == $release->hosting_type) {
     39            if ( dc_is_default_hosting_type( $release->hosting_type )) {
    4040                // Download file directly
    4141       
  • wp-download-codes/trunk/includes/helpers/db.php

    r2032823 r2033571  
    397397      $errors[] = "The title must not be empty";   
    398398   }
    399    if ( 'WP_DIRECT' == $hosting_type && '' == $filename ) {
     399   if ( dc_is_default_hosting_type( $hosting_type ) && '' == $filename ) {
    400400      $errors[] = "Please choose a valid file for this release";   
    401401   }
     
    441441      $errors[] = "The title must not be empty";   
    442442   }
    443    if ( 'WP_DIRECT' == $hosting_type && '' == $filename ) {
     443   if ( dc_is_default_hosting_type( $hosting_type ) && '' == $filename ) {
    444444      $errors[] = "Please choose a valid file for this release";   
    445445   }
  • wp-download-codes/trunk/includes/helpers/file.php

    r2032823 r2033571  
    114114    );
    115115}
     116
     117/**
     118 * Returns if hosting type is default (WP_DIRECT)
     119 */
     120function dc_is_default_hosting_type($hosting_type)
     121{
     122    return ( '' == $hosting_type || 'WP_DIRECT' == $hosting_type );
     123}
    116124?>
  • wp-download-codes/trunk/resources/js/wp-download-codes.js

    r2032823 r2033571  
    101101   
    102102    switch (hosting_type) {
    103         case "WP_DIRECT":
    104             $("#manage-releases-hosting-type-wp-direct").show();
    105             $("#manage-releases-hosting-type-redirect-url-open").hide();
    106             break;
    107            
    108103        case "REDIRECT_URL_OPEN":
    109104            $("#manage-releases-hosting-type-wp-direct").hide();
    110105            $("#manage-releases-hosting-type-redirect-url-open").show();
    111106            break;
    112            
     107       
    113108        default:
     109            $("#manage-releases-hosting-type-wp-direct").show();
     110            $("#manage-releases-hosting-type-redirect-url-open").hide();
    114111            break;
    115112    }
  • wp-download-codes/trunk/wp-download-codes.php

    r2032823 r2033571  
    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.5.3
     8Version: 2.5.3.1
    99Author: misanthrop, spalmer
    1010Author URI: http://www.misantropolis.de, http://quoperative.com
Note: See TracChangeset for help on using the changeset viewer.