Changeset 3123942
- Timestamp:
- 07/23/2024 01:36:20 PM (21 months ago)
- Location:
- rotatingtweets/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (1 diff)
-
rotatingtweets.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
rotatingtweets/trunk/readme.txt
r3109619 r3123942 5 5 Requires at least: 3.2 6 6 Tested up to: 6.4.3 7 Stable tag: 1.9.1 07 Stable tag: 1.9.11 8 8 Requires PHP: 5.2.4 9 9 License: GPLv2 or later -
rotatingtweets/trunk/rotatingtweets.php
r3109619 r3123942 415 415 endif; 416 416 } 417 /* translators: %d is replaced with the number of hours since the tweet was posted */ 418 if($n < (60*60*16)) { $hours = round($n/(60*60)); return sprintf(_n('about an hour ago','about %d hours ago',$hours,'rotatingtweets'),$hours); } 417 418 if($n < (60*60*16)) { $hours = round($n/(60*60)); 419 if($hours == 1): 420 return __('about an hour ago'); 421 else: 422 /* translators: %d is replaced with the number of hours since the tweet was posted */ 423 return sprintf(_n('about %d hour ago','about %d hours ago',$hours,'rotatingtweets'),$hours); 424 endif; 425 } 419 426 if($n < (time() - strtotime('yesterday'))) return __('yesterday','rotatingtweets'); 420 /* translators: %d is replaced with the number of hours since the tweet was posted */ 421 if($n < (60*60*24)) { $hours = round($n/(60*60)); return sprintf(_n('about an hour ago','about %d hours ago',$hours,'rotatingtweets'),$hours); } 422 /* translators: %d is replaced with the number of days since the tweet was posted */ 423 if($n < (60*60*24*6.5)) { $days = round($n/(60*60*24)); return sprintf(_n('about a day ago','about %d days ago',$days,'rotatingtweets'),$days); } 427 428 if($n < (60*60*24)) { $hours = round($n/(60*60)); 429 if($hours == 1): 430 return __('about an hour ago'); 431 else: 432 /* translators: %d is replaced with the number of hours since the tweet was posted */ 433 return sprintf(_n('about %d hour ago','about %d hours ago',$hours,'rotatingtweets'),$hours); 434 endif; 435 } 436 if($n < (60*60*24*6.5)) { $days = round($n/(60*60*24)); 437 if($days ==1): 438 return __('about a day ago'); 439 else: 440 /* translators: %d is replaced with the number of days since the tweet was posted */ 441 return sprintf(_n('about %d day ago','about %d days ago',$days,'rotatingtweets'),$days); 442 endif; 443 } 424 444 if($n < (time() - strtotime('last week'))) return __('last week','rotatingtweets'); 425 /* translators: %d is replaced with the number of weeks since the tweet was posted */ 426 if($n < (60*60*24*7*3.5)) { $weeks = round($n/(60*60*24*7)); return sprintf(_n('about a week ago','about %d weeks ago',$weeks,'rotatingtweets'),$weeks); } 445 if($n < (60*60*24*7*3.5)) { $weeks = round($n/(60*60*24*7)); 446 if($weeks==1): 447 return __('about a week ago'); 448 else: 449 /* translators: %d is replaced with the number of weeks since the tweet was posted */ 450 return sprintf(_n('about %d week ago','about %d weeks ago',$weeks,'rotatingtweets'),$weeks); 451 endif; 452 } 427 453 if($n < (time() - strtotime('last month'))) return __('last month','rotatingtweets'); 428 /* translators: %d is replaced with the number of months since the tweet was posted */ 429 if($n < (60*60*24*7*4*11.5)) { $months = round($n/(60*60*24*7*4)) ; return sprintf(_n('about a month ago','about %d months ago',$months,'rotatingtweets'),$months);} 454 455 if($n < (60*60*24*7*4*11.5)) { $months = round($n/(60*60*24*7*4)) ; 456 if($months==1): 457 return __('about a month ago'); 458 else: 459 /* translators: %d is replaced with the number of months since the tweet was posted */ 460 return sprintf(_n('about %d month ago','about %d months ago',$months,'rotatingtweets'),$months); 461 endif; 462 } 430 463 if($n < (time() - strtotime('last year'))) return __('last year','rotatingtweets'); 431 /* translators: %d is replaced with the number of years since the tweet was posted */ 432 if($n >= (60*60*24*7*4*12)){$years=round($n/(60*60*24*7*52)) ;return sprintf(_n('about a year ago','about %d years ago',$years,'rotatingtweets'),$years);} 464 if($n >= (60*60*24*7*4*12)){$years=round($n/(60*60*24*7*52)) ; 465 if($years==1): 466 return __('about a year ago'); 467 else: 468 /* translators: %d is replaced with the number of years since the tweet was posted */ 469 return sprintf(_n('about %d year ago','about %d years ago',$years,'rotatingtweets'),$years); 470 endif; 471 } 433 472 return false; 434 473 } … … 2519 2558 // case 'zeeStyle': 2520 2559 wp_dequeue_script( 'zee_jquery-cycle'); 2521 wp_enqueue_script( 'zee_jquery-cycle', plugins_url($cyclejsfile, __FILE__),$dependence, FALSE,$api['js_in_footer']);2560 wp_enqueue_script( 'zee_jquery-cycle', plugins_url($cyclejsfile, __FILE__),$dependence,$rt_data['Version'],$api['js_in_footer']); 2522 2561 $dependence[]='zee_jquery-cycle'; 2523 2562 break; 2524 2563 case 'oxygen': 2525 2564 wp_dequeue_script( 'oxygen_cycle'); 2526 wp_enqueue_script( 'oxygen_cycle', plugins_url($cyclejsfile, __FILE__),$dependence, FALSE,$api['js_in_footer']);2565 wp_enqueue_script( 'oxygen_cycle', plugins_url($cyclejsfile, __FILE__),$dependence,$rt_data['Version'],$api['js_in_footer']); 2527 2566 $dependence[]='oxygen_cycle'; 2528 2567 break; … … 2533 2572 case 'a52cars': 2534 2573 wp_dequeue_script( 'jquery.cycle'); 2535 wp_enqueue_script( 'jquery.cycle', plugins_url($cyclejsfile, __FILE__),$dependence, FALSE,$api['js_in_footer'] );2574 wp_enqueue_script( 'jquery.cycle', plugins_url($cyclejsfile, __FILE__),$dependence,$rt_data['Version'],$api['js_in_footer'] ); 2536 2575 $dependence[]='jquery.cycle'; 2537 2576 break; 2538 2577 default: 2539 wp_enqueue_script( 'jquery-cycle', plugins_url($cyclejsfile, __FILE__),$dependence, FALSE,$api['js_in_footer'] );2578 wp_enqueue_script( 'jquery-cycle', plugins_url($cyclejsfile, __FILE__),$dependence,$rt_data['Version'],$api['js_in_footer'] ); 2540 2579 $dependence[]='jquery-cycle'; 2541 2580 break; … … 2552 2591 if(is_admin()) return; 2553 2592 $api = get_option('rotatingtweets-api-settings'); 2593 $rt_data = get_plugin_data( __FILE__ ); 2554 2594 if(isset($api['hide_css']) && $api['hide_css']==1) return; 2555 wp_enqueue_style( 'rotatingtweets', plugins_url('css/style.css', __FILE__),array(), 1.9 ); // Update version number if Rotating Tweets CSS changes2595 wp_enqueue_style( 'rotatingtweets', plugins_url('css/style.css', __FILE__),array(), $rt_data['Version'] ); 2556 2596 $uploads = wp_upload_dir(); 2557 2597 $personalstyle = array( … … 2563 2603 foreach($personalstyle as $dir => $url): 2564 2604 if(file_exists( $dir )): 2565 wp_enqueue_style( $scriptname, $url );2605 wp_enqueue_style( $scriptname, $url,array(),$rt_data['Version']); 2566 2606 $scriptname = 'rotatingtweet-yourstyle-'.$scriptcounter; 2567 2607 $scriptcounter ++; … … 2574 2614 } 2575 2615 function rotatingtweets_enqueue_admin_scripts($hook) { 2616 $rt_data = get_plugin_data( __FILE__ ); 2576 2617 wp_enqueue_script( 'jquery' ); 2577 wp_enqueue_script( 'rotating_tweet_admin', plugins_url('js/rotating_tweet_admin.js', __FILE__),array('jquery'), FALSE,FALSE );2618 wp_enqueue_script( 'rotating_tweet_admin', plugins_url('js/rotating_tweet_admin.js', __FILE__),array('jquery'),$rt_data['Version'],FALSE ); 2578 2619 } 2579 2620 add_action( 'admin_enqueue_scripts', 'rotatingtweets_enqueue_admin_scripts_widget_page' );
Note: See TracChangeset
for help on using the changeset viewer.