diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/contacts.php | 24 | ||||
-rw-r--r-- | mod/display.php | 30 | ||||
-rw-r--r-- | mod/message.php | 13 | ||||
-rw-r--r-- | mod/network.php | 35 | ||||
-rw-r--r-- | mod/photos.php | 39 | ||||
-rw-r--r-- | mod/profile.php | 26 |
6 files changed, 137 insertions, 30 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 .= '<div id="contact-edit-end"></div>'; 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'][] = '<a href="'. $url . '">' . $item['name'] . '</a>'; + $alike[$item['parent'] . '-l'][] = '<a href="'. $url . '"' . $sparkle . '>' . $item['name'] . '</a>'; } 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'][] = '<a href="'. $url . '">' . $item['name'] . '</a>'; + $dlike[$item['parent'] . '-l'][] = '<a href="'. $url . '"' . $sparkle . '>' . $item['name'] . '</a>'; } } @@ -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'] : '<strong>' . $rr['title'] . '</strong>'), '$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'][] = '<a href="'. $url . '">' . $item['name'] . '</a>'; + $alike[$item['parent'] . '-l'][] = '<a href="'. $url . '"' . $sparkle . '>' . $item['name'] . '</a>'; } 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'][] = '<a href="'. $url . '">' . $item['name'] . '</a>'; + $dlike[$item['parent'] . '-l'][] = '<a href="'. $url . '"' . $sparkle . '>' . $item['name'] . '</a>'; } } @@ -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'][] = '<a href="'. $url . '">' . $item['name'] . '</a>'; + $alike[$item['parent'] . '-l'][] = '<a href="'. $url . '"'. $sparkle .'>' . $item['name'] . '</a>'; } 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'][] = '<a href="'. $url . '">' . $item['name'] . '</a>'; + $dlike[$item['parent'] . '-l'][] = '<a href="'. $url . '"'. $sparkle .'>' . $item['name'] . '</a>'; } } 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']), |