From 18287a365693d0607be76091679cb45dc2748a6f Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Tue, 28 Sep 2010 22:12:27 -0700 Subject: [PATCH] show lockstate on messages, sparkle failure on profile page, comments on typo checker --- mod/display.php | 9 ++++++++- mod/network.php | 8 ++++++++ mod/profile.php | 11 ++++++++++- test/typo.php | 4 ++++ view/theme/default/style.css | 5 ++++- view/wall_item.tpl | 1 + view/wallwall_item.tpl | 1 + 7 files changed, 36 insertions(+), 3 deletions(-) diff --git a/mod/display.php b/mod/display.php index 9c24d85b0..d0bbf54bf 100644 --- a/mod/display.php +++ b/mod/display.php @@ -85,7 +85,7 @@ function display_content(&$a) { } $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, - `contact`.`name`, `contact`.`photo`, `contact`.`url`, + `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`, `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid` FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` @@ -149,6 +149,12 @@ function display_content(&$a) { if((($item['verb'] == ACTIVITY_LIKE) || ($item['verb'] == ACTIVITY_DISLIKE)) && ($item['id'] != $item['parent'])) continue; + $lock = (($item['uid'] == get_uid()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) + || strlen($item['deny_cid']) || strlen($item['deny_gid'])) + ? '
Private Message
' + : '
'); + + if(can_write_wall($a,$a->profile['uid'])) { if($item['last-child']) { $comment = replace_macros($cmnt_tpl,array( @@ -239,6 +245,7 @@ function display_content(&$a) { '$title' => $item['title'], '$body' => bbcode($item['body']), '$ago' => relative_date($item['created']), + '$lock' => $lock, '$location' => (($item['location']) ? '' . $item['location'] . '' : ''), '$indent' => (($item['parent'] != $item['item_id']) ? ' comment' : ''), '$owner_url' => $owner_url, diff --git a/mod/network.php b/mod/network.php index 1634a0f06..b0daecac4 100644 --- a/mod/network.php +++ b/mod/network.php @@ -173,6 +173,13 @@ function network_content(&$a, $update = 0) { if((($item['verb'] == ACTIVITY_LIKE) || ($item['verb'] == ACTIVITY_DISLIKE)) && ($item['id'] != $item['parent'])) continue; + + $lock = (($item['uid'] == get_uid()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) + || strlen($item['deny_cid']) || strlen($item['deny_gid'])) + ? '
Private Message
' + : '
'); + + // Top-level wall post not written by the wall owner (wall-to-wall) // First figure out who owns it. @@ -279,6 +286,7 @@ function network_content(&$a, $update = 0) { '$title' => $item['title'], '$body' => bbcode($item['body']), '$ago' => relative_date($item['created']), + '$lock' => $lock, '$location' => (($item['location']) ? '' . $item['location'] . '' : ''), '$indent' => (($item['parent'] != $item['item_id']) ? ' comment' : ''), '$owner_url' => $owner_url, diff --git a/mod/profile.php b/mod/profile.php index a0cdcfcc7..bf9c0f758 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -231,7 +231,7 @@ function profile_content(&$a, $update = 0) { $a->set_pager_total($r[0]['total']); $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, - `contact`.`name`, `contact`.`photo`, `contact`.`url`, + `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`, `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid` FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` @@ -307,6 +307,14 @@ function profile_content(&$a, $update = 0) { if((($item['verb'] == ACTIVITY_LIKE) || ($item['verb'] == ACTIVITY_DISLIKE)) && ($item['id'] != $item['parent'])) continue; + $lock = (($item['uid'] == get_uid()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) + || strlen($item['deny_cid']) || strlen($item['deny_gid'])) + ? '
Private Message
' + : '
'); + + + + if(can_write_wall($a,$a->profile['profile_uid'])) { if($item['id'] == $item['parent']) { $likebuttons = replace_macros($like_tpl,array('$id' => $item['id'])); @@ -370,6 +378,7 @@ function profile_content(&$a, $update = 0) { '$title' => $item['title'], '$body' => bbcode($item['body']), '$ago' => relative_date($item['created']), + '$lock' => $lock, '$location' => (($item['location']) ? '' . $item['location'] . '' : ''), '$indent' => (($item['parent'] != $item['item_id']) ? ' comment' : ''), '$drop' => $drop, diff --git a/test/typo.php b/test/typo.php index c8b94be21..e3141a46e 100644 --- a/test/typo.php +++ b/test/typo.php @@ -1,4 +1,8 @@
+ $lock $name
$ago
$location
diff --git a/view/wallwall_item.tpl b/view/wallwall_item.tpl index d98289901..f8affd1c5 100644 --- a/view/wallwall_item.tpl +++ b/view/wallwall_item.tpl @@ -11,6 +11,7 @@
+ $lock $name to $owner_name via Wall-To-Wall:
$ago
$location