]> git.mxchange.org Git - friendica.git/blob - mod/localtime.php
added spaces + some curly braces + some usage of dbm::is_result()
[friendica.git] / mod / localtime.php
1 <?php
2
3 require_once('include/datetime.php');
4
5
6 function localtime_post(App $a) {
7
8         $t = $_REQUEST['time'];
9         if (! $t) {
10                 $t = 'now';
11         }
12
13         $bd_format = t('l F d, Y \@ g:i A') ; // Friday January 18, 2011 @ 8 AM
14
15         if ($_POST['timezone']) {
16                 $a->data['mod-localtime'] = datetime_convert('UTC',$_POST['timezone'],$t,$bd_format);
17         }
18
19 }
20
21 function localtime_content(App $a) {
22         $t = $_REQUEST['time'];
23         if (! $t) {
24                 $t = 'now';
25         }
26
27         $o .= '<h3>' . t('Time Conversion') . '</h3>';
28
29         $o .= '<p>' . t('Friendica provides this service for sharing events with other networks and friends in unknown timezones.') . '</p>';
30
31
32
33         $o .= '<p>' . sprintf( t('UTC time: %s'), $t) . '</p>';
34
35         if ($_REQUEST['timezone']) {
36                 $o .= '<p>' . sprintf( t('Current timezone: %s'), $_REQUEST['timezone']) . '</p>';
37         }
38
39         if (x($a->data,'mod-localtime')) {
40                 $o .= '<p>' . sprintf( t('Converted localtime: %s'),$a->data['mod-localtime']) . '</p>';
41         }
42
43
44         $o .= '<form action ="' . App::get_baseurl() . '/localtime?f=&time=' . $t . '" method="post" >';
45
46         $o .= '<p>' . t('Please select your timezone:') . '</p>';
47
48         $o .= select_timezone(($_REQUEST['timezone']) ? $_REQUEST['timezone'] : 'America/Los_Angeles');
49
50         $o .= '<input type="submit" name="submit" value="' . t('Submit') . '" /></form>';
51
52         return $o;
53
54 }