$avatar->filename = $filename;
$avatar->original = true;
$avatar->url = common_avatar_url($filename);
-
+ $avatar->created = date(DATE_RFC822); # current time
foreach (array(AVATAR_PROFILE_SIZE, AVATAR_STREAM_SIZE, AVATAR_MINI_SIZE) as $size) {
$scaled[] = $this->scale_avatar($user, $avatar, $size);
}
$scaled->mediatype = ($avatar->mediattype == 'image/jpeg') ? 'image/jpeg' : 'image/png';
$scaled->filename = $filename;
$scaled->url = common_avatar_url($filename);
+ $scaled->created = date(DATE_RFC822); # current time
return $scaled;
}
common_user_error(_t('Not logged in.'));
} else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$id = $this->save_new_notice();
-
- if ($id) {
+# if ($id) {
common_broadcast_notices($id);
common_redirect(common_local_url('shownotice',
array('notice' => $id)), 303);
assert($notice);
$notice->profile_id = $user->id; # user id *is* profile id
$notice->content = $this->arg('content');
- $notice->created = time();
+ $notice->created = date(DATE_RFC822); # current time
return $notice->insert();
}
common_element_start('form', array('id' => 'newnotice', 'method' => 'POST',
'action' => common_local_url('newnotice')));
common_element('span', 'nickname', $profile->nickname);
- common_element('textarea', array('rows' => 4, 'cols' => 80, 'id' => 'content'));
+ common_element('textarea', array('rows' => 4, 'cols' => 80,
+ 'name' => 'content',
+ 'id' => 'content'));
common_element('input', array('type' => 'submit', 'value' => 'Send'));
common_element_end('form');
}
# TODO: wrap this in a transaction!
$profile = new Profile();
$profile->nickname = $nickname;
- $profile->created = time();
+ $profile->created = date(DATE_RFC822); # current time
$id = $profile->insert();
if (!$id) {
return FALSE;
$user->nickname = $nickname;
$user->password = common_munge_password($password, $id);
$user->email = $email;
- $user->created = time();
+ $user->created = date(DATE_RFC822); # current time
$result = $user->insert();
if (!$result) {
# Try to clean up...
'id' => 'cancel',
'value' => _t('Cancel')));
common_element_end('form');
+ common_show_footer();
}
}
function notice_form() {
common_element_start('form', array('id' => 'newnotice', 'method' => 'POST',
'action' => common_local_url('newnotice')));
- common_element('textarea', array('rows' => 4, 'cols' => 80, 'id' => 'content'));
+ common_element('textarea', array('rows' => 4, 'cols' => 80,
+ 'name' => 'content',
+ 'id' => 'content'));
common_element('input', array('type' => 'submit', 'value' => 'Send'));
common_element_end('form');
}
function common_date_string($dt) {
// XXX: do some sexy date formatting
- return date(DATE_RFC822);
+ return date(DATE_RFC822, $dt);
}
function common_redirect($url, $code=307) {
return false;
}
- function show_message($msg, $success) {
+ function message($msg, $success) {
if ($msg) {
common_element('div', ($success) ? 'success' : 'error',
$msg);