Changeset 213105
- Timestamp:
- 03/04/2010 06:10:11 PM (16 years ago)
- Location:
- file-proxy/trunk/com/twothirdsdesign/file-proxy
- Files:
-
- 2 edited
-
admin/admin.php (modified) (1 diff)
-
ttd_file_proxy.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
file-proxy/trunk/com/twothirdsdesign/file-proxy/admin/admin.php
r213089 r213105 39 39 40 40 function upload_form_filter( $form_fields, $post ){ 41 $link = $this->m->generate_url( $post->ID );41 $link = "[file-proxy-url]{$post->ID}[/file-proxy-url]"; 42 42 $form_fields['url']['html'] = $form_fields['url']['html'] . "<button type='button' class='button urlfileproxy' title='" . esc_attr($link) . "'>" . __( 'File Proxy', $this->domain ) . "</button>"; 43 43 return $form_fields; -
file-proxy/trunk/com/twothirdsdesign/file-proxy/ttd_file_proxy.php
r212172 r213105 48 48 49 49 // shortcodes 50 add_shortcode('file-proxy', array(&$this, 'return_proxy_url')); 50 add_shortcode('file-proxy', array(&$this, 'return_proxy_link')); 51 add_shortcode('file-proxy-url', array(&$this, 'return_proxy_url')); 51 52 52 53 // adds proxy rewrite rule & query_var … … 278 279 * @since 0.1 279 280 **/ 280 public function return_proxy_ url($atts, $content = '')281 public function return_proxy_link($atts, $content = '') 281 282 { 282 283 global $wpdb; 283 284 284 285 extract(shortcode_atts(array( 285 'id' => '', 286 'alt' => 'Some Really Great File', 286 'id' => '0', 287 'alt' => '', 288 'type' => 'link', 287 289 ), $atts)); 288 290 … … 298 300 //if( !is_user_logged_in() ) 299 301 // $title = $title . " - Login to download this file."; 300 echo "<a href='{$link}' alt='{$alt}'>{$title}</a>"; 301 } 302 switch( $type ) 303 { 304 case 'url': 305 echo $link; 306 break; 307 308 case 'link': 309 default: 310 echo "<a href='{$link}' alt='{$alt}'>{$title}</a>"; 311 break; 312 } 313 } 314 315 public function return_proxy_url($atts, $content = '') 316 { 317 global $wpdb; 318 $id = intval($content); 319 320 $link = $this->generate_url($id); 321 echo $link; 322 } 323 302 324 303 325 /**
Note: See TracChangeset
for help on using the changeset viewer.