From 3f432a7b82480dd985dbc2a67ae23cfc1ed258c6 Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 16 Mar 2011 19:36:59 -0700 Subject: share,retweet,relay,forward, whatever --- mod/network.php | 1 + 1 file changed, 1 insertion(+) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index 32c7216d4..1f92145d1 100644 --- a/mod/network.php +++ b/mod/network.php @@ -364,6 +364,7 @@ function network_content(&$a, $update = 0) { '$id' => $item['id'], '$likethis' => t("I like this \x28toggle\x29"), '$nolike' => t("I don't like this \x28toggle\x29"), + '$share' => t('Share'), '$wait' => t('Please wait') )); } -- cgit v1.2.3 From 334353e502db5abd7ee248d183a915ff7468de3a Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 16 Mar 2011 21:14:22 -0700 Subject: vorbis audio/video link buttons --- mod/network.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index 1f92145d1..ad028df1f 100644 --- a/mod/network.php +++ b/mod/network.php @@ -92,6 +92,8 @@ function network_content(&$a, $update = 0) { '$upload' => t('Upload photo'), '$weblink' => t('Insert web link'), '$youtube' => t('Insert YouTube video'), + '$video' => t('Insert Vorbis [.ogg] video'), + '$audio' => t('Insert Vorbis [.ogg] audio'), '$setloc' => t('Set your location'), '$noloc' => t('Clear browser location'), '$wait' => t('Please wait'), -- cgit v1.2.3 From 47f0abf27e2aa0f5443badd2a43617b922662bba Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 16 Mar 2011 22:04:00 -0700 Subject: no sharing icon for private msgs --- mod/network.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index ad028df1f..abdf59c48 100644 --- a/mod/network.php +++ b/mod/network.php @@ -219,6 +219,7 @@ function network_content(&$a, $update = 0) { $cmnt_tpl = load_view_file('view/comment_item.tpl'); $like_tpl = load_view_file('view/like.tpl'); + $noshare_tpl = load_view_file('view/like_noshare.tpl'); $tpl = load_view_file('view/wall_item.tpl'); $wallwall = load_view_file('view/wallwall_item.tpl'); @@ -362,7 +363,7 @@ function network_content(&$a, $update = 0) { $likebuttons = ''; if($item['id'] == $item['parent']) { - $likebuttons = replace_macros($like_tpl,array( + $likebuttons = replace_macros((($item['private']) ? $noshare_tpl : $like_tpl),array( '$id' => $item['id'], '$likethis' => t("I like this \x28toggle\x29"), '$nolike' => t("I don't like this \x28toggle\x29"), -- cgit v1.2.3 From 9f5201dcaa4737427da7ec37969556c574e4711f Mon Sep 17 00:00:00 2001 From: Friendika Date: Fri, 18 Mar 2011 00:30:34 -0700 Subject: edit posting after submission --- mod/network.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index abdf59c48..81c85f0ff 100644 --- a/mod/network.php +++ b/mod/network.php @@ -387,6 +387,9 @@ function network_content(&$a, $update = 0) { )); } + $edpost = ''; + if(($item['id'] == $item['parent']) && (intval($item['wall']) == 1)) + $edpost = ''; $drop = replace_macros(load_view_file('view/wall_item_drop.tpl'), array('$id' => $item['id'], '$delete' => t('Delete'))); $photo = $item['photo']; @@ -455,6 +458,7 @@ function network_content(&$a, $update = 0) { '$owner_photo' => $owner_photo, '$owner_name' => $owner_name, '$plink' => get_plink($item), + '$edpost' => $edpost, '$drop' => $drop, '$vote' => $likebuttons, '$like' => $like, -- cgit v1.2.3 From 798c83b6aa3887622299ec4071c0d817953f3db9 Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 21 Mar 2011 00:21:35 -0700 Subject: localise some more templates --- mod/network.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index 81c85f0ff..97bc0713d 100644 --- a/mod/network.php +++ b/mod/network.php @@ -65,7 +65,12 @@ function network_content(&$a, $update = 0) { $a->page['htmlhead'] .= replace_macros($tpl, array( '$baseurl' => $a->get_baseurl(), '$geotag' => $geotag, - '$nickname' => $a->user['nickname'] + '$nickname' => $a->user['nickname'], + '$linkurl' => t('Please enter a link URL:'), + '$utubeurl' => t('Please enter a YouTube link:'), + '$vidurl' => t("Please enter a video\x28.ogg\x29 link/URL:"), + '$audurl' => t("Please enter an audio\x28.ogg\x29 link/URL:"), + '$whereareu' => t('Where are you right now?') )); -- cgit v1.2.3 From c962f5c4bcc26fa7bad98a714cdb5e92b6acb57c Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 27 Mar 2011 19:53:36 -0700 Subject: comment collapsing, pagination wasn't advancing past 16 --- mod/network.php | 72 ++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 61 insertions(+), 11 deletions(-) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index 97bc0713d..08bc5af4c 100644 --- a/mod/network.php +++ b/mod/network.php @@ -183,8 +183,11 @@ function network_content(&$a, $update = 0) { intval($_SESSION['uid']) ); - if(count($r)) + if(count($r)) { $a->set_pager_total($r[0]['total']); + $a->set_pager_itemspage(40); + } + if($nouveau) { $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, @@ -203,21 +206,41 @@ function network_content(&$a, $update = 0) { ); } else { - $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, - `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, - `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`, - `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid` - FROM `item`, (SELECT `p`.`id`,`p`.`created` FROM `item` AS `p` WHERE `p`.`parent`=`p`.`id`) as `parentitem`, `contact` + $r = q("SELECT `item`.`id` AS `item_id`, `contact`.`uid` AS `contact_uid` + FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 - AND `contact`.`id` = `item`.`contact-id` AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 - AND `item`.`parent` = `parentitem`.`id` + AND `item`.`parent` = `item`.`id` $sql_extra - ORDER BY `parentitem`.`created` DESC, `item`.`gravity` ASC, `item`.`created` ASC LIMIT %d ,%d ", + ORDER BY `item`.`created` DESC LIMIT %d ,%d ", intval(local_user()), intval($a->pager['start']), intval($a->pager['itemspage']) ); + + $parents_arr = array(); + $parents_str = ''; + + if(count($r)) { + foreach($r as $rr) + $parents_arr[] = $rr['item_id']; + $parents_str = implode(', ', $parents_arr); + + $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, + `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, + `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`, + `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid` + FROM `item`, (SELECT `p`.`id`,`p`.`created` FROM `item` AS `p` WHERE `p`.`parent`=`p`.`id`) as `parentitem`, `contact` + WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 + AND `contact`.`id` = `item`.`contact-id` + AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 + AND `item`.`parent` = `parentitem`.`id` AND `item`.`parent` IN ( %s ) + $sql_extra + ORDER BY `parentitem`.`created` DESC, `item`.`gravity` ASC, `item`.`created` ASC ", + intval(local_user()), + dbesc($parents_str) + ); + } } $author_contacts = extract_item_authors($r,local_user()); @@ -302,15 +325,25 @@ function network_content(&$a, $update = 0) { } - + $comments = array(); + foreach($r as $rr) { + if(intval($rr['gravity']) == 6) { + if(! x($comments,$rr['parent'])) + $comments[$rr['parent']] = 1; + else + $comments[$rr['parent']] += 1; + } + } foreach($r as $item) { like_puller($a,$item,$alike,'like'); like_puller($a,$item,$dlike,'dislike'); } + $comments_collapsed = false; foreach($r as $item) { + $comment = ''; $template = $tpl; $commentww = ''; @@ -320,9 +353,26 @@ function network_content(&$a, $update = 0) { if(((activity_match($item['verb'],ACTIVITY_LIKE)) || (activity_match($item['verb'],ACTIVITY_DISLIKE))) && ($item['id'] != $item['parent'])) continue; - $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ; + if($item['id'] == $item['parent']) { + $comments_seen = 0; + $comments_collapsed = false; + } + else + $comments_seen ++; + + if(($comments[$item['parent']] > 2) && ($comments_seen <= ($comments[$item['parent']] - 2)) && ($item['gravity'] == 6)) { + if(! $comments_collapsed) { + $o .= ''; + $o .= ''; + } + $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ; $lock = ((($item['private']) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) || strlen($item['deny_cid']) || strlen($item['deny_gid'])))) -- cgit v1.2.3 From 7defb1768bff1c3da7ea63957cf8c7c928d379ab Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 27 Mar 2011 20:37:44 -0700 Subject: collapse posts by same author (but not you). --- mod/network.php | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index 08bc5af4c..21b818f9c 100644 --- a/mod/network.php +++ b/mod/network.php @@ -325,6 +325,7 @@ function network_content(&$a, $update = 0) { } + $comments = array(); foreach($r as $rr) { if(intval($rr['gravity']) == 6) { @@ -341,9 +342,11 @@ function network_content(&$a, $update = 0) { } $comments_collapsed = false; + $blowhard = 0; + $blowhard_count = 0; + foreach($r as $item) { - $comment = ''; $template = $tpl; $commentww = ''; @@ -354,6 +357,20 @@ function network_content(&$a, $update = 0) { continue; if($item['id'] == $item['parent']) { + if($blowhard == $item['cid'] && (! $item['self'])) { + $blowhard_count ++; + if($blowhard_count == 3) { + $o .= '' . ''; + } + } + $comments_seen = 0; $comments_collapsed = false; } @@ -369,7 +386,7 @@ function network_content(&$a, $update = 0) { } } if(($comments[$item['parent']] > 2) && ($comments_seen == ($comments[$item['parent']] - 1))) { - $o .= ''; + $o .= ''; } $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ; -- cgit v1.2.3 From 77fbd2f78c6a24201a26d5c4ec60ad5fb42c48dd Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 27 Mar 2011 20:43:45 -0700 Subject: tweaks to author collapsing --- mod/network.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index 21b818f9c..f68b399f8 100644 --- a/mod/network.php +++ b/mod/network.php @@ -365,10 +365,9 @@ function network_content(&$a, $update = 0) { } else { $blowhard = $item['cid']; - if($blowhard_count > 3) { - $blowhard_count = 0; + if($blowhard_count > 3) $o .= ''; - } + $blowhard_count = 0; } $comments_seen = 0; -- cgit v1.2.3 From 1f6c6c466a449ba422c4e67744577f6c35b3ce0b Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 28 Mar 2011 00:49:20 -0700 Subject: author collapse: close off before pagination --- mod/network.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index f68b399f8..17d36dfb2 100644 --- a/mod/network.php +++ b/mod/network.php @@ -546,6 +546,10 @@ function network_content(&$a, $update = 0) { } if(! $update) { + if($blowhard_count > 3) + $o .= ''; + + $o .= paginate($a); $o .= '
' . t('Shared content is covered by the Creative Commons Attribution 3.0 license.') . '
'; } -- cgit v1.2.3 From 00b5f6f8a1bdc004380fd75dd5e6dc52117dd6d7 Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 28 Mar 2011 17:24:11 -0700 Subject: added comments, make typo checker work with redefined plural string functions --- mod/network.php | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index 17d36dfb2..8e8fe8d1e 100644 --- a/mod/network.php +++ b/mod/network.php @@ -114,7 +114,7 @@ function network_content(&$a, $update = 0) { '$lockstate' => $lockstate, '$acl' => populate_acl((($group) ? $group_acl : $a->user), $celeb), '$bang' => (($group) ? '!' : ''), - '$profile_uid' => $_SESSION['uid'] + '$profile_uid' => local_user() )); @@ -190,6 +190,9 @@ function network_content(&$a, $update = 0) { if($nouveau) { + + // "New Item View" - show all items unthreaded in reverse created date order + $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`, @@ -206,6 +209,10 @@ function network_content(&$a, $update = 0) { ); } else { + + // Normal conversation view + // First fetch a known number of parent items + $r = q("SELECT `item`.`id` AS `item_id`, `contact`.`uid` AS `contact_uid` FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 @@ -218,6 +225,9 @@ function network_content(&$a, $update = 0) { intval($a->pager['itemspage']) ); + + // Then fetch all the children of the parents that are on this page + $parents_arr = array(); $parents_str = ''; @@ -243,6 +253,10 @@ function network_content(&$a, $update = 0) { } } + // find all the authors involved in remote conversations + // We will use a local profile photo if they are one of our contacts + // otherwise we have to get the photo from the item owner's site + $author_contacts = extract_item_authors($r,local_user()); $cmnt_tpl = load_view_file('view/comment_item.tpl'); @@ -258,6 +272,8 @@ function network_content(&$a, $update = 0) { if($nouveau) { + // "New Item View" - just loop through the items and format them minimally for display + $tpl = load_view_file('view/search_item.tpl'); $droptpl = load_view_file('view/wall_fake_drop.tpl'); @@ -325,6 +341,12 @@ function network_content(&$a, $update = 0) { } + // Normal View + + + // Figure out how many comments each parent has + // (Comments all have gravity of 6) + // Store the result in the $comments array $comments = array(); foreach($r as $rr) { @@ -336,6 +358,9 @@ function network_content(&$a, $update = 0) { } } + // map all the like/dislike activities for each parent item + // Store these in the $alike and $dlike arrays + foreach($r as $item) { like_puller($a,$item,$alike,'like'); like_puller($a,$item,$dlike,'dislike'); @@ -353,9 +378,18 @@ function network_content(&$a, $update = 0) { $sparkle = ''; $owner_url = $owner_photo = $owner_name = ''; - if(((activity_match($item['verb'],ACTIVITY_LIKE)) || (activity_match($item['verb'],ACTIVITY_DISLIKE))) && ($item['id'] != $item['parent'])) + + // We've already parsed out like/dislike for special treatment. We can ignore them now + + if(((activity_match($item['verb'],ACTIVITY_LIKE)) + || (activity_match($item['verb'],ACTIVITY_DISLIKE))) + && ($item['id'] != $item['parent'])) continue; + // Take care of author collapsing and comment collapsing + // If a single author has more than 3 consecutive top-level posts, squash the remaining ones. + // If there are more than two comments, squash all but the last 2. + if($item['id'] == $item['parent']) { if($blowhard == $item['cid'] && (! $item['self'])) { $blowhard_count ++; @@ -388,6 +422,8 @@ function network_content(&$a, $update = 0) { $o .= ''; } + + $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ; $lock = ((($item['private']) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) @@ -546,6 +582,9 @@ function network_content(&$a, $update = 0) { } if(! $update) { + + // if author collapsing is in force but didn't get closed, close it off now. + if($blowhard_count > 3) $o .= ''; -- cgit v1.2.3 From 920396e4024e56c3e00f1f159268c2aba16e4609 Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 28 Mar 2011 20:06:45 -0700 Subject: off by one --- mod/network.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index 8e8fe8d1e..2ff15a29b 100644 --- a/mod/network.php +++ b/mod/network.php @@ -399,7 +399,7 @@ function network_content(&$a, $update = 0) { } else { $blowhard = $item['cid']; - if($blowhard_count > 3) + if($blowhard_count >= 3) $o .= ''; $blowhard_count = 0; } @@ -585,7 +585,7 @@ function network_content(&$a, $update = 0) { // if author collapsing is in force but didn't get closed, close it off now. - if($blowhard_count > 3) + if($blowhard_count >= 3) $o .= ''; -- cgit v1.2.3 From 066bdca30dde91fd94c58707f638536ec0ba9002 Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 29 Mar 2011 18:57:26 -0700 Subject: optionally set article title --- mod/network.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index 2ff15a29b..39679b48a 100644 --- a/mod/network.php +++ b/mod/network.php @@ -70,7 +70,8 @@ function network_content(&$a, $update = 0) { '$utubeurl' => t('Please enter a YouTube link:'), '$vidurl' => t("Please enter a video\x28.ogg\x29 link/URL:"), '$audurl' => t("Please enter an audio\x28.ogg\x29 link/URL:"), - '$whereareu' => t('Where are you right now?') + '$whereareu' => t('Where are you right now?'), + '$title' => t('Enter a title for this item') )); @@ -101,6 +102,7 @@ function network_content(&$a, $update = 0) { '$audio' => t('Insert Vorbis [.ogg] audio'), '$setloc' => t('Set your location'), '$noloc' => t('Clear browser location'), + '$title' => t('Set title'), '$wait' => t('Please wait'), '$permset' => t('Permission settings'), '$content' => '', -- cgit v1.2.3 From 3f94721d6257b4fe31054682b258223b992c4011 Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Wed, 30 Mar 2011 17:10:14 +0200 Subject: first work --- mod/network.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index 39679b48a..84efe52ba 100644 --- a/mod/network.php +++ b/mod/network.php @@ -543,6 +543,8 @@ function network_content(&$a, $update = 0) { $indent .= ' shiny'; + $contact_url = $a->get_baseurl()."/contacts/".$item['cid']; + // Build the HTML $tmp_item = replace_macros($template,array( @@ -553,6 +555,9 @@ function network_content(&$a, $update = 0) { '$wall' => t('Wall-to-Wall'), '$vwall' => t('via Wall-To-Wall:'), '$profile_url' => $profile_link, + '$profile_tab_url' => $profile_link."?tab=profile", //don't work with secure redirects + '$contact_url' => $contact_url, + '$pm_url' => "", '$name' => $profile_name, '$thumb' => $profile_avatar, '$osparkle' => $osparkle, @@ -596,4 +601,4 @@ function network_content(&$a, $update = 0) { } return $o; -} \ No newline at end of file +} -- cgit v1.2.3 From fe67c346e5ed9f65fe25dd9337b6424c04d09c4a Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Thu, 31 Mar 2011 16:52:51 +0200 Subject: Moved popup logic in boot.php, added 'item_photo_menu' hook --- mod/network.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index 84efe52ba..13ce81abc 100644 --- a/mod/network.php +++ b/mod/network.php @@ -209,6 +209,7 @@ function network_content(&$a, $update = 0) { intval($a->pager['start']), intval($a->pager['itemspage']) ); + } else { @@ -315,11 +316,12 @@ function network_content(&$a, $update = 0) { $drop = replace_macros($droptpl,array('$id' => $item['id'])); $lock = '
'; - + $o .= replace_macros($tpl,array( '$id' => $item['item_id'], '$linktitle' => t('View $name\'s profile'), '$profile_url' => $profile_link, + '$item_photo_menu' => item_photo_menu($item), '$name' => $profile_name, '$sparkle' => $sparkle, '$lock' => $lock, @@ -543,7 +545,6 @@ function network_content(&$a, $update = 0) { $indent .= ' shiny'; - $contact_url = $a->get_baseurl()."/contacts/".$item['cid']; // Build the HTML @@ -555,9 +556,7 @@ function network_content(&$a, $update = 0) { '$wall' => t('Wall-to-Wall'), '$vwall' => t('via Wall-To-Wall:'), '$profile_url' => $profile_link, - '$profile_tab_url' => $profile_link."?tab=profile", //don't work with secure redirects - '$contact_url' => $contact_url, - '$pm_url' => "", + '$item_photo_menu' => item_photo_menu($item), '$name' => $profile_name, '$thumb' => $profile_avatar, '$osparkle' => $osparkle, -- cgit v1.2.3 From 9b50b0e16f2046b91cb4c734c56024524d8b178b Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 3 Apr 2011 20:41:40 -0700 Subject: Public exposure warning on affected network group pages. config-able so a plugin can shut it up. --- mod/network.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index 39679b48a..a304c211f 100644 --- a/mod/network.php +++ b/mod/network.php @@ -54,6 +54,14 @@ function network_content(&$a, $update = 0) { } if(! $update) { + if(group) { + if(($t = group_public_members($group)) && (! get_pconfig(local_user(),'system','nowarn_insecure'))) { + $plural_form = sprintf( tt('%d member', '%d members', $t), $t); + notice( sprintf( t('Warning: This group contains %s from an insecure network.'), $plural_form ) . EOL); + notice( t('Private messages to this group are at risk of public disclosure.') . EOL); + } + } + $o .= ''; $_SESSION['return_url'] = $a->cmd; -- cgit v1.2.3 From 5d5a94c88a173b95e902afc31a9a2e527b6d3098 Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 7 Apr 2011 16:19:46 -0700 Subject: comment open/close anomolies in non-English languages --- mod/network.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index 42c6c0c29..678a41f0a 100644 --- a/mod/network.php +++ b/mod/network.php @@ -502,6 +502,8 @@ function network_content(&$a, $update = 0) { '$mylink' => $a->contact['url'], '$mytitle' => t('This is you'), '$myphoto' => $a->contact['thumb'], + '$comment' => t('Comment'), + '$submit' => t('Submit'), '$ww' => $commentww )); } -- cgit v1.2.3 From a65c595b169eec63b9a9dddac14b72e88ba34a04 Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 10 Apr 2011 21:21:16 -0700 Subject: "display list of status items" moved to include/conversation.php, currently network module has been updated to use it for display, other modules to follow with whatever special case code they require. --- mod/network.php | 341 +------------------------------------------------------- 1 file changed, 3 insertions(+), 338 deletions(-) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index 678a41f0a..5461aae3f 100644 --- a/mod/network.php +++ b/mod/network.php @@ -32,8 +32,6 @@ function network_content(&$a, $update = 0) { $o = ''; - require_once("include/bbcode.php"); - $contact_id = $a->cid; $group = 0; @@ -264,347 +262,14 @@ function network_content(&$a, $update = 0) { } } - // find all the authors involved in remote conversations - // We will use a local profile photo if they are one of our contacts - // otherwise we have to get the photo from the item owner's site - - $author_contacts = extract_item_authors($r,local_user()); - - $cmnt_tpl = load_view_file('view/comment_item.tpl'); - $like_tpl = load_view_file('view/like.tpl'); - $noshare_tpl = load_view_file('view/like_noshare.tpl'); - $tpl = load_view_file('view/wall_item.tpl'); - $wallwall = load_view_file('view/wallwall_item.tpl'); - - $alike = array(); - $dlike = array(); - - if(count($r)) { - - if($nouveau) { - - // "New Item View" - just loop through the items and format them minimally for display - - $tpl = load_view_file('view/search_item.tpl'); - $droptpl = load_view_file('view/wall_fake_drop.tpl'); - - foreach($r as $item) { - - $comment = ''; - $owner_url = ''; - $owner_photo = ''; - $owner_name = ''; - $sparkle = ''; - - $profile_name = ((strlen($item['author-name'])) ? $item['author-name'] : $item['name']); - $profile_avatar = ((strlen($item['author-avatar'])) ? $item['author-avatar'] : $item['thumb']); - $profile_link = ((strlen($item['author-link'])) ? $item['author-link'] : $item['url']); - - $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ; - - if(strlen($item['author-link'])) { - if(link_compare($item['author-link'],$item['url']) && ($item['network'] === 'dfrn') && (! $item['self'])) { - $profile_link = $redirect_url; - $sparkle = ' sparkle'; - } - elseif(isset($author_contacts[$item['author-link']])) { - $profile_link = $a->get_baseurl() . '/redir/' . $author_contacts[$item['author-link']]; - $sparkle = ' sparkle'; - } - } - - $location = (($item['location']) ? '' . $item['location'] . '' : ''); - $coord = (($item['coord']) ? '' . $item['coord'] . '' : ''); - if($coord) { - if($location) - $location .= '
(' . $coord . ')'; - else - $location = '' . $coord . ''; - } - - $drop = replace_macros($droptpl,array('$id' => $item['id'])); - $lock = '
'; - - $o .= replace_macros($tpl,array( - '$id' => $item['item_id'], - '$linktitle' => t('View $name\'s profile'), - '$profile_url' => $profile_link, - '$item_photo_menu' => item_photo_menu($item), - '$name' => $profile_name, - '$sparkle' => $sparkle, - '$lock' => $lock, - '$thumb' => $profile_avatar, - '$title' => $item['title'], - '$body' => smilies(bbcode($item['body'])), - '$ago' => relative_date($item['created']), - '$location' => $location, - '$indent' => '', - '$owner_url' => $owner_url, - '$owner_photo' => $owner_photo, - '$owner_name' => $owner_name, - '$drop' => $drop, - '$conv' => '' . t('View in context') . '' - )); - - } - $o .= paginate($a); - - return $o; - - } - - // Normal View + $mode = (($nouveau) ? 'network-new' : 'network'); + require_once('include/conversation.php'); - // Figure out how many comments each parent has - // (Comments all have gravity of 6) - // Store the result in the $comments array - - $comments = array(); - foreach($r as $rr) { - if(intval($rr['gravity']) == 6) { - if(! x($comments,$rr['parent'])) - $comments[$rr['parent']] = 1; - else - $comments[$rr['parent']] += 1; - } - } - - // map all the like/dislike activities for each parent item - // Store these in the $alike and $dlike arrays - - foreach($r as $item) { - like_puller($a,$item,$alike,'like'); - like_puller($a,$item,$dlike,'dislike'); - } - - $comments_collapsed = false; - $blowhard = 0; - $blowhard_count = 0; - - foreach($r as $item) { - - $comment = ''; - $template = $tpl; - $commentww = ''; - $sparkle = ''; - $owner_url = $owner_photo = $owner_name = ''; - - - // We've already parsed out like/dislike for special treatment. We can ignore them now - - if(((activity_match($item['verb'],ACTIVITY_LIKE)) - || (activity_match($item['verb'],ACTIVITY_DISLIKE))) - && ($item['id'] != $item['parent'])) - continue; - - // Take care of author collapsing and comment collapsing - // If a single author has more than 3 consecutive top-level posts, squash the remaining ones. - // If there are more than two comments, squash all but the last 2. - - if($item['id'] == $item['parent']) { - if($blowhard == $item['cid'] && (! $item['self'])) { - $blowhard_count ++; - if($blowhard_count == 3) { - $o .= '' . ''; - $blowhard_count = 0; - } - - $comments_seen = 0; - $comments_collapsed = false; - } - else - $comments_seen ++; - - - if(($comments[$item['parent']] > 2) && ($comments_seen <= ($comments[$item['parent']] - 2)) && ($item['gravity'] == 6)) { - if(! $comments_collapsed) { - $o .= ''; - $o .= ''; - } - - - - $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ; - - $lock = ((($item['private']) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) - || strlen($item['deny_cid']) || strlen($item['deny_gid'])))) - ? '
' . t('Private Message') . '
' - : '
'); - - - // 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') { - // I do. Put me on the left of the wall-to-wall notice. - $owner_url = $a->contact['url']; - $owner_photo = $a->contact['thumb']; - $owner_name = $a->contact['name']; - $template = $wallwall; - $commentww = 'ww'; - } - if(($item['type'] === 'remote') && (strlen($item['owner-link'])) && ($item['owner-link'] != $item['author-link'])) { - // Could be anybody. - $owner_url = $item['owner-link']; - $owner_photo = $item['owner-avatar']; - $owner_name = $item['owner-name']; - $template = $wallwall; - $commentww = 'ww'; - // If it is our contact, use a friendly redirect link - if((link_compare($item['owner-link'],$item['url'])) - && ($item['network'] === 'dfrn')) { - $owner_url = $redirect_url; - $osparkle = ' sparkle'; - } - } - } - - if($update) - $return_url = $_SESSION['return_url']; - else - $return_url = $_SESSION['return_url'] = $a->cmd; - - $likebuttons = ''; - if($item['id'] == $item['parent']) { - $likebuttons = replace_macros((($item['private']) ? $noshare_tpl : $like_tpl),array( - '$id' => $item['id'], - '$likethis' => t("I like this \x28toggle\x29"), - '$nolike' => t("I don't like this \x28toggle\x29"), - '$share' => t('Share'), - '$wait' => t('Please wait') - )); - } - - if($item['last-child']) { - $comment = replace_macros($cmnt_tpl,array( - '$return_path' => '', - '$jsreload' => '', // $_SESSION['return_url'], - '$type' => 'net-comment', - '$id' => $item['item_id'], - '$parent' => $item['parent'], - '$profile_uid' => $_SESSION['uid'], - '$mylink' => $a->contact['url'], - '$mytitle' => t('This is you'), - '$myphoto' => $a->contact['thumb'], - '$comment' => t('Comment'), - '$submit' => t('Submit'), - '$ww' => $commentww - )); - } - - $edpost = ''; - if(($item['id'] == $item['parent']) && (intval($item['wall']) == 1)) - $edpost = ''; - $drop = replace_macros(load_view_file('view/wall_item_drop.tpl'), array('$id' => $item['id'], '$delete' => t('Delete'))); - - $photo = $item['photo']; - $thumb = $item['thumb']; - - // Post was remotely authored. - - $diff_author = ((link_compare($item['url'],$item['author-link'])) ? false : true); - - $profile_name = (((strlen($item['author-name'])) && $diff_author) ? $item['author-name'] : $item['name']); - $profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $thumb); - - if(strlen($item['author-link'])) { - $profile_link = $item['author-link']; - if(link_compare($item['author-link'],$item['url']) && ($item['network'] === 'dfrn') && (! $item['self'])) { - $profile_link = $redirect_url; - $sparkle = ' sparkle'; - } - elseif(isset($author_contacts[$item['author-link']])) { - $profile_link = $a->get_baseurl() . '/redir/' . $author_contacts[$item['author-link']]; - $sparkle = ' sparkle'; - } - } - else - $profile_link = $item['url']; - - $like = ((x($alike,$item['id'])) ? format_like($alike[$item['id']],$alike[$item['id'] . '-l'],'like',$item['id']) : ''); - $dislike = ((x($dlike,$item['id'])) ? format_like($dlike[$item['id']],$dlike[$item['id'] . '-l'],'dislike',$item['id']) : ''); - - $location = (($item['location']) ? '' . $item['location'] . '' : ''); - $coord = (($item['coord']) ? '' . $item['coord'] . '' : ''); - if($coord) { - if($location) - $location .= '
(' . $coord . ')'; - else - $location = '' . $coord . ''; - } - - $indent = (($item['parent'] != $item['item_id']) ? ' comment' : ''); - - if(strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC','now - 12 hours')) > 0) - $indent .= ' shiny'; - - - - // Build the HTML - - $tmp_item = replace_macros($template,array( - '$id' => $item['item_id'], - '$linktitle' => t('View $name\'s profile'), - '$olinktitle' => t('View $owner_name\'s profile'), - '$to' => t('to'), - '$wall' => t('Wall-to-Wall'), - '$vwall' => t('via Wall-To-Wall:'), - '$profile_url' => $profile_link, - '$item_photo_menu' => item_photo_menu($item), - '$name' => $profile_name, - '$thumb' => $profile_avatar, - '$osparkle' => $osparkle, - '$sparkle' => $sparkle, - '$title' => $item['title'], - '$body' => smilies(bbcode($item['body'])), - '$ago' => relative_date($item['created']), - '$lock' => $lock, - '$location' => $location, - '$indent' => $indent, - '$owner_url' => $owner_url, - '$owner_photo' => $owner_photo, - '$owner_name' => $owner_name, - '$plink' => get_plink($item), - '$edpost' => $edpost, - '$drop' => $drop, - '$vote' => $likebuttons, - '$like' => $like, - '$dislike' => $dislike, - '$comment' => $comment - )); - - $arr = array('item' => $item, 'output' => $tmp_item); - call_hooks('display_item', $arr); - - $o .= $arr['output']; - - } - } + $o .= conversation($a,$r,$mode,$update); if(! $update) { - // if author collapsing is in force but didn't get closed, close it off now. - - if($blowhard_count >= 3) - $o .= ''; - - $o .= paginate($a); $o .= '
' . t('Shared content is covered by the Creative Commons Attribution 3.0 license.') . '
'; } -- cgit v1.2.3 From c8f32536ff77193689efe69702f91122f97c1f36 Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 11 Apr 2011 03:22:09 -0700 Subject: pull in new 'writable' dfrn flag --- mod/network.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index 5461aae3f..29b852c07 100644 --- a/mod/network.php +++ b/mod/network.php @@ -202,7 +202,7 @@ function network_content(&$a, $update = 0) { // "New Item View" - show all items unthreaded in reverse created date order $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, - `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, + `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, `contact`.`writable`, `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`, `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid` FROM `item`, `contact` @@ -246,7 +246,7 @@ function network_content(&$a, $update = 0) { $parents_str = implode(', ', $parents_arr); $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, - `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, + `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, `contact`.`writable`, `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`, `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid` FROM `item`, (SELECT `p`.`id`,`p`.`created` FROM `item` AS `p` WHERE `p`.`parent`=`p`.`id`) as `parentitem`, `contact` -- cgit v1.2.3 From a4836ac1ba1c92f54d286621592f3f332603ff07 Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 11 Apr 2011 16:15:38 -0700 Subject: wallwall oddities on display page --- mod/network.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index 29b852c07..1b5ea5d65 100644 --- a/mod/network.php +++ b/mod/network.php @@ -262,6 +262,9 @@ function network_content(&$a, $update = 0) { } } + // Set this so that the conversation function can find out contact info for our wall-wall items + $a->page_contact = $a->contact; + $mode = (($nouveau) ? 'network-new' : 'network'); require_once('include/conversation.php'); -- cgit v1.2.3 From 5654ce926ca012acd9f725c8c7d6e32609a17646 Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 12 Apr 2011 17:58:16 -0700 Subject: move all message display sub-functions from boot.php into conversation.php --- mod/network.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index 1b5ea5d65..35b6a299b 100644 --- a/mod/network.php +++ b/mod/network.php @@ -27,6 +27,8 @@ function network_init(&$a) { function network_content(&$a, $update = 0) { + require_once('include/conversation.php'); + if(! local_user()) return login(false); @@ -267,8 +269,6 @@ function network_content(&$a, $update = 0) { $mode = (($nouveau) ? 'network-new' : 'network'); - require_once('include/conversation.php'); - $o .= conversation($a,$r,$mode,$update); if(! $update) { -- cgit v1.2.3 From f04e2e70447e433bdc6acb2094fd988a995d1c08 Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 12 Apr 2011 18:22:58 -0700 Subject: edit group links on network page --- mod/network.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index 35b6a299b..f0a071cbf 100644 --- a/mod/network.php +++ b/mod/network.php @@ -21,7 +21,7 @@ function network_init(&$a) { $a->page['aside'] .= ''; - $a->page['aside'] .= group_side('network','network'); + $a->page['aside'] .= group_side('network','network',true); } -- cgit v1.2.3 From ab099e91028122dfb6b10cf9510b1b061f6f547f Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 17 Apr 2011 23:27:11 -0700 Subject: email integration, cont. --- mod/network.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index f0a071cbf..746206031 100644 --- a/mod/network.php +++ b/mod/network.php @@ -94,6 +94,28 @@ function network_content(&$a, $update = 0) { $jotplugins = ''; $jotnets = ''; + + + $mail_enabled = false; + $pubmail_enabled = false; + + + $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1", + intval(local_user()) + ); + if(count($r)) { + $mail_enabled = true; + if(intval($r[0]['pubmail'])) + $pubmail_enabled = true; + } + + if($mail_enabled) { + $selected = (($pubmail_enabled) ? ' checked="checked" ' : ''); + $jotnets .= '
' + . t("Post to Email") . '
'; + } + + call_hooks('jot_tool', $jotplugins); call_hooks('jot_networks', $jotnets); -- cgit v1.2.3 From a0179235d2d4672ba9dc79b33505555766b3228a Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 18 Apr 2011 20:20:04 -0700 Subject: provide a way to disable mailbox integration --- mod/network.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index 746206031..9061dff0f 100644 --- a/mod/network.php +++ b/mod/network.php @@ -95,18 +95,20 @@ function network_content(&$a, $update = 0) { $jotplugins = ''; $jotnets = ''; + $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1); $mail_enabled = false; $pubmail_enabled = false; - - $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1", - intval(local_user()) - ); - if(count($r)) { - $mail_enabled = true; - if(intval($r[0]['pubmail'])) - $pubmail_enabled = true; + if(! $mail_disabled) { + $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1", + intval(local_user()) + ); + if(count($r)) { + $mail_enabled = true; + if(intval($r[0]['pubmail'])) + $pubmail_enabled = true; + } } if($mail_enabled) { -- cgit v1.2.3 From d874a55178cce01195b23296bbae6365807dc300 Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 19 Apr 2011 20:50:02 -0700 Subject: per contact network page (link in photo menu) --- mod/network.php | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index 9061dff0f..9d5fb5b84 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) { + + $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) && (! $update)) + if((! $group) && (! $cid) && (! $update)) $o .= get_birthdays(); -- cgit v1.2.3 From 3787e1e500b72db49958c15ebe8991caaf06ec4d Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 19 Apr 2011 21:09:25 -0700 Subject: provide disclosure warning on private network page --- mod/network.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index 9d5fb5b84..3e6c5dc4a 100644 --- a/mod/network.php +++ b/mod/network.php @@ -212,13 +212,17 @@ function network_content(&$a, $update = 0) { } elseif($cid) { - $r = q("SELECT `id`,`name` FROM `contact` WHERE `id` = %d + $r = q("SELECT `id`,`name`,`network`,`writable` 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; + if($r[0]['network'] !== NETWORK_MAIL && $r[0]['network'] !== NETWORK_DFRN && $r[0]['writable'] && (! get_pconfig(local_user(),'system','nowarn_insecure'))) { + notice( t('Private messages to this person are at risk of public disclosure.') . EOL); + } + } else { notice( t('Invalid contact.') . EOL); -- cgit v1.2.3 From e302741e49adc73150bcd3027de1fdb157600a9b Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 20 Apr 2011 05:48:12 -0700 Subject: merge status editor instances --- mod/network.php | 94 ++++++++------------------------------------------------- 1 file changed, 12 insertions(+), 82 deletions(-) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index 3e6c5dc4a..f40d34353 100644 --- a/mod/network.php +++ b/mod/network.php @@ -71,91 +71,21 @@ function network_content(&$a, $update = 0) { $_SESSION['return_url'] = $a->cmd; - $geotag = (($a->user['allow_location']) ? load_view_file('view/jot_geotag.tpl') : ''); - - $tpl = load_view_file('view/jot-header.tpl'); - - $a->page['htmlhead'] .= replace_macros($tpl, array( - '$baseurl' => $a->get_baseurl(), - '$geotag' => $geotag, - '$nickname' => $a->user['nickname'], - '$linkurl' => t('Please enter a link URL:'), - '$utubeurl' => t('Please enter a YouTube link:'), - '$vidurl' => t("Please enter a video\x28.ogg\x29 link/URL:"), - '$audurl' => t("Please enter an audio\x28.ogg\x29 link/URL:"), - '$whereareu' => t('Where are you right now?'), - '$title' => t('Enter a title for this item') - )); - - - $tpl = load_view_file("view/jot.tpl"); - - if(($group) || (is_array($a->user) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))))) - $lockstate = 'lock'; - else - $lockstate = 'unlock'; - $celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false); - $jotplugins = ''; - $jotnets = ''; - - $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1); - - $mail_enabled = false; - $pubmail_enabled = false; - - if(! $mail_disabled) { - $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1", - intval(local_user()) - ); - if(count($r)) { - $mail_enabled = true; - if(intval($r[0]['pubmail'])) - $pubmail_enabled = true; - } - } - - if($mail_enabled) { - $selected = (($pubmail_enabled) ? ' checked="checked" ' : ''); - $jotnets .= '
' - . t("Post to Email") . '
'; - } - - - call_hooks('jot_tool', $jotplugins); - call_hooks('jot_networks', $jotnets); - - $tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins)); - - $o .= replace_macros($tpl,array( - '$return_path' => $a->cmd, - '$action' => 'item', - '$share' => t('Share'), - '$upload' => t('Upload photo'), - '$weblink' => t('Insert web link'), - '$youtube' => t('Insert YouTube video'), - '$video' => t('Insert Vorbis [.ogg] video'), - '$audio' => t('Insert Vorbis [.ogg] audio'), - '$setloc' => t('Set your location'), - '$noloc' => t('Clear browser location'), - '$title' => t('Set title'), - '$wait' => t('Please wait'), - '$permset' => t('Permission settings'), - '$content' => '', - '$post_id' => '', - '$baseurl' => $a->get_baseurl(), - '$defloc' => $a->user['default-location'], - '$visitor' => 'block', - '$emailcc' => t('CC: email addresses'), - '$jotnets' => $jotnets, - '$emtitle' => t('Example: bob@example.com, mary@example.com'), - '$lockstate' => $lockstate, - '$acl' => populate_acl((($group || $cid) ? $def_acl : $a->user), $celeb), - '$bang' => (($group || $cid) ? '!' : ''), - '$profile_uid' => local_user() - )); + $x = array( + 'is_owner' => true, + 'allow_location' => $a->user['allow_location'], + 'default_location' => $a->user['default_location'], + 'nickname' => $a->user['nickname'], + 'lockstate' => ((($group) || (is_array($a->user) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))))) ? 'lock' : 'unlock'), + 'acl' => populate_acl((($group || $cid) ? $def_acl : $a->user), $celeb), + 'bang' => (($group || $cid) ? '!' : ''), + 'visitor' => 'block', + 'profile_uid' => local_user() + ); + $o .= status_editor($a,$x); // The special div is needed for liveUpdate to kick in for this page. // We only launch liveUpdate if you are on the front page, you aren't -- cgit v1.2.3 From a01c40a845ae96d44ca58859cb2bc54ad6cd0b3d Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 26 Apr 2011 05:45:53 -0700 Subject: no insecure warning on FB connections --- mod/network.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index f40d34353..ae991e6ee 100644 --- a/mod/network.php +++ b/mod/network.php @@ -149,7 +149,7 @@ function network_content(&$a, $update = 0) { 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; - if($r[0]['network'] !== NETWORK_MAIL && $r[0]['network'] !== NETWORK_DFRN && $r[0]['writable'] && (! get_pconfig(local_user(),'system','nowarn_insecure'))) { + if($r[0]['network'] !== NETWORK_MAIL && $r[0]['network'] !== NETWORK_DFRN && $r[0]['network'] !== NETWORK_FACEBOOK && $r[0]['writable'] && (! get_pconfig(local_user(),'system','nowarn_insecure'))) { notice( t('Private messages to this person are at risk of public disclosure.') . EOL); } -- cgit v1.2.3 From 69dc17eb81fb0e0f0a21b4495807aa24cb90fa18 Mon Sep 17 00:00:00 2001 From: Friendika Date: Sat, 30 Apr 2011 21:53:51 -0700 Subject: when viewing network group, show my private conversations to the group --- mod/network.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index ae991e6ee..8846b8086 100644 --- a/mod/network.php +++ b/mod/network.php @@ -137,7 +137,7 @@ function network_content(&$a, $update = 0) { notice( t('Group is empty')); } - $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 ) OR `allow_gid` REGEXP '<" . intval($group) . ">' )) "; $o = '

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

' . $o; } elseif($cid) { -- cgit v1.2.3 From 5f0b43485a9bab882f6ac6a0c7c7667f9f2a188a Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 4 May 2011 20:49:11 -0700 Subject: incorrect count of total pages in normal view mode --- mod/network.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index 8846b8086..7ad5058bf 100644 --- a/mod/network.php +++ b/mod/network.php @@ -164,11 +164,13 @@ function network_content(&$a, $update = 0) { if((! $group) && (! $cid) && (! $update)) $o .= get_birthdays(); + $sql_extra2 = (($nouveau) ? '' : " AND `item`.`parent` = `item`.`id` "); $r = q("SELECT COUNT(*) AS `total` FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 + $sql_extra2 $sql_extra ", intval($_SESSION['uid']) ); -- cgit v1.2.3 From 22cf6b3fe681af22b23de48610cb4801b742b04b Mon Sep 17 00:00:00 2001 From: Friendika Date: Fri, 20 May 2011 19:28:48 -0700 Subject: 'mark seen' not getting all msgs on profile page --- mod/network.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index 7ad5058bf..16739b434 100644 --- a/mod/network.php +++ b/mod/network.php @@ -100,14 +100,16 @@ function network_content(&$a, $update = 0) { } - // We aren't going to try and figure out at the item, group, and page level - // which items you've seen and which you haven't. You're looking at some - // subset of items, so just mark everything seen. + // We aren't going to try and figure out at the item, group, and page + // level which items you've seen and which you haven't. If you're looking + // at the top level network page just mark everything seen. - $r = q("UPDATE `item` SET `unseen` = 0 - WHERE `unseen` = 1 AND `uid` = %d", - intval($_SESSION['uid']) - ); + if((! $group) && (! $cid)) { + $r = q("UPDATE `item` SET `unseen` = 0 + WHERE `unseen` = 1 AND `uid` = %d", + intval($_SESSION['uid']) + ); + } // We don't have to deal with ACL's on this page. You're looking at everything // that belongs to you, hence you can see all of it. We will filter by group if -- cgit v1.2.3