diff options
-rw-r--r-- | include/socgraph.php | 30 | ||||
-rw-r--r-- | mod/contacts.php | 59 | ||||
-rw-r--r-- | view/contact_edit.tpl | 92 | ||||
-rw-r--r-- | view/theme/duepuntozero/style.css | 93 | ||||
-rw-r--r-- | view/theme/testbubble/contact_edit.tpl | 67 | ||||
-rw-r--r-- | view/theme/testbubble/style.css | 65 |
6 files changed, 151 insertions, 255 deletions
diff --git a/include/socgraph.php b/include/socgraph.php index 84cfe4468..7f3ad7322 100644 --- a/include/socgraph.php +++ b/include/socgraph.php @@ -161,6 +161,36 @@ function common_friends($uid,$cid) { } +function count_all_friends($uid,$cid) { + + $r = q("SELECT count(*) as `total` + FROM `glink` left join `gcontact` on `glink`.`gcid` = `gcontact`.`id` + where `glink`.`cid` = %d and `glink`.`uid` = %d ", + intval($cid), + intval($uid) + ); + + if(count($r)) + return $r[0]['total']; + return 0; + +} + + +function all_friends($uid,$cid,$start = 0, $limit = 80) { + + $r = q("SELECT `gcontact`.* + FROM `glink` left join `gcontact` on `glink`.`gcid` = `gcontact`.`id` + where `glink`.`cid` = %d and `glink`.`uid` = %d LIMIT %d, %d ", + intval($cid), + intval($uid), + intval($start), + intval($limit) + ); + + return $r; +} + function suggestion_query($uid, $start = 0, $limit = 40) { 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') . '" /> ' - . 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, diff --git a/view/contact_edit.tpl b/view/contact_edit.tpl index c2e3e36fb..44eb850ac 100644 --- a/view/contact_edit.tpl +++ b/view/contact_edit.tpl @@ -1,74 +1,74 @@ <h2>$header</h2> -<div id="contact-edit-banner-name">$name</div> - -$nettype +<div id="contact-edit-wrapper" > -<form action="contacts/$contact_id" method="post" > -<input type="hidden" name="contact_id" value="$contact_id"> + <div id="contact-edit-drop-link" > + <a href="contacts/$contact_id/drop" class="icon drophide" id="contact-edit-drop-link" onclick="return confirmDelete();" title="$delete" onmouseover="imgbright(this);" onmouseout="imgdull(this);"></a> + </div> -<div id="contact-edit-wrapper" > + <div id="contact-edit-drop-link-end"></div> - <div id="contact-edit-photo-wrapper" > - <img id="contact-edit-direction-icon" src="$dir_icon" alt="$alt_text" title="$alt_text" /> - <div id="contact-edit-photo" > - <a href="$url" title="$visit" /><img src="$photo" $sparkle alt="$name" /></a> + <div id="contact-edit-nav-wrapper" > + <div id="contact-edit-links"> + <ul> + <li><div id="contact-edit-rel">$relation_text</div></li> + <li><div id="contact-edit-nettype">$nettype</div></li> + {{ if $insecure }} + <li><div id="insecure-message">$insecure</div></li> + {{ endif }} + {{ if $blocked }} + <li><div id="block-message">$blocked</div></li> + {{ endif }} + {{ if $ignored }} + <li><div id="ignore-message">$ignored</div></li> + {{ endif }} + {{ if $common_text }} + <li><div id="contact-edit-common"><a href="common/$contact_id">$common_text</a></div></li> + {{ endif }} + {{ if $all_friends }} + <li><div id="contact-edit-allfriends"><a href="allfriends/$contact_id">$all_friends</a></div></li> + {{ endif }} + + <li> </li> + + <li><a href="network/?cid=$contact_id" id="contact-edit-view-recent">$lblrecent</a></li> + {{ if $lblsuggest }} + <li><a href="fsuggest/$contact_id" id="contact-edit-suggest">$lblsuggest</a></li> + {{ endif }} + <li><a href="contacts/$contact_id/block" id="contact-edit-block-link" title="$block_text">$block_text</a></li> + <li><a href="contacts/$contact_id/ignore" id="contact-edit-ignore-link" title="$ignore_text">$ignore_text</a></li> + <li><a href="crepair/$contact_id" id="contact-edit-repair" title="$lblcrepair">$lblcrepair</a></li> + </ul> </div> - <div id="contact-edit-photo-end" ></div> </div> - <div id="contact-edit-nav-wrapper" > + <div id="contact-edit-nav-end"></div> - <div id="contact-edit-links" > - <a href="contacts/$contact_id/block" class="icon block" id="contact-edit-block-link" title="$block_text"></a> - <a href="contacts/$contact_id/ignore" class="icon no" id="contact-edit-ignore-link" title="$ignore_text"></a> - <a href="crepair/$contact_id" class="icon tools" id="contact-edit-repair" title="$lblcrepair"></a> - - </div> - <div id="contact-drop-links" > - <a href="contacts/$contact_id/drop" class="icon drophide" id="contact-edit-drop-link" onclick="return confirmDelete();" title="$delete" onmouseover="imgbright(this);" onmouseout="imgdull(this);"></a> - </div> - <div id="contact-edit-nav-end"></div> +<form action="contacts/$contact_id" method="post" > +<input type="hidden" name="contact_id" value="$contact_id"> - {{ if $poll_enabled }} + {{ if $poll_enabled }} <div id="contact-edit-poll-wrapper"> - <div id="contact-edit-last-update-text">$lastupdtext<span id="contact-edit-last-updated">$last_update</span></div> - <div id="contact-edit-poll-text">$updpub</div> - $poll_interval - <div id="contact-edit-update-now" class="button"><a href="contacts/$contact_id/update" >$udnow</a></div> + <div id="contact-edit-last-update-text">$lastupdtext <span id="contact-edit-last-updated">$last_update</span></div> + <span id="contact-edit-poll-text">$updpub</span> $poll_interval <span id="contact-edit-update-now" class="button"><a href="contacts/$contact_id/update" >$udnow</a></span> </div> - {{ endif }} - </div> - <div id="contact-edit-end" ></div> - - - {{ if $common_text }} - <div id="contact-edit-common"> - <a href="$common_link">$common_text</a> - </a> {{ endif }} + <div id="contact-edit-end" ></div> -$insecure -$blocked -$ignored - -<div id="view-recent-wrapper"><a href="network/?cid=$contact_id" id="contact-view-recent">$lblrecent</a></div> -$lblsuggest <div id="contact-edit-info-wrapper"> <h4>$lbl_info1</h4> -<textarea id="contact-edit-info" rows="10" cols="72" name="info" >$info</textarea> + <textarea id="contact-edit-info" rows=8 cols=72 name="info" >$info</textarea> + <input class="contact-edit-submit" type="submit" name="submit" value="$submit" /> </div> <div id="contact-edit-info-end"></div> -<input class="contact-edit-submit" type="submit" name="submit" value="$submit" /> <div id="contact-edit-profile-select-text"> <h4>$lbl_vis1</h4> -<p>$lbl_vis2 -</p> +<p>$lbl_vis2</p> </div> $profile_select <div id="contact-edit-profile-select-end"></div> diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index e9c0817f4..088cb7c18 100644 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -583,6 +583,7 @@ input#dfrn-url { #profile-photo-wrapper img { width:175px; height:175px; + padding: 12px; } #profile-edit-profile-name-label, @@ -804,11 +805,6 @@ input#dfrn-url { clear: both; } -#contact-edit-end { - clear: both; - margin-bottom: 65px; -} - #fsuggest-desc, #fsuggest-submit-wrapper { margin-top: 15px; margin-bottom: 15px; @@ -1396,25 +1392,18 @@ input#dfrn-url { } #contact-edit-wrapper { - margin-top: 50px; + margin-top: 10px; } #contact-edit-banner-name { font-size: 1.4em; font-weight: bold; - margin-left: 30px; } -#contact-edit-nettype { - margin-top: 5px; - margin-left: 30px; -} - - #contact-edit-poll-wrapper { - margin-left: 50px; - margin-top: 30px; + margin-top: 15px; } + #contact-edit-poll-text { margin-top: 15px; margin-bottom: 5px; @@ -1424,53 +1413,28 @@ input#dfrn-url { margin-top: 15px; } -#contact-edit-photo-wrapper { - margin-bottom: 20px; -} -#contact-edit-links { - float: left; -} -#contact-edit-links a { - float: left; -} -#contact-edit-links img { - margin-left: 20px; - border: none; -} - -#contact-drop-links { - float: left; -} - -#contact-drop-links img { - margin-left: 20px; - border: none; -} - -#contact-edit-nav-end { +#contact-edit-links{ clear: both; } -#contact-edit-direction-icon { - float: left; - margin-top: 70px; - margin-right: 2px; +#contact-edit-links ul { + list-style: none; } - -#contact-edit-photo { - float: left; +#contact-edit-links li { + margin-top: 5px; } -#contact-edit-photo-end { - clear: both; +#contact-edit-drop-link { + float: right; + margin-right: 20px; } -#contact-edit-photo-wrapper { - float: left; +#contact-edit-nav-end { + clear: both; } -#contact-edit-nav-wrapper { - float: left; +#contact-edit-wrapper { + width: 100%; } #contact-edit-end { @@ -1482,17 +1446,8 @@ input#dfrn-url { margin-left: 175px; } -#contact-reputation-selector { - margin-left: 175px; -} - -#contact-edit-rating-text { - margin-left: 175px; -} - .contact-edit-submit { margin-top: 20px; - /*margin-left: 50px;*/ } @@ -1525,12 +1480,7 @@ input#dfrn-url { #block-message, #ignore-message { - margin-top: 20px; color: #FF0000; - font-size: 1.1em; - border: 1px solid #FF8888; - background-color: #FFEEEE; - padding: 10px; } #profile-edit-insecure { @@ -1544,10 +1494,6 @@ input#dfrn-url { width: 587px; } -#block-message, #ignore-message { - width: 180px; -} - #profile-jot-text { height: 20px; color:#cccccc; @@ -2229,13 +2175,14 @@ a.mail-list-link { .fn { - padding: 0px 0px 5px 0px; + padding: 0px 0px 5px 12px; font-size: 120%; font-weight: bold; } .vcard .title { margin-bottom: 5px; + margin-left: 12px; } .vcard dl { @@ -2512,10 +2459,6 @@ a.mail-list-link { width: 300px; } -#contact-edit-links .icon, #contact-drop-links .icon { - margin: 0px 3px 0px 3px; -} - #netsearch-box { margin-top: 20px; diff --git a/view/theme/testbubble/contact_edit.tpl b/view/theme/testbubble/contact_edit.tpl deleted file mode 100644 index 9191a36b0..000000000 --- a/view/theme/testbubble/contact_edit.tpl +++ /dev/null @@ -1,67 +0,0 @@ - -<h2>$header</h2> - -<div id="contact-edit-banner-name">$name</div> - -$nettype - -<form action="contacts/$contact_id" method="post" > -<input type="hidden" name="contact_id" value="$contact_id"> - -<div id="contact-edit-wrapper" > - - <div id="contact-edit-photo-wrapper" > - <img id="contact-edit-direction-icon" src="$dir_icon" alt="$alt_text" title="$alt_text" /> - <div id="contact-edit-photo" class="lframe"> - <a href="$url" title="$visit" /><img src="$photo" $sparkle alt="$name" /></a> - </div> - <div id="contact-edit-photo-end" ></div> - </div> - <div id="contact-edit-nav-wrapper" > - - <div id="contact-edit-links" > - <a href="contacts/$contact_id/block" class="icon block" id="contact-edit-block-link" title="$block_text"></a> - <a href="contacts/$contact_id/ignore" class="icon no" id="contact-edit-ignore-link" title="$ignore_text"></a> - <a href="crepair/$contact_id" class="icon tools" id="contact-edit-repair" title="$lblcrepair"></a> - <a href="contacts/$contact_id/drop" class="icon drophide" id="contact-edit-drop-link" onclick="return confirmDelete();" title="$delete" onmouseover="imgbright(this);" onmouseout="imgdull(this);"></a> - </div> - <div id="contact-edit-nav-end"></div> - - {{ if $poll_enabled }} - <div id="contact-edit-poll-wrapper"> - <div id="contact-edit-last-update-text">$lastupdtext<span id="contact-edit-last-updated">$last_update</span></div> - <div id="contact-edit-poll-text">$updpub</div> - $poll_interval - <div id="contact-edit-update-now" class="button"><a href="contacts/$contact_id/update" >$udnow</a></div> - </div> - {{ endif }} - </div> - <div id="contact-edit-end" ></div> - -$insecure -$blocked -$ignored - -<div id="view-recent-wrapper"><a href="network/?cid=$contact_id" id="contact-view-recent" class="button">$lblrecent</a></div> -$lblsuggest - -<div id="contact-edit-info-wrapper"> -<h4>$lbl_info1</h4> -<textarea id="contact-edit-info" rows="10" cols="72" name="info" >$info</textarea> -</div> -<div id="contact-edit-info-end"></div> - -<input class="contact-edit-submit" type="submit" name="submit" value="$submit" /> - -<div id="contact-edit-profile-select-text"> -<h4>$lbl_vis1</h4> -<p>$lbl_vis2 -</p> -</div> -$profile_select -<div id="contact-edit-profile-select-end"></div> - -<input class="contact-edit-submit" type="submit" name="submit" value="$submit" /> - -</form> -</div> diff --git a/view/theme/testbubble/style.css b/view/theme/testbubble/style.css index a094d3393..695e20ffd 100644 --- a/view/theme/testbubble/style.css +++ b/view/theme/testbubble/style.css @@ -1831,41 +1831,30 @@ margin-left: 0px; } #contact-edit-banner-name { font-size: 1.5em; margin-left: 30px; font-variant: small-caps; } -#contact-edit-photo-wrapper {position: relative; float: left; padding: 20px;} -#contact-edit-direction-icon { position: absolute; top: 60px; left:0px;} -#contact-edit-nav-wrapper { margin-left: 210px; } -#contact-edit-links { float: left; margin-top: 23px; } -#contact-edit-nav-wrapper .icon { - border: 1px solid #babdb6; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; -} -#contact-edit-nettype { - font-size: 1em; - font-variant: small-caps; - margin-left: 30px; - margin-bottom: 0px; - padding-bottom: 0px; -} - -#contact-edit-poll-wrapper { margin-left: 50px; width: 300px;} -#contact-edit-last-update-text { margin-bottom: 15px; padding-top: 20px; padding-left: 10px; font-size: 0.9em; max-width: 300px; } -#contact-edit-last-updated { font-weight: bold; } -#contact-edit-poll-text { display: inline; font-size: 0.9em; padding-left: 10px; } -#contact-edit-end { clear: both; margin-bottom: 65px;} #contact-edit-update-now { - width: 80px; - padding: 5px 10px 5px 10px; - margin-left: 125px; - margin-top: 10px; - font-style: bold; + padding:7px; + width: 165px; + margin: auto; + margin-left: 40px; + -moz-box-shadow:inset 0px 1px 0px 0px #cfcfcf; + -webkit-box-shadow:inset 0px 1px 0px 0px #cfcfcf; + box-shadow:inset 0px 1px 0px 0px #cfcfcf; + background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #bdbdbd), color-stop(1, #a2a2a2) ); + background:-moz-linear-gradient( center top, #bdbdbd 5%, #a2a2a2 100% ); + filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#bdbdbd', endColorstr='#a2a2a2'); + background-color:#bdbdbd; + -moz-border-radius:5px; + -webkit-border-radius:5px; + border-radius:5px; + display:inline-block; + color:#efefef; + text-decoration:none; + text-align: center; } #contact-edit-update-now:hover { - color: #efefef; background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #b20202), color-stop(1, #d60808) ); background:-moz-linear-gradient( center top, #b20202 5%, #d60808 100% ); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#b20202', endColorstr='#d60808'); @@ -1873,20 +1862,18 @@ margin-left: 0px; } #contact-edit-update-now:active { - background-color: #b20202; position:relative; top:1px; } #contact-edit-update-now a { color: #efefef; + font-size: 14px; + text-align: center; + margin: auto; } -#contact-edit-profile-select-text > p { - font-size: 1em; -} - .contact-photo-menu-button { position: absolute; background-image: url("photo-menu.jpg"); @@ -2095,13 +2082,6 @@ margin-left: 0px; font-variant: normal; } -#contact-view-recent { - float: left; - width: 150px; - padding: 5px; - margin-bottom: 20px; -} - #contact-suggest { float: left; margin-left: 10px; @@ -2142,9 +2122,6 @@ margin-left: 0px; color: #efefef; } -#contact-edit-info-wrapper { - clear: both; -} /* ===================================== */ /* = Register, Settings, Profile Forms = */ |