From 9ff1a3444e9029c94541a7c84f0ed5ba764adef3 Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 4 Sep 2011 00:48:45 -0700 Subject: add timezone convert module, several other minor or in progress fixes --- mod/localtime.php | 44 ++++++++++++++++++++++++++++++++++++++++++++ mod/parse_url.php | 2 ++ 2 files changed, 46 insertions(+) create mode 100644 mod/localtime.php (limited to 'mod') diff --git a/mod/localtime.php b/mod/localtime.php new file mode 100644 index 000000000..f5ecf3a96 --- /dev/null +++ b/mod/localtime.php @@ -0,0 +1,44 @@ +data['mod-localtime'] = datetime_convert('UTC',$_POST['timezone'],$t,$bd_format); + +} + +function localtime_content(&$a) { + $t = $_REQUEST['time']; + if(! $t) + $t = 'now'; + + $o .= '

' . t('Time Conversion') . '

'; + + $o .= '

' . t('Friendika provides this service for sharing events with other networks and friends in unknown timezones.') . '

'; + + + if(x($a->data,'mod-localtime')) + $o .= '

' . sprintf( t('Converted localtime: %s'),$a->data['mod-localtime']) . '

'; + + $o .= '

' . sprintf( t('UTC time: %s'), $t) . '

'; + + $o .= '
'; + + $o .= '

' . t('Please select your timezone:') . '

'; + + $o .= select_timezone(); + + $o .= '
'; + + return $o; + +} \ No newline at end of file diff --git a/mod/parse_url.php b/mod/parse_url.php index 9bb0bc464..b10d11c4b 100644 --- a/mod/parse_url.php +++ b/mod/parse_url.php @@ -119,6 +119,8 @@ function parse_url_content(&$a) { $text = '

' . $text . '

'; } + $title = str_replace("\n",'',$title); + echo sprintf($template,$url,($title) ? $title : $url,$text); killme(); } -- cgit v1.2.3