Plugin Directory

Changeset 691410


Ignore:
Timestamp:
04/03/2013 10:14:46 PM (13 years ago)
Author:
Potsky
Message:

release 0.4.1

Location:
s2member-secure-file-browser
Files:
100 added
12 edited

Legend:

Unmodified
Added
Removed
  • s2member-secure-file-browser/trunk/class/psk_s2msfb.admin.manager.class.php

    r689667 r691410  
    5555        wp_enqueue_script( 'jquery.tablesorter.widgets', PSK_S2MSFB_JS_URL . 'jquery.tablesorter.widgets.min.js', array( 'jquery', 'jquery.tablesorter' ), false, true );
    5656
    57         wp_enqueue_style( 'jquery.tablesorter.pager', PSK_S2MSFB_CSS_URL . 'jquery.tablesorter.pager.' . PSK_S2MSFB_EXT_CSS  );
    58         wp_enqueue_script( 'jquery.tablesorter.pager', PSK_S2MSFB_JS_URL . 'jquery.tablesorter.pager.' . PSK_S2MSFB_EXT_JS , array( 'jquery', 'jquery.tablesorter' ), false, true );
     57        wp_enqueue_style( 'jquery.tablesorter.pager', PSK_S2MSFB_CSS_URL . 'jquery.tablesorter.pager.' . PSK_S2MSFB_EXT_CSS );
     58        wp_enqueue_script( 'jquery.tablesorter.pager', PSK_S2MSFB_JS_URL . 'jquery.tablesorter.pager.' . PSK_S2MSFB_EXT_JS, array( 'jquery', 'jquery.tablesorter' ), false, true );
    5959
    6060        wp_enqueue_style( 'theme.bootstrap', PSK_S2MSFB_CSS_URL . 'theme.bootstrap.' . PSK_S2MSFB_EXT_CSS );
    6161
    62         wp_enqueue_script( PSK_S2MSFB_ID . '.admin.manager', PSK_S2MSFB_JS_URL . 'admin.manager.' . PSK_S2MSFB_EXT_JS , array( 'jquery', 'jquery.tablesorter' ), false, true );
     62        wp_enqueue_script( PSK_S2MSFB_ID . '.admin.manager', PSK_S2MSFB_JS_URL . 'admin.manager.' . PSK_S2MSFB_EXT_JS, array( 'jquery', 'jquery.tablesorter' ), false, true );
    6363    }
    6464
     
    122122                'more'     => __( 'Set to <code>1</code> to display all directories', PSK_S2MSFB_ID ),
    123123            ),
     124//          array(
     125//              'name'     => 'displaybirthdate',
     126//              'desc'     => __( 'Display files birth date', PSK_S2MSFB_ID ),
     127//              'descm'    => '',
     128//              'default'  => '0',
     129//              'defaultm' => '',
     130//              'more'     => __( 'Set to <code>0</code> to hide the date when the file has been added', PSK_S2MSFB_ID ),
     131//          ),
     132//          array(
     133//              'name'     => 'displaycomment',
     134//              'desc'     => __( 'Display files comment', PSK_S2MSFB_ID ),
     135//              'descm'    => '',
     136//              'default'  => '1',
     137//              'defaultm' => '',
     138//              'more'     => __( 'Set to <code>0</code> to hide files comment', PSK_S2MSFB_ID ),
     139//          ),
    124140            array(
    125141                'name'     => 'displaydownloaded',
     
    138154                'defaultm' => '',
    139155                'more'     => __( 'Set to <code>0</code> to hide files size', PSK_S2MSFB_ID ),
     156            ),
     157            array(
     158                'name'     => 'displaymodificationdate',
     159                'desc'     => __( 'Display files modification date', PSK_S2MSFB_ID ),
     160                'descm'    => '',
     161                'default'  => '0',
     162                'defaultm' => '',
     163                'more'     => __( 'Set to <code>0</code> to hide files modification date', PSK_S2MSFB_ID ),
    140164            ),
    141165            array(
     
    260284                    __( 'Can be set to <code>4</code> to display files group by extension with full path between parenthesis', PSK_S2MSFB_ID ),
    261285            ),
    262 
     286            array(
     287                'name'     => 'sortby',
     288                'desc'     => __( 'Sort files in directories by a criteria', PSK_S2MSFB_ID ),
     289                'descm'    => '',
     290                'default'  => '0',
     291                'defaultm' => __( 'Files are sorted by name', PSK_S2MSFB_ID ),
     292                'more'     =>
     293                    __( 'Can be set to <code>0D</code> to sort files by name descendant', PSK_S2MSFB_ID ) . '<br/>' .
     294                    __( 'Can be set to <code>1</code> to sort files by extension', PSK_S2MSFB_ID ) . '<br/>' .
     295                    __( 'Can be set to <code>1D</code> to sort files by extension descendant', PSK_S2MSFB_ID ) . '<br/>' .
     296                    __( 'Can be set to <code>2</code> to sort files by size', PSK_S2MSFB_ID ) . '<br/>' .
     297                    __( 'Can be set to <code>2D</code> to sort files by size descendant', PSK_S2MSFB_ID ) . '<br/>' .
     298                    __( 'Can be set to <code>3</code> to sort files by modification date', PSK_S2MSFB_ID ) . '<br/>' .
     299                    __( 'Can be set to <code>3D</code> to sort files by modification date descendant', PSK_S2MSFB_ID ),
     300//                  __( 'Can be set to <code>4</code> to sort files by birth date', PSK_S2MSFB_ID ) . '<br/>' .
     301//                  __( 'Can be set to <code>4D</code> to sort files by birth date descendant', PSK_S2MSFB_ID ),
     302            ),
    263303        );
    264304    }
     
    332372
    333373                    } else {
    334                         $result = PSK_S2MSFB::db_clean_files( true, ( $_POST['hash'] == '1' ) );
     374                        $result  = PSK_S2MSFB::db_clean_files( true, ( $_POST['hash'] == '1' ) );
    335375                        $message = __( 'The cache has been successfully refreshed !', PSK_S2MSFB_ID ) . '<br/><br/>';
    336376                    }
     
    455495
    456496            echo 'For readme.txt : <br/><pre>';
    457             foreach ( self::$shortcode_options as $option )
     497            foreach ( self::$shortcode_options as $option ) {
    458498                echo "* `" . $option['name'] . "` : " . $option['desc'] . "\n";
     499            }
    459500            echo '</pre>';
    460501
    461502            echo 'For wordpress doc : <br/><pre>';
    462             foreach ( self::$shortcode_options as $option )
     503            foreach ( self::$shortcode_options as $option ) {
    463504                echo "&lt;li&gt;&lt;code&gt;" . $option['name'] . "&lt;/code&gt; : " . $option['desc'] . "&lt;/li&gt;\n";
     505            }
    464506            echo '</pre>';
    465507
    466         }
    467 
    468         else {
     508        } else {
    469509            echo '<table class="table table-bordered table-striped">
    470510                <thead>
     
    554594                    break;
    555595
     596                case 'sortby' :
     597                    $checked0  = ( $default == "0" ) ? ' checked="checked"' : '';
     598                    $checked1  = ( $default == "1" ) ? ' checked="checked"' : '';
     599                    $checked2  = ( $default == "2" ) ? ' checked="checked"' : '';
     600                    $checked3  = ( $default == "3" ) ? ' checked="checked"' : '';
     601//                  $checked4  = ( $default == "4" ) ? ' checked="checked"' : '';
     602                    $checked0D = ( $default == "0D" ) ? ' checked="checked"' : '';
     603                    $checked1D = ( $default == "1D" ) ? ' checked="checked"' : '';
     604                    $checked2D = ( $default == "2D" ) ? ' checked="checked"' : '';
     605                    $checked3D = ( $default == "3D" ) ? ' checked="checked"' : '';
     606//                  $checked4D = ( $default == "4D" ) ? ' checked="checked"' : '';
     607                    $control .= '
     608                    <label class="radio inline">
     609                      <input class="generator" type="radio" name="' . $tagname . '" id="' . $tagname . '0" value="0"' . $checked0 . '/>' . __( 'Sort files by name', PSK_S2MSFB_ID ) . '
     610                    </label><br/>
     611                    <label class="radio inline">
     612                      <input class="generator" type="radio" name="' . $tagname . '" id="' . $tagname . '0D" value="0D"' . $checked0D . '/>' . __( 'Sort files by name descendant', PSK_S2MSFB_ID ) . '
     613                    </label><br/>
     614                    <label class="radio inline">
     615                      <input class="generator" type="radio" name="' . $tagname . '" id="' . $tagname . '1" value="1"' . $checked1 . '/>' . __( 'Sort files by extension', PSK_S2MSFB_ID ) . '
     616                    </label><br/>
     617                    <label class="radio inline">
     618                      <input class="generator" type="radio" name="' . $tagname . '" id="' . $tagname . '1D" value="1D"' . $checked1D . '/>' . __( 'Sort files by extension descendant', PSK_S2MSFB_ID ) . '
     619                    </label><br/>
     620                    <label class="radio inline">
     621                      <input class="generator" type="radio" name="' . $tagname . '" id="' . $tagname . '2" value="2"' . $checked2 . '/>' . __( 'Sort files by size', PSK_S2MSFB_ID ) . '
     622                    </label><br/>
     623                    <label class="radio inline">
     624                      <input class="generator" type="radio" name="' . $tagname . '" id="' . $tagname . '2D" value="2D"' . $checked2D . '/>' . __( 'Sort files by size descendant', PSK_S2MSFB_ID ) . '
     625                    </label><br/>
     626                    <label class="radio inline">
     627                      <input class="generator" type="radio" name="' . $tagname . '" id="' . $tagname . '3" value="3"' . $checked3 . '/>' . __( 'Sort files by modification date', PSK_S2MSFB_ID ) . '
     628                    </label><br/>
     629                    <label class="radio inline">
     630                      <input class="generator" type="radio" name="' . $tagname . '" id="' . $tagname . '3D" value="3D"' . $checked3D . '/>' . __( 'Sort files by modification date descendant', PSK_S2MSFB_ID ) . '
     631                    </label><br/>
     632                    ';
     633//                  <label class="radio inline">
     634//                    <input class="generator" type="radio" name="' . $tagname . '" id="' . $tagname . '4" value="4"' . $checked4 . '/>' . __( 'Sort files by birth date', PSK_S2MSFB_ID ) . '
     635//                  </label><br/>
     636//                  <label class="radio inline">
     637//                    <input class="generator" type="radio" name="' . $tagname . '" id="' . $tagname . '4D" value="4D"' . $checked4D . '/>' . __( 'Sort files by birth date descendant', PSK_S2MSFB_ID ) . '
     638//                  </label><br/>
     639
     640                    break;
     641
    556642                case 'searchdisplay' :
    557643                    $checked0 = ( $default == "0" ) ? ' checked="checked"' : '';
     
    578664                    break;
    579665
    580                 case 'displayall'        :
    581                 case 'displaysize'       :
    582                 case 'dirzip'            :
    583                 case 'dirfirst'          :
    584                 case 'hidden'            :
    585                 case 'multifolder'       :
    586                 case 'openrecursive'     :
    587                 case 's2alertbox'        :
     666                case 'displayall'              :
     667                case 'displaysize'             :
     668                case 'displaybirthdate'        :
     669                case 'displaymodificationdate' :
     670                case 'displaycomment'          :
     671                case 'dirzip'                  :
     672                case 'dirfirst'                :
     673                case 'hidden'                  :
     674                case 'multifolder'             :
     675                case 'openrecursive'           :
     676                case 's2alertbox'              :
    588677                    $checked1 = ( $default == "1" ) ? ' checked="checked"' : '';
    589678                    $checked0 = ( $default != "1" ) ? ' checked="checked"' : '';
  • s2member-secure-file-browser/trunk/class/psk_s2msfb.class.php

    r689667 r691410  
    5353    private static $display_all_levels = '';
    5454    private static $displaysize = true;
     55    private static $displaymodificationdate = true;
     56    private static $displaybirthdate = true;
    5557    private static $displaydownloaded = 0;
    5658    private static $search = 0;
     59    private static $sortby = '0';
     60    private static $sortby_available = array( '0', '1', '2', '3', '0D', '1D', '2D', '3D' );
    5761    private static $searchdisplay = 0;
    5862    private static $dirzip = false;
     
    394398        self::$openrecursive           = ( @$_POST['openrecursive'] == '1' ) ? true : false;
    395399        self::$displaysize             = ( @$_POST['displaysize'] == '0' ) ? false : true;
     400        self::$displaymodificationdate = ( @$_POST['displaymodificationdate'] == '0' ) ? false : true;
     401        self::$displaybirthdate        = ( @$_POST['displaybirthdate'] == '0' ) ? false : true;
    396402        self::$dirzip                  = ( @$_POST['dirzip'] == '1' ) ? true : false;
    397403        self::$displaydownloaded       = (int) @$_POST['displaydownloaded'];
     
    402408        self::$filterfile              = stripslashes( rawurldecode( @$_POST['filterfile'] ) );
    403409        self::$filterdir               = stripslashes( rawurldecode( @$_POST['filterdir'] ) );
    404         $display_directory_names       = stripslashes( @$_POST['names'] );
     410
     411        if ( in_array( @$_POST['sortby'], self::$sortby_available ) )
     412            self::$sortby = $_POST['sortby'];
    405413
    406414        self::$displayed_directory_names = array();
    407         $tmp                             = explode( '|', $display_directory_names );
     415        $tmp                             = explode( '|', stripslashes( @$_POST['names'] ) );
    408416        foreach ( $tmp as $keyval ) {
    409417            @list( $key, $val ) = @explode( ':', $keyval, 2 );
    410418            self::$displayed_directory_names[rawurldecode( $key )] = rawurldecode( $val );
    411419        }
     420
    412421        self::$previewext = array();
    413         /** @var $ext string */
    414         foreach ( explode( ',', @$_POST['previewext'] ) as $ext ) {
    415             $ext = trim( strtolower( $ext ) );
    416             if ( in_array( $ext, self::$previewext_available ) )
    417                 self::$previewext[] = $ext;
     422        if ( is_user_logged_in() ) {
     423            /** @var $ext string */
     424            foreach ( explode( ',', @$_POST['previewext'] ) as $ext ) {
     425                $ext = trim( strtolower( $ext ) );
     426                if ( in_array( $ext, self::$previewext_available ) )
     427                    self::$previewext[] = $ext;
     428            }
    418429        }
    419430
     
    478489            $resultf = array();
    479490            $resultd = array();
     491            $ext_all = array();
     492            $mdate_all = array();
     493            $size_all = array();
    480494
    481495            // Part : listing
    482496            if ( $token == '' ) {
     497                // TODO: Retrieve db informations if needed later (comments,birthdate)
    483498
    484499                // Browse all dirs and files
     
    508523                            if ( ! preg_match( self::$filterdir, $file ) )
    509524                                continue;
    510                             else
    511                                 if ( self::$filterfile != '' )
    512                                     if ( ! preg_match( self::$filterfile, $file ) )
    513                                         continue;
     525                    } else {
     526                        if ( self::$filterfile != '' )
     527                            if ( ! preg_match( self::$filterfile, $file ) )
     528                                continue;
    514529                    }
    515530
     
    537552
    538553                    // Get the html fragment
    539                     list( $display_name, $li ) = self::get_html_li_token( $isdir, $file, $filepathrelbase, $filepathrel, $filepath, $current, $dirbase, $token, $alreadyd, $hashes );
    540                     if ( self::$display_directory_first )
    541                         if ( $isdir )
     554                    list( $display_name, $li, $size, $mdate, $ext ) = self::get_html_li_token( $isdir, $file, $filepathrelbase, $filepathrel, $filepath, $current, $dirbase, $token, $alreadyd, $hashes );
     555
     556                    if ( self::$display_directory_first ) {
     557                        if ( $isdir ) {
    542558                            $resultd[$display_name] = $li;
    543                         else
    544                             $resultf[$display_name] = $li;
    545                     else
    546                         $result[$display_name] = $li;
     559                        } else {
     560                            $resultf[$display_name]   = $li;
     561                            $size_all[$display_name]  = $size;
     562                            $mdate_all[$display_name] = $mdate;
     563                            $ext_all[$display_name]   = $ext;
     564                        }
     565                    } else {
     566                        $result[$display_name]    = $li;
     567                        $size_all[$display_name]  = $size;
     568                        $mdate_all[$display_name] = $mdate;
     569                        $ext_all[$display_name]   = $ext;
     570                    }
    547571
    548572                }
     
    551575                if ( self::$display_directory_first ) {
    552576                    uksort( $resultd, "strnatcasecmp" );
    553                     uksort( $resultf, "strnatcasecmp" );
     577                    switch ( self::$sortby ) {
     578                        case '0D' :
     579                            uksort( $resultf, "strnatcasecmp" );
     580                            $resultf = array_reverse( $resultf , true );
     581                            break;
     582                        case '1' :
     583                            array_multisort( $ext_all, SORT_STRING, SORT_ASC, $resultf, SORT_STRING, SORT_ASC );
     584                            break;
     585                        case '1D' :
     586                            array_multisort( $ext_all, SORT_STRING, SORT_DESC, $resultf, SORT_STRING, SORT_ASC );
     587                            break;
     588                        case '2' :
     589                            array_multisort( $size_all, SORT_NUMERIC, SORT_ASC, $resultf, SORT_STRING, SORT_ASC );
     590                            break;
     591                        case '2D' :
     592                            array_multisort( $size_all, SORT_NUMERIC, SORT_DESC, $resultf, SORT_STRING, SORT_ASC );
     593                            break;
     594                        case '3' :
     595                            array_multisort( $mdate_all, SORT_NUMERIC, SORT_ASC, $resultf, SORT_STRING, SORT_ASC );
     596                            break;
     597                        case '3D' :
     598                            array_multisort( $mdate_all, SORT_NUMERIC, SORT_DESC, $resultf, SORT_STRING, SORT_ASC );
     599                            break;
     600                        default:
     601                            uksort( $resultf, "strnatcasecmp" );
     602                            break;
     603                    }
    554604                    $result = array_merge( $resultd, $resultf );
    555605                } else {
    556                     uksort( $result, "strnatcasecmp" );
     606                    switch ( self::$sortby ) {
     607                        case '0D' :
     608                            uksort( $result, "strnatcasecmp" );
     609                            $result = array_reverse( $result , true );
     610                            break;
     611                        case '1' :
     612                            array_multisort( $ext_all, SORT_STRING, SORT_ASC, $result, SORT_STRING, SORT_ASC );
     613                            break;
     614                        case '1D' :
     615                            array_multisort( $ext_all, SORT_STRING, SORT_DESC, $result, SORT_STRING, SORT_ASC );
     616                            break;
     617                        case '2' :
     618                            array_multisort( $size_all, SORT_NUMERIC, SORT_ASC, $result, SORT_STRING, SORT_ASC );
     619                            break;
     620                        case '2D' :
     621                            array_multisort( $size_all, SORT_NUMERIC, SORT_DESC, $result, SORT_STRING, SORT_ASC );
     622                            break;
     623                        case '3' :
     624                            array_multisort( $mdate_all, SORT_NUMERIC, SORT_ASC, $result, SORT_STRING, SORT_ASC );
     625                            break;
     626                        case '3D' :
     627                            array_multisort( $mdate_all, SORT_NUMERIC, SORT_DESC, $result, SORT_STRING, SORT_ASC );
     628                            break;
     629                        default:
     630                            uksort( $result, "strnatcasecmp" );
     631                            break;
     632                    }
    557633                }
    558 
    559634                $search_inp_value = __( 'Search...', PSK_S2MSFB_ID );
    560635                $reset_btn_hidden = ' style="display:none;" ';
     
    585660                    $clause = ( count( $clauses ) > 0 ) ? ' AND ( ' . implode( ' OR ', $clauses ) . ' ) ' : '';
    586661                    $worda  = implode( ' ', $wordz );
    587                     $sql    = "SELECT filename, filepath, MATCH(filename) AGAINST('" . mysql_real_escape_string( $worda ) . ' ' . mysql_real_escape_string( str_replace( ' ', '* ', $worda . '*' ) ) . "' IN BOOLEAN MODE) AS score ";
    588                     $sql .= "FROM " . $tablename . " ";
    589                     $sql .= "WHERE filepath LIKE '" . mysql_real_escape_string( $dirfile ) . "%' " . $clause;
    590                     $sql .= "ORDER BY score DESC, filename";
     662                    $sql    = " SELECT filename, filepath, MATCH(filename) AGAINST('" . mysql_real_escape_string( $worda ) . ' ' . mysql_real_escape_string( str_replace( ' ', '* ', $worda . '*' ) ) . "' IN BOOLEAN MODE) AS score ";
     663                    $sql .= " FROM " . $tablename . " ";
     664                    $sql .= " WHERE filepath LIKE '" . mysql_real_escape_string( $dirfile ) . "%' " . $clause;
     665                    $sql .= " ORDER BY score DESC, filename";
    591666                    $sqlres = $wpdb->get_results( $sql, ARRAY_A );
    592667
     
    636711                    $clause = ( count( $clauses ) > 0 ) ? ' AND ( ' . implode( ' OR ', $clauses ) . ' ) ' : '';
    637712                    $worda  = implode( ' ', $wordz );
    638                     $sql    = "SELECT filename, filepath, fileext, MATCH(filename) AGAINST('" . mysql_real_escape_string( $worda ) . ' ' . mysql_real_escape_string( str_replace( ' ', '* ', $worda . '*' ) ) . "' IN BOOLEAN MODE) AS score ";
    639                     $sql .= "FROM " . $tablename . " ";
    640                     $sql .= "WHERE filepath LIKE '" . mysql_real_escape_string( $dirfile ) . "%' " . $clause;
    641                     $sql .= "ORDER BY score DESC, filename";
     713                    $sql    = " SELECT filename, filepath, fileext, MATCH(filename) AGAINST('" . mysql_real_escape_string( $worda ) . ' ' . mysql_real_escape_string( str_replace( ' ', '* ', $worda . '*' ) ) . "' IN BOOLEAN MODE) AS score ";
     714                    $sql .= " FROM " . $tablename . " ";
     715                    $sql .= " WHERE filepath LIKE '" . mysql_real_escape_string( $dirfile ) . "%' " . $clause;
     716                    $sql .= " ORDER BY score DESC, filename";
    642717                    $sqlres = $wpdb->get_results( $sql, ARRAY_A );
    643718
     
    687762                    $clause = ( count( $clauses ) > 0 ) ? ' AND ( ' . implode( ' OR ', $clauses ) . ' ) ' : '';
    688763                    $worda  = implode( ' ', $wordz );
    689                     $sql    = "SELECT filename, filepath, MATCH(filename) AGAINST('" . mysql_real_escape_string( $worda ) . ' ' . mysql_real_escape_string( str_replace( ' ', '* ', $worda . '*' ) ) . "' IN BOOLEAN MODE) AS score ";
    690                     $sql .= "FROM " . $tablename . " ";
    691                     $sql .= "WHERE filepath LIKE '" . mysql_real_escape_string( $dirfile ) . "%' " . $clause;
    692                     $sql .= "ORDER BY score DESC, filename";
     764                    $sql    = " SELECT filename, filepath, MATCH(filename) AGAINST('" . mysql_real_escape_string( $worda ) . ' ' . mysql_real_escape_string( str_replace( ' ', '* ', $worda . '*' ) ) . "' IN BOOLEAN MODE) AS score ";
     765                    $sql .= " FROM " . $tablename . " ";
     766                    $sql .= " WHERE filepath LIKE '" . mysql_real_escape_string( $dirfile ) . "%' " . $clause;
     767                    $sql .= " ORDER BY score DESC, filename";
    693768                    $sqlres = $wpdb->get_results( $sql, ARRAY_A );
    694769
     
    718793                $search_inp_title = __( 'Search...', PSK_S2MSFB_ID );
    719794
     795                $ie      = ( preg_match( '~MSIE|Internet Explorer~i' , $_SERVER['HTTP_USER_AGENT'] ) ) ? 'ie ' : '';
    720796                $return .= '<li>';
    721                 $return .= ' <div class="PSK_S2MSFB_search">';
     797                $return .= ' <div class="PSK_S2MSFB_search' . $ie . '">';
    722798                $return .= '  <button value="reset"' . $reset_btn_hidden . 'class="PSK_S2MSFB_' . $reset_class . 'btn" title="' . PSK_Tools::rel_literal( $reset_btn_value ) . '"></button>';
    723799                $return .= '  <button value="submit" class="PSK_S2MSFB_searchbtn" title="' . PSK_Tools::rel_literal( $search_btn_value ) . '"></button>';
     
    819895    private static function get_html_li_token( $isdir, $file, $filepathrelbase, $filepathrel, $filepath, $current, $dirbase, $token, $alreadyd, $hashes, $extended = '' ) {
    820896
    821         $display_name = self::get_display_name( $isdir, $file );
    822 
     897        $display_name    = self::get_display_name( $isdir, $file );
     898        $filepathrelbase = PSK_Tools::sanitize_directory_path( $filepathrelbase, true, false );
     899        $size            = 0;
     900        $mdate           = 0;
     901        $ext             = '';
    823902        if ( $isdir ) {
    824903            $lizip    = '';
     
    827906            $alreadya = '0';
    828907
    829             if ( file_exists( $filepath . '.zip' ) ) {
    830                 $filepathrelbasezip = $filepathrelbase . '.zip';
    831                 $link               = PSK_Tools::rel_literal( s2member_file_download_url( array( 'file_download' => $filepathrelbasezip ) ) );
    832                 if ( self::$displaydownloaded > 0 ) {
    833                     if ( isset( $alreadyd[$filepathrelbasezip] ) ) {
    834                         if ( ! isset( $hashes[$filepathrelbasezip] ) ) {
    835                             self::db_clean_files();
    836                         } else {
    837                             if ( $hashes[$filepathrelbasezip] == $alreadyd[$filepathrelbasezip] ) {
    838                                 if ( self::$displaydownloaded == 2 ) {
    839                                     $already  = '';
    840                                     $alreadys = ' already';
     908            if ( self::$dirzip == "1" ) {
     909                if ( file_exists( $filepath . '.zip' ) ) {
     910                    $filepathrelbasezip = $filepathrelbase . '.zip';
     911                    $link               = PSK_Tools::rel_literal( s2member_file_download_url( array( 'file_download' => $filepathrelbasezip ) ) );
     912                    if ( self::$displaydownloaded > 0 ) {
     913                        if ( isset( $alreadyd[$filepathrelbasezip] ) ) {
     914                            if ( ! isset( $hashes[$filepathrelbasezip] ) ) {
     915                                self::db_clean_files();
     916                            } else {
     917                                if ( $hashes[$filepathrelbasezip] == $alreadyd[$filepathrelbasezip] ) {
     918                                    if ( self::$displaydownloaded == 2 ) {
     919                                        $already  = '';
     920                                        $alreadys = ' already';
     921                                    }
     922                                    $alreadya = '1';
    841923                                }
    842                                 $alreadya = '1';
    843924                            }
    844925                        }
    845926                    }
     927                    $lizip = '<span class="d dwnl display_name"><a href="#" class="link" rel="' . $link . '">' . __( 'Download zip', PSK_S2MSFB_ID ) . '</a></span>';
    846928                }
    847                 $lizip = '<span class="d dwnl display_name"><a href="#" class="link" rel="' . $link . '">' . __( 'Download zip', PSK_S2MSFB_ID ) . '</a></span>';
    848929            }
    849930
     
    864945
    865946        } else {
    866             $ext      = mb_strtolower( preg_replace( '/^.*\./', '', $file ) );
    867             $link     = PSK_Tools::rel_literal( s2member_file_download_url( array( 'file_download' => $filepathrelbase ) ) );
    868             $prev     = PSK_Tools::rel_literal( s2member_file_download_url( array( 'file_download' => $filepathrelbase, 'file_inline' => true ) ) );
    869             $size     = filesize( $filepath );
    870             $hsize    = PSK_Tools::size_readable( $size );
    871             $size     = PSK_Tools::rel_literal( $size );
     947            $ext  = mb_strtolower( preg_replace( '/^.*\./', '', $file ) );
     948            $link = PSK_Tools::rel_literal( s2member_file_download_url( array( 'file_download' => $filepathrelbase ) ) );
     949            $prev = PSK_Tools::rel_literal( s2member_file_download_url( array( 'file_download' => $filepathrelbase, 'file_inline' => true ) ) . '&PSK_preview=1' );
     950
     951            if ( ( 2 == (int) self::$sortby ) || ( self::$displaysize ) )
     952                $size = filesize( $filepath );
     953            if ( self::$displaysize ) {
     954                $hsize = PSK_Tools::size_readable( $size );
     955                $msize = PSK_Tools::rel_literal( $size );
     956            }
     957
     958            if ( ( 3 == (int) self::$sortby ) || ( self::$displaymodificationdate ) )
     959                $mdate = filemtime( $filepath ) + get_option( 'gmt_offset' ) * 3600;
     960            if ( self::$displaymodificationdate ) {
     961                $hmdate = date_i18n( sprintf( '%1$s - %2$s', get_option( 'date_format' ), get_option( 'time_format' ) ), $mdate );
     962                $tmdate = PSK_Tools::rel_literal( sprintf( __( 'Modified on %s', PSK_S2MSFB_ID ), $hmdate ) );
     963            }
     964
    872965            $already  = ' style="display:none;"';
    873966            $alreadys = '';
     
    890983
    891984            /** @var $ext string */
    892             $li = '<li class="file' . $alreadys . ' ext_' . PSK_Tools::rel_literal( $ext ) . '" data-s="' . $size . '" data-already="' . $alreadya . '">';
     985            $li = '<li data-n="' . $display_name . '" class="file' . $alreadys . ' ext_' . PSK_Tools::rel_literal( $ext ) . '" data-s="' . $msize . '" data-already="' . $alreadya . '">';
    893986            $li .= '<div class="jftctn"><a href="#" class="link" rel="' . $link . '">' . $display_name . $extended . '</a>';
    894             $li .= '<span class="size d" title="' . $size . ' ' . _x( 'B', 'Bytes abbr', PSK_S2MSFB_ID ) . '">';
    895             $li .= ( self::$displaysize ) ? $hsize : '';
    896             $li .= '</span>';
     987
     988            if ( self::$displaysize ) {
     989                $li .= '<span class="size d" title="' . $msize . ' ' . _x( 'B', 'Bytes abbr', PSK_S2MSFB_ID ) . '">' . $hsize . '</span>';
     990            }
     991
     992            if ( self::$displaymodificationdate )
     993                $li .= '<span class="size d" title="' . $tmdate . '">' . $hmdate . '</span>';
    897994
    898995            if ( in_array( $ext, self::$previewext ) )
     
    9061003        }
    9071004
    908         return array( $display_name, $li );
    909 
     1005        return array( $display_name, $li, $size, $mdate, $ext );
    9101006    }
    9111007
     
    9391035        $rt .= '}, function( obj ) {';
    9401036
    941         $rt .= 'var download = false;';
    942         $rt .= 'var a = $(obj).parent().parent().attr( "data-already" );';
    943         $rt .= 'var f = (typeof a !== "undefined" && a !== false) ? $(obj).parent().parent() : $(obj).parent().parent().parent();'; // file or directory
     1037        /*      $rt .= 'var download = false;';
     1038                $rt .= 'var a = $(obj).parent().parent().attr( "data-already" );';
     1039                $rt .= 'var f = (typeof a !== "undefined" && a !== false) ? $(obj).parent().parent() : $(obj).parent().parent().parent();'; // file or directory
     1040        */
     1041        $rt .= 'var download=false;';
     1042        $rt .= 'var f=$(obj).parent().parent(); if ($(f).attr("data-already")===undefined) f=$(f).parent();'; // file or directory
    9441043
    9451044        if ( @$atts['displaydownloaded'] == '1' ) {
     
    10221121                $users[$user->ID] = $user->display_name;
    10231122            }
    1024 
    10251123
    10261124            // Block unnotified rows now
     
    10771175                    $msg .= '<h3>' . __( 'Top downloaders', PSK_S2MSFB_ID ) . '</h3>';
    10781176                    $tablename = $wpdb->prefix . PSK_S2MSFB_DB_DOWNLOAD_TABLE_NAME;
    1079                     $sql       = "SELECT userid, COUNT(*) A FROM " . $tablename . "WHERE notified='" . $now . " GROUP BY userid ORDER BY A DESC";
     1177                    $sql       = "SELECT userid, COUNT(*) A FROM " . $tablename . " WHERE notified='" . $now . " GROUP BY userid ORDER BY A DESC";
    10801178                    $result    = $wpdb->get_results( $sql, ARRAY_A );
    10811179                    if ( count( $result ) == 0 ) {
     
    11331231        global $wpdb;
    11341232
    1135         /* It seems to be a preview...
    1136          * Do not record anything
    1137          */
    1138         if ( isset( $vars['serving_range'] ) ) {
    1139             if ( $vars['serving_range'] === true ) {
     1233        if ( isset( $_GET["s2member_file_download"] ) ) {
     1234
     1235            // It seems to be a preview..., do not record anything
     1236            if ( isset( $_GET['PSK_preview'] ) )
    11401237                return;
    1141             }
    1142         }
    1143 
    1144         if ( isset( $_GET["s2member_file_download"] ) ) {
     1238
    11451239            delete_transient( PSK_S2MSFB_WIDGET_DOWNLOAD_LATEST_ID );
    11461240            delete_transient( PSK_S2MSFB_WIDGET_DOWNLOAD_TOP0_ID );
  • s2member-secure-file-browser/trunk/css/jqueryFileTree.css

    r689667 r691410  
    3737UL.jqueryFileTree .size {
    3838    color: #888;
    39     font-style: italic;
    4039    text-align: right;
    41     width: 100px;
     40    width: 90px;
     41    font-size:10px!important;
     42}
     43
     44UL.jqueryFileTree .mdate {
     45    color: #888;
     46    text-align: right;
     47    width: 200px;
     48    margin-right: 20px!important;
     49    font-size:10px!important;
    4250}
    4351
     
    8290    background-repeat: no-repeat;
    8391    background-position: 0 0;
     92    margin-left: 20px!important;
    8493}
    8594.jqueryFileTree LI.file SPAN.prev DIV.play {
     
    371380    clear:left;
    372381}
     382
     383.PSK_S2MSFB_searchie {
     384    width:250px!important;
     385    opacity:0.5;
     386    display: block;
     387    float:left;
     388    clear:left;
     389}
     390
     391.PSK_S2MSFB_searchie:hover,
    373392.PSK_S2MSFB_search:hover {
    374393    opacity:1.0;
    375394}
     395.PSK_S2MSFB_searchie input,
    376396.PSK_S2MSFB_search input {
    377     float:right;
    378     width:190px;
    379     height:14px;
     397    float:right!important;
     398    width:190px!important;
     399    height:14px!important;
    380400    margin:0!important;
    381401    border-top: 1px solid #f4f4f4!important;
     
    386406    font-size:small!important;
    387407}
     408.PSK_S2MSFB_searchie input:hover,
    388409.PSK_S2MSFB_search input:hover {
    389410    color: #3f9aff!important;
    390411}
     412.PSK_S2MSFB_searchie button,
    391413.PSK_S2MSFB_search button {
    392     float:right;
    393     width:23px;
    394     height:18px;
     414    float:right!important;;
     415    width:23px!important;;
     416    height:18px!important;;
    395417    margin:0!important;
    396418    padding:0!important;
    397419    border:0!important;
    398     background-repeat:no-repeat;
    399 }
     420    background-repeat:no-repeat!important;;
     421}
     422.PSK_S2MSFB_searchie button.PSK_S2MSFB_searchbtn,
    400423.PSK_S2MSFB_search button.PSK_S2MSFB_searchbtn {
    401424    background-image:url('../img/search.png');
    402425}
     426.PSK_S2MSFB_searchie button.PSK_S2MSFB_resetbtn,
     427.PSK_S2MSFB_searchie button.PSK_S2MSFB_reloadbtn,
    403428.PSK_S2MSFB_search button.PSK_S2MSFB_resetbtn,
    404429.PSK_S2MSFB_search button.PSK_S2MSFB_reloadbtn {
     
    406431}
    407432
     433.PSK_S2MSFB_searchie button:hover,
    408434.PSK_S2MSFB_search button:hover {
    409435    cursor:pointer;
    410436}
    411 
    412 
    413 
    414 
  • s2member-secure-file-browser/trunk/css/jqueryFileTree.min.css

    r689667 r691410  
    1 UL.jqueryFileTree{font-family:Verdana,sans-serif;font-size:11px;line-height:18px;margin:0;padding:0;padding-left:20px}UL.jqueryFileTree LI{list-style:none;margin:0;padding:0;white-space:nowrap}.jqueryFileTree div.jftctn:hover{background-color:#f4f4ff}UL.jqueryFileTree A.link,UL.jqueryFileTree A.prev{color:#333;text-decoration:none;display:block;float:left;clear:left;margin:0;padding:0;padding-left:20px}UL.jqueryFileTree A.link SPAN.fn{color:#888;font-style:italic}UL.jqueryFileTree .size{color:#888;font-style:italic;text-align:right;width:100px}UL.jqueryFileTree .d{float:right;margin:0;padding:0}UL.jqueryFileTree input,UL.jqueryFileTree label{margin:0;padding:0;background:0}.jqueryFileTree LI.waitinit{background:url(../img/spinner.gif) left top no-repeat;padding-left:20px}.jqueryFileTree LI.directory SPAN.dwnl A.link{background:url(../img/download.png) left top no-repeat}.jqueryFileTree LI.directory A.link{background:url(../img/folder_open.png) left top no-repeat}.jqueryFileTree LI.collapsed A.link{background:url(../img/directory.png) left top no-repeat}.jqueryFileTree LI.already{opacity:.69}.jqueryFileTree LI.file SPAN.prev DIV{width:16px;height:16px;background:url(../img/playpause.png);background-repeat:no-repeat;background-position:0 0}.jqueryFileTree LI.file SPAN.prev DIV.play{background-position:0 0}.jqueryFileTree LI.file SPAN.prev DIV.stop{background-position:0 -16px}.jqueryFileTree LI.file SPAN.prev DIV.play:hover{background-position:-16px 0}.jqueryFileTree LI.file SPAN.prev DIV.stop:hover{background-position:-16px -16px}.jqueryFileTree LI.file A.link{background:url(../img/file.png) left top no-repeat}.jqueryFileTree LI.wait A.link{background:url(../img/spinner.gif) left top no-repeat}.jqueryFileTree LI.ext_3gp A.link{background:url(../img/film.png) left top no-repeat}.jqueryFileTree LI.ext_afp A.link{background:url(../img/code.png) left top no-repeat}.jqueryFileTree LI.ext_afpa A.link{background:url(../img/code.png) left top no-repeat}.jqueryFileTree LI.ext_asp A.link{background:url(../img/code.png) left top no-repeat}.jqueryFileTree LI.ext_aspx A.link{background:url(../img/code.png) left top no-repeat}.jqueryFileTree LI.ext_avi A.link{background:url(../img/film.png) left top no-repeat}.jqueryFileTree LI.ext_bat A.link{background:url(../img/application.png) left top no-repeat}.jqueryFileTree LI.ext_bmp A.link{background:url(../img/picture.png) left top no-repeat}.jqueryFileTree LI.ext_c A.link{background:url(../img/code.png) left top no-repeat}.jqueryFileTree LI.ext_cfm A.link{background:url(../img/code.png) left top no-repeat}.jqueryFileTree LI.ext_cgi A.link{background:url(../img/code.png) left top no-repeat}.jqueryFileTree LI.ext_com A.link{background:url(../img/application.png) left top no-repeat}.jqueryFileTree LI.ext_cpp A.link{background:url(../img/code.png) left top no-repeat}.jqueryFileTree LI.ext_css A.link{background:url(../img/css.png) left top no-repeat}.jqueryFileTree LI.ext_doc A.link{background:url(../img/doc.png) left top no-repeat}.jqueryFileTree LI.ext_exe A.link{background:url(../img/application.png) left top no-repeat}.jqueryFileTree LI.ext_gif A.link{background:url(../img/picture.png) left top no-repeat}.jqueryFileTree LI.ext_fla A.link{background:url(../img/flash.png) left top no-repeat}.jqueryFileTree LI.ext_h A.link{background:url(../img/code.png) left top no-repeat}.jqueryFileTree LI.ext_htm A.link{background:url(../img/html.png) left top no-repeat}.jqueryFileTree LI.ext_html A.link{background:url(../img/html.png) left top no-repeat}.jqueryFileTree LI.ext_jar A.link{background:url(../img/java.png) left top no-repeat}.jqueryFileTree LI.ext_jpg A.link{background:url(../img/picture.png) left top no-repeat}.jqueryFileTree LI.ext_jpeg A.link{background:url(../img/picture.png) left top no-repeat}.jqueryFileTree LI.ext_js A.link{background:url(../img/script.png) left top no-repeat}.jqueryFileTree LI.ext_lasso A.link{background:url(../img/code.png) left top no-repeat}.jqueryFileTree LI.ext_log A.link{background:url(../img/txt.png) left top no-repeat}.jqueryFileTree LI.ext_m4p A.link{background:url(../img/music.png) left top no-repeat}.jqueryFileTree LI.ext_mov A.link{background:url(../img/film.png) left top no-repeat}.jqueryFileTree LI.ext_mp3 A.link{background:url(../img/music.png) left top no-repeat}.jqueryFileTree LI.ext_mp4 A.link{background:url(../img/film.png) left top no-repeat}.jqueryFileTree LI.ext_mpg A.link{background:url(../img/film.png) left top no-repeat}.jqueryFileTree LI.ext_mpeg A.link{background:url(../img/film.png) left top no-repeat}.jqueryFileTree LI.ext_mpeg4 A.link{background:url(../img/film.png) left top no-repeat}.jqueryFileTree LI.ext_ogg A.link{background:url(../img/music.png) left top no-repeat}.jqueryFileTree LI.ext_pcx A.link{background:url(../img/picture.png) left top no-repeat}.jqueryFileTree LI.ext_pdf A.link{background:url(../img/pdf.png) left top no-repeat}.jqueryFileTree LI.ext_php A.link{background:url(../img/php.png) left top no-repeat}.jqueryFileTree LI.ext_png A.link{background:url(../img/picture.png) left top no-repeat}.jqueryFileTree LI.ext_ppt A.link{background:url(../img/ppt.png) left top no-repeat}.jqueryFileTree LI.ext_pps A.link{background:url(../img/ppt.png) left top no-repeat}.jqueryFileTree LI.ext_psd A.link{background:url(../img/psd.png) left top no-repeat}.jqueryFileTree LI.ext_pl A.link{background:url(../img/script.png) left top no-repeat}.jqueryFileTree LI.ext_py A.link{background:url(../img/script.png) left top no-repeat}.jqueryFileTree LI.ext_rb A.link{background:url(../img/ruby.png) left top no-repeat}.jqueryFileTree LI.ext_rbx A.link{background:url(../img/ruby.png) left top no-repeat}.jqueryFileTree LI.ext_rhtml A.link{background:url(../img/ruby.png) left top no-repeat}.jqueryFileTree LI.ext_rpm A.link{background:url(../img/linux.png) left top no-repeat}.jqueryFileTree LI.ext_ruby A.link{background:url(../img/ruby.png) left top no-repeat}.jqueryFileTree LI.ext_sql A.link{background:url(../img/db.png) left top no-repeat}.jqueryFileTree LI.ext_swf A.link{background:url(../img/flash.png) left top no-repeat}.jqueryFileTree LI.ext_tif A.link{background:url(../img/picture.png) left top no-repeat}.jqueryFileTree LI.ext_tiff A.link{background:url(../img/picture.png) left top no-repeat}.jqueryFileTree LI.ext_txt A.link{background:url(../img/txt.png) left top no-repeat}.jqueryFileTree LI.ext_vb A.link{background:url(../img/code.png) left top no-repeat}.jqueryFileTree LI.ext_wav A.link{background:url(../img/music.png) left top no-repeat}.jqueryFileTree LI.ext_wmv A.link{background:url(../img/film.png) left top no-repeat}.jqueryFileTree LI.ext_xls A.link{background:url(../img/xls.png) left top no-repeat}.jqueryFileTree LI.ext_xml A.link{background:url(../img/code.png) left top no-repeat}.jqueryFileTree LI.ext_zip A.link{background:url(../img/zip.png) left top no-repeat}.jqueryFileTree LI.ext_rar A.link{background:url(../img/zip.png) left top no-repeat}.jqueryFileTree LI.ext_bz2 A.link{background:url(../img/zip.png) left top no-repeat}.jqueryFileTree LI.ext_tar A.link{background:url(../img/zip.png) left top no-repeat}.jqueryFileTree LI.ext_gz A.link{background:url(../img/zip.png) left top no-repeat}.jqueryFileTree LI.ext_vsa A.link{background:url(../img/vsa.png) left top no-repeat}.PSK_S2MSFB_search{opacity:.5;display:block;float:left;clear:left}.PSK_S2MSFB_search:hover{opacity:1.0}.PSK_S2MSFB_search input{float:right;width:190px;height:14px;margin:0!important;border-top:1px solid #f4f4f4!important;border-left:1px solid #e2e2e2!important;border-right:1px solid #e2e2e2!important;border-bottom:1px solid #b9b9b9!important;padding:1px 3px 1px 3px!important;font-size:small!important}.PSK_S2MSFB_search input:hover{color:#3f9aff!important}.PSK_S2MSFB_search button{float:right;width:23px;height:18px;margin:0!important;padding:0!important;border:0!important;background-repeat:no-repeat}.PSK_S2MSFB_search button.PSK_S2MSFB_searchbtn{background-image:url('../img/search.png')}.PSK_S2MSFB_search button.PSK_S2MSFB_resetbtn,.PSK_S2MSFB_search button.PSK_S2MSFB_reloadbtn{background-image:url('../img/reset.png')}.PSK_S2MSFB_search button:hover{cursor:pointer}
     1UL.jqueryFileTree{font-family:Verdana,sans-serif;font-size:11px;line-height:18px;margin:0;padding:0;padding-left:20px}UL.jqueryFileTree LI{list-style:none;margin:0;padding:0;white-space:nowrap}.jqueryFileTree div.jftctn:hover{background-color:#f4f4ff}UL.jqueryFileTree A.link,UL.jqueryFileTree A.prev{color:#333;text-decoration:none;display:block;float:left;clear:left;margin:0;padding:0;padding-left:20px}UL.jqueryFileTree A.link SPAN.fn{color:#888;font-style:italic}UL.jqueryFileTree .size{color:#888;text-align:right;width:90px;font-size:10px!important}UL.jqueryFileTree .mdate{color:#888;text-align:right;width:200px;margin-right:20px!important;font-size:10px!important}UL.jqueryFileTree .d{float:right;margin:0;padding:0}UL.jqueryFileTree input,UL.jqueryFileTree label{margin:0;padding:0;background:0}.jqueryFileTree LI.waitinit{background:url(../img/spinner.gif) left top no-repeat;padding-left:20px}.jqueryFileTree LI.directory SPAN.dwnl A.link{background:url(../img/download.png) left top no-repeat}.jqueryFileTree LI.directory A.link{background:url(../img/folder_open.png) left top no-repeat}.jqueryFileTree LI.collapsed A.link{background:url(../img/directory.png) left top no-repeat}.jqueryFileTree LI.already{opacity:.69}.jqueryFileTree LI.file SPAN.prev DIV{width:16px;height:16px;background:url(../img/playpause.png);background-repeat:no-repeat;background-position:0 0;margin-left:20px!important}.jqueryFileTree LI.file SPAN.prev DIV.play{background-position:0 0}.jqueryFileTree LI.file SPAN.prev DIV.stop{background-position:0 -16px}.jqueryFileTree LI.file SPAN.prev DIV.play:hover{background-position:-16px 0}.jqueryFileTree LI.file SPAN.prev DIV.stop:hover{background-position:-16px -16px}.jqueryFileTree LI.file A.link{background:url(../img/file.png) left top no-repeat}.jqueryFileTree LI.wait A.link{background:url(../img/spinner.gif) left top no-repeat}.jqueryFileTree LI.ext_3gp A.link{background:url(../img/film.png) left top no-repeat}.jqueryFileTree LI.ext_afp A.link{background:url(../img/code.png) left top no-repeat}.jqueryFileTree LI.ext_afpa A.link{background:url(../img/code.png) left top no-repeat}.jqueryFileTree LI.ext_asp A.link{background:url(../img/code.png) left top no-repeat}.jqueryFileTree LI.ext_aspx A.link{background:url(../img/code.png) left top no-repeat}.jqueryFileTree LI.ext_avi A.link{background:url(../img/film.png) left top no-repeat}.jqueryFileTree LI.ext_bat A.link{background:url(../img/application.png) left top no-repeat}.jqueryFileTree LI.ext_bmp A.link{background:url(../img/picture.png) left top no-repeat}.jqueryFileTree LI.ext_c A.link{background:url(../img/code.png) left top no-repeat}.jqueryFileTree LI.ext_cfm A.link{background:url(../img/code.png) left top no-repeat}.jqueryFileTree LI.ext_cgi A.link{background:url(../img/code.png) left top no-repeat}.jqueryFileTree LI.ext_com A.link{background:url(../img/application.png) left top no-repeat}.jqueryFileTree LI.ext_cpp A.link{background:url(../img/code.png) left top no-repeat}.jqueryFileTree LI.ext_css A.link{background:url(../img/css.png) left top no-repeat}.jqueryFileTree LI.ext_doc A.link{background:url(../img/doc.png) left top no-repeat}.jqueryFileTree LI.ext_exe A.link{background:url(../img/application.png) left top no-repeat}.jqueryFileTree LI.ext_gif A.link{background:url(../img/picture.png) left top no-repeat}.jqueryFileTree LI.ext_fla A.link{background:url(../img/flash.png) left top no-repeat}.jqueryFileTree LI.ext_h A.link{background:url(../img/code.png) left top no-repeat}.jqueryFileTree LI.ext_htm A.link{background:url(../img/html.png) left top no-repeat}.jqueryFileTree LI.ext_html A.link{background:url(../img/html.png) left top no-repeat}.jqueryFileTree LI.ext_jar A.link{background:url(../img/java.png) left top no-repeat}.jqueryFileTree LI.ext_jpg A.link{background:url(../img/picture.png) left top no-repeat}.jqueryFileTree LI.ext_jpeg A.link{background:url(../img/picture.png) left top no-repeat}.jqueryFileTree LI.ext_js A.link{background:url(../img/script.png) left top no-repeat}.jqueryFileTree LI.ext_lasso A.link{background:url(../img/code.png) left top no-repeat}.jqueryFileTree LI.ext_log A.link{background:url(../img/txt.png) left top no-repeat}.jqueryFileTree LI.ext_m4p A.link{background:url(../img/music.png) left top no-repeat}.jqueryFileTree LI.ext_mov A.link{background:url(../img/film.png) left top no-repeat}.jqueryFileTree LI.ext_mp3 A.link{background:url(../img/music.png) left top no-repeat}.jqueryFileTree LI.ext_mp4 A.link{background:url(../img/film.png) left top no-repeat}.jqueryFileTree LI.ext_mpg A.link{background:url(../img/film.png) left top no-repeat}.jqueryFileTree LI.ext_mpeg A.link{background:url(../img/film.png) left top no-repeat}.jqueryFileTree LI.ext_mpeg4 A.link{background:url(../img/film.png) left top no-repeat}.jqueryFileTree LI.ext_ogg A.link{background:url(../img/music.png) left top no-repeat}.jqueryFileTree LI.ext_pcx A.link{background:url(../img/picture.png) left top no-repeat}.jqueryFileTree LI.ext_pdf A.link{background:url(../img/pdf.png) left top no-repeat}.jqueryFileTree LI.ext_php A.link{background:url(../img/php.png) left top no-repeat}.jqueryFileTree LI.ext_png A.link{background:url(../img/picture.png) left top no-repeat}.jqueryFileTree LI.ext_ppt A.link{background:url(../img/ppt.png) left top no-repeat}.jqueryFileTree LI.ext_pps A.link{background:url(../img/ppt.png) left top no-repeat}.jqueryFileTree LI.ext_psd A.link{background:url(../img/psd.png) left top no-repeat}.jqueryFileTree LI.ext_pl A.link{background:url(../img/script.png) left top no-repeat}.jqueryFileTree LI.ext_py A.link{background:url(../img/script.png) left top no-repeat}.jqueryFileTree LI.ext_rb A.link{background:url(../img/ruby.png) left top no-repeat}.jqueryFileTree LI.ext_rbx A.link{background:url(../img/ruby.png) left top no-repeat}.jqueryFileTree LI.ext_rhtml A.link{background:url(../img/ruby.png) left top no-repeat}.jqueryFileTree LI.ext_rpm A.link{background:url(../img/linux.png) left top no-repeat}.jqueryFileTree LI.ext_ruby A.link{background:url(../img/ruby.png) left top no-repeat}.jqueryFileTree LI.ext_sql A.link{background:url(../img/db.png) left top no-repeat}.jqueryFileTree LI.ext_swf A.link{background:url(../img/flash.png) left top no-repeat}.jqueryFileTree LI.ext_tif A.link{background:url(../img/picture.png) left top no-repeat}.jqueryFileTree LI.ext_tiff A.link{background:url(../img/picture.png) left top no-repeat}.jqueryFileTree LI.ext_txt A.link{background:url(../img/txt.png) left top no-repeat}.jqueryFileTree LI.ext_vb A.link{background:url(../img/code.png) left top no-repeat}.jqueryFileTree LI.ext_wav A.link{background:url(../img/music.png) left top no-repeat}.jqueryFileTree LI.ext_wmv A.link{background:url(../img/film.png) left top no-repeat}.jqueryFileTree LI.ext_xls A.link{background:url(../img/xls.png) left top no-repeat}.jqueryFileTree LI.ext_xml A.link{background:url(../img/code.png) left top no-repeat}.jqueryFileTree LI.ext_zip A.link{background:url(../img/zip.png) left top no-repeat}.jqueryFileTree LI.ext_rar A.link{background:url(../img/zip.png) left top no-repeat}.jqueryFileTree LI.ext_bz2 A.link{background:url(../img/zip.png) left top no-repeat}.jqueryFileTree LI.ext_tar A.link{background:url(../img/zip.png) left top no-repeat}.jqueryFileTree LI.ext_gz A.link{background:url(../img/zip.png) left top no-repeat}.jqueryFileTree LI.ext_vsa A.link{background:url(../img/vsa.png) left top no-repeat}.PSK_S2MSFB_search{opacity:.5;display:block;float:left;clear:left}.PSK_S2MSFB_searchie{width:250px!important;opacity:.5;display:block;float:left;clear:left}.PSK_S2MSFB_searchie:hover,.PSK_S2MSFB_search:hover{opacity:1.0}.PSK_S2MSFB_searchie input,.PSK_S2MSFB_search input{float:right!important;width:190px!important;height:14px!important;margin:0!important;border-top:1px solid #f4f4f4!important;border-left:1px solid #e2e2e2!important;border-right:1px solid #e2e2e2!important;border-bottom:1px solid #b9b9b9!important;padding:1px 3px 1px 3px!important;font-size:small!important}.PSK_S2MSFB_searchie input:hover,.PSK_S2MSFB_search input:hover{color:#3f9aff!important}.PSK_S2MSFB_searchie button,.PSK_S2MSFB_search button{float:right!important;width:23px!important;height:18px!important;margin:0!important;padding:0!important;border:0!important;background-repeat:no-repeat!important}.PSK_S2MSFB_searchie button.PSK_S2MSFB_searchbtn,.PSK_S2MSFB_search button.PSK_S2MSFB_searchbtn{background-image:url('../img/search.png')}.PSK_S2MSFB_searchie button.PSK_S2MSFB_resetbtn,.PSK_S2MSFB_searchie button.PSK_S2MSFB_reloadbtn,.PSK_S2MSFB_search button.PSK_S2MSFB_resetbtn,.PSK_S2MSFB_search button.PSK_S2MSFB_reloadbtn{background-image:url('../img/reset.png')}.PSK_S2MSFB_searchie button:hover,.PSK_S2MSFB_search button:hover{cursor:pointer}
  • s2member-secure-file-browser/trunk/inc/define.php

    r689667 r691410  
    11<?php
    2 define( 'PSK_S2MSFB_VERSION', '0.4' );
     2define( 'PSK_S2MSFB_VERSION', '0.4.1' );
    33define( 'PSK_S2MSFB_MIN_PHP_VERSION', '5.2' );
    44define( 'PSK_S2MSFB_MIN_WP_VERSION', '3.3' );
    55define( 'PSK_S2MSFB_EXT_JS', 'min.js' );
    66define( 'PSK_S2MSFB_EXT_CSS', 'min.css' );
     7//define( 'PSK_S2MSFB_EXT_JS', 'js' );
     8//define( 'PSK_S2MSFB_EXT_CSS', 'css' );
    79
    810
  • s2member-secure-file-browser/trunk/inc/tools.class.php

    r689667 r691410  
    357357    }
    358358
     359/*
     360    public static function relative_time( $time , $granularity ) {
     361        $d = array(
     362            array(1 , "second" ),
     363            array(60 , "minute" ),
     364            array(3600 , "hour" ),
     365            array(86400 , "day" ),
     366            array(604800 , "week" ),
     367            array(2592000 , "month" ),
     368            array(31104000 , "year" ),
     369        );
     370
     371        $w = array();
     372
     373        $return = "";
     374        $now = time();
     375        $diff = ($now-$time);
     376        $secondsLeft = $diff;
     377
     378        for($i=6;$i>-1;$i--)
     379        {
     380             $w[$i] = intval($secondsLeft/$d[$i][0]);
     381             $secondsLeft -= ($w[$i]*$d[$i][0]);
     382             if($w[$i]!=0)
     383             {
     384                $return.= abs($w[$i]) . " " . $d[$i][1] . (($w[$i]>1)?'s':'') ." ";
     385             }
     386
     387        }
     388
     389        $return .= ($diff>0)? "ago" : "left";
     390        return $return;
     391    }
     392*/
     393
    359394}
    360395
    361396
     397
  • s2member-secure-file-browser/trunk/js/admin.manager.js

    r689667 r691410  
    142142
    143143    switch (tag) {
    144         case 'displayall'        :
    145         case 'displaydownloaded' :
    146         case 'search'            :
    147         case 'displaysize'       :
    148         case 'dirzip'            :
    149         case 's2alertbox'        :
    150         case 'dirfirst'          :
    151         case 'hidden'            :
    152         case 'multifolder'       :
    153         case 'openrecursive'     :
     144        case 'displayall'              :
     145        case 'displaydownloaded'       :
     146        case 'displaybirthdate'        :
     147        case 'displaycomment'          :
     148        case 'displaymodificationdate' :
     149        case 'sortby'                  :
     150        case 'search'                  :
     151        case 'searchdisplay'           :
     152        case 'displaysize'             :
     153        case 'dirzip'                  :
     154        case 's2alertbox'              :
     155        case 'dirfirst'                :
     156        case 'hidden'                  :
     157        case 'multifolder'             :
     158        case 'openrecursive'           :
    154159            val = $('input[type=radio][name=' + tag + ']:checked').val();
    155160            break;
  • s2member-secure-file-browser/trunk/js/admin.manager.min.js

    r689667 r691410  
    1 function psk_sfb_rename_file(f){psk_sfb_rename_df(f,false);}function psk_sfb_remove_file(f){psk_sfb_remove_df(f,false);}function psk_sfb_rename_dir(f){psk_sfb_rename_df(f,true);}function psk_sfb_remove_dir(f){psk_sfb_remove_df(f,true);}var sk_sfb_rename_df_lock=false;function psk_sfb_rename_df(f,d){var title=(d===true)?objectL10n.renamedirectory:objectL10n.renamefile;$("#pskModalLabel").html(title);var s=psk_sfb_basename(f);var text=objectL10n.rename+" <code>"+new psk_sfb_html(f)+'</code><br/><br/><input id="pskModalInput" type="text" value="'+new psk_sfb_html(s)+'"/><br/><br/>';$("#pskModalBody").html(text);$("#pskModalSave").html(objectL10n.rename);$("#pskModalSave").removeClass("btn-danger");$("#pskModalSave").addClass("btn-success");$("#pskModal").modal("show");$("#pskModalInput").keypress(function(event){var keycode=(event.keyCode?event.keyCode:event.which);if(keycode=="13"){$("#pskModalSave").trigger("click");}});$("#pskModalSave").click(function(){if(!sk_sfb_rename_df_lock){sk_sfb_rename_df_lock=true;$("#pskModalSave").addClass("disabled");var d=encodeURIComponent($("#pskModalInput").attr("value"));$.post(PSK_S2MSFB.ajaxurl,{action:PSK_S2MSFB.action_rf,dir:"",dirbase:"",s:f,d:d,nonce:PSK_S2MSFB.nonce,},function(data){if(data!="1"){psk_sfb_alert(objectL10n.error,objectL10n.erroroccurs+"<br/>"+data,"error",120000);}else{psk_sfb_alert(objectL10n.success,(d===true)?objectL10n.renamedirectoryok:objectL10n.renamefileok,"success");}$("#pskModalSave").unbind();$("#pskModalInput").unbind();$(".psk_jfiletree").each(function(){$(this).fileTreeReload();});$("#pskModal").modal("hide");$("#pskModalSave").removeClass("disabled");sk_sfb_rename_df_lock=false;});}else{alert(objectL10n.pleasewait);}});}var sk_sfb_remove_df_lock=false;function psk_sfb_remove_df(f,d){var title=(d===true)?objectL10n.removedirectory:objectL10n.removefile;$("#pskModalLabel").html(title);var text=(d===true)?objectL10n.removedirectory+"<br/><code>"+new psk_sfb_html(f)+"</code><br/><br/>"+objectL10n.removedirectorywarning:objectL10n.removefile+"<br/><code>"+f+"</code><br/><br/>"+objectL10n.removefilewarning;$("#pskModalBody").html(text);$("#pskModalSave").html(objectL10n.remove);$("#pskModalSave").removeClass("btn-success");$("#pskModalSave").addClass("btn-danger");$("#pskModal").modal("show");$("#pskModalSave").click(function(){if(!sk_sfb_remove_df_lock){sk_sfb_remove_df_lock=true;$("#pskModalSave").addClass("disabled");$.post(PSK_S2MSFB.ajaxurl,{action:PSK_S2MSFB.action_df,dir:"",dirbase:"",s:f,nonce:PSK_S2MSFB.nonce,},function(data){if(data!="1"){if(data.indexOf("Maximum function nesting level")!=-1){data=objectL10n.xdebugerror;}psk_sfb_alert(objectL10n.error,objectL10n.erroroccurs+"<br/>"+data,"error",120000);}else{psk_sfb_alert(objectL10n.success,(d===true)?objectL10n.removedirectoryok:objectL10n.removefileok,"success");}$("#pskModalSave").unbind();$(".psk_jfiletree").each(function(){$(this).fileTreeReload();});$("#pskModal").modal("hide");$("#pskModalSave").removeClass("disabled");sk_sfb_remove_df_lock=false;});}else{alert(objectL10n.pleasewait);}});}$("#pskModal").on("hidden",function(){$("#pskModalSave").unbind();$("#pskModalInput").unbind();});function generate_shortcode(){var str="["+objectL10n.shortcode;var taa=objectL10n.shortcodetags.split(",");$.each(taa,function(i){var tag=taa[i];var val=get_shortcode_val(tag);if((val!="")&&(val!=undefined)){str+=" "+tag+'="'+val+'"';}});str+=" /]";$("#shortcode_preview").html(str);}function get_shortcode_val(tag){var val="";switch(tag){case"displayall":case"displaydownloaded":case"search":case"displaysize":case"dirzip":case"s2alertbox":case"dirfirst":case"hidden":case"multifolder":case"openrecursive":val=$("input[type=radio][name="+tag+"]:checked").val();break;case"collapsespeed":case"expandspeed":val=$("#"+tag).val();if(val!=""){val=parseInt($("#"+tag).val(),10);if(isNaN(val)){val="";$("#cg"+tag).addClass("error");}else{$("#cg"+tag).removeClass("error");}val=val.toString();}else{$("#cg"+tag).removeClass("error");}break;case"filterdir":case"filterfile":case"dirbase":val=encodeURIComponent($("#"+tag).val());break;case"names":for(var i=0;i<6;i++){var k=$("#h"+tag+i).val();var v=$("#"+tag+i).val();if(v!=""){val=val+encodeURIComponent(k)+":"+encodeURIComponent(v)+"|";}}val=(val.substr(-1,1)=="|")?val.slice(0,-1):val;break;case"folderevent":case"collapseeasing":case"expandeasing":default:val=$("#"+tag).val();break;}return val;}if($("#shortcode_preview").length!=0){$(".generator").on("change",function(){generate_shortcode();});$(document).ready(function(){generate_shortcode();});}
     1function psk_sfb_rename_file(f){psk_sfb_rename_df(f,false);}function psk_sfb_remove_file(f){psk_sfb_remove_df(f,false);}function psk_sfb_rename_dir(f){psk_sfb_rename_df(f,true);}function psk_sfb_remove_dir(f){psk_sfb_remove_df(f,true);}var sk_sfb_rename_df_lock=false;function psk_sfb_rename_df(f,d){var title=(d===true)?objectL10n.renamedirectory:objectL10n.renamefile;$("#pskModalLabel").html(title);var s=psk_sfb_basename(f);var text=objectL10n.rename+" <code>"+new psk_sfb_html(f)+'</code><br/><br/><input id="pskModalInput" type="text" value="'+new psk_sfb_html(s)+'"/><br/><br/>';$("#pskModalBody").html(text);$("#pskModalSave").html(objectL10n.rename);$("#pskModalSave").removeClass("btn-danger");$("#pskModalSave").addClass("btn-success");$("#pskModal").modal("show");$("#pskModalInput").keypress(function(event){var keycode=(event.keyCode?event.keyCode:event.which);if(keycode=="13"){$("#pskModalSave").trigger("click");}});$("#pskModalSave").click(function(){if(!sk_sfb_rename_df_lock){sk_sfb_rename_df_lock=true;$("#pskModalSave").addClass("disabled");var d=encodeURIComponent($("#pskModalInput").attr("value"));$.post(PSK_S2MSFB.ajaxurl,{action:PSK_S2MSFB.action_rf,dir:"",dirbase:"",s:f,d:d,nonce:PSK_S2MSFB.nonce,},function(data){if(data!="1"){psk_sfb_alert(objectL10n.error,objectL10n.erroroccurs+"<br/>"+data,"error",120000);}else{psk_sfb_alert(objectL10n.success,(d===true)?objectL10n.renamedirectoryok:objectL10n.renamefileok,"success");}$("#pskModalSave").unbind();$("#pskModalInput").unbind();$(".psk_jfiletree").each(function(){$(this).fileTreeReload();});$("#pskModal").modal("hide");$("#pskModalSave").removeClass("disabled");sk_sfb_rename_df_lock=false;});}else{alert(objectL10n.pleasewait);}});}var sk_sfb_remove_df_lock=false;function psk_sfb_remove_df(f,d){var title=(d===true)?objectL10n.removedirectory:objectL10n.removefile;$("#pskModalLabel").html(title);var text=(d===true)?objectL10n.removedirectory+"<br/><code>"+new psk_sfb_html(f)+"</code><br/><br/>"+objectL10n.removedirectorywarning:objectL10n.removefile+"<br/><code>"+f+"</code><br/><br/>"+objectL10n.removefilewarning;$("#pskModalBody").html(text);$("#pskModalSave").html(objectL10n.remove);$("#pskModalSave").removeClass("btn-success");$("#pskModalSave").addClass("btn-danger");$("#pskModal").modal("show");$("#pskModalSave").click(function(){if(!sk_sfb_remove_df_lock){sk_sfb_remove_df_lock=true;$("#pskModalSave").addClass("disabled");$.post(PSK_S2MSFB.ajaxurl,{action:PSK_S2MSFB.action_df,dir:"",dirbase:"",s:f,nonce:PSK_S2MSFB.nonce,},function(data){if(data!="1"){if(data.indexOf("Maximum function nesting level")!=-1){data=objectL10n.xdebugerror;}psk_sfb_alert(objectL10n.error,objectL10n.erroroccurs+"<br/>"+data,"error",120000);}else{psk_sfb_alert(objectL10n.success,(d===true)?objectL10n.removedirectoryok:objectL10n.removefileok,"success");}$("#pskModalSave").unbind();$(".psk_jfiletree").each(function(){$(this).fileTreeReload();});$("#pskModal").modal("hide");$("#pskModalSave").removeClass("disabled");sk_sfb_remove_df_lock=false;});}else{alert(objectL10n.pleasewait);}});}$("#pskModal").on("hidden",function(){$("#pskModalSave").unbind();$("#pskModalInput").unbind();});function generate_shortcode(){var str="["+objectL10n.shortcode;var taa=objectL10n.shortcodetags.split(",");$.each(taa,function(i){var tag=taa[i];var val=get_shortcode_val(tag);if((val!="")&&(val!=undefined)){str+=" "+tag+'="'+val+'"';}});str+=" /]";$("#shortcode_preview").html(str);}function get_shortcode_val(tag){var val="";switch(tag){case"displayall":case"displaydownloaded":case"displaybirthdate":case"displaycomment":case"displaymodificationdate":case"sortby":case"search":case"searchdisplay":case"displaysize":case"dirzip":case"s2alertbox":case"dirfirst":case"hidden":case"multifolder":case"openrecursive":val=$("input[type=radio][name="+tag+"]:checked").val();break;case"collapsespeed":case"expandspeed":val=$("#"+tag).val();if(val!=""){val=parseInt($("#"+tag).val(),10);if(isNaN(val)){val="";$("#cg"+tag).addClass("error");}else{$("#cg"+tag).removeClass("error");}val=val.toString();}else{$("#cg"+tag).removeClass("error");}break;case"filterdir":case"filterfile":case"dirbase":val=encodeURIComponent($("#"+tag).val());break;case"names":for(var i=0;i<6;i++){var k=$("#h"+tag+i).val();var v=$("#"+tag+i).val();if(v!=""){val=val+encodeURIComponent(k)+":"+encodeURIComponent(v)+"|";}}val=(val.substr(-1,1)=="|")?val.slice(0,-1):val;break;case"folderevent":case"collapseeasing":case"expandeasing":default:val=$("#"+tag).val();break;}return val;}if($("#shortcode_preview").length!=0){$(".generator").on("change",function(){generate_shortcode();});$(document).ready(function(){generate_shortcode();});}
  • s2member-secure-file-browser/trunk/js/jqueryFileTree.js

    r689667 r691410  
    2222//
    2323// History:
     24// 1.?? - Modified by potsky : unable to explain all changes ! (2013/04/01)
    2425// 1.03 - Modified by potsky : LI are now triggerable (2012/12/30)
    2526// 1.02 - Modified by potsky : work with Wordpress plugin s2member-files-browser (2012/12/24)
     
    3233// is copyright 2008 A Beautiful Site, LLC.
    3334//
    34 ;(function ($) {
     35;
     36(function ($) {
    3537    $.extend($.fn, {
    3638
     
    6870                if (o.cutfilenames === undefined) o.cutfilenames = '0';
    6971                if (o.displaysize === undefined) o.displaysize = '1';
     72                if (o.displaymodificationdate === undefined) o.displaymodificationdate = '0';
     73                if (o.displaybirthdate === undefined) o.displaybirthdate = '0';
     74                if (o.displaycomment === undefined) o.displaycomment = '1';
     75                if (o.sortby === undefined) o.sortby = '0';
    7076                if (o.displaydownloaded === undefined) o.displaydownloaded = '0';
    7177                if (o.search === undefined) o.search = '0';
     
    8894                    $(c).addClass('wait');
    8995                    $.post(o.script, {
    90                         action           : o.action,
    91                         dir              : t,
    92                         hidden           : o.hidden,
    93                         dirfirst         : o.dirfirst,
    94                         names            : o.names,
    95                         filterfile       : o.filterfile,
    96                         filterdir        : o.filterdir,
    97                         displayall       : o.displayall,
    98                         dirbase          : o.dirbase,
    99                         openrecursive    : o.openrecursive,
    100                         cutdirnames      : o.cutdirnames,
    101                         cutfilenames     : o.cutfilenames,
    102                         displaysize      : o.displaysize,
    103                         displaydownloaded: o.displaydownloaded,
    104                         search           : o.search,
    105                         searchdisplay    : o.searchdisplay,
    106                         dirzip           : o.dirzip,
    107                         previewext       : o.previewext,
    108                         nonce            : PSK_S2MSFB.nonce
     96                        action                 : o.action,
     97                        dir                    : t,
     98                        hidden                 : o.hidden,
     99                        dirfirst               : o.dirfirst,
     100                        names                  : o.names,
     101                        filterfile             : o.filterfile,
     102                        filterdir              : o.filterdir,
     103                        displayall             : o.displayall,
     104                        dirbase                : o.dirbase,
     105                        openrecursive          : o.openrecursive,
     106                        cutdirnames            : o.cutdirnames,
     107                        cutfilenames           : o.cutfilenames,
     108                        displaysize            : o.displaysize,
     109                        displaydownloaded      : o.displaydownloaded,
     110                        search                 : o.search,
     111                        searchdisplay          : o.searchdisplay,
     112                        dirzip                 : o.dirzip,
     113                        previewext             : o.previewext,
     114                        displaymodificationdate: o.displaymodificationdate,
     115                        displaybirthdate       : o.displaybirthdate,
     116                        displaycomment         : o.displaycomment,
     117                        sortby                 : o.sortby,
     118                        nonce                  : PSK_S2MSFB.nonce
    109119                    }, function (data) {
    110120                        $(c).removeClass('wait').append(data);
     
    115125                }
    116126
    117                 function searchTree(c,s) {
     127                function searchTree(c, s) {
    118128                    if ($(c).hasClass('psk_jfiletree')) { // top search
    119129                        var t = '/';
     
    158168                    // Search feature
    159169                    $(t).find('.PSK_S2MSFB_searchinp')
    160                         .blur(function(){
    161                             if ( $(this).val() == '' ) {
    162                                 $(this).val( $(this).attr('title') );
    163                                 if ( $(this).find('UL.jqueryFileTree').attr('data-token') == '' )
     170                        .blur(function () {
     171                            if ($(this).val() == '') {
     172                                $(this).val($(this).attr('title'));
     173                                if ($(this).find('UL.jqueryFileTree').attr('data-token') == '')
    164174                                    $(this).prev().prev().hide();//resetbtn
    165175                            }
    166176                        })
    167                         .click(function(){
    168                             if ( $(this).val() == $(this).attr('title') )
     177                        .click(function () {
     178                            if ($(this).val() == $(this).attr('title'))
    169179                                $(this).val('');
    170180
    171                             if ( ( $(this).val() == '' ) || ( $(this).val() == $(this).attr('title') ) )
    172                                 if ( $(this).find('UL.jqueryFileTree').attr('data-token') == '' )
     181                            if (( $(this).val() == '' ) || ( $(this).val() == $(this).attr('title') ))
     182                                if ($(this).find('UL.jqueryFileTree').attr('data-token') == '')
    173183                                    $(this).prev().prev().hide();//resetbtn
    174                             else
    175                                 $(this).prev().prev().show();//resetbtn
    176                         })
    177                         .keypress(function(e){
    178                             if ( ( $(this).val() == '' ) || ( $(this).val() == $(this).attr('title') ) )
    179                                 if ( $(this).find('UL.jqueryFileTree').attr('data-token') == '' )
     184                                else
     185                                    $(this).prev().prev().show();//resetbtn
     186                        })
     187                        .keypress(function (e) {
     188                            if (( $(this).val() == '' ) || ( $(this).val() == $(this).attr('title') ))
     189                                if ($(this).find('UL.jqueryFileTree').attr('data-token') == '')
    180190                                    $(this).prev().prev().hide();//resetbtn
    181                             else
    182                                 $(this).prev().prev().show();//resetbtn
     191                                else
     192                                    $(this).prev().prev().show();//resetbtn
    183193
    184194                            if (e.which == 13)
    185                                 if ( ( $(this).val() == '' ) || ( $(this).val() == $(this).attr('title') ) )
    186                                     alert( PSK_S2MSFB.errorsearch );
     195                                if (( $(this).val() == '' ) || ( $(this).val() == $(this).attr('title') ))
     196                                    alert(PSK_S2MSFB.errorsearch);
    187197                                else
    188                                     searchTree( $(this).parent().parent().parent().parent() , $(this).val() );
     198                                    searchTree($(this).parent().parent().parent().parent(), $(this).val());
    189199                        })
    190200                    ;
    191201                    $(t).find('.PSK_S2MSFB_searchbtn')
    192                         .click(function(){
     202                        .click(function () {
    193203                            var e = jQuery.Event("keypress");
    194204                            e.which = 13;
     
    197207                    ;
    198208                    $(t).find('.PSK_S2MSFB_reloadbtn')
    199                         .click(function(){
    200                             searchTree( $(this).parent().parent().parent().parent() , '' );
     209                        .click(function () {
     210                            searchTree($(this).parent().parent().parent().parent(), '');
    201211                        })
    202212                    ;
    203213                    $(t).find('.PSK_S2MSFB_resetbtn')
    204                         .click(function(){
    205                             $(this).next().next().val( $(this).next().next().attr('title') );
     214                        .click(function () {
     215                            $(this).next().next().val($(this).next().next().attr('title'));
    206216                            $(this).hide();
    207217                        })
     
    214224                        var thisurl = $(this).attr('rel');
    215225                        $(this)
    216                             .html('<div id="' + thisplayer + '" style="display:none"></div><div id="' + thisdesign + '" class="play"></div>')
     226                            .html('<div id="' + thisplayer + '" style="width:1px!important;height:1px!important;"></div><div id="' + thisdesign + '" class="play"></div>')
    217227                            .unbind('click')
    218228                            .click(function () {
     
    228238                                    },
    229239                                    play         : function () {
     240                                        $('#' + thisplayer)
     241                                            .jPlayer('pauseOthers');
    230242                                        $('#' + thisdesign)
    231243                                            .removeClass('play')
     
    259271                                    swfPath      : o.swfurl,
    260272                                    supplied     : 'mp3',
    261                                     solution     : 'html, flash',
     273                                    solution     : 'html,flash',
    262274                                    preload      : 'none',
    263275                                    volume       : 1,
    264276                                    muted        : false,
    265                                     errorAlerts  : false,
    266                                     warningAlerts: false
     277                                    errorAlerts  : true,
     278                                    warningAlerts: false,
     279                                    wmode        : "window"
    267280                                });
    268 
    269281                                //noinspection JSJQueryEfficiency
    270                                 $('#' + thisplayer)
    271                                     .jPlayer('pauseOthers')
    272                                     .jPlayer('play');
     282                                /*                              $('#' + thisplayer)
     283                                 .jPlayer("setMedia", { mp3: thisurl })
     284                                 .jPlayer('pauseOthers')
     285                                 .jPlayer('play');
     286                                 */
    273287                            }
    274288                        );
     
    283297                                    $(this).parent().parent().parent().find('LI.directory').removeClass('expanded').addClass('collapsed');
    284298                                }
    285                                 if ($(this).attr('rel')=='') {
     299                                if ($(this).attr('rel') == '') {
    286300                                    $(this).parent().parent().find('UL').slideDown({ duration: o.expandspeed, easing: o.expandeasing });
    287301                                    $(this).parent().parent().removeClass('collapsed').addClass('expanded');
  • s2member-secure-file-browser/trunk/js/jqueryFileTree.min.js

    r689667 r691410  
    1 (function($){$.extend($.fn,{fileTreeReload:function(){$(this).empty();$(this).fileTree();},fileTree:function(o,h){if($(this).data("o")){o=$(this).data("o");h=$(this).data("h");}else{if(!o){o={};}if(o.action===undefined){o.action=PSK_S2MSFB.action_get_dir;}if(o.script===undefined){o.script=PSK_S2MSFB.ajaxurl;}if(o.folderevent===undefined){o.folderevent="click";}if(o.expandspeed===undefined){o.expandspeed=500;}if(o.collapsespeed===undefined){o.collapsespeed=500;}if(o.expandeasing===undefined){o.expandeasing=null;}if(o.collapseeasing===undefined){o.collapseeasing=null;}if(o.multifolder===undefined){o.multifolder=true;}if(o.openrecursive===undefined){o.openrecursive="0";}if(o.loadmessage===undefined){o.loadmessage="";}if(o.hidden===undefined){o.hidden="0";}if(o.dirfirst===undefined){o.dirfirst="1";}if(o.names===undefined){o.names="";}if(o.dirbase===undefined){o.dirbase="";}if(o.filterfile===undefined){o.filterfile="";}if(o.filterdir===undefined){o.filterdir="";}if(o.displayall===undefined){o.displayall="";}if(o.cutdirnames===undefined){o.cutdirnames="0";}if(o.cutfilenames===undefined){o.cutfilenames="0";}if(o.displaysize===undefined){o.displaysize="1";}if(o.displaydownloaded===undefined){o.displaydownloaded="0";}if(o.search===undefined){o.search="0";}if(o.searchdisplay===undefined){o.searchdisplay="0";}if(o.dirzip===undefined){o.dirzip="0";}if(o.previewext===undefined){o.previewext="";}if(o.swfurl===undefined){o.swfurl="";}o.root="/";o.collapsespeed=parseInt(o.collapsespeed,10);o.expandspeed=parseInt(o.expandspeed,10);o.multifolder=(o.multifolder!="0");o.openrecursive=(o.openrecursive=="1")?"1":"0";$(this).data("o",o);$(this).data("h",h);}$(this).each(function(){function showTree(c,t){$(c).addClass("wait");$.post(o.script,{action:o.action,dir:t,hidden:o.hidden,dirfirst:o.dirfirst,names:o.names,filterfile:o.filterfile,filterdir:o.filterdir,displayall:o.displayall,dirbase:o.dirbase,openrecursive:o.openrecursive,cutdirnames:o.cutdirnames,cutfilenames:o.cutfilenames,displaysize:o.displaysize,displaydownloaded:o.displaydownloaded,search:o.search,searchdisplay:o.searchdisplay,dirzip:o.dirzip,previewext:o.previewext,nonce:PSK_S2MSFB.nonce},function(data){$(c).removeClass("wait").append(data);$(c).find("UL:hidden").slideDown({duration:o.expandspeed,easing:o.expandeasing});$(c).find(".start").hide();bindTree(c);});}function searchTree(c,s){if($(c).hasClass("psk_jfiletree")){var t="/";$(c).find(".start").show();$(c).find("UL.jqueryFileTree").not(".start").remove();}else{var t=$(c).find("DIV.jftctn A.link").attr("rel");$(c).addClass("wait");$(c).find("UL.jqueryFileTree").remove();}$.post(o.script,{action:o.action,dir:t,hidden:o.hidden,dirfirst:o.dirfirst,names:o.names,filterfile:o.filterfile,filterdir:o.filterdir,displayall:o.displayall,dirbase:o.dirbase,openrecursive:o.openrecursive,cutdirnames:o.cutdirnames,cutfilenames:o.cutfilenames,displaysize:o.displaysize,displaydownloaded:o.displaydownloaded,search:o.search,searchdisplay:o.searchdisplay,dirzip:o.dirzip,previewext:o.previewext,token:s,nonce:PSK_S2MSFB.nonce},function(data){$(c).removeClass("wait").append(data);$(c).find("UL:hidden").slideDown({duration:o.expandspeed,easing:o.expandeasing});$(c).find(".start").hide();bindTree(c);});}function bindTree(t){$(t).find(".PSK_S2MSFB_searchinp").blur(function(){if($(this).val()==""){$(this).val($(this).attr("title"));if($(this).find("UL.jqueryFileTree").attr("data-token")==""){$(this).prev().prev().hide();}}}).click(function(){if($(this).val()==$(this).attr("title")){$(this).val("");}if(($(this).val()=="")||($(this).val()==$(this).attr("title"))){if($(this).find("UL.jqueryFileTree").attr("data-token")==""){$(this).prev().prev().hide();}else{$(this).prev().prev().show();}}}).keypress(function(e){if(($(this).val()=="")||($(this).val()==$(this).attr("title"))){if($(this).find("UL.jqueryFileTree").attr("data-token")==""){$(this).prev().prev().hide();}else{$(this).prev().prev().show();}}if(e.which==13){if(($(this).val()=="")||($(this).val()==$(this).attr("title"))){alert(PSK_S2MSFB.errorsearch);}else{searchTree($(this).parent().parent().parent().parent(),$(this).val());}}});$(t).find(".PSK_S2MSFB_searchbtn").click(function(){var e=jQuery.Event("keypress");e.which=13;$(this).next().trigger(e);});$(t).find(".PSK_S2MSFB_reloadbtn").click(function(){searchTree($(this).parent().parent().parent().parent(),"");});$(t).find(".PSK_S2MSFB_resetbtn").click(function(){$(this).next().next().val($(this).next().next().attr("title"));$(this).hide();});$(t).find("LI SPAN.prev[data-e=mp3]").each(function(){PSK_S2MSFB_jplayer_id++;var thisplayer="PSK_S2MSFB_jplayer"+PSK_S2MSFB_jplayer_id;var thisdesign="PSK_S2MSFB_jdesign"+PSK_S2MSFB_jplayer_id;var thisurl=$(this).attr("rel");$(this).html('<div id="'+thisplayer+'" style="display:none"></div><div id="'+thisdesign+'" class="play"></div>').unbind("click").click(function(){$(this).unbind("click");$("#"+thisplayer).jPlayer({ready:function(){$("#"+thisplayer).jPlayer("setMedia",{mp3:thisurl}).jPlayer("pauseOthers").jPlayer("play");},play:function(){$("#"+thisdesign).removeClass("play").addClass("stop").unbind("click").click(function(){$("#"+thisplayer).jPlayer("pause");});},ended:function(){$("#"+thisdesign).removeClass("stop").addClass("play").unbind("click").click(function(){$("#"+thisplayer).jPlayer("play");});},pause:function(){$("#"+thisdesign).removeClass("stop").addClass("play").unbind("click").click(function(){$("#"+thisplayer).jPlayer("play");});},swfPath:o.swfurl,supplied:"mp3",solution:"html, flash",preload:"none",volume:1,muted:false,errorAlerts:false,warningAlerts:false});$("#"+thisplayer).jPlayer("pauseOthers").jPlayer("play");});});$(t).find("LI DIV A.link").bind(o.folderevent,function(){if($(this).parent().parent().hasClass("directory")){if($(this).parent().parent().hasClass("collapsed")){if(!o.multifolder){$(this).parent().parent().parent().find("UL").slideUp({duration:o.collapsespeed,easing:o.collapseeasing});$(this).parent().parent().parent().find("LI.directory").removeClass("expanded").addClass("collapsed");}if($(this).attr("rel")==""){$(this).parent().parent().find("UL").slideDown({duration:o.expandspeed,easing:o.expandeasing});$(this).parent().parent().removeClass("collapsed").addClass("expanded");}else{$(this).parent().parent().find("UL").remove();showTree($(this).parent().parent(),encodeURIComponent($(this).attr("rel").match(/.*\//)));$(this).parent().parent().removeClass("collapsed").addClass("expanded");}}else{$(this).parent().parent().find("UL").slideUp({duration:o.collapsespeed,easing:o.collapseeasing});$(this).parent().parent().removeClass("expanded").addClass("collapsed");}}else{h($(this));}return false;});if(o.folderevent.toLowerCase!="click"){$(t).find("LI DIV A.link").bind("click",function(){return false;});}}$(this).html('<ul class="jqueryFileTree start"><li class="waitinit">'+o.loadmessage+"<li></ul>");showTree($(this),"/");});}});}(jQuery));var PSK_S2MSFB_jplayer_id=0;
     1(function($){$.extend($.fn,{fileTreeReload:function(){$(this).empty();$(this).fileTree();},fileTree:function(o,h){if($(this).data("o")){o=$(this).data("o");h=$(this).data("h");}else{if(!o){o={};}if(o.action===undefined){o.action=PSK_S2MSFB.action_get_dir;}if(o.script===undefined){o.script=PSK_S2MSFB.ajaxurl;}if(o.folderevent===undefined){o.folderevent="click";}if(o.expandspeed===undefined){o.expandspeed=500;}if(o.collapsespeed===undefined){o.collapsespeed=500;}if(o.expandeasing===undefined){o.expandeasing=null;}if(o.collapseeasing===undefined){o.collapseeasing=null;}if(o.multifolder===undefined){o.multifolder=true;}if(o.openrecursive===undefined){o.openrecursive="0";}if(o.loadmessage===undefined){o.loadmessage="";}if(o.hidden===undefined){o.hidden="0";}if(o.dirfirst===undefined){o.dirfirst="1";}if(o.names===undefined){o.names="";}if(o.dirbase===undefined){o.dirbase="";}if(o.filterfile===undefined){o.filterfile="";}if(o.filterdir===undefined){o.filterdir="";}if(o.displayall===undefined){o.displayall="";}if(o.cutdirnames===undefined){o.cutdirnames="0";}if(o.cutfilenames===undefined){o.cutfilenames="0";}if(o.displaysize===undefined){o.displaysize="1";}if(o.displaymodificationdate===undefined){o.displaymodificationdate="0";}if(o.displaybirthdate===undefined){o.displaybirthdate="0";}if(o.displaycomment===undefined){o.displaycomment="1";}if(o.sortby===undefined){o.sortby="0";}if(o.displaydownloaded===undefined){o.displaydownloaded="0";}if(o.search===undefined){o.search="0";}if(o.searchdisplay===undefined){o.searchdisplay="0";}if(o.dirzip===undefined){o.dirzip="0";}if(o.previewext===undefined){o.previewext="";}if(o.swfurl===undefined){o.swfurl="";}o.root="/";o.collapsespeed=parseInt(o.collapsespeed,10);o.expandspeed=parseInt(o.expandspeed,10);o.multifolder=(o.multifolder!="0");o.openrecursive=(o.openrecursive=="1")?"1":"0";$(this).data("o",o);$(this).data("h",h);}$(this).each(function(){function showTree(c,t){$(c).addClass("wait");$.post(o.script,{action:o.action,dir:t,hidden:o.hidden,dirfirst:o.dirfirst,names:o.names,filterfile:o.filterfile,filterdir:o.filterdir,displayall:o.displayall,dirbase:o.dirbase,openrecursive:o.openrecursive,cutdirnames:o.cutdirnames,cutfilenames:o.cutfilenames,displaysize:o.displaysize,displaydownloaded:o.displaydownloaded,search:o.search,searchdisplay:o.searchdisplay,dirzip:o.dirzip,previewext:o.previewext,displaymodificationdate:o.displaymodificationdate,displaybirthdate:o.displaybirthdate,displaycomment:o.displaycomment,sortby:o.sortby,nonce:PSK_S2MSFB.nonce},function(data){$(c).removeClass("wait").append(data);$(c).find("UL:hidden").slideDown({duration:o.expandspeed,easing:o.expandeasing});$(c).find(".start").hide();bindTree(c);});}function searchTree(c,s){if($(c).hasClass("psk_jfiletree")){var t="/";$(c).find(".start").show();$(c).find("UL.jqueryFileTree").not(".start").remove();}else{var t=$(c).find("DIV.jftctn A.link").attr("rel");$(c).addClass("wait");$(c).find("UL.jqueryFileTree").remove();}$.post(o.script,{action:o.action,dir:t,hidden:o.hidden,dirfirst:o.dirfirst,names:o.names,filterfile:o.filterfile,filterdir:o.filterdir,displayall:o.displayall,dirbase:o.dirbase,openrecursive:o.openrecursive,cutdirnames:o.cutdirnames,cutfilenames:o.cutfilenames,displaysize:o.displaysize,displaydownloaded:o.displaydownloaded,search:o.search,searchdisplay:o.searchdisplay,dirzip:o.dirzip,previewext:o.previewext,token:s,nonce:PSK_S2MSFB.nonce},function(data){$(c).removeClass("wait").append(data);$(c).find("UL:hidden").slideDown({duration:o.expandspeed,easing:o.expandeasing});$(c).find(".start").hide();bindTree(c);});}function bindTree(t){$(t).find(".PSK_S2MSFB_searchinp").blur(function(){if($(this).val()==""){$(this).val($(this).attr("title"));if($(this).find("UL.jqueryFileTree").attr("data-token")==""){$(this).prev().prev().hide();}}}).click(function(){if($(this).val()==$(this).attr("title")){$(this).val("");}if(($(this).val()=="")||($(this).val()==$(this).attr("title"))){if($(this).find("UL.jqueryFileTree").attr("data-token")==""){$(this).prev().prev().hide();}else{$(this).prev().prev().show();}}}).keypress(function(e){if(($(this).val()=="")||($(this).val()==$(this).attr("title"))){if($(this).find("UL.jqueryFileTree").attr("data-token")==""){$(this).prev().prev().hide();}else{$(this).prev().prev().show();}}if(e.which==13){if(($(this).val()=="")||($(this).val()==$(this).attr("title"))){alert(PSK_S2MSFB.errorsearch);}else{searchTree($(this).parent().parent().parent().parent(),$(this).val());}}});$(t).find(".PSK_S2MSFB_searchbtn").click(function(){var e=jQuery.Event("keypress");e.which=13;$(this).next().trigger(e);});$(t).find(".PSK_S2MSFB_reloadbtn").click(function(){searchTree($(this).parent().parent().parent().parent(),"");});$(t).find(".PSK_S2MSFB_resetbtn").click(function(){$(this).next().next().val($(this).next().next().attr("title"));$(this).hide();});$(t).find("LI SPAN.prev[data-e=mp3]").each(function(){PSK_S2MSFB_jplayer_id++;var thisplayer="PSK_S2MSFB_jplayer"+PSK_S2MSFB_jplayer_id;var thisdesign="PSK_S2MSFB_jdesign"+PSK_S2MSFB_jplayer_id;var thisurl=$(this).attr("rel");$(this).html('<div id="'+thisplayer+'" style="width:1px!important;height:1px!important;"></div><div id="'+thisdesign+'" class="play"></div>').unbind("click").click(function(){$(this).unbind("click");$("#"+thisplayer).jPlayer({ready:function(){$("#"+thisplayer).jPlayer("setMedia",{mp3:thisurl}).jPlayer("pauseOthers").jPlayer("play");},play:function(){$("#"+thisplayer).jPlayer("pauseOthers");$("#"+thisdesign).removeClass("play").addClass("stop").unbind("click").click(function(){$("#"+thisplayer).jPlayer("pause");});},ended:function(){$("#"+thisdesign).removeClass("stop").addClass("play").unbind("click").click(function(){$("#"+thisplayer).jPlayer("play");});},pause:function(){$("#"+thisdesign).removeClass("stop").addClass("play").unbind("click").click(function(){$("#"+thisplayer).jPlayer("play");});},swfPath:o.swfurl,supplied:"mp3",solution:"html,flash",preload:"none",volume:1,muted:false,errorAlerts:true,warningAlerts:false,wmode:"window"});});});$(t).find("LI DIV A.link").bind(o.folderevent,function(){if($(this).parent().parent().hasClass("directory")){if($(this).parent().parent().hasClass("collapsed")){if(!o.multifolder){$(this).parent().parent().parent().find("UL").slideUp({duration:o.collapsespeed,easing:o.collapseeasing});$(this).parent().parent().parent().find("LI.directory").removeClass("expanded").addClass("collapsed");}if($(this).attr("rel")==""){$(this).parent().parent().find("UL").slideDown({duration:o.expandspeed,easing:o.expandeasing});$(this).parent().parent().removeClass("collapsed").addClass("expanded");}else{$(this).parent().parent().find("UL").remove();showTree($(this).parent().parent(),encodeURIComponent($(this).attr("rel").match(/.*\//)));$(this).parent().parent().removeClass("collapsed").addClass("expanded");}}else{$(this).parent().parent().find("UL").slideUp({duration:o.collapsespeed,easing:o.collapseeasing});$(this).parent().parent().removeClass("expanded").addClass("collapsed");}}else{h($(this));}return false;});if(o.folderevent.toLowerCase!="click"){$(t).find("LI DIV A.link").bind("click",function(){return false;});}}$(this).html('<ul class="jqueryFileTree start"><li class="waitinit">'+o.loadmessage+"<li></ul>");showTree($(this),"/");});}});}(jQuery));var PSK_S2MSFB_jplayer_id=0;
  • s2member-secure-file-browser/trunk/readme.txt

    r689667 r691410  
    55Requires at least: 3.3
    66Tested up to: 3.5.1
    7 Stable tag: 0.4
     7Stable tag: 0.4.1
    88License: GPLv3 or later
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    180180== Changelog ==
    181181
     182= 0.4.1 =
     183* New feature : sortby shortcode option
     184* New feature : modification date display shortcode option
     185* New feature : order files by modification date,  addition date, size
     186* Enhancement : disable previews for non logged users
     187* Bug fix : IE fix for search button
     188* Bug fix : mp3 previews in flash fallback was not working in IE and FF.
     189* Bug fix : searchdisplay shortcode option was not included in the generator
     190* Bug fix : filterfile was not working anymore in 0.4
     191* Bug fix : report notification was blank in 0.4
     192* Bug fix : download zip link was displayed even if dirzip shortcode option was disabled
     193
    182194= 0.4 =
    183195* New feature : cut filename shortcode option
     
    245257== Upgrade Notice ==
    246258
     259= 0.4.1 =
     260This version fixes 2 bugs. Upgrade immediately.
     261
    247262= 0.4 =
    248263This update includes the new file caching feature. **On first launch, it computes all files hash. It can last several minutes!**
  • s2member-secure-file-browser/trunk/s2member-secure-file-browser.php

    r689667 r691410  
    66                You can display the file browser via the shortcode [s2member_secure_files_browser /].
    77                You can manage files and get statistics in the Dashboard > s2Member > Secure File Browser
    8 Version: 0.4
    9 Date: 2013-04-01
     8Version: 0.4.1
     9Date: 2013-04-03
    1010Author: Potsky
    1111Author URI: http://www.potsky.com/about/
Note: See TracChangeset for help on using the changeset viewer.