common_checkbox('emailnotifymsg',
_('Send me email when someone sends me a private message.'),
$user->emailnotifymsg);
+ common_checkbox('emailnotifynudge',
+ _('Send me an email when someone nudges me.'),
+ $user->emailnotifnudge);
common_checkbox('emailpost',
_('I want to post notices by email.'),
$user->emailpost);
$emailnotifysub = $this->boolean('emailnotifysub');
$emailnotifyfav = $this->boolean('emailnotifyfav');
$emailnotifymsg = $this->boolean('emailnotifymsg');
+ $emailnotifynudge = $this->boolean('emailnotifynudge');
$emailmicroid = $this->boolean('emailmicroid');
$emailpost = $this->boolean('emailpost');
$user->emailnotifysub = $emailnotifysub;
$user->emailnotifyfav = $emailnotifyfav;
$user->emailnotifymsg = $emailnotifymsg;
+ $user->emailnotifynudge = $emailnotifynudge;
$user->emailmicroid = $emailmicroid;
$user->emailpost = $emailpost;
}
function show_top($user) {
-
$cur = common_current_user();
if ($cur && $cur->id == $user->id) {
'width' => AVATAR_PROFILE_SIZE,
'height' => AVATAR_PROFILE_SIZE,
'alt' => $profile->nickname));
+
+ common_element_start('ul', array('id' => 'profile_actions'));
+
+ common_element_start('li', array('id' => 'profile_subscribe'));
$cur = common_current_user();
if ($cur) {
if ($cur->id != $profile->id) {
} else {
$this->show_remote_subscribe_link($profile);
}
+ common_element_end('li');
$user = User::staticGet('id', $profile->id);
if ($cur && $cur->id != $user->id && $cur->mutuallySubscribed($user)) {
+ common_element_start('li', array('id' => 'profile_send_a_new_message'));
common_element('a', array('href' => common_local_url('newmessage', array('to' => $user->id))),
_('Send a message'));
+ common_element_end('li');
+ common_element_start('li', array('id' => 'profile_nudge'));
+ common_nudge_form($user);
+ common_element_end('li');
}
+ common_element_end('ul');
common_element_end('div');
common_raw('×');
common_element_end('a');
}
+
common_element_end('p');
common_element_end('li');
}
-}
\ No newline at end of file
+}
incomingemail varchar(255) unique key comment 'email address for post-by-email',
emailnotifysub tinyint default 1 comment 'Notify by email of subscriptions',
emailnotifyfav tinyint default 1 comment 'Notify by email of favorites',
+ emailnotifynudge tinyint default 1 comment 'Notify by email of nudges',
emailnotifymsg tinyint default 1 comment 'Notify by email of direct messages',
emailmicroid tinyint default 1 comment 'whether to publish email microid',
language varchar(50) comment 'preferred language',
email varchar(255) unique /* comment 'email address for password recovery etc.' */,\r
incomingemail varchar(255) unique /* comment 'email address for post-by-email' */,\r
emailnotifysub integer default 1 /* comment 'Notify by email of subscriptions' */,\r
+ emailnotifyfav integer default 1 /* comment 'Notify by email of favorites' */,\r
+ emailnotifynudge integer default 1 /* comment 'Notify by email of nudges' */,\r
emailmicroid integer default 1 /* comment 'whether to publish email microid' */,\r
language varchar(50) /* comment 'preferred language' */,\r
timezone varchar(50) /* comment 'timezone' */,\r
$("form.disfavor").ajaxForm(disoptions);
$("form.favor").each(addAjaxHidden);
$("form.disfavor").each(addAjaxHidden);
+
+ $("#nudge").ajaxForm ({ dataType: 'xml',
+ success: function(xml) { $("#nudge").replaceWith(document._importNode($("#nudge_response", xml).get(0),true)); }
+ });
+ $("#nudge .submit").bind('click', function(e) { $(this).addClass("processing"); });
});
function doreply(nick,id) {
mail_send($recipients, $headers, $body);
}
+
+function mail_notify_nudge($from, $to) {
+
+ $subject = sprintf(_('You\'ve been nudged by %s'), $from->nickname);
+
+ $from_profile = $from->getProfile();
+
+ $body = sprintf(_("%1\$s (%2\$s) is wondering what you are up to these days and is inviting you to post some news.\n\n".
+ "You can reply to their message here:\n\n".
+ "%3\$s\n\n".
+ "Don't reply to this email; it won't get to them.\n\n".
+ "With kind regards,\n".
+ "%4\$s\n"),
+ $from_profile->getBestName(),
+ $from->nickname,
+ common_local_url('newmessage', array('to' => $from->id)),
+ common_config('site', 'name'));
+
+ return mail_to_user($to, $subject, $body);
+}
+
+
+
function mail_notify_message($message, $from=NULL, $to=NULL) {
if (is_null($from)) {
} else {
return common_path('main/remote');
}
+ case 'nudge':
+ return common_path($args['nickname'].'/nudge');
case 'openidlogin':
return common_path('main/openid');
case 'profilesettings':
common_element_end('form');
}
+function common_nudge_form($profile) {
+ common_element_start('form', array('id' => 'nudge', 'method' => 'post',
+ 'action' => common_local_url('nudge', array('nickname' => $profile->nickname))));
+ common_hidden('token', common_session_token()); //Is this necessary?
+// common_element('input', array('id' => 'nudge_nickname',
+// 'name' => 'nudge_nickname',
+// 'type' => 'hidden',
+// 'value' => $profile->nickname));
+ common_element('input', array('type' => 'submit',
+ 'class' => 'submit',
+ 'value' => _('Send a nudge')));
+ common_element_end('form');
+}
+
+function common_nudge_response() {
+ common_element('p', array('id' => 'nudge_response'), _('Nudge sent!'));
+}
+
+
function common_cache_key($extra) {
return 'laconica:' . common_keyize(common_config('site', 'name')) . ':' . $extra;
}
}
+/*profile_actions*/
+#profile_actions {
+padding-left:0;
+list-style-type:none;
+margin:0;
+}
+#profile_actions li {
+margin-bottom:0.5em;
+clear:both;
+}
+
+#profile_actions #profile_nudge input.submit {
+margin:0;
+padding:0;
+padding-left:17px;
+background:transparent url(icon_emote-wink.png) 0 1px no-repeat;
+color:#C15D42;
+font-family:Georgia,"Times New Roman",Times,serif;
+font-weight:normal;
+font-size:14px;
+text-align:left;
+float:left;
+line-height:18px;
+}
+#profile_actions #profile_nudge input.submit:hover {
+background-color:transparent;
+color:#C15D42;
+}
+
+#wrap #content input.processing {
+padding-left:17px;
+background:transparent url(icon_process-working.gif) 0 1px no-repeat;
+line-height:18px;
+}
+
+#wrap p#nudge_response {
+padding-left:20px;
+background:transparent url(icon_checkmark.png) 0 1px no-repeat;
+line-height:18px;
+font-size:14px;
+}
+
/* ----- Nav Footer ----- */
#nav_sub {
@charset "UTF-8";
/* CSS Document */
-
-
input.disfavor,
input.favor {
text-indent:0;
padding-left:25px;
}
+#profile_actions li {
+float:left;
+clear:both;
+}
+#profile_actions #profile_nudge input.submit {
+margin-left:0;
+width:100px;
+}
+
#statistics dd {
clear: both;
}
-
#subscriptions_avatars li {
float: left;
}