aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/contacts.php59
1 files changed, 36 insertions, 23 deletions
diff --git a/mod/contacts.php b/mod/contacts.php
index ecfbe6c2c..627c99d07 100644
--- a/mod/contacts.php
+++ b/mod/contacts.php
@@ -8,6 +8,7 @@ function contacts_init(&$a) {
return;
$contact_id = 0;
+
if(($a->argc == 2) && intval($a->argv[1])) {
$contact_id = intval($a->argv[1]);
$r = q("SELECT * FROM `contact` WHERE `uid` = %d and `id` = %d LIMIT 1",
@@ -25,7 +26,15 @@ function contacts_init(&$a) {
if(! x($a->page,'aside'))
$a->page['aside'] = '';
- $a->page['aside'] .= follow_widget();
+ if($contact_id) {
+ $a->data['contact'] = $r[0];
+ $o .= '<div class="vcard">';
+ $o .= '<div class="fn">' . $a->data['contact']['name'] . '</div>';
+ $o .= '<div id="profile-photo-wrapper"><img class="photo" style="width: 175px; height: 175px;" src="' . $a->data['contact']['photo'] . '" alt="' . $a->data['contact']['name'] . '" /></div>';
+ $o .= '</div>';
+ $a->page['aside'] .= $o;
+
+ }
$a->page['aside'] .= group_side('contacts','group',false,0,$contact_id);
@@ -225,21 +234,23 @@ function contacts_content(&$a) {
switch($r[0]['rel']) {
case CONTACT_IS_FRIEND:
$dir_icon = 'images/lrarrow.gif';
- $alt_text = t('Mutual Friendship');
+ $relation_text = t('You are mutual friends with %s');
break;
case CONTACT_IS_FOLLOWER;
$dir_icon = 'images/larrow.gif';
- $alt_text = t('is a fan of yours');
+ $relation_text = t('You are sharing with %s');
break;
case CONTACT_IS_SHARING;
$dir_icon = 'images/rarrow.gif';
- $alt_text = t('you are a fan of');
+ $relation_text = t('%s is sharing with you');
break;
default:
break;
}
+ $relation_text = sprintf($relation_text,$r[0]['name']);
+
if(($r[0]['network'] === 'dfrn') && ($r[0]['rel'])) {
$url = "redir/{$r[0]['id']}";
$sparkle = ' class="sparkle" ';
@@ -249,8 +260,7 @@ function contacts_content(&$a) {
$sparkle = '';
}
- $insecure = '<div id="profile-edit-insecure"><p><img src="images/unlock_icon.gif" alt="' . t('Privacy Unavailable') . '" />&nbsp;'
- . t('Private communications are not available for this contact.') . '</p></div>';
+ $insecure = t('Private communications are not available for this contact.');
$last_update = (($r[0]['last-update'] == '0000-00-00 00:00:00')
? t('Never')
@@ -259,50 +269,53 @@ function contacts_content(&$a) {
if($r[0]['last-update'] !== '0000-00-00 00:00:00')
$last_update .= ' ' . (($r[0]['last-update'] == $r[0]['success_update']) ? t("\x28Update was successful\x29") : t("\x28Update was not successful\x29"));
- $lblsuggest = (($r[0]['network'] === NETWORK_DFRN)
- ? '<div id="contact-suggest-wrapper"><a href="fsuggest/' . $r[0]['id'] . '" id="contact-suggest">' . t('Suggest friends') . '</a></div>' : '');
+ $lblsuggest = (($r[0]['network'] === NETWORK_DFRN) ? t('Suggest friends') : '');
$poll_enabled = (($r[0]['network'] !== NETWORK_DIASPORA) ? true : false);
- $nettype = '<div id="contact-edit-nettype">' . sprintf( t('Network type: %s'),network_to_name($r[0]['network'])) . '</div>';
+ $nettype = sprintf( t('Network type: %s'),network_to_name($r[0]['network']));
$common = count_common_friends(local_user(),$r[0]['id']);
- $common_text = (($common) ? sprintf( tt('%d friends in common','%d friends in common', $common),$common) : '');
+ $common_text = (($common) ? sprintf( tt('%d contact in common','%d contacts in common', $common),$common) : '');
+
+ $polling = (($r[0]['network'] === NETWORK_MAIL | $r[0]['network'] === NETWORK_FEED) ? 'polling' : '');
+
+ $x = count_all_friends(local_user(), $r[0]['id']);
+ $all_friends = (($x) ? t('View all contacts') : '');
+
$o .= replace_macros($tpl,array(
'$header' => t('Contact Editor'),
'$submit' => t('Submit'),
'$lbl_vis1' => t('Profile Visibility'),
'$lbl_vis2' => sprintf( t('Please choose the profile you would like to display to %s when viewing your profile securely.'), $r[0]['name']),
'$lbl_info1' => t('Contact Information / Notes'),
- '$lbl_rep1' => t('Online Reputation'),
- '$lbl_rep2' => t('Occasionally your friends may wish to inquire about this person\'s online legitimacy.'),
- '$lbl_rep3' => t('You may help them choose whether or not to interact with this person by providing a <em>reputation</em> to guide them.'),
- '$lbl_rep4' => t('Please take a moment to elaborate on this selection if you feel it could be helpful to others.'),
+ '$infedit' => t('Edit contact notes'),
'$common_text' => $common_text,
'$common_link' => $a->get_baseurl() . '/common/' . $r[0]['id'],
+ '$all_friends' => $all_friends,
+ '$relation_text' => $relation_text,
'$visit' => sprintf( t('Visit %s\'s profile [%s]'),$r[0]['name'],$r[0]['url']),
'$blockunblock' => t('Block/Unblock contact'),
'$ignorecont' => t('Ignore contact'),
- '$altcrepair' => t('Repair contact URL settings'),
- '$lblcrepair' => t("Repair contact URL settings \x28WARNING: Advanced\x29"),
+ '$lblcrepair' => t("Repair URL settings"),
'$lblrecent' => t('View conversations'),
'$lblsuggest' => $lblsuggest,
'$delete' => t('Delete contact'),
'$nettype' => $nettype,
'$poll_interval' => contact_poll_interval($r[0]['priority'],(! $poll_enabled)),
'$poll_enabled' => $poll_enabled,
- '$lastupdtext' => t('Last updated: '),
- '$updpub' => t('Update public posts: '),
+ '$lastupdtext' => t('Last update:'),
+ '$updpub' => t('Update public posts'),
'$last_update' => $last_update,
'$udnow' => t('Update now'),
- '$profile_select' => contact_profile_assign($r[0]['profile-id'],(($r[0]['network'] !== 'dfrn') ? true : false)),
+ '$profile_select' => contact_profile_assign($r[0]['profile-id'],(($r[0]['network'] !== NETWORK_DFRN) ? true : false)),
'$contact_id' => $r[0]['id'],
- '$block_text' => (($r[0]['blocked']) ? t('Unblock this contact') : t('Block this contact') ),
- '$ignore_text' => (($r[0]['readonly']) ? t('Unignore this contact') : t('Ignore this contact') ),
+ '$block_text' => (($r[0]['blocked']) ? t('Unblock') : t('Block') ),
+ '$ignore_text' => (($r[0]['readonly']) ? t('Unignore') : t('Ignore') ),
'$insecure' => (($r[0]['network'] !== NETWORK_DFRN && $r[0]['network'] !== NETWORK_MAIL && $r[0]['network'] !== NETWORK_FACEBOOK && $r[0]['network'] !== NETWORK_DIASPORA) ? $insecure : ''),
'$info' => $r[0]['info'],
- '$blocked' => (($r[0]['blocked']) ? '<div id="block-message">' . t('Currently blocked') . '</div>' : ''),
- '$ignored' => (($r[0]['readonly']) ? '<div id="ignore-message">' . t('Currently ignored') . '</div>' : ''),
+ '$blocked' => (($r[0]['blocked']) ? t('Currently blocked') : ''),
+ '$ignored' => (($r[0]['readonly']) ? t('Currently ignored') : ''),
'$photo' => $r[0]['photo'],
'$name' => $r[0]['name'],
'$dir_icon' => $dir_icon,