diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/events.php | 9 | ||||
-rw-r--r-- | mod/localtime.php | 9 | ||||
-rw-r--r-- | mod/profile_photo.php | 8 |
3 files changed, 22 insertions, 4 deletions
diff --git a/mod/events.php b/mod/events.php index 27ca69830..5bc9807ed 100644 --- a/mod/events.php +++ b/mod/events.php @@ -45,13 +45,20 @@ function events_post(&$a) { $finish = datetime_convert('UTC','UTC',$finish); } + // Don't allow the event to finish before it begins. + // It won't hurt anything, but somebody will file a bug report + // and we'll waste a bunch of time responding to it. Time that + // could've been spent doing something else. + + if(strcmp($finish,$start) < 0) + $finish = $start; $desc = escape_tags(trim($_POST['desc'])); $location = escape_tags(trim($_POST['location'])); $type = 'event'; if((! $desc) || (! $start)) { - notice('Event description and start time are required.'); + notice( t('Event description and start time are required.') . EOL); goaway($a->get_baseurl() . '/events/new'); } diff --git a/mod/localtime.php b/mod/localtime.php index f5ecf3a96..c03eae1b0 100644 --- a/mod/localtime.php +++ b/mod/localtime.php @@ -26,16 +26,21 @@ function localtime_content(&$a) { $o .= '<p>' . t('Friendika provides this service for sharing events with other networks and friends in unknown timezones.') . '</p>'; + + $o .= '<p>' . sprintf( t('UTC time: %s'), $t) . '</p>'; + + if($_REQUEST['timezone']) + $o .= '<p>' . sprintf( t('Current timezone: %s'), $_REQUEST['timezone']) . '</p>'; + if(x($a->data,'mod-localtime')) $o .= '<p>' . sprintf( t('Converted localtime: %s'),$a->data['mod-localtime']) . '</p>'; - $o .= '<p>' . sprintf( t('UTC time: %s'), $t) . '</p>'; $o .= '<form action ="' . $a->get_baseurl() . '/localtime?f=&time=' . $t . '" method="post" >'; $o .= '<p>' . t('Please select your timezone:') . '</p>'; - $o .= select_timezone(); + $o .= select_timezone(($_REQUEST['timezone']) ? $_REQUEST['timezone'] : 'America/Los_Angeles'); $o .= '<input type="submit" name="submit" value="' . t('Submit') . '" /></form>'; diff --git a/mod/profile_photo.php b/mod/profile_photo.php index 8dc896653..4de3aaa3e 100644 --- a/mod/profile_photo.php +++ b/mod/profile_photo.php @@ -155,9 +155,15 @@ function profile_photo_content(&$a) { notice( t('Permission denied.') . EOL ); return; } + $havescale = false; + foreach($r as $rr) { + if($rr['scale'] == 5) + $havescale = true; + } + // set an already uloaded photo as profile photo // if photo is in 'Profile Photos', change it in db - if ($r[0]['album']== t('Profile Photos')){ + if (($r[0]['album']== t('Profile Photos')) && ($havescale)){ $r=q("UPDATE `photo` SET `profile`=0 WHERE `profile`=1 AND `uid`=%d", intval(local_user())); |