Changeset 1047430
- Timestamp:
- 12/17/2014 07:25:39 PM (11 years ago)
- File:
-
- 1 edited
-
content-scheduler/trunk/content-scheduler.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
content-scheduler/trunk/content-scheduler.php
r1047429 r1047430 304 304 ?> 305 305 <script type="text/javascript"> 306 jQuery(function(){307 jQuery( '#cs-expire-date' ).datetimepicker();306 jQuery(function(){ 307 jQuery( '#cs-expire-date' ).datetimepicker() 308 308 }); 309 309 </script> 310 <!-- .datetimepicker -->311 310 <?php 312 311 } … … 481 480 return $post_id; 482 481 } 482 483 483 // OK, we're authenticated: we need to find and save the data 484 484 // First, let's make sure we'll do date operations in the right timezone for this blog … … 496 496 } 497 497 // Textbox for "expiration date" 498 $dateString = $_POST['_cs-expire-date']; 498 $dateString = $_POST['_cs-expire-date']; 499 499 $offsetHours = 0; 500 500 // if it is empty then set it to tomorrow … … 553 553 else 554 554 { 555 $ date = DateUtilities::getTimestampFromReadableDate( $dateString, $offsetHours );555 $expiration_date = DateUtilities::getTimestampFromReadableDate( $dateString, $offsetHours ); 556 556 } 557 557 // We probably need to store the date differently, … … 844 844 } 845 845 846 // We'll need the following if / when we allow formatting of the timestamp847 /*848 // we'll default to formats selected in Settings > General849 extract( shortcode_atts( array(850 'dateformat' => get_option('date_format'),851 'timeformat' => get_option('time_format')852 ), $attributes ) );853 // We always show date and time together854 $format = $dateformat . ' ' . $timeformat;855 return date( "$format", $expirationdt );856 */857 846 $return_string = sprintf( __("Expires: %s", 'contentscheduler'), $expirationdt ); 858 847 return $return_string; 859 848 } 860 861 862 863 864 865 // =======================================================================866 // == GENERAL UTILITY FUNCTIONS867 // =======================================================================868 // 11/17/2010 3:06:27 PM -pk869 // NOTE: We could add another parameter, '$format,' to support different date formats870 function check_date_format($date) {871 // match the format of the date872 // in this case, it is ####-##-##873 if (preg_match ("/^([0-9]{4})-([0-9]{2})-([0-9]{2})\ ([0-9]{2}):([0-9]{2}):([0-9]{2})$/", $date, $parts))874 {875 // check whether the date is valid or not876 // $parts[1] = year; $parts[2] = month; $parts[3] = day877 // $parts[4] = hour; [5] = minute; [6] = second878 if(checkdate($parts[2],$parts[3],$parts[1]))879 {880 // NOTE: We are only checking the HOUR here, since we won't make use of Min and Sec anyway881 if( $parts[4] <= 23 )882 {883 // time (24-hour hour) is okay884 return true;885 }886 else887 {888 // not a valid 24-hour HOUR889 return false;890 }891 }892 else893 {894 // not a valid date by php checkdate()895 return false;896 }897 }898 else899 {900 return false;901 }902 }903 904 // ================================================================905 // handle timezones906 function setup_timezone() {907 error_log( __FILE__ . " :: " . __FUNCTION__ . " was called, but we want to stop using it." );908 /*909 if ( ! $wp_timezone = get_option( 'timezone_string' ) )910 {911 return false;912 }913 // 11/5/2010 10:14:14 AM -pk914 // Set the default timezone used by Content Scheduler915 date_default_timezone_set( $wp_timezone );916 */917 }918 919 849 } // end ContentScheduler Class 920 850 } // End IF Class ContentScheduler … … 932 862 // == For displaying the expiration date / time of the current post. 933 863 // == Must be used within the loop 864 // We could do away with this and just advise people to use do_shortcode instead 934 865 function cont_sched_show_expiration( $args = '' ) 935 866 {
Note: See TracChangeset
for help on using the changeset viewer.