From c8f32536ff77193689efe69702f91122f97c1f36 Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 11 Apr 2011 03:22:09 -0700 Subject: [PATCH] pull in new 'writable' dfrn flag --- boot.php | 12 ++++++++++++ include/notifier.php | 1 + mod/display.php | 2 +- mod/network.php | 4 ++-- mod/photos.php | 17 +++++++---------- mod/profile.php | 2 +- mod/search.php | 2 +- 7 files changed, 25 insertions(+), 15 deletions(-) diff --git a/boot.php b/boot.php index 5d8417bd2..2a4c29c1a 100644 --- a/boot.php +++ b/boot.php @@ -73,6 +73,18 @@ define ( 'PAGE_SOAPBOX', 1 ); define ( 'PAGE_COMMUNITY', 2 ); define ( 'PAGE_FREELOVE', 3 ); +/** + * Network and protocol family types + */ + +define ( 'NETWORK_DFRN', 'dfrn'); // Friendika, Mistpark, other DFRN implementations +define ( 'NETWORK_OSTATUS', 'stat'); // status.net, identi.ca, GNU-social, other OStatus implementations +define ( 'NETWORK_FEED', 'feed'); // RSS/Atom feeds with no known "post/notify" protocol +define ( 'NETWORK_DIASPORA', 'dspr'); // Diaspora +define ( 'NETWORK_MAIL', 'mail'); // IMAP/POP +define ( 'NETWORK_FACEBOOK', 'face'); // Facebook API + + /** * Maximum number of "people who like (or don't like) this" that we will list by name */ diff --git a/include/notifier.php b/include/notifier.php index ca2304845..9d74f8b9b 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -354,6 +354,7 @@ function notifier_run($argv, $argc){ case 'mail': case 'dspr': case 'feed': + case 'face': default: break; } diff --git a/mod/display.php b/mod/display.php index fb69523e9..dd880907e 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`.`rel`, - `contact`.`network`, `contact`.`thumb`, `contact`.`self`, + `contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`, `contact`.`id` AS `cid`, `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 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` diff --git a/mod/photos.php b/mod/photos.php index 2e0ccd248..757b4685d 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -1259,17 +1259,14 @@ function photos_content(&$a) { if(count($r)) { foreach($r as $rr) { $o .= replace_macros($tpl,array( - '$id' => $rr['id'], - '$photolink' => $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] - . '/image/' . $rr['resource-id'], + '$id' => $rr['id'], + '$photolink' => $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $rr['resource-id'], '$phototitle' => t('View Photo'), - '$imgsrc' => $a->get_baseurl() . '/photo/' - . $rr['resource-id'] . '-' . ((($rr['scale']) == 6) ? 4 : $rr['scale']) . '.jpg', - '$albumlink' => $a->get_baseurl() . '/photos/' - . $a->data['user']['nickname'] . '/album/' . bin2hex($rr['album']), - '$albumname' => $rr['album'], - '$albumalt' => t('View Album'), - '$imgalt' => $rr['filename'] + '$imgsrc' => $a->get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . ((($rr['scale']) == 6) ? 4 : $rr['scale']) . '.jpg', + '$albumlink' => $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($rr['album']), + '$albumname' => $rr['album'], + '$albumalt' => t('View Album'), + '$imgalt' => $rr['filename'] )); } diff --git a/mod/profile.php b/mod/profile.php index f98c28f8f..a12fd9af2 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -272,7 +272,7 @@ function profile_content(&$a, $update = 0) { $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`network`, `contact`.`rel`, - `contact`.`thumb`, `contact`.`self`, + `contact`.`thumb`, `contact`.`self`, `contact`.`writable`, `contact`.`id` AS `cid`, `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 diff --git a/mod/search.php b/mod/search.php index e0a8506b6..23b2ddb7e 100644 --- a/mod/search.php +++ b/mod/search.php @@ -65,7 +65,7 @@ function search_content(&$a) { $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, - `contact`.`network`, `contact`.`thumb`, `contact`.`self`, + `contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`, `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`, `user`.`nickname` FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`