diff --git a/boot.php b/boot.php index 8d2e7c6e8..8031c43fa 100644 --- a/boot.php +++ b/boot.php @@ -1,4 +1,5 @@ '; return $o; -}} +} // return a select using 'field_select_raw' template, with timezones // groupped (primarily) by continent // arguments follow convetion as other field_* template array: // 'name', 'label', $value, 'help' -if (!function_exists('field_timezone')){ + function field_timezone($name='timezone', $label='', $current = 'America/Los_Angeles', $help){ $options = select_timezone($current); $options = str_replace('"; return $o; -}} +} + -if(! function_exists('timesel')) { function timesel($pre,$h,$m) { $o = ''; @@ -250,7 +250,7 @@ function timesel($pre,$h,$m) { $o .= ""; return $o; -}} +} @@ -264,7 +264,7 @@ function timesel($pre,$h,$m) { // Results relative to current timezone // Limited to range of timestamps -if(! function_exists('relative_date')) { + function relative_date($posted_date,$format = null) { $localtime = datetime_convert('UTC',date_default_timezone_get(),$posted_date); @@ -300,7 +300,7 @@ function relative_date($posted_date,$format = null) { return sprintf( $format,$r, (($r == 1) ? $str[0] : $str[1])); } } -}} +} @@ -341,7 +341,7 @@ function age($dob,$owner_tz = '',$viewer_tz = '') { // $month[1] = 'January'; // to match human usage. -if(! function_exists('get_dim')) { + function get_dim($y,$m) { $dim = array( 0, @@ -353,7 +353,7 @@ function get_dim($y,$m) { if(((($y % 4) == 0) && (($y % 100) != 0)) || (($y % 400) == 0)) return 29; return $dim[2]; -}} +} // Returns the first day in month for a given month, year @@ -361,11 +361,11 @@ function get_dim($y,$m) { // returns 0 = Sunday through 6 = Saturday // Months start at 1. -if(! function_exists('get_first_dim')) { + function get_first_dim($y,$m) { $d = sprintf('%04d-%02d-01 00:00', intval($y), intval($m)); return datetime_convert('UTC','UTC',$d,'w'); -}} +} // output a calendar for the given month, year. // if $links are provided (array), e.g. $links[12] => 'http://mylink' , @@ -376,8 +376,6 @@ function get_first_dim($y,$m) { // TODO: provide (prev,next) links, define class variations for different size calendars - -if(! function_exists('cal')) { function cal($y = 0,$m = 0, $links = false, $class='') { @@ -442,6 +440,6 @@ function cal($y = 0,$m = 0, $links = false, $class='') { $o .= ''."\r\n"; return $o; -}} +} diff --git a/include/dba.php b/include/dba.php index d1502af12..3117744aa 100644 --- a/include/dba.php +++ b/include/dba.php @@ -1,4 +1,4 @@ - diff --git a/include/oembed.php b/include/oembed.php index 6fc4c5371..7ef6d561f 100755 --- a/include/oembed.php +++ b/include/oembed.php @@ -1,4 +1,4 @@ -