From d874a55178cce01195b23296bbae6365807dc300 Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 19 Apr 2011 20:50:02 -0700 Subject: [PATCH] per contact network page (link in photo menu) --- include/conversation.php | 5 +- mod/network.php | 36 ++++++++++--- util/messages.po | 108 ++++++++++++++++++++++----------------- util/strings.php | 2 + 4 files changed, 95 insertions(+), 56 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index 3ec0706e9d..5cdcfca8cd 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -533,6 +533,7 @@ function item_photo_menu($item){ $status_link=""; $photo_link=""; + $posts_link=""; $profile_link = ((strlen($item['author-link'])) ? $item['author-link'] : $item['url']); $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ; @@ -564,6 +565,7 @@ function item_photo_menu($item){ if((isset($cid)) && (! $item['self'])) { $contact_url = $a->get_baseurl() . '/contacts/' . $cid; + $posts_link = $a->get_baseurl() . '/network/?cid=' . $cid; if($item['network'] === 'dfrn') { $status_link = $redir . "?url=status"; $profile_link = $redir . "?url=profile"; @@ -577,7 +579,8 @@ function item_photo_menu($item){ $menu = Array( t("View status") => $status_link, t("View profile") => $profile_link, - t("View photos") => $photos_link, + t("View photos") => $photos_link, + t("View recent") => $posts_link, t("Edit contact") => $contact_url, t("Send PM") => $pm_url, ); diff --git a/mod/network.php b/mod/network.php index 9061dff0fd..9d5fb5b84a 100644 --- a/mod/network.php +++ b/mod/network.php @@ -15,9 +15,9 @@ function network_init(&$a) { $a->page['aside'] .= ''; @@ -41,6 +41,8 @@ function network_content(&$a, $update = 0) { $nouveau = false; require_once('include/acl_selectors.php'); + $cid = ((x($_GET['cid'])) ? intval($_GET['cid']) : 0); + if(($a->argc > 2) && $a->argv[2] === 'new') $nouveau = true; @@ -49,10 +51,13 @@ function network_content(&$a, $update = 0) { $nouveau = true; else { $group = intval($a->argv[1]); - $group_acl = array('allow_gid' => '<' . $group . '>'); + $def_acl = array('allow_gid' => '<' . $group . '>'); } } + if($cid) + $def_acl = array('allow_cid' => '<' . intval($cid) . '>'); + if(! $update) { if(group) { if(($t = group_public_members($group)) && (! get_pconfig(local_user(),'system','nowarn_insecure'))) { @@ -146,8 +151,8 @@ function network_content(&$a, $update = 0) { '$jotnets' => $jotnets, '$emtitle' => t('Example: bob@example.com, mary@example.com'), '$lockstate' => $lockstate, - '$acl' => populate_acl((($group) ? $group_acl : $a->user), $celeb), - '$bang' => (($group) ? '!' : ''), + '$acl' => populate_acl((($group || $cid) ? $def_acl : $a->user), $celeb), + '$bang' => (($group || $cid) ? '!' : ''), '$profile_uid' => local_user() )); @@ -160,6 +165,7 @@ function network_content(&$a, $update = 0) { $o .= '
' . "\r\n"; $o .= "\r\n"; } @@ -189,7 +195,7 @@ function network_content(&$a, $update = 0) { killme(); notice( t('No such group') . EOL ); goaway($a->get_baseurl() . '/network'); - return; // NOTREACHED + // NOTREACHED } $contacts = expand_groups(array($group)); @@ -204,8 +210,24 @@ function network_content(&$a, $update = 0) { $sql_extra = " AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` AND `contact-id` IN ( $contact_str )) "; $o = '

' . t('Group: ') . $r[0]['name'] . '

' . $o; } + elseif($cid) { - if((! $group) && (! $update)) + $r = q("SELECT `id`,`name` FROM `contact` WHERE `id` = %d + AND `blocked` = 0 AND `pending` = 0 LIMIT 1", + intval($cid) + ); + if(count($r)) { + $sql_extra = " AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` AND `contact-id` IN ( " . intval($cid) . " )) "; + $o = '

' . t('Contact: ') . $r[0]['name'] . '

' . $o; + } + else { + notice( t('Invalid contact.') . EOL); + goaway($a->get_baseurl() . '/network'); + // NOTREACHED + } + } + + if((! $group) && (! $cid) && (! $update)) $o .= get_birthdays(); diff --git a/util/messages.po b/util/messages.po index 0a939a0f4d..ad81cd886d 100644 --- a/util/messages.po +++ b/util/messages.po @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: 2.1.953\n" +"Project-Id-Version: 2.1.954\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-04-18 20:13-0700\n" +"POT-Creation-Date: 2011-04-19 20:49-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -343,13 +343,13 @@ msgstr "" msgid "I don't like this (toggle)" msgstr "" -#: ../../mod/photos.php:1089 ../../mod/network.php:129 +#: ../../mod/photos.php:1089 ../../mod/network.php:134 #: ../../mod/profile.php:181 ../../include/conversation.php:347 msgid "Share" msgstr "" #: ../../mod/photos.php:1090 ../../mod/editpost.php:95 -#: ../../mod/network.php:138 ../../mod/message.php:190 +#: ../../mod/network.php:143 ../../mod/message.php:190 #: ../../mod/message.php:324 ../../mod/profile.php:190 #: ../../include/conversation.php:348 msgid "Please wait" @@ -397,7 +397,7 @@ msgstr "" msgid "Edit post" msgstr "" -#: ../../mod/editpost.php:74 ../../mod/network.php:117 +#: ../../mod/editpost.php:74 ../../mod/network.php:122 #: ../../mod/profile.php:169 msgid "Post to Email" msgstr "" @@ -407,54 +407,54 @@ msgstr "" msgid "Edit" msgstr "" -#: ../../mod/editpost.php:88 ../../mod/network.php:130 +#: ../../mod/editpost.php:88 ../../mod/network.php:135 #: ../../mod/message.php:188 ../../mod/message.php:322 #: ../../mod/profile.php:182 msgid "Upload photo" msgstr "" -#: ../../mod/editpost.php:89 ../../mod/network.php:131 +#: ../../mod/editpost.php:89 ../../mod/network.php:136 #: ../../mod/message.php:189 ../../mod/message.php:323 #: ../../mod/profile.php:183 msgid "Insert web link" msgstr "" -#: ../../mod/editpost.php:90 ../../mod/network.php:132 +#: ../../mod/editpost.php:90 ../../mod/network.php:137 #: ../../mod/profile.php:184 msgid "Insert YouTube video" msgstr "" -#: ../../mod/editpost.php:91 ../../mod/network.php:133 +#: ../../mod/editpost.php:91 ../../mod/network.php:138 #: ../../mod/profile.php:185 msgid "Insert Vorbis [.ogg] video" msgstr "" -#: ../../mod/editpost.php:92 ../../mod/network.php:134 +#: ../../mod/editpost.php:92 ../../mod/network.php:139 #: ../../mod/profile.php:186 msgid "Insert Vorbis [.ogg] audio" msgstr "" -#: ../../mod/editpost.php:93 ../../mod/network.php:135 +#: ../../mod/editpost.php:93 ../../mod/network.php:140 #: ../../mod/profile.php:187 msgid "Set your location" msgstr "" -#: ../../mod/editpost.php:94 ../../mod/network.php:136 +#: ../../mod/editpost.php:94 ../../mod/network.php:141 #: ../../mod/profile.php:188 msgid "Clear browser location" msgstr "" -#: ../../mod/editpost.php:96 ../../mod/network.php:139 +#: ../../mod/editpost.php:96 ../../mod/network.php:144 #: ../../mod/profile.php:191 msgid "Permission settings" msgstr "" -#: ../../mod/editpost.php:102 ../../mod/network.php:145 +#: ../../mod/editpost.php:102 ../../mod/network.php:150 #: ../../mod/profile.php:198 msgid "CC: email addresses" msgstr "" -#: ../../mod/editpost.php:104 ../../mod/network.php:147 +#: ../../mod/editpost.php:104 ../../mod/network.php:152 #: ../../mod/profile.php:200 msgid "Example: bob@example.com, mary@example.com" msgstr "" @@ -528,7 +528,7 @@ msgstr "" msgid "Invalid profile URL." msgstr "" -#: ../../mod/dfrn_request.php:336 +#: ../../mod/dfrn_request.php:336 ../../mod/follow.php:16 msgid "Disallowed profile URL." msgstr "" @@ -1137,7 +1137,7 @@ msgstr "" msgid "Visit $username's profile" msgstr "" -#: ../../mod/contacts.php:387 ../../include/conversation.php:581 +#: ../../mod/contacts.php:387 ../../include/conversation.php:584 msgid "Edit contact" msgstr "" @@ -1489,64 +1489,72 @@ msgstr "" msgid "New Item View" msgstr "" -#: ../../mod/network.php:59 +#: ../../mod/network.php:64 #, php-format msgid "%d member" msgid_plural "%d members" msgstr[0] "" msgstr[1] "" -#: ../../mod/network.php:60 +#: ../../mod/network.php:65 #, php-format msgid "Warning: This group contains %s from an insecure network." msgstr "" -#: ../../mod/network.php:61 +#: ../../mod/network.php:66 msgid "Private messages to this group are at risk of public disclosure." msgstr "" -#: ../../mod/network.php:77 ../../mod/message.php:172 +#: ../../mod/network.php:82 ../../mod/message.php:172 #: ../../mod/profile.php:131 msgid "Please enter a link URL:" msgstr "" -#: ../../mod/network.php:78 ../../mod/profile.php:132 +#: ../../mod/network.php:83 ../../mod/profile.php:132 msgid "Please enter a YouTube link:" msgstr "" -#: ../../mod/network.php:79 ../../mod/profile.php:133 +#: ../../mod/network.php:84 ../../mod/profile.php:133 msgid "Please enter a video(.ogg) link/URL:" msgstr "" -#: ../../mod/network.php:80 ../../mod/profile.php:134 +#: ../../mod/network.php:85 ../../mod/profile.php:134 msgid "Please enter an audio(.ogg) link/URL:" msgstr "" -#: ../../mod/network.php:81 ../../mod/profile.php:135 +#: ../../mod/network.php:86 ../../mod/profile.php:135 msgid "Where are you right now?" msgstr "" -#: ../../mod/network.php:82 ../../mod/profile.php:136 +#: ../../mod/network.php:87 ../../mod/profile.php:136 msgid "Enter a title for this item" msgstr "" -#: ../../mod/network.php:137 ../../mod/profile.php:189 +#: ../../mod/network.php:142 ../../mod/profile.php:189 msgid "Set title" msgstr "" -#: ../../mod/network.php:190 +#: ../../mod/network.php:196 msgid "No such group" msgstr "" -#: ../../mod/network.php:201 +#: ../../mod/network.php:207 msgid "Group is empty" msgstr "" -#: ../../mod/network.php:205 +#: ../../mod/network.php:211 msgid "Group: " msgstr "" -#: ../../mod/network.php:301 ../../mod/register.php:450 +#: ../../mod/network.php:221 +msgid "Contact: " +msgstr "" + +#: ../../mod/network.php:224 +msgid "Invalid contact." +msgstr "" + +#: ../../mod/network.php:323 ../../mod/register.php:450 #: ../../mod/profile.php:322 ../../mod/display.php:142 msgid "" "Shared content is covered by the %2$d people like this." msgstr "" -#: ../../include/conversation.php:638 +#: ../../include/conversation.php:641 #, php-format msgid "%2$d people don't like this." msgstr "" -#: ../../include/conversation.php:644 +#: ../../include/conversation.php:647 msgid "and" msgstr "" -#: ../../include/conversation.php:647 +#: ../../include/conversation.php:650 #, php-format msgid ", and %d other people" msgstr "" -#: ../../include/conversation.php:648 +#: ../../include/conversation.php:651 #, php-format msgid "%s like this." msgstr "" -#: ../../include/conversation.php:648 +#: ../../include/conversation.php:651 #, php-format msgid "%s don't like this." msgstr "" diff --git a/util/strings.php b/util/strings.php index b18d571347..f5663d8e7b 100644 --- a/util/strings.php +++ b/util/strings.php @@ -364,6 +364,8 @@ $a->strings['Set title'] = 'Set title'; $a->strings['No such group'] = 'No such group'; $a->strings['Group is empty'] = 'Group is empty'; $a->strings['Group: '] = 'Group: '; +$a->strings['Contact: '] = 'Contact: '; +$a->strings['Invalid contact.'] = 'Invalid contact.'; $a->strings['%d member'] = array( 0 => '%d member', 1 => '%d members',