From 01d36785b052f722c982700bcfe29e7ea26d1321 Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Mon, 27 Sep 2010 19:48:45 -0700 Subject: fixed photo comments, msg typo, and changed cursor when hovering over "special friends" where SSO is allowed --- mod/contacts.php | 24 ++++++++++++++++++++++-- mod/display.php | 30 +++++++++++++++++++++++------- mod/message.php | 13 +++++++++++-- mod/network.php | 35 +++++++++++++++++++++++++++-------- mod/photos.php | 39 ++++++++++++++++++++++++++++++++++++--- mod/profile.php | 26 ++++++++++++++++++-------- view/contact_edit.tpl | 2 +- view/contact_template.tpl | 2 +- view/mail_conv.tpl | 2 +- view/mail_list.tpl | 2 +- view/theme/default/style.css | 4 ++++ view/wall_item.tpl | 4 ++-- view/wallwall_item.tpl | 6 +++--- 13 files changed, 150 insertions(+), 39 deletions(-) diff --git a/mod/contacts.php b/mod/contacts.php index 50cc1586a..438b37aaf 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -168,6 +168,14 @@ function contacts_content(&$a) { break; } + if($r[0]['rel'] != REL_FAN) { + $url = "redir/{$r[0]['id']}"; + $sparkle = ' class="sparkle" '; + } + else { + $url = $r[0]['url']; + $sparkle = ''; + } $o .= replace_macros($tpl,array( '$poll_interval' => contact_poll_interval($r[0]['priority']), '$last_update' => (($r[0]['last-update'] == '0000-00-00 00:00:00') @@ -186,7 +194,8 @@ function contacts_content(&$a) { '$name' => $r[0]['name'], '$dir_icon' => $dir_icon, '$alt_text' => $alt_text, - '$url' => (($r[0]['rel'] != REL_FAN) ? "redir/{$r[0]['id']}" : $r[0]['url'] ) + '$sparkle' => $sparkle, + '$url' => $url )); @@ -258,6 +267,16 @@ function contacts_content(&$a) { break; } + if($rr['rel'] != REL_FAN) { + $url = "redir/{$rr['id']}"; + $sparkle = ' class="sparkle" '; + } + else { + $url = $rr['url']; + $sparkle = ''; + } + + $o .= replace_macros($tpl, array( '$img_hover' => t('Visit ') . $rr['name'] . t('\'s profile'), '$edit_hover' => t('Edit contact'), @@ -266,7 +285,8 @@ function contacts_content(&$a) { '$dir_icon' => $dir_icon, '$thumb' => $rr['thumb'], '$name' => $rr['name'], - '$url' => (($rr['rel'] != REL_FAN) ? "redir/{$rr['id']}" : $rr['url'] ) + '$sparkle' => $sparkle, + '$url' => $url )); } $o .= '
'; diff --git a/mod/display.php b/mod/display.php index f695dc205..2bc85f190 100644 --- a/mod/display.php +++ b/mod/display.php @@ -113,24 +113,28 @@ function display_content(&$a) { if(count($r)) { foreach($r as $item) { - + $sparkle = ''; if(($item['verb'] == ACTIVITY_LIKE) && ($item['id'] != $item['parent'])) { $url = $item['url']; - if(($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'])) + if(($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'])) { $url = $a->get_baseurl() . '/redir/' . $item['contact-id']; + $sparkle = ' class="sparkle"'; + } if(! is_array($alike[$item['parent'] . '-l'])) $alike[$item['parent'] . '-l'] = array(); $alike[$item['parent']] ++; - $alike[$item['parent'] . '-l'][] = '' . $item['name'] . ''; + $alike[$item['parent'] . '-l'][] = '' . $item['name'] . ''; } if(($item['verb'] == ACTIVITY_DISLIKE) && ($item['id'] != $item['parent'])) { $url = $item['url']; - if(($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'])) + if(($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'])) { $url = $a->get_baseurl() . '/redir/' . $item['contact-id']; + $sparkle = ' class="sparkle"'; + } if(! is_array($dlike[$item['parent'] . '-l'])) $dlike[$item['parent'] . '-l'] = array(); $dlike[$item['parent']] ++; - $dlike[$item['parent'] . '-l'][] = '' . $item['name'] . ''; + $dlike[$item['parent'] . '-l'][] = '' . $item['name'] . ''; } } @@ -163,14 +167,22 @@ function display_content(&$a) { $profile_url = $item['url']; + $sparkle = ''; $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ; + if(($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'] )) { + $profile_url = $redirect_url; + $sparkle = ' sparkle'; + } + // Top-level wall post not written by the wall owner (wall-to-wall) // First figure out who owns it. + $osparkle = ''; + if(($item['parent'] == $item['item_id']) && (! $item['self'])) { if($item['type'] === 'wall') { @@ -189,9 +201,11 @@ function display_content(&$a) { $template = $wallwall; $commentww = 'ww'; // If it is our contact, use a friendly redirect link - if(($item['owner-link'] == $item['url']) && ($item['rel'] == REL_VIP || $item['rel'] == REL_BUD)) - $owner_url = $redirect_url; + if(($item['owner-link'] == $item['url']) && ($item['rel'] == REL_VIP || $item['rel'] == REL_BUD)) { $owner_url = $redirect_url; + $osparkle = ' sparkle'; + } + } } @@ -219,6 +233,8 @@ function display_content(&$a) { '$id' => $item['item_id'], '$profile_url' => $profile_link, '$name' => $profile_name, + '$sparkle' => $sparkle, + '$osparkle' => $osparkle, '$thumb' => $profile_avatar, '$title' => $item['title'], '$body' => bbcode($item['body']), diff --git a/mod/message.php b/mod/message.php index b544b552a..114f558db 100644 --- a/mod/message.php +++ b/mod/message.php @@ -211,6 +211,7 @@ function message_content(&$a) { '$id' => $rr['id'], '$from_name' =>$rr['from-name'], '$from_url' => $a->get_baseurl() . '/redir/' . $rr['contact-id'], + '$sparkle' => ' sparkle', '$from_photo' => $rr['from-photo'], '$subject' => (($rr['mailseen']) ? $rr['title'] : '' . $rr['title'] . ''), '$delete' => t('Delete conversation'), @@ -261,11 +262,19 @@ function message_content(&$a) { $tpl = load_view_file('view/mail_conv.tpl'); foreach($messages as $message) { + if($message['from-url'] == $myprofile) { + $from_url = $myprofile; + $sparkle = ''; + } + else { + $from_url = $a->get_baseurl() . '/redir/' . $message['contact-id']; + $sparkle = ' sparkle'; + } $o .= replace_macros($tpl, array( '$id' => $message['id'], '$from_name' =>$message['from-name'], - '$from_url' => (($message['from-url'] == $myprofile) - ? $myprofile : $a->get_baseurl() . '/redir/' . $message['contact-id']), + '$from_url' => $from_url, + '$sparkle' => $sparkle, '$from_photo' => $message['from-photo'], '$subject' => $message['title'], '$body' => bbcode($message['body']), diff --git a/mod/network.php b/mod/network.php index 541e10494..26e4b0524 100644 --- a/mod/network.php +++ b/mod/network.php @@ -135,23 +135,29 @@ function network_content(&$a, $update = 0) { if(count($r)) { foreach($r as $item) { + $sparkle = ''; + if(($item['verb'] == ACTIVITY_LIKE) && ($item['id'] != $item['parent'])) { $url = $item['url']; - if(($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'])) + if(($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'])) { $url = $a->get_baseurl() . '/redir/' . $item['contact-id']; + $sparkle = ' class="sparkle"'; + } if(! is_array($alike[$item['parent'] . '-l'])) $alike[$item['parent'] . '-l'] = array(); $alike[$item['parent']] ++; - $alike[$item['parent'] . '-l'][] = '' . $item['name'] . ''; + $alike[$item['parent'] . '-l'][] = '' . $item['name'] . ''; } if(($item['verb'] == ACTIVITY_DISLIKE) && ($item['id'] != $item['parent'])) { $url = $item['url']; - if(($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'])) + if(($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'])) { $url = $a->get_baseurl() . '/redir/' . $item['contact-id']; + $sparkle = ' class="sparkle"'; + } if(! is_array($dlike[$item['parent'] . '-l'])) $dlike[$item['parent'] . '-l'] = array(); $dlike[$item['parent']] ++; - $dlike[$item['parent'] . '-l'][] = '' . $item['name'] . ''; + $dlike[$item['parent'] . '-l'][] = '' . $item['name'] . ''; } } @@ -170,6 +176,8 @@ function network_content(&$a, $update = 0) { // Top-level wall post not written by the wall owner (wall-to-wall) // First figure out who owns it. + $osparkle = ''; + if(($item['parent'] == $item['item_id']) && (! $item['self'])) { if($item['type'] === 'wall') { @@ -188,8 +196,11 @@ function network_content(&$a, $update = 0) { $template = $wallwall; $commentww = 'ww'; // If it is our contact, use a friendly redirect link - if(($item['owner-link'] == $item['url']) && ($item['rel'] == REL_VIP || $item['rel'] == REL_BUD)) + if(($item['owner-link'] == $item['url']) + && ($item['rel'] == REL_VIP || $item['rel'] == REL_BUD)) { $owner_url = $redirect_url; + $osparkle = ' sparkle'; + } } } @@ -223,8 +234,10 @@ function network_content(&$a, $update = 0) { - if(($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'] )) + if(($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'] )) { $profile_url = $redirect_url; + $sparkle = ' sparkle'; + } $photo = $item['photo']; $thumb = $item['thumb']; @@ -239,10 +252,14 @@ function network_content(&$a, $update = 0) { // Can we use our special contact URL for this author? if(strlen($item['author-link'])) { - if($item['author-link'] == $item['url']) + if($item['author-link'] == $item['url']) { $profile_link = $redirect_url; - else + $sparkle = ' sparkle'; + } + else { $profile_link = $item['author-link']; + $sparkle = ''; + } } @@ -257,6 +274,8 @@ function network_content(&$a, $update = 0) { '$profile_url' => $profile_link, '$name' => $profile_name, '$thumb' => $profile_avatar, + '$osparkle' => $osparkle, + '$sparkle' => $sparkle, '$title' => $item['title'], '$body' => bbcode($item['body']), '$ago' => relative_date($item['created']), diff --git a/mod/photos.php b/mod/photos.php index 693d068e4..f5d4258ac 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -166,7 +166,7 @@ function photos_post(&$a) { $drop_id = intval($i[0]['id']); $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); - $proc_debug = get_config('system','proc_debug']); + $proc_debug = get_config('system','proc_debug'); // send the notification upstream/downstream as the case may be @@ -406,11 +406,32 @@ function photos_content(&$a) { $owner_uid = $a->data['user']['uid']; + + + $contact = null; + $remote_contact = false; + if(remote_user()) { $contact_id = $_SESSION['visitor_id']; $groups = init_groups_visitor($contact_id); + $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1", + intval($contact_id), + intval($owner_uid) + ); + if(count($r)) { + $contact = $r[0]; + $remote_contact = true; + } } + if(! $remote_contact) { + if(local_user()) { + $contact_id = $_SESSION['cid']; + $contact = $a->contact; + } + } + + // default permissions - anonymous user $sql_extra = " AND `allow_cid` = '' AND `allow_gid` = '' AND `deny_cid` = '' AND `deny_gid` = '' "; @@ -669,6 +690,9 @@ function photos_content(&$a) { '$id' => $i1[0]['id'], '$parent' => $i1[0]['id'], '$profile_uid' => $a->data['user']['uid'], + '$mylink' => $contact['url'], + '$mytitle' => t('This is you'), + '$myphoto' => $contact['thumb'], '$ww' => '' )); } @@ -691,16 +715,24 @@ function photos_content(&$a) { '$id' => $item['item_id'], '$parent' => $item['parent'], '$profile_uid' => $a->data['user']['uid'], + '$mylink' => $contact['url'], + '$mytitle' => t('This is you'), + '$myphoto' => $contact['thumb'], '$ww' => '' )); } } - $profile_url = $item['url']; if(local_user() && ($item['contact-uid'] == get_uid()) - && ($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'] )) + && ($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'] )) { $profile_url = $redirect_url; + $sparkle = ' sparkle'; + } + else { + $profile_url = $item['url']; + $sparkle = ''; + } $profile_name = ((strlen($item['author-name'])) ? $item['author-name'] : $item['name']); $profile_avatar = ((strlen($item['author-avatar'])) ? $item['author-avatar'] : $item['thumb']); @@ -717,6 +749,7 @@ function photos_content(&$a) { '$profile_url' => $profile_link, '$name' => $profile_name, '$thumb' => $profile_avatar, + '$sparkle' => $sparkle, '$title' => $item['title'], '$body' => bbcode($item['body']), '$ago' => relative_date($item['created']), diff --git a/mod/profile.php b/mod/profile.php index 8395bc1f6..a0cdcfcc7 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -268,29 +268,35 @@ function profile_content(&$a, $update = 0) { foreach($r as $item) { + $sparkle = ''; + if(($item['verb'] == ACTIVITY_LIKE) && ($item['id'] != $item['parent'])) { $url = $item['url']; - if(($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'])) + if(($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'])) { $url = $a->get_baseurl() . '/redir/' . $item['contact-id']; + $sparkle = ' class="sparkle" '; + } if(! is_array($alike[$item['parent'] . '-l'])) $alike[$item['parent'] . '-l'] = array(); $alike[$item['parent']] ++; - $alike[$item['parent'] . '-l'][] = '' . $item['name'] . ''; + $alike[$item['parent'] . '-l'][] = '' . $item['name'] . ''; } if(($item['verb'] == ACTIVITY_DISLIKE) && ($item['id'] != $item['parent'])) { $url = $item['url']; - if(($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'])) + if(($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'])) { $url = $a->get_baseurl() . '/redir/' . $item['contact-id']; + $sparkle = ' class="sparkle" '; + } if(! is_array($dlike[$item['parent'] . '-l'])) $dlike[$item['parent'] . '-l'] = array(); $dlike[$item['parent']] ++; - $dlike[$item['parent'] . '-l'][] = '' . $item['name'] . ''; + $dlike[$item['parent'] . '-l'][] = '' . $item['name'] . ''; } } foreach($r as $item) { - + $sparkle = ''; $comment = ''; $likebuttons = ''; @@ -313,7 +319,7 @@ function profile_content(&$a, $update = 0) { '$parent' => $item['parent'], '$profile_uid' => $a->profile['profile_uid'], '$mylink' => $contact['url'], - '$mytitle' => t('Me'), + '$mytitle' => t('This is you'), '$myphoto' => $contact['thumb'], '$ww' => '' )); @@ -327,9 +333,12 @@ function profile_content(&$a, $update = 0) { // I can go directly to their profile as an authenticated guest. if(local_user() && ($item['contact-uid'] == $_SESSION['uid']) - && ($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'] )) + && ($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'] )) { $profile_url = $redirect_url; - + $sparkle = ' sparkle'; + } + else + $sparkle = ''; // We received this post via a remote feed. It's either a wall-to-wall or a remote comment. The author is // known to us and is reflected in the contact-id for this item. We can use the contact url or redirect rather than @@ -357,6 +366,7 @@ function profile_content(&$a, $update = 0) { '$profile_url' => $profile_link, '$name' => $profile_name, '$thumb' => $profile_avatar, + '$sparkle' => $sparkle, '$title' => $item['title'], '$body' => bbcode($item['body']), '$ago' => relative_date($item['created']), diff --git a/view/contact_edit.tpl b/view/contact_edit.tpl index a049c232f..acea1da4e 100644 --- a/view/contact_edit.tpl +++ b/view/contact_edit.tpl @@ -9,7 +9,7 @@
$alt_text
- $name + $name
diff --git a/view/contact_template.tpl b/view/contact_template.tpl index 763cde00b..5b99f1be1 100644 --- a/view/contact_template.tpl +++ b/view/contact_template.tpl @@ -13,7 +13,7 @@
- $name + $name
diff --git a/view/mail_conv.tpl b/view/mail_conv.tpl index 3c26a9c54..779ef39ee 100644 --- a/view/mail_conv.tpl +++ b/view/mail_conv.tpl @@ -1,6 +1,6 @@
- $from_name + $from_name
$from_name
diff --git a/view/mail_list.tpl b/view/mail_list.tpl index ee64f15e0..1ef714f7a 100644 --- a/view/mail_list.tpl +++ b/view/mail_list.tpl @@ -1,6 +1,6 @@
- $from_name + $from_name
$from_name
diff --git a/view/theme/default/style.css b/view/theme/default/style.css index a97ad9331..a7dee04b6 100644 --- a/view/theme/default/style.css +++ b/view/theme/default/style.css @@ -1586,3 +1586,7 @@ input#dfrn-url { bottom: 5px; right: 5px; } + +.sparkle { + cursor: crosshair; +} diff --git a/view/wall_item.tpl b/view/wall_item.tpl index 479a72ce2..58a7727a8 100644 --- a/view/wall_item.tpl +++ b/view/wall_item.tpl @@ -2,11 +2,11 @@
- $name + $name
- $name + $name
$ago
$location
$vote diff --git a/view/wallwall_item.tpl b/view/wallwall_item.tpl index 0ff2ff6f7..d98289901 100644 --- a/view/wallwall_item.tpl +++ b/view/wallwall_item.tpl @@ -2,16 +2,16 @@
- $owner_name + $owner_name
Wall-To-Wall
- $name + $name
- $name to $owner_name via Wall-To-Wall:
+ $name to $owner_name via Wall-To-Wall:
$ago
$location
$vote -- cgit v1.2.3