Plugin Directory

Changeset 210651


Ignore:
Timestamp:
02/26/2010 08:15:10 PM (16 years ago)
Author:
geraint
Message:
 
Location:
file-proxy/trunk
Files:
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • file-proxy/trunk/com/twothirdsdesign/file-proxy/ttd_file_proxy.php

    r210619 r210651  
    3737        // Add admin menu interface
    3838        if( is_admin() ){
    39             include( TTDFP_ADMIN.DS."adminController.php" );
     39            //include( TTDFP_ADMIN.DS."adminController.php" );
    4040            //$adminCrtl = new GcpfAdminController( &$this );
    4141            //add_action('admin_menu', array(&$adminCrtl, 'adminMenus'));
     
    110110        $this->update_option("version", TTDPF_VERSION );
    111111        if( defined('WP_CONTENT_DIR') ){
    112             if(!is_dir(WP_CONTENT_DIR.DS.'cache')){
    113                 mkdir(WP_CONTENT_DIR.DS.'cache');
    114             }
    115             if(!is_dir(WP_CONTENT_DIR.DS.'cache'.DS. $plugin_domain)){ 
    116                 mkdir(WP_CONTENT_DIR.DS.'cache'.DS. $plugin_domain);
    117             }
    118             if(!is_dir(WP_CONTENT_DIR.DS.'cache'.DS. $plugin_domain)){
     112            if(!is_dir( WP_CONTENT_DIR.DS.'cache' )){
     113                mkdir( WP_CONTENT_DIR.DS.'cache' );
     114            }
     115            if(!is_dir( WP_CONTENT_DIR.DS.'cache'.DS. $this->plugin_domain )){ 
     116                mkdir( WP_CONTENT_DIR.DS.'cache'.DS. $this->plugin_domain );
     117            }
     118            if(!is_dir( WP_CONTENT_DIR.DS.'cache'.DS. $this->plugin_domain )){
    119119                exit ("cache dir failure");
    120120            }
    121121        }
    122122        else
    123             mkdir(TTDFP_DIR.DS.'cache');
     123            mkdir( TTDFP_DIR.DS.'cache' );
    124124    }
    125125       
     
    136136            delete_option($this->options_key);
    137137           
    138             if(is_dir(WP_CONTENT_DIR.DS.'cache'.DS. $plugin_domain ))
    139                 $this->rmdirr(WP_CONTENT_DIR.DS.'cache'.DS. $plugin_domain );
    140             if(is_dir(TTDFP_DIR.DS.'cache'))
    141                 $this->rmdirr(TTDFP_DIR.DS.'cache');
     138            if( is_dir( WP_CONTENT_DIR.DS.'cache'.DS. $this->plugin_domain ))
     139                $this->rmdirr(WP_CONTENT_DIR.DS.'cache'.DS. $this->plugin_domain );
     140            if( is_dir( TTDFP_DIR.DS.'cache' ))
     141                $this->rmdirr( TTDFP_DIR.DS.'cache' );
    142142        }
    143143    }
     
    217217    public function return_proxy_url($atts, $content = '')
    218218    {   
     219        global $wpdb;
     220       
    219221        extract(shortcode_atts(array(
    220222                'id' => '',
    221223                'alt' => 'Some Really Great File',
    222224            ), $atts));
     225           
     226        $id = intval($id);
     227        $file_name = $wpdb->get_var( $wpdb->prepare( "SELECT guid FROM {$wpdb->prefix}posts WHERE id=%d", $id ));
     228        $file_name = $file_name = explode( DS , $file_name );
     229        $file_name = $file_name[( count($file_name)-1 )];
    223230       
    224231        $link =  get_bloginfo('url') .'/index.php?'. $this->options->get_option('url-key') .'='. $id;
    225         $title = empty($content) ? 'DEFAULT TITLE' : $content ;
     232        $title = empty($content) ? $file_name : $content ;
    226233       
    227234        //if( !is_user_logged_in() )
  • file-proxy/trunk/init.php

    r210180 r210651  
    4848            require_once( TTDFP_CORE.DS.'gcp_options.php' );
    4949       
    50         require_once( TTDFP_LIB.DS.'file-proxy'.DS.'TtdFileProxy.php' );
     50        require_once( TTDFP_LIB.DS.'file-proxy'.DS.'ttd_file_proxy.php' );
    5151       
    5252        // Create Plugin Instance
  • file-proxy/trunk/readme.txt

    r210305 r210651  
    2626
    2727== Screenshots ==
    28 1. Screen shots to follow
     28none
    2929
    3030== Frequently Asked Questions ==
     
    3737== Changelog ==
    3838
     39= 0.3 =
     40Corrects Default link text, to file name.
     41
    3942= 0.2 =
    4043Adds some Variable sanitation
     
    4447
    4548== Upgrade Notice ==
     49= 0.3 =
     50Corrects Default link text, to link file name.
    4651
    4752= 0.2 =
Note: See TracChangeset for help on using the changeset viewer.