Plugin Directory

Changeset 599590


Ignore:
Timestamp:
09/16/2012 08:19:13 AM (14 years ago)
Author:
fabifott
Message:

WP-Filebase 0.2.9.22

  • Multi instance File List Widget (old one is deprecated!)
  • DataTable List template is automatically added
  • New Template Download-button
  • Fixed missing argument warning for TitleFilter
  • Fixed Post Browser permission (now usable by Authors & Contributors)
Location:
wp-filebase
Files:
623 added
14 edited

Legend:

Unmodified
Added
Removed
  • wp-filebase/trunk/classes/Admin.php

    r598768 r599590  
    124124    'use_path_tags' => array('default' => false, 'title' => __('Use path instead of ID in Shortcode', WPFB), 'type' => 'checkbox', 'desc' => __('Files and Categories are identified by paths and not by their IDs in the generated Shortcodes', WPFB)),
    125125    'no_name_formatting'  => array('default' => false, 'title' => __('Disable Name Formatting', WPFB), 'type' => 'checkbox', 'desc' => __('This will disable automatic formatting/uppercasing file names when they are used as title (e.g. when syncing)', WPFB)),
     126   
    126127   
    127128    // file browser
     
    249250    'file_icon_url'         => __('URL of the thumbnail or icon', WPFB),
    250251   
     252   
    251253    'file_size'             => __('Formatted file size', WPFB),
    252254    'file_date'             => __('Formatted file date', WPFB),
     
    543545    // check extension
    544546    if($upload || $add_existing) {
    545         if(!self::_isAllowedFileExt($file_name)) {
     547        if(!self::IsAllowedFileExt($file_name)) {
    546548            if(isset($file_src_path)) @unlink($file_src_path);
    547549            return array( 'error' => sprintf( __( 'The file extension of the file <b>%s</b> is forbidden!', WPFB), $file_name ) );
     
    666668    }
    667669   
     670   
    668671    // custom fields!
    669672    $var_names = array_keys(WPFB_Core::GetCustomFields(true));
     
    785788}
    786789
     790static function CreateCatTree($file_path)
     791{
     792    $rel_path = trim(substr($file_path, strlen(WPFB_Core::UploadDir())),'/');
     793    $rel_dir = dirname($rel_path);
     794   
     795    if(empty($rel_dir) || $rel_dir == '.')
     796        return 0;
     797   
     798    $last_cat_id = 0;
     799    $dirs = explode('/', $rel_dir);
     800    foreach($dirs as $dir) {
     801        if(empty($dir) || $dir == '.')
     802            continue;
     803        $cat = WPFB_Item::GetByName($dir, $last_cat_id);
     804        if($cat != null && $cat->is_category) {
     805            $last_cat_id = $cat->cat_id;
     806        } else {
     807            $result = self::InsertCategory(array('add_existing' => true, 'cat_parent' => $last_cat_id, 'cat_folder' => $dir));
     808            if(!empty($result['error']))
     809                return $result;
     810            elseif(empty($result['cat_id']))
     811                wp_die('Could not create category!');
     812            else
     813                $last_cat_id = intval($result['cat_id']);
     814        }
     815    }   
     816    return $last_cat_id;
     817}
     818
    787819static function AddExistingFile($file_path, $thumb=null)
    788820{
    789     $upload_dir = WPFB_Core::UploadDir();
    790     $rel_path = trim(substr($file_path, strlen($upload_dir)),'/');
    791     $rel_dir = dirname($rel_path);
    792    
    793     $last_cat_id = 0;
    794    
    795     if(!empty($rel_dir) && $rel_dir != '.')
    796     {
    797         $dirs = explode('/', $rel_dir);
    798         foreach($dirs as $dir) {
    799             if(empty($dir) || $dir == '.')
    800                 continue;
    801             $cat = WPFB_Item::GetByName($dir, $last_cat_id);
    802             if($cat != null && $cat->is_category) {
    803                 $last_cat_id = $cat->cat_id;
    804             } else {
    805                 $result = self::InsertCategory(array('add_existing' => true, 'cat_parent' => $last_cat_id, 'cat_folder' => $dir));
    806                 if(!empty($result['error']))
    807                     return $result;
    808                 elseif(empty($result['cat_id']))
    809                     wp_die('Could not create category!');
    810                 else
    811                     $last_cat_id = intval($result['cat_id']);
    812             }
    813         }
    814     }
     821    $cat_id = self::CreateCatTree($file_path);
    815822   
    816823    // check if file still exists (it could be renamed while creating the category if its used for category icon!)
     
    818825        return array();
    819826       
    820     return self::InsertFile(array('add_existing' => true, 'file_category' => $last_cat_id, 'file_path' => $file_path, 'file_thumbnail' => $thumb));
     827    return self::InsertFile(array(
     828        'add_existing' => true,
     829        'file_category' => $cat_id,
     830        'file_path' => $file_path,
     831        'file_thumbnail' => $thumb
     832    ));
    821833}
    822834
     
    894906}
    895907
    896 private static function _isAllowedFileExt($ext)
     908static function IsAllowedFileExt($ext)
    897909{
    898910    static $srv_script_exts = array('php', 'php3', 'php4', 'php5', 'phtml', 'cgi', 'pl', 'asp', 'py', 'aspx', 'jsp', 'jhtml', 'jhtm'); 
     
    11731185    }
    11741186   
     1187   
    11751188    return $messages;
    11761189}
  • wp-filebase/trunk/classes/AdminGuiManage.php

    r590827 r599590  
    260260                WPFB_Sync::PrintResult($result);
    261261
     262       
    262263            if(empty($_GET['hash_sync']))
    263264                echo '<p><a href="' . add_query_arg('hash_sync',1) . '" class="button">' . __('Complete file sync', WPFB) . '</a> ' . __('Checks files for changes, so more reliable but might take much longer. Do this if you uploaded/changed files with FTP.', WPFB) . '</p>';         
  • wp-filebase/trunk/classes/AdminLite.php

    r598768 r599590  
    1818   
    1919   
    20     wp_register_widget_control(WPFB_PLUGIN_NAME, WPFB_PLUGIN_NAME .' '. __('File list'), array(__CLASS__, 'WidgetFileListControl'), array('description' => __('Lists the latest or most popular files', WPFB)));
    21    
    22     //wp_register_widget_control(WPFB_PLUGIN_NAME.'_cats', "[DEPRECATED]".WPFB_PLUGIN_NAME.' ' . __('Category list'), array(__CLASS__, 'WidgetCatListControl'), array('description' => __('Simple listing of file categories', WPFB)));
     20    wp_register_widget_control(WPFB_PLUGIN_NAME, "[DEPRECATED]".WPFB_PLUGIN_NAME .' '. __('File list'), array(__CLASS__, 'WidgetFileListControl'), array('description' => __('DEPRECATED', WPFB)));
    2321   
    2422    add_action('admin_print_scripts', array('WPFB_AdminLite', 'PrintCKEditorPlugin'));
     
    7876}
    7977
    80 static function WidgetCatListControl()
    81 {
    82     WPFB_Core::LoadLang();
    83     wpfb_loadclass('Widget');
    84     WPFB_Widget::CatListCntrl();
    85 }
    86 
    8778private static function CheckChangedVer()
    8879{
  • wp-filebase/trunk/classes/Core.php

    r598867 r599590  
    2727    // for attachments and file browser
    2828    add_filter('the_content',   array(__CLASS__, 'ContentFilter'), 10); // must be lower than 11 (before do_shortcode) and after wpautop (>9)
    29     add_filter('the_title', array(__CLASS__, 'TitleFilter'), 10, 2);
    3029    add_filter('ext2type', array(__CLASS__, 'Ext2TypeFilter'));
    3130    add_filter('wp_get_attachment_url', array(__CLASS__, 'GetAttachmentUrlFilter'));
     
    4948   
    5049    // widgets
    51     wp_register_sidebar_widget(WPFB_PLUGIN_NAME, WPFB_PLUGIN_NAME .' '. __('File list', WPFB), array(__CLASS__, 'FileWidget'), array('description' => __('Lists the latest or most popular files', WPFB)));
    52     //wp_register_sidebar_widget(WPFB_PLUGIN_NAME.'_cats', "[DEPRECATED]".WPFB_PLUGIN_NAME.' ' . __('Category list', WPFB), array(__CLASS__, 'CatWidget'), array('description' => __('Simple listing of file categories', WPFB)));
    53     //wp_register_sidebar_widget(WPFB_PLUGIN_NAME.'_upload', WPFB_PLUGIN_NAME.' ' . __('File upload', WPFB), array(__CLASS__, 'UploadWidget'), array('description' => __('Supplies a form for uploading files', WPFB)));
     50    wp_register_sidebar_widget(WPFB_PLUGIN_NAME, "[DEPRECATED]".WPFB_PLUGIN_NAME .' '. __('File list', WPFB), array(__CLASS__, 'FileWidget'), array('description' => __('Deprecated, use other widget instead!', WPFB)));
    5451   
    5552    if((is_admin() && !empty($_GET['page']) && strpos($_GET['page'], 'wpfilebase_') !== false) || defined('WPFB_EDITOR_PLUGIN'))
     
    151148
    152149static function FileWidget($args) { return wpfb_call('Widget', 'FileList', $args); }
    153 //static function CatWidget($args) { return wpfb_call('Widget', 'CatList', $args); } // DEPRECATED
    154 //static function UploadWidget($args) { return wpfb_call('Widget', 'Upload', $args); } // uses new class-style widgets
    155150
    156151static function DownloadRedirect()
     
    281276}
    282277
    283 function TitleFilter($title, $id)
    284 {
    285     return $title;
    286 }
    287 
    288278
    289279static function ShortCode($atts, $content=null, $tag=null) {
     
    649639    return $path;
    650640}
    651 }
     641
     642static function CreateTplFunc($parsed_tpl) {
     643    return create_function('$f', "return ($parsed_tpl);");
     644}
     645}
  • wp-filebase/trunk/classes/File.php

    r598768 r599590  
    357357        $wpdb->query("DELETE FROM $wpdb->wpfilebase_files_id3 WHERE file_id = " . (int)$this->file_id);
    358358       
    359         // delete WP attachment entry
    360         $wpa_id = (int)$this->file_wpattach_id;
    361         if($wpa_id > 0 && $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE ID = %d AND post_type = 'attachment' AND post_status IN ('private', 'publish')", $wpa_id)))
    362             wp_delete_attachment($wpa_id, true);
     359       
    363360           
    364361        if(!$bulk)
     
    600597    }
    601598   
     599   
     600   
    602601    function GetWPAttachmentID() {
    603602        return $this->file_wpattach_id;
     
    606605    }
    607606   
     607   
    608608    function IsRemote() { return !empty($this->file_remote_uri); } 
    609609    function IsLocal() { return empty($this->file_remote_uri); }
  • wp-filebase/trunk/classes/Item.php

    r598867 r599590  
    274274            $parsed_tpl = WPFB_Core::GetParsedTpl($this->is_file?'file':'cat', $tpl_tag);
    275275            if(empty($parsed_tpl)) return "Template $type :: $tpl_tag does not exist!";
    276             $tpl_funcs[$type][$tpl_tag] = create_function('$f', "return ($parsed_tpl);");
     276            $tpl_funcs[$type][$tpl_tag] = WPFB_Core::CreateTplFunc($parsed_tpl);
    277277        }
    278278       
  • wp-filebase/trunk/classes/Output.php

    r598768 r599590  
    1010        $args ['id'] = $id = is_null($item = WPFB_Item::GetByPath($args['path'])) ? 0 : $item->GetId();
    1111    }
     12   
    1213   
    1314    switch($args['tag']) {
  • wp-filebase/trunk/classes/Setup.php

    r598768 r599590  
    1414    {
    1515        $new_opts[$opt_name] = $opt_data['default'];
    16     }       
    17 
    18     $new_opts['widget'] = array(
    19         'filelist_title' => 'Top Downloads',
    20         'filelist_order_by' => 'file_hits',
    21         'filelist_asc' => false,
    22         'filelist_limit' => 10,
    23         'filelist_template' => '<a href="%file_post_url%">%file_display_name%</a> (%file_hits%)',
    24         'filelist_template_parsed' => '',
    25        
    26         'catlist_title' => __('File Categories', WPFB),
    27         'catlist_hierarchical' => false
    28     );
    29 
     16    }
     17   
    3018    $new_opts['version'] = WPFB_VERSION;
    3119    $new_opts['tag_ver'] = WPFB_TAG_VER;
     
    5240    add_option(WPFB_OPT_NAME.'_ftags', array(), null, 'no'/*autoload*/);
    5341   
     42 
    5443}
    5544static function AddTpls($old_ver) {
    5645    $def_tpls_file = array(
    5746        'filebrowser' => '%file_small_icon% <a href="%file_url%" title="Download %file_display_name%">%file_display_name%</a> (%file_size%)',
     47        'download-button' => '<style type="text/css" media="screen">
     48    .wpfb-dlbtn div { width:250px; height:40px; margin:0; padding:0; background:transparent url(\'%wpfb_url%/images/dl_btn.png\') no-repeat top center;}
     49    .wpfb-dlbtn div:hover { background-image: url(%wpfb_url%/images/dl_btn_hover.png); }
     50</style>
     51<div style="text-align:center; width:250px; margin: auto; font-size:smaller;"><a href="%file_url%" class="wpfb-dlbtn"><div></div></a>
     52%file_display_name% (%file_size%, %file_hits% downloads)
     53</div>',
    5854        'image_320' => '[caption id="file_%file_id%" align="alignnone" width="320" caption="<!-- IF %file_description% -->%file_description%<!-- ELSE -->%file_display_name%<!-- ENDIF -->"]<img class="size-full" title="%file_display_name%" src="%file_url%" alt="%file_display_name%" width="320" />[/caption]'."\n\n",
    5955        'thumbnail' => '<div class="wpfilebase-fileicon"><a href="%file_url%" title="Download %file_display_name%"><img align="middle" src="%file_icon_url%" /></a></div>'."\n",
     
    174170    // add new data table template
    175171    if(!empty($old_ver)) {
    176         if(version_compare($old_ver, '0.2.9.20') < 0)
     172        if(version_compare($old_ver, '0.2.9.22') < 0) {
    177173            $default_templates[] = 'data-table';
     174            $default_templates[] = 'download-button';
     175        }
    178176    }
    179177   
     
    186184    update_option(WPFB_OPT_NAME.'_tpls_file', $tpls_file);
    187185    update_option(WPFB_OPT_NAME.'_tpls_cat', $tpls_cat);
    188     update_option(WPFB_OPT_NAME.'_tpls_list', $tpls_list);
     186    update_option(WPFB_OPT_NAME.'_list_tpls', $tpls_list);
    189187   
    190188    WPFB_Admin::ParseTpls();
     
    233231    $tbl_files = $wpdb->prefix . 'wpfb_files';
    234232    $tbl_files_id3 = $wpdb->prefix . 'wpfb_files_id3';
     233   
    235234    $queries[] = "CREATE TABLE IF NOT EXISTS `$tbl_cats` (
    236235  `cat_id` int(8) unsigned NOT NULL auto_increment,
     
    297296  PRIMARY KEY  (`file_id`)
    298297) ENGINE=MyISAM  DEFAULT CHARSET=utf8";
    299    
     298
     299   
     300
    300301    // errors of queries starting with @ are supressed
    301302   
     
    351352    //$queries[] = "@ALTER TABLE `$tbl_files` ADD `file_meta` TEXT NULL DEFAULT NULL";
    352353   
     354
    353355    $queries[] = "OPTIMIZE TABLE `$tbl_cats`";
    354356    $queries[] = "OPTIMIZE TABLE `$tbl_files`";
  • wp-filebase/trunk/classes/TplLib.php

    r590827 r599590  
    1515    // remove cat anchors
    1616    $tpl = str_replace('%cat_url%#wpfb-cat-%cat_id%','%cat_url%',$tpl);
     17   
     18    // remote slash after wpfb_url
     19    $tpl = str_replace("%wpfb_url%/", "%wpfb_url%", $tpl);
    1720   
    1821    // since 0.2.0 the onclick is set via jQuery!
  • wp-filebase/trunk/classes/Widget.php

    r590827 r599590  
    77    register_widget('WPFB_SearchWidget');
    88    register_widget('WPFB_CatListWidget');
     9    register_widget('WPFB_FileListWidget');
    910}
    1011
     
    6061function FileListCntrl()
    6162{
     63    echo "DEPRECATED! Use other widget instead!";
    6264    wpfb_loadclass('File', 'Category', 'Output', 'Admin');
    6365   
     
    120122    </div>
    121123    <?php
    122 }
    123 
    124 function CatList($args)
    125 {
    126     // if no filebrowser this widget doosnt work
    127     if(WPFB_Core::GetOpt('file_browser_post_id') <= 0)
    128         return;
    129        
    130     wpfb_loadclass('Category', 'Output');
    131    
    132     extract($args);
    133    
    134     $options = &WPFB_Core::GetOpt('widget');
    135 
    136     echo $before_widget;
    137     echo $before_title , (empty($options['catlist_title']) ? __('File Categories', WPFB) : $options['catlist_title']), $after_title;
    138    
    139     if(current_user_can('upload_files')) {
    140         echo '<p>This widget is deprecated! Please use the new <a href="'.admin_url('widgets.php').'">WP-Filebase Category List Widget</a>.</p>';
    141     }
    142    
    143     $tree = !empty($options['catlist_hierarchical']);
    144    
    145     // load all categories
    146     WPFB_Category::GetCats();
    147    
    148     $cats = WPFB_Category::GetCats(($tree ? 'WHERE cat_parent = 0 ' : '') . 'ORDER BY cat_name ASC' /* . $options['catlist_order_by'] . ($options['catlist_asc'] ? ' ASC' : ' DESC') /*. ' LIMIT ' . (int)$options['catlist_limit']*/);
    149    
    150     echo '<ul>';
    151     foreach($cats as $cat){
    152         if($cat->CurUserCanAccess(true))
    153         {
    154             if($tree)
    155                 self::CatTree($cat);
    156             else
    157                 echo '<li><a href="'.$cat->GetUrl().'">'.esc_html($cat->cat_name).'</a></li>';
    158         }
    159     }
    160     echo '</ul>';
    161     echo $after_widget;
    162 }
    163 
    164 function CatTree(&$root_cat)
    165 {
    166     echo '<li><a href="'.$root_cat->GetUrl().'">'.esc_html($root_cat->cat_name).'</a>';
    167    
    168     $childs =& $root_cat->GetChildCats();
    169     if(count($childs) > 0)
    170     {
    171         echo '<ul>';
    172         foreach(array_keys($childs) as $i) self::CatTree($childs[$i]);
    173         echo '</ul>';
    174     }
    175    
    176     echo '</li>';
    177 }
    178 
    179 // DEPRECATED TODO remove
    180 function CatListCntrl()
    181 {
    182     echo "DEPRECATED";
    183124}
    184125}
     
    292233}
    293234
    294 
    295235class WPFB_SearchWidget extends WP_Widget {
    296236
     
    337277}
    338278
    339 
    340279class WPFB_CatListWidget extends WP_Widget {
    341280
     
    439378    }
    440379}
     380
     381class WPFB_FileListWidget extends WP_Widget {
     382
     383    function WPFB_FileListWidget() {
     384        parent::WP_Widget( false, WPFB_PLUGIN_NAME .' '.__('File list', WPFB), array('description' => __('Listing of files with custom sorting', WPFB)) );
     385    }
     386
     387    function widget( $args, $instance ) {
     388        wpfb_loadclass('File', 'Category', 'Output');
     389       
     390        extract( $args );
     391        $title = apply_filters('widget_title', $instance['title']);     
     392        echo $before_widget, $before_title . (empty($title) ? __('Files',WPFB) : $title) . $after_title;
     393   
     394   
     395        // load all categories
     396        //WPFB_Category::GetCats();
     397       
     398        $files = WPFB_File::GetFiles2(
     399            !empty($instance['cat']) ?  array('file_category'=>(int)$instance['cat']) : null,
     400            WPFB_Core::GetOpt('hide_inaccessible'),
     401            array($instance['sort-by'] => ($instance['sort-asc'] ? 'ASC' : 'DESC')),
     402            (int)$instance['limit']
     403        );
     404       
     405        $tpl_func = WPFB_Core::CreateTplFunc($instance['tpl_parsed']);
     406        echo '<ul>';
     407        foreach($files as $file){
     408            echo '<li>',($tpl_func($file)),'</li>';
     409        }
     410        echo '</ul>';
     411        echo $after_widget;
     412    }
     413   
     414
     415    function update( $new_instance, $old_instance ) {
     416        wpfb_loadclass('Admin','TplLib', 'Output');
     417       
     418        $instance = $old_instance;
     419        $instance['title'] = strip_tags($new_instance['title']);
     420        $instance['cat'] = max(0, intval($new_instance['cat']));
     421        $instance['limit'] = max(1, intval($new_instance['limit']));
     422        $instance['sort-by'] = strip_tags($new_instance['sort-by']);
     423        if(!in_array($instance['sort-by'], array_keys(WPFB_Admin::FileSortFields())))
     424            $instance['sort-by'] = 'cat_name';
     425        $instance['sort-asc'] = !empty($new_instance['sort-asc']);
     426        $instance['tpl_parsed'] = WPFB_TplLib::Parse($instance['tpl'] = $new_instance['tpl']);
     427       
     428        return $instance;
     429    }
     430   
     431    function form( $instance ) {
     432       
     433        $defaults = array(
     434            'title' => 'Top Downloads',
     435            'sort-by' => 'file_hits',
     436            'sort-asc' => false,
     437            'limit' => 10,
     438            'tpl' => '<a href="%file_post_url%">%file_display_name%</a> (%file_hits%)'
     439        );
     440       
     441        foreach($defaults as $prop => $val)
     442            if(!isset($instance[$prop])) $instance[$prop] = $val;
     443       
     444        wpfb_loadclass('Admin','Output');
     445    ?>
     446    <div>
     447        <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?>
     448            <input type="text" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo esc_attr($instance['title']); ?>" /></label>
     449        </p>
     450       
     451        <p><label for="<?php echo $this->get_field_id('cat'); ?>"><?php _e('Category:', WPFB); ?>
     452            <select name="<?php echo $this->get_field_name('cat'); ?>" id="<?php echo $this->get_field_id('cat'); ?>">
     453            <?php echo WPFB_Output::CatSelTree(array('selected'=>empty($instance['cat']) ? 0 : $instance['cat'], 'none_label'=>__('All'))) ?>
     454            </select></label>
     455        </p>
     456        <!--
     457        <p><input type="checkbox" id="<?php echo $this->get_field_id('hierarchical'); ?>" name="<?php echo $this->get_field_name('hierarchical'); ?>" value="1" <?php checked($instance['hierarchical']); ?> />
     458        <label for="<?php echo $this->get_field_id('hierarchical'); ?>"><?php _e( 'Show hierarchy' ); ?></label>
     459        </p>
     460         -->
     461       
     462        <p>
     463            <label for="<?php echo $this->get_field_id('sort-by'); ?>"><?php _e('Sort by:'/*def*/); ?></label>
     464            <select id="<?php echo $this->get_field_id('sort-by'); ?>" name="<?php echo $this->get_field_name('sort-by'); ?>">
     465            <?php
     466                $sort_vars = WPFB_Admin::FileSortFields();
     467                foreach($sort_vars as $tag => $name)
     468                {
     469                    echo '<option value="' . esc_attr($tag) . '" title="' . esc_attr($name) . '"' . ( ($instance['sort-by'] == $tag) ? ' selected="selected"' : '' ) . '>' .$tag.'</option>';
     470                }
     471            ?>
     472            </select><br />
     473            <label for="<?php echo $this->get_field_id('sort-asc0'); ?>"><input type="radio" name="<?php echo $this->get_field_name('sort-asc'); ?>" id="<?php echo $this->get_field_id('sort-asc0'); ?>" value="0"<?php checked($instance['sort-asc'], false) ?>/><?php _e('Descending'); ?></label>
     474            <label for="<?php echo $this->get_field_id('sort-asc1'); ?>"><input type="radio" name="<?php echo $this->get_field_name('sort-asc'); ?>" id="<?php echo $this->get_field_id('sort-asc1'); ?>" value="1"<?php checked($instance['sort-asc'], true) ?>/><?php _e('Ascending'); ?></label>
     475        </p>
     476       
     477        <p><label for="<?php echo $this->get_field_id('limit'); ?>"><?php _e('Limit:', WPFB); ?>
     478            <input type="text" id="<?php echo $this->get_field_id('limit'); ?>" name="<?php echo $this->get_field_name('limit'); ?>" value="<?php echo intval($instance['limit']); ?>" size="4" maxlength="3" /></label>
     479        </p>
     480       
     481        <p><label for="<?php echo $this->get_field_id('tpl'); ?>"><?php _e('Template:', WPFB); ?>
     482            <input class="widefat" type="text" id="<?php echo $this->get_field_id('id'); ?>" name="<?php echo $this->get_field_name('tpl'); ?>" value="<?php echo esc_attr($instance['tpl']); ?>" /></label>
     483            <br /><?php echo WPFB_Admin::TplFieldsSelect($this->get_field_id('id'), true); ?>
     484        </p>
     485    </div>
     486    <?php
     487    }
     488}
  • wp-filebase/trunk/readme.txt

    r598867 r599590  
    55Requires at least: 3.1
    66Tested up to: 3.4.2
    7 Stable tag: 0.2.9.21
     7Stable tag: 0.2.9.22
    88
    99Adds a powerful download manager supporting file categories, downloads counter, widgets, sorted file lists and more to your WordPress blog.
     
    104104
    105105== Changelog ==
     106
     107= 0.2.9.22 =
     108* Multi instance File List Widget (old one is deprecated!)
     109* DataTable List template is automatically added
     110* New Template `Download-button`
     111* Fixed missing argument warning for `TitleFilter`
     112* Fixed Post Browser permission (now usable by Authors & Contributors)
    106113
    107114= 0.2.9.21 =
  • wp-filebase/trunk/todo.txt

    r598867 r599590  
     1rsync: make sure cat is empty!
     2dropbox: checkbox for toggle preview
    13wp-search: Notice: Undefined index: wpfb_s in C:\xampp\htdocs\wpt\wp-content\plugins\wp-filebase-pro\classes\Search.php on line 126
    24multiple instance file widget
     
    46bmp thumnails in  otuner broken??!?
    57drag & drop file widget
    6 file details without permalinks
    78
    89simpel form by default!
    910
    10 filebrowser subpage links to parent??!? fix?!
    1111
    1212ftp sideload link
  • wp-filebase/trunk/wp-filebase.php

    r598867 r599590  
    55Description: Adds a powerful downloads manager supporting file categories, download counter, widgets, sorted file lists and more to your WordPress blog.
    66Author: Fabian Schlieper
    7 Version: 0.2.9.21
     7Version: 0.2.9.22
    88Author URI: http://fabi.me/
    99*/
     
    1212{
    1313    define('WPFB', 'wpfb');
    14     define('WPFB_VERSION', '0.2.9.21');
     14    define('WPFB_VERSION', '0.2.9.22');
    1515    define('WPFB_PLUGIN_ROOT', str_replace('\\','/',dirname(__FILE__)).'/');
    1616    if(!defined('ABSPATH')) {
  • wp-filebase/trunk/wpfb-postbrowser.php

    r590827 r599590  
    11<?php
    22require_once(dirname(__FILE__).'/../../../wp-load.php');
    3 if(!current_user_can('read_private_posts'))
     3if(!current_user_can('edit_posts'))
    44    wp_die(__('Cheatin&#8217; uh?'));
    55?>
Note: See TracChangeset for help on using the changeset viewer.