per contact network page (link in photo menu)

This commit is contained in:
Friendika 2011-04-19 20:50:02 -07:00
parent 29a48de5e2
commit d874a55178
4 changed files with 95 additions and 56 deletions

View file

@ -533,6 +533,7 @@ function item_photo_menu($item){
$status_link=""; $status_link="";
$photo_link=""; $photo_link="";
$posts_link="";
$profile_link = ((strlen($item['author-link'])) ? $item['author-link'] : $item['url']); $profile_link = ((strlen($item['author-link'])) ? $item['author-link'] : $item['url']);
$redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ; $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
@ -564,6 +565,7 @@ function item_photo_menu($item){
if((isset($cid)) && (! $item['self'])) { if((isset($cid)) && (! $item['self'])) {
$contact_url = $a->get_baseurl() . '/contacts/' . $cid; $contact_url = $a->get_baseurl() . '/contacts/' . $cid;
$posts_link = $a->get_baseurl() . '/network/?cid=' . $cid;
if($item['network'] === 'dfrn') { if($item['network'] === 'dfrn') {
$status_link = $redir . "?url=status"; $status_link = $redir . "?url=status";
$profile_link = $redir . "?url=profile"; $profile_link = $redir . "?url=profile";
@ -577,7 +579,8 @@ function item_photo_menu($item){
$menu = Array( $menu = Array(
t("View status") => $status_link, t("View status") => $status_link,
t("View profile") => $profile_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("Edit contact") => $contact_url,
t("Send PM") => $pm_url, t("Send PM") => $pm_url,
); );

View file

@ -15,9 +15,9 @@ function network_init(&$a) {
$a->page['aside'] .= '<div id="network-new-link">'; $a->page['aside'] .= '<div id="network-new-link">';
if(($a->argc > 1 && $a->argv[1] === 'new') || ($a->argc > 2 && $a->argv[2] === 'new')) if(($a->argc > 1 && $a->argv[1] === 'new') || ($a->argc > 2 && $a->argv[2] === 'new'))
$a->page['aside'] .= '<a href="' . $a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . '">' . t('Normal View') . '</a>'; $a->page['aside'] .= '<a href="' . $a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?cid=' . $_GET['cid'] : '') . '">' . t('Normal View') . '</a>';
else else
$a->page['aside'] .= '<a href="' . $a->get_baseurl() . '/' . $a->cmd . '/new' . '">' . t('New Item View') . '</a>'; $a->page['aside'] .= '<a href="' . $a->get_baseurl() . '/' . $a->cmd . '/new' . ((x($_GET,'cid')) ? '/?cid=' . $_GET['cid'] : '') . '">' . t('New Item View') . '</a>';
$a->page['aside'] .= '</div>'; $a->page['aside'] .= '</div>';
@ -41,6 +41,8 @@ function network_content(&$a, $update = 0) {
$nouveau = false; $nouveau = false;
require_once('include/acl_selectors.php'); require_once('include/acl_selectors.php');
$cid = ((x($_GET['cid'])) ? intval($_GET['cid']) : 0);
if(($a->argc > 2) && $a->argv[2] === 'new') if(($a->argc > 2) && $a->argv[2] === 'new')
$nouveau = true; $nouveau = true;
@ -49,10 +51,13 @@ function network_content(&$a, $update = 0) {
$nouveau = true; $nouveau = true;
else { else {
$group = intval($a->argv[1]); $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(! $update) {
if(group) { if(group) {
if(($t = group_public_members($group)) && (! get_pconfig(local_user(),'system','nowarn_insecure'))) { 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, '$jotnets' => $jotnets,
'$emtitle' => t('Example: bob@example.com, mary@example.com'), '$emtitle' => t('Example: bob@example.com, mary@example.com'),
'$lockstate' => $lockstate, '$lockstate' => $lockstate,
'$acl' => populate_acl((($group) ? $group_acl : $a->user), $celeb), '$acl' => populate_acl((($group || $cid) ? $def_acl : $a->user), $celeb),
'$bang' => (($group) ? '!' : ''), '$bang' => (($group || $cid) ? '!' : ''),
'$profile_uid' => local_user() '$profile_uid' => local_user()
)); ));
@ -160,6 +165,7 @@ function network_content(&$a, $update = 0) {
$o .= '<div id="live-network"></div>' . "\r\n"; $o .= '<div id="live-network"></div>' . "\r\n";
$o .= "<script> var profile_uid = " . $_SESSION['uid'] $o .= "<script> var profile_uid = " . $_SESSION['uid']
. "; var netargs = '" . substr($a->cmd,8) . "; var netargs = '" . substr($a->cmd,8)
. ((x($_GET,'cid')) ? '/?cid=' . $_GET['cid'] : '')
. "'; var profile_page = " . $a->pager['page'] . "; </script>\r\n"; . "'; var profile_page = " . $a->pager['page'] . "; </script>\r\n";
} }
@ -189,7 +195,7 @@ function network_content(&$a, $update = 0) {
killme(); killme();
notice( t('No such group') . EOL ); notice( t('No such group') . EOL );
goaway($a->get_baseurl() . '/network'); goaway($a->get_baseurl() . '/network');
return; // NOTREACHED // NOTREACHED
} }
$contacts = expand_groups(array($group)); $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 )) "; $sql_extra = " AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` AND `contact-id` IN ( $contact_str )) ";
$o = '<h2>' . t('Group: ') . $r[0]['name'] . '</h2>' . $o; $o = '<h2>' . t('Group: ') . $r[0]['name'] . '</h2>' . $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 = '<h2>' . t('Contact: ') . $r[0]['name'] . '</h2>' . $o;
}
else {
notice( t('Invalid contact.') . EOL);
goaway($a->get_baseurl() . '/network');
// NOTREACHED
}
}
if((! $group) && (! $cid) && (! $update))
$o .= get_birthdays(); $o .= get_birthdays();

View file

@ -6,9 +6,9 @@
#, fuzzy #, fuzzy
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 2.1.953\n" "Project-Id-Version: 2.1.954\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -343,13 +343,13 @@ msgstr ""
msgid "I don't like this (toggle)" msgid "I don't like this (toggle)"
msgstr "" 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 #: ../../mod/profile.php:181 ../../include/conversation.php:347
msgid "Share" msgid "Share"
msgstr "" msgstr ""
#: ../../mod/photos.php:1090 ../../mod/editpost.php:95 #: ../../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 #: ../../mod/message.php:324 ../../mod/profile.php:190
#: ../../include/conversation.php:348 #: ../../include/conversation.php:348
msgid "Please wait" msgid "Please wait"
@ -397,7 +397,7 @@ msgstr ""
msgid "Edit post" msgid "Edit post"
msgstr "" msgstr ""
#: ../../mod/editpost.php:74 ../../mod/network.php:117 #: ../../mod/editpost.php:74 ../../mod/network.php:122
#: ../../mod/profile.php:169 #: ../../mod/profile.php:169
msgid "Post to Email" msgid "Post to Email"
msgstr "" msgstr ""
@ -407,54 +407,54 @@ msgstr ""
msgid "Edit" msgid "Edit"
msgstr "" 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/message.php:188 ../../mod/message.php:322
#: ../../mod/profile.php:182 #: ../../mod/profile.php:182
msgid "Upload photo" msgid "Upload photo"
msgstr "" 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/message.php:189 ../../mod/message.php:323
#: ../../mod/profile.php:183 #: ../../mod/profile.php:183
msgid "Insert web link" msgid "Insert web link"
msgstr "" msgstr ""
#: ../../mod/editpost.php:90 ../../mod/network.php:132 #: ../../mod/editpost.php:90 ../../mod/network.php:137
#: ../../mod/profile.php:184 #: ../../mod/profile.php:184
msgid "Insert YouTube video" msgid "Insert YouTube video"
msgstr "" msgstr ""
#: ../../mod/editpost.php:91 ../../mod/network.php:133 #: ../../mod/editpost.php:91 ../../mod/network.php:138
#: ../../mod/profile.php:185 #: ../../mod/profile.php:185
msgid "Insert Vorbis [.ogg] video" msgid "Insert Vorbis [.ogg] video"
msgstr "" msgstr ""
#: ../../mod/editpost.php:92 ../../mod/network.php:134 #: ../../mod/editpost.php:92 ../../mod/network.php:139
#: ../../mod/profile.php:186 #: ../../mod/profile.php:186
msgid "Insert Vorbis [.ogg] audio" msgid "Insert Vorbis [.ogg] audio"
msgstr "" msgstr ""
#: ../../mod/editpost.php:93 ../../mod/network.php:135 #: ../../mod/editpost.php:93 ../../mod/network.php:140
#: ../../mod/profile.php:187 #: ../../mod/profile.php:187
msgid "Set your location" msgid "Set your location"
msgstr "" msgstr ""
#: ../../mod/editpost.php:94 ../../mod/network.php:136 #: ../../mod/editpost.php:94 ../../mod/network.php:141
#: ../../mod/profile.php:188 #: ../../mod/profile.php:188
msgid "Clear browser location" msgid "Clear browser location"
msgstr "" msgstr ""
#: ../../mod/editpost.php:96 ../../mod/network.php:139 #: ../../mod/editpost.php:96 ../../mod/network.php:144
#: ../../mod/profile.php:191 #: ../../mod/profile.php:191
msgid "Permission settings" msgid "Permission settings"
msgstr "" msgstr ""
#: ../../mod/editpost.php:102 ../../mod/network.php:145 #: ../../mod/editpost.php:102 ../../mod/network.php:150
#: ../../mod/profile.php:198 #: ../../mod/profile.php:198
msgid "CC: email addresses" msgid "CC: email addresses"
msgstr "" msgstr ""
#: ../../mod/editpost.php:104 ../../mod/network.php:147 #: ../../mod/editpost.php:104 ../../mod/network.php:152
#: ../../mod/profile.php:200 #: ../../mod/profile.php:200
msgid "Example: bob@example.com, mary@example.com" msgid "Example: bob@example.com, mary@example.com"
msgstr "" msgstr ""
@ -528,7 +528,7 @@ msgstr ""
msgid "Invalid profile URL." msgid "Invalid profile URL."
msgstr "" msgstr ""
#: ../../mod/dfrn_request.php:336 #: ../../mod/dfrn_request.php:336 ../../mod/follow.php:16
msgid "Disallowed profile URL." msgid "Disallowed profile URL."
msgstr "" msgstr ""
@ -1137,7 +1137,7 @@ msgstr ""
msgid "Visit $username's profile" msgid "Visit $username's profile"
msgstr "" msgstr ""
#: ../../mod/contacts.php:387 ../../include/conversation.php:581 #: ../../mod/contacts.php:387 ../../include/conversation.php:584
msgid "Edit contact" msgid "Edit contact"
msgstr "" msgstr ""
@ -1489,64 +1489,72 @@ msgstr ""
msgid "New Item View" msgid "New Item View"
msgstr "" msgstr ""
#: ../../mod/network.php:59 #: ../../mod/network.php:64
#, php-format #, php-format
msgid "%d member" msgid "%d member"
msgid_plural "%d members" msgid_plural "%d members"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#: ../../mod/network.php:60 #: ../../mod/network.php:65
#, php-format #, php-format
msgid "Warning: This group contains %s from an insecure network." msgid "Warning: This group contains %s from an insecure network."
msgstr "" msgstr ""
#: ../../mod/network.php:61 #: ../../mod/network.php:66
msgid "Private messages to this group are at risk of public disclosure." msgid "Private messages to this group are at risk of public disclosure."
msgstr "" msgstr ""
#: ../../mod/network.php:77 ../../mod/message.php:172 #: ../../mod/network.php:82 ../../mod/message.php:172
#: ../../mod/profile.php:131 #: ../../mod/profile.php:131
msgid "Please enter a link URL:" msgid "Please enter a link URL:"
msgstr "" msgstr ""
#: ../../mod/network.php:78 ../../mod/profile.php:132 #: ../../mod/network.php:83 ../../mod/profile.php:132
msgid "Please enter a YouTube link:" msgid "Please enter a YouTube link:"
msgstr "" 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:" msgid "Please enter a video(.ogg) link/URL:"
msgstr "" 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:" msgid "Please enter an audio(.ogg) link/URL:"
msgstr "" msgstr ""
#: ../../mod/network.php:81 ../../mod/profile.php:135 #: ../../mod/network.php:86 ../../mod/profile.php:135
msgid "Where are you right now?" msgid "Where are you right now?"
msgstr "" msgstr ""
#: ../../mod/network.php:82 ../../mod/profile.php:136 #: ../../mod/network.php:87 ../../mod/profile.php:136
msgid "Enter a title for this item" msgid "Enter a title for this item"
msgstr "" msgstr ""
#: ../../mod/network.php:137 ../../mod/profile.php:189 #: ../../mod/network.php:142 ../../mod/profile.php:189
msgid "Set title" msgid "Set title"
msgstr "" msgstr ""
#: ../../mod/network.php:190 #: ../../mod/network.php:196
msgid "No such group" msgid "No such group"
msgstr "" msgstr ""
#: ../../mod/network.php:201 #: ../../mod/network.php:207
msgid "Group is empty" msgid "Group is empty"
msgstr "" msgstr ""
#: ../../mod/network.php:205 #: ../../mod/network.php:211
msgid "Group: " msgid "Group: "
msgstr "" 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 #: ../../mod/profile.php:322 ../../mod/display.php:142
msgid "" msgid ""
"Shared content is covered by the <a href=\"http://creativecommons.org/" "Shared content is covered by the <a href=\"http://creativecommons.org/"
@ -2055,21 +2063,21 @@ msgstr ""
msgid "Welcome back " msgid "Welcome back "
msgstr "" msgstr ""
#: ../../mod/follow.php:32 ../../wip/follow2.php:186 #: ../../mod/follow.php:39 ../../wip/follow2.php:186
msgid "The profile address specified does not provide adequate information." msgid "The profile address specified does not provide adequate information."
msgstr "" msgstr ""
#: ../../mod/follow.php:38 ../../wip/follow2.php:192 #: ../../mod/follow.php:45 ../../wip/follow2.php:192
msgid "" msgid ""
"Limited profile. This person will be unable to receive direct/personal " "Limited profile. This person will be unable to receive direct/personal "
"notifications from you." "notifications from you."
msgstr "" msgstr ""
#: ../../mod/follow.php:93 ../../wip/follow2.php:247 #: ../../mod/follow.php:100 ../../wip/follow2.php:247
msgid "Unable to retrieve contact information." msgid "Unable to retrieve contact information."
msgstr "" msgstr ""
#: ../../mod/follow.php:139 ../../wip/follow2.php:293 #: ../../mod/follow.php:146 ../../wip/follow2.php:293
msgid "following" msgid "following"
msgstr "" msgstr ""
@ -3162,7 +3170,7 @@ msgstr ""
msgid "Except For:" msgid "Except For:"
msgstr "" msgstr ""
#: ../../include/notifier.php:407 #: ../../include/notifier.php:412
msgid "(no subject)" msgid "(no subject)"
msgstr "" msgstr ""
@ -3201,57 +3209,61 @@ msgstr ""
msgid "via Wall-To-Wall:" msgid "via Wall-To-Wall:"
msgstr "" msgstr ""
#: ../../include/conversation.php:578 #: ../../include/conversation.php:580
msgid "View status" msgid "View status"
msgstr "" msgstr ""
#: ../../include/conversation.php:579 #: ../../include/conversation.php:581
msgid "View profile" msgid "View profile"
msgstr "" msgstr ""
#: ../../include/conversation.php:580 #: ../../include/conversation.php:582
msgid "View photos" msgid "View photos"
msgstr "" msgstr ""
#: ../../include/conversation.php:582 #: ../../include/conversation.php:583
msgid "View recent"
msgstr ""
#: ../../include/conversation.php:585
msgid "Send PM" msgid "Send PM"
msgstr "" msgstr ""
#: ../../include/conversation.php:632 #: ../../include/conversation.php:635
#, php-format #, php-format
msgid "%s likes this." msgid "%s likes this."
msgstr "" msgstr ""
#: ../../include/conversation.php:632 #: ../../include/conversation.php:635
#, php-format #, php-format
msgid "%s doesn't like this." msgid "%s doesn't like this."
msgstr "" msgstr ""
#: ../../include/conversation.php:636 #: ../../include/conversation.php:639
#, php-format #, php-format
msgid "<span %1$s>%2$d people</span> like this." msgid "<span %1$s>%2$d people</span> like this."
msgstr "" msgstr ""
#: ../../include/conversation.php:638 #: ../../include/conversation.php:641
#, php-format #, php-format
msgid "<span %1$s>%2$d people</span> don't like this." msgid "<span %1$s>%2$d people</span> don't like this."
msgstr "" msgstr ""
#: ../../include/conversation.php:644 #: ../../include/conversation.php:647
msgid "and" msgid "and"
msgstr "" msgstr ""
#: ../../include/conversation.php:647 #: ../../include/conversation.php:650
#, php-format #, php-format
msgid ", and %d other people" msgid ", and %d other people"
msgstr "" msgstr ""
#: ../../include/conversation.php:648 #: ../../include/conversation.php:651
#, php-format #, php-format
msgid "%s like this." msgid "%s like this."
msgstr "" msgstr ""
#: ../../include/conversation.php:648 #: ../../include/conversation.php:651
#, php-format #, php-format
msgid "%s don't like this." msgid "%s don't like this."
msgstr "" msgstr ""

View file

@ -364,6 +364,8 @@ $a->strings['Set title'] = 'Set title';
$a->strings['No such group'] = 'No such group'; $a->strings['No such group'] = 'No such group';
$a->strings['Group is empty'] = 'Group is empty'; $a->strings['Group is empty'] = 'Group is empty';
$a->strings['Group: '] = 'Group: '; $a->strings['Group: '] = 'Group: ';
$a->strings['Contact: '] = 'Contact: ';
$a->strings['Invalid contact.'] = 'Invalid contact.';
$a->strings['%d member'] = array( $a->strings['%d member'] = array(
0 => '%d member', 0 => '%d member',
1 => '%d members', 1 => '%d members',