Changeset 211980
- Timestamp:
- 03/01/2010 10:28:03 PM (16 years ago)
- Location:
- file-proxy/trunk/com/twothirdsdesign
- Files:
-
- 2 edited
-
core/gcp_options.php (modified) (2 diffs)
-
file-proxy/ttd_file_proxy.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
file-proxy/trunk/com/twothirdsdesign/core/gcp_options.php
r211919 r211980 4 4 * 5 5 * @author Geraint Palmer 6 * @version 1.0. 16 * @version 1.0.2 7 7 */ 8 8 class GcpOptions … … 26 26 { 27 27 // tries to create a cache from wordpress DB options table.// uses plugin preset options not in db 28 $this->_optioncache = unserialize( get_option( $this->options_key, false ));28 $this->_optioncache = unserialize( get_option( $this->options_key , false )); 29 29 if (!$this->_optioncache) $this->_optioncache = $this->_options; 30 30 } -
file-proxy/trunk/com/twothirdsdesign/file-proxy/ttd_file_proxy.php
r211903 r211980 20 20 'url-key' => 'file', 21 21 'cache' => 'off', 22 'permalinks' => 'off', 22 23 ); 23 24 … … 257 258 $id = intval($id); 258 259 $file_name = $wpdb->get_var( $wpdb->prepare( "SELECT guid FROM {$wpdb->prefix}posts WHERE id=%d", $id )); 259 $file_name = $file_name =explode( DS , $file_name );260 $file_name = explode( DS , $file_name ); 260 261 $file_name = $file_name[( count($file_name)-1 )]; 261 262 $link = get_bloginfo('url') .'/index.php?'. $this->options->get_option('url-key') .'='. $id;262 263 263 264 $title = empty($content) ? $file_name : $content ; 264 265 … … 267 268 echo "<a href='{$link}' alt='{$alt}'>{$title}</a>"; 268 269 } 270 271 /** 272 * Constructs the correct Download URI 273 * 274 * @return String 275 * @author Geraint Palmer 276 * @since 0.5 277 **/ 278 private function generate_url($id) 279 { 280 global $wp_rewrite; 281 282 $link = get_bloginfo('url') .'/index.php?'. $this->options->get_option('url-key') .'='. $id; 283 284 if ( $this->get_option('permalink') == 'on' ) 285 { 286 if( $wp_rewrite->using_permalinks() ) 287 $link = get_bloginfo('url') .'/'. $this->get_option('url-key') .'/'. $id ."/"; 288 else if( $wp_rewite->using_index_permalinks() ) 289 $link = get_bloginfo('url') .'/index.php/'. $this->get_option('url-key') .'/'. $id ."/"; 290 } 291 return $link; 292 } 269 293 } 270 294 ?>
Note: See TracChangeset
for help on using the changeset viewer.