Plugin Directory

Changeset 3249887


Ignore:
Timestamp:
03/03/2025 06:27:58 PM (11 months ago)
Author:
3skel
Message:

update 1.0.20 / Add version var to check PRO compatibility.

Location:
hypertransfer/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • hypertransfer/trunk/assets/admin.php

    r3246045 r3249887  
    5757   
    5858    if ($ListaRecords) {
    59         echo '<table class="wp-list-table widefat">';
     59        echo '<table id="fileTable" class="wp-list-table widefat">';
    6060        echo '<thead ><tr>';
    61         echo '<th>File</th>';
    62         echo '<th class="centrato">Size Mb</th>';
     61        echo '<th onclick="HPTR_sortTable(0)">File</th>';
     62        echo '<th onclick="HPTR_sortTable(1)" class="centrato">Size Mb</th>';
    6363        do_action('HPTR_ACT_add_pro_row_head');
    6464        echo '<th class="centrato">Copy<br>Rapid link</th>';
    6565        echo '<th class="centrato">Action</th>';
    6666        echo '<th class="centrato">Downloaded<br>times</th>';
    67         echo '<th class="centrato">Upload<br>date</th>';
     67        echo '<th onclick="HPTR_sortTable(7)" class="centrato">Upload<br>date</th>';
    6868        echo '</tr></thead>';
    6969        echo '<tbody>';
     
    135135
    136136
    137 
    138 
    139137// Lista dei file registrati nella tabella option e quindi presenti nella cartella VERSIONE API WP
    140 function HPTR_items_files_list() {
     138
     139function HPTR_items_files_list($order_by = 'date', $order = 'DESC') {
    141140    // Ottieni tutte le opzioni
    142141    $all_options = wp_load_alloptions();
     
    148147            $filtered_options[$key] = maybe_unserialize($value);
    149148        }
    150    
    151     }
    152 
     149    }
     150
     151    // Ordina l'array in base alla chiave specificata mantenendo le chiavi originali
     152    uasort($filtered_options, function ($a, $b) use ($order_by, $order) {
     153        $valA = isset($a[$order_by]) ? $a[$order_by] : null;
     154        $valB = isset($b[$order_by]) ? $b[$order_by] : null;
     155
     156        if ($valA == $valB) {
     157            return 0;
     158        }
     159
     160        return ($order === 'ASC') ? ($valA <=> $valB) : ($valB <=> $valA);
     161    });
    153162
    154163    return $filtered_options;
  • hypertransfer/trunk/assets/hypertransfer.js

    r3246045 r3249887  
    370370
    371371}
     372
     373
     374function HPTR_sortTable(columnIndex) {
     375//
     376}
  • hypertransfer/trunk/hypertransfer.php

    r3246045 r3249887  
    55 * License:           GPL v2 or later
    66 * Description:       This plugin is used for the rapid and easy transfer of files, stored on your web space, via links. Valid alternative to file transfer sites, with the advantage of having no transfer deadline, the files are stored on your private web space and customers will be able to visit the website via the download page.
    7  * Version:           1.0.19
     7 * Version:           1.0.20
    88 * Requires at least: 6.3
    99 * Requires PHP:      7.4
     
    2222
    2323// Definisce la directory e variabili globali
    24 define('HYPERTRANSFER_THIS_VERSION', '1.0.19'); // *** Aggiornare come sopra *** //
     24
     25
     26define('HYPERTRANSFER_PRO_MIN', '1.0.19'); // Versione Pro Minima per funzionare con questa versione  BASE
     27
    2528define('HYPERTRANSFER_UPLOAD_DIR', wp_upload_dir()['basedir'] . '/HyperTransferFile/');
    2629define('HYPERTRANSFER_UPLOAD_URL', wp_upload_dir()['baseurl'] . '/HyperTransferFile/');
    2730define('HYPERTRANSFER_DIR', __FILE__);
    2831define('HYPERTRANSFER_URL', plugin_dir_url(__FILE__));
     32define('HYPERTRANSFER_THIS_VERSION', HPTR_this_plugin_ver()); // prende dall'header di questo file la versione corrente
     33
    2934
    3035// opzionie di compressione definite per riusarle più avanti
     
    3540    $Post_Upload_Compress = false;
    3641}
    37 
     42// funzione per leggere la versione dal header
     43function HPTR_this_plugin_ver() {
     44    // Set the file path to a variable.
     45    $file_path = HYPERTRANSFER_DIR;
     46    // Read the version number from the main plugin file then set it to a variable.
     47    $plugin_data = get_file_data( $file_path, array(
     48        'Version' => 'Version'
     49    ) );
     50
     51    if ( !empty( $plugin_data['Version'] ) ) {
     52        // The the value of the Version header to a variable.
     53        return $plugin_data['Version'];
     54    }
     55}
    3856
    3957// carica JS e CSS
    4058function HPTR_assets() {
    4159   
    42     wp_register_script( 'HyperTransferScript', plugin_dir_url(__FILE__) .'assets/hypertransfer.js', array( 'jquery' ), '1.0.19', true);
    43     wp_register_style( 'HyperTransferStyle', plugin_dir_url(__FILE__) .'assets/hypertransfer.css', array(), '1.0.19' );
     60    wp_register_script( 'HyperTransferScript', plugin_dir_url(__FILE__) .'assets/hypertransfer.js', array( 'jquery' ), '1.0.20', true);
     61    wp_register_style( 'HyperTransferStyle', plugin_dir_url(__FILE__) .'assets/hypertransfer.css', array(), '1.0.20' );
    4462   
    4563    wp_enqueue_style( 'HyperTransferStyle');
  • hypertransfer/trunk/readme.txt

    r3246045 r3249887  
    33Tags: file, transfer, sender, share, wp transfer
    44Tested up to: 6.7
    5 Stable tag: 1.0.19
     5Stable tag: 1.0.20
    66Requires PHP: 7.4
    77License: GPLv2
     
    6060* Initial release
    6161 
    62 == Upgrade Notice ==
    63  
    64 = 1.0.17 =
    65 Just released into the wild.
    66 
    6762= 1.0.18 =
    6863Fix page 404 if no key is defined in the "hypertransfer" url
     
    7166= 1.0.19 =
    7267Improved file deletion control.
     68
     69= 1.0.20 =
     70Add version var to check PRO compatibility.
     71
    7372
    7473== Language ==
Note: See TracChangeset for help on using the changeset viewer.