From 358ffaef24e961dc6afd61090e86be1921106ca2 Mon Sep 17 00:00:00 2001 From: "Zvi ben Yaakov (a.k.a rdc)" Date: Mon, 18 Jun 2012 21:12:13 +0300 Subject: [PATCH 01/30] Added get_cached_avatar_image to App class for shared profile image access and reduced sql queries/load --- boot.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/boot.php b/boot.php index 06f18b7845..465bdf0c11 100644 --- a/boot.php +++ b/boot.php @@ -332,6 +332,9 @@ if(! class_exists('App')) { private $curl_code; private $curl_headers; + private $cached_profile_image; + private $cached_profile_picdate; + function __construct() { global $default_timezone; @@ -543,6 +546,28 @@ if(! class_exists('App')) { return $this->curl_headers; } + function get_cached_avatar_image($avatar_image){ + if($this->cached_profile_image[$avatar_image]) + return $this->cached_profile_image[$avatar_image]; + + $path_parts = explode("/",$avatar_image); + $common_filename = $path_parts[count($path_parts)-1]; + + if($this->cached_profile_picdate[$common_filename]){ + $this->cached_profile_image[$avatar_image] = $avatar_image . $this->cached_profile_picdate[$common_filename]; + } else { + $r = q("SELECT `contact`.`avatar-date` AS picdate FROM `contact` WHERE `contact`.`thumb` like \"%%/%s\"", + $common_filename); + if(! count($r)){ + $this->cached_profile_image[$avatar_image] = $avatar_image; + } else { + $this->cached_profile_picdate[$common_filename] = "?rev=" . urlencode($r[0]['picdate']); + $this->cached_profile_image[$avatar_image] = $avatar_image . $this->cached_profile_picdate[$common_filename]; + } + } + return $this->cached_profile_image[$avatar_image]; + } + } } From 88e7fe67de734035ec35621dd0dc4b29807e8ed6 Mon Sep 17 00:00:00 2001 From: "Zvi ben Yaakov (a.k.a rdc)" Date: Mon, 18 Jun 2012 21:17:02 +0300 Subject: [PATCH 02/30] Beginning to use App::get_cached_avatar_image for loading profile images in conversations --- include/conversation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/conversation.php b/include/conversation.php index 1d5a92284a..ee012232e2 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -308,7 +308,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { if(($normalised != 'mailbox') && (x($a->contacts[$normalised]))) $profile_avatar = $a->contacts[$normalised]['thumb']; else - $profile_avatar = ((strlen($item['author-avatar'])) ? $item['author-avatar'] : $item['thumb']); + $profile_avatar = ((strlen($item['author-avatar'])) ? $a->get_cached_avatar_image($item['author-avatar']) : $item['thumb']); $locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => ''); call_hooks('render_location',$locate); From 47650a0ee216463de43f7e837fcbbd5a5a0d8481 Mon Sep 17 00:00:00 2001 From: "Zvi ben Yaakov (a.k.a rdc)" Date: Mon, 18 Jun 2012 21:59:58 +0300 Subject: [PATCH 03/30] Now using App::get_cached_avatar_image for /directory page --- mod/directory.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/directory.php b/mod/directory.php index 7f3a44ff42..930a575b66 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -73,7 +73,7 @@ function directory_content(&$a) { $order = " ORDER BY `name` ASC "; - $r = q("SELECT `profile`.*, `profile`.`uid` AS `profile_uid`, `contact`.`avatar-date` AS picdate, `user`.`nickname`, `user`.`timezone` FROM `profile` LEFT join `contact` on `contact`.`uid` = `profile`.`uid` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` WHERE `is-default` = 1 AND `self` = 1 $publish AND `user`.`blocked` = 0 $sql_extra $order LIMIT %d , %d ", + $r = q("SELECT `profile`.*, `profile`.`uid` AS `profile_uid`, `user`.`nickname`, `user`.`timezone` FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 $sql_extra $order LIMIT %d , %d ", intval($a->pager['start']), intval($a->pager['itemspage']) ); @@ -116,7 +116,7 @@ function directory_content(&$a) { $entry = replace_macros($tpl,array( '$id' => $rr['id'], '$profile-link' => $profile_link, - '$photo' => $rr[$photo] . '?rev=' . urlencode($rr['picdate']), + '$photo' => $a->get_cached_avatar_image($rr[$photo]), '$alt-text' => $rr['name'], '$name' => $rr['name'], '$details' => $pdesc . $details From 428fce633feea10d0ba1b04be34a82fbc4448904 Mon Sep 17 00:00:00 2001 From: "Zvi ben Yaakov (a.k.a rdc)" Date: Mon, 18 Jun 2012 22:09:00 +0300 Subject: [PATCH 04/30] Now using App::get_cached_avatar_image for navigation bar --- include/nav.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/nav.php b/include/nav.php index d760cc8ae5..a67a8b6141 100644 --- a/include/nav.php +++ b/include/nav.php @@ -53,9 +53,9 @@ function nav(&$a) { $nav['usermenu'][] = Array('notes/', t('Personal notes'), "", t('Your personal photos')); // user info - $r = q("SELECT `micro`,`avatar-date` FROM `contact` WHERE uid=%d AND self=1", intval($a->user['uid'])); + $r = q("SELECT micro FROM contact WHERE uid=%d AND self=1", intval($a->user['uid'])); $userinfo = array( - 'icon' => (count($r) ? $r[0]['micro']."?rev=".urlencode($r[0]['avatar-date']): $a->get_baseurl($ssl_state)."/images/person-48.jpg"), + 'icon' => (count($r) ? $a->get_cached_avatar_image($r[0]['micro']) : $a->get_baseurl($ssl_state)."/images/person-48.jpg"), 'name' => $a->user['username'], ); From 0c5476c6f27812e57ec515f330e3677080be29de Mon Sep 17 00:00:00 2001 From: "Zvi ben Yaakov (a.k.a rdc)" Date: Mon, 18 Jun 2012 22:18:43 +0300 Subject: [PATCH 05/30] Now using App::get_cached_avatar_image for /profile/{nickname} page --- mod/profiles.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/profiles.php b/mod/profiles.php index 7b6e61ad6a..a9da5454cf 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -635,7 +635,7 @@ function profiles_content(&$a) { } else { - $r = q("SELECT `profile`.*, `contact`.`avatar-date` AS picdate FROM `profile` LEFT JOIN `contact` on `contact`.`uid` = `profile`.`uid` WHERE `profile`.`uid` = %d and contact.self = 1", + $r = q("SELECT * FROM `profile` WHERE `uid` = %d", local_user()); if(count($r)) { @@ -652,7 +652,7 @@ function profiles_content(&$a) { foreach($r as $rr) { $o .= replace_macros($tpl, array( - '$photo' => $rr['thumb'] . '?rev=' . urlencode($rr['picdate']), + '$photo' => $a->get_cached_avatar_image($rr['thumb']), '$id' => $rr['id'], '$alt' => t('Profile Image'), '$profile_name' => $rr['profile-name'], From d1f81fff6b3d9528a2576ce4231479fddd01ba75 Mon Sep 17 00:00:00 2001 From: "Zvi ben Yaakov (a.k.a rdc)" Date: Mon, 18 Jun 2012 22:41:43 +0300 Subject: [PATCH 06/30] Now using App::get_cached_avatar_image for /photos page --- mod/photos.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/photos.php b/mod/photos.php index a6552994e5..c6065f3cad 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -16,7 +16,7 @@ function photos_init(&$a) { if($a->argc > 1) { $nick = $a->argv[1]; - $r = q("SELECT `user`.*, `contact`.`avatar-date` AS picdate FROM `user` LEFT JOIN `contact` on `contact`.`uid` = `user`.`uid` WHERE `user`.`nickname` = '%s' AND `user`.`blocked` = 0 LIMIT 1", + $r = q("SELECT * FROM `user` WHERE `nickname` = '%s' AND `blocked` = 0 LIMIT 1", dbesc($nick) ); @@ -36,7 +36,7 @@ function photos_init(&$a) { $o .= '
'; $o .= '
' . $a->data['user']['username'] . '
'; - $o .= '
' . $a->data['user']['username'] . '
'; + $o .= '
' . $a->data['user']['username'] . '
'; $o .= '
'; if(! intval($a->data['user']['hidewall'])) { From 45b4867bd31d54f76a366cdda68b5f90f2bca3b2 Mon Sep 17 00:00:00 2001 From: "Zvi ben Yaakov (a.k.a rdc)" Date: Tue, 19 Jun 2012 21:40:14 +0300 Subject: [PATCH 07/30] Added App::get_cached_avatar_image usage on conversation wall of Normal View --- include/conversation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/conversation.php b/include/conversation.php index ee012232e2..2244e8df7f 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -657,7 +657,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { if(($normalised != 'mailbox') && (x($a->contacts,$normalised))) $profile_avatar = $a->contacts[$normalised]['thumb']; else - $profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $thumb); + $profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $a->get_cached_avatar_image($thumb)); $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']) : ''); From 5b057e5dee09e0cab5b78bb9b2ac2e27d59a11f7 Mon Sep 17 00:00:00 2001 From: "Zvi ben Yaakov (a.k.a rdc)" Date: Tue, 19 Jun 2012 22:24:31 +0300 Subject: [PATCH 08/30] Added App::get_cached_avater_image usage in profile_sidebar function for creating the $diaspora array that is used to populate diaspora_vcard.tpl. This allows the correct profile image revision to be used when dfrn_request friend requests are made. --- boot.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/boot.php b/boot.php index 465bdf0c11..ecd95acecc 100644 --- a/boot.php +++ b/boot.php @@ -1155,9 +1155,9 @@ if(! function_exists('profile_sidebar')) { 'fullname' => $profile['name'], 'firstname' => $firstname, 'lastname' => $lastname, - 'photo300' => $a->get_baseurl() . '/photo/custom/300/' . $profile['uid'] . '.jpg', - 'photo100' => $a->get_baseurl() . '/photo/custom/100/' . $profile['uid'] . '.jpg', - 'photo50' => $a->get_baseurl() . '/photo/custom/50/' . $profile['uid'] . '.jpg', + 'photo300' => $a->get_cached_avatar_image($a->get_baseurl() . '/photo/custom/300/' . $profile['uid'] . '.jpg'), + 'photo100' => $a->get_cached_avatar_image($a->get_baseurl() . '/photo/custom/100/' . $profile['uid'] . '.jpg'), + 'photo50' => $a->get_cached_avatar_image($a->get_baseurl() . '/photo/custom/50/' . $profile['uid'] . '.jpg'), ); if (!$block){ From 51ef8fb7ff77323382fa750827aa25f4652a1891 Mon Sep 17 00:00:00 2001 From: "Zvi ben Yaakov (a.k.a rdc)" Date: Mon, 25 Jun 2012 14:01:16 +0300 Subject: [PATCH 09/30] Added App::get_cached_avatar_image usage for displaying "Last users" avatar thumbs in right sidebar --- view/theme/diabook/theme.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/theme/diabook/theme.php b/view/theme/diabook/theme.php index 83079782e8..53048df6cd 100755 --- a/view/theme/diabook/theme.php +++ b/view/theme/diabook/theme.php @@ -528,7 +528,7 @@ if ($color=="dark") $color_path = "/diabook-dark/"; $entry = replace_macros($tpl,array( '$id' => $rr['id'], '$profile-link' => $profile_link, - '$photo' => $rr[$photo], + '$photo' => $a->get_cached_avatar_image($rr[$photo]), '$alt-text' => $rr['name'], )); $aside['$lastusers_items'][] = $entry; From 4293de75546249256e438b87f869a99d864117d6 Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Sun, 24 Jun 2012 09:37:31 -0600 Subject: [PATCH 10/30] allow nested [ol] and [ul] lists too --- include/bb2diaspora.php | 14 ++++++++------ include/bbcode.php | 9 +++++---- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index ac693127ba..a0d114a372 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -109,20 +109,22 @@ function bb2diaspora($Text,$preserve_nl = false) { // "
  • " into a deeper nested element until it crashes. So pre-format // the lists as Diaspora lists before sending the $Text to bbcode() // - // Note that regular expressions are really not suitable for parsing - // text with opening and closing tags, so nested lists may make things - // wonky + // Note that to get nested lists to work for Diaspora, we would need + // to define the closing tag for the list elements. So nested lists + // are going to be flattened out in Diaspora for now $endlessloop = 0; - while ((strpos($Text, "[/list]") !== false) && (strpos($Text, "[list") !== false) && (++$endlessloop < 20)) { + while ((strpos($Text, "[/list]") !== false) && (strpos($Text, "[list") !== false) + (strpos($Text, "[/ol]") !== false) && (strpos($Text, "[ol]") !== false) && + (strpos($Text, "[/ul]") !== false) && (strpos($Text, "[ul]") !== false) && (++$endlessloop < 20)) { $Text = preg_replace_callback("/\[list\](.*?)\[\/list\]/is", 'diaspora_ul', $Text); $Text = preg_replace_callback("/\[list=1\](.*?)\[\/list\]/is", 'diaspora_ol', $Text); $Text = preg_replace_callback("/\[list=i\](.*?)\[\/list\]/s",'diaspora_ol', $Text); $Text = preg_replace_callback("/\[list=I\](.*?)\[\/list\]/s", 'diaspora_ol', $Text); $Text = preg_replace_callback("/\[list=a\](.*?)\[\/list\]/s", 'diaspora_ol', $Text); $Text = preg_replace_callback("/\[list=A\](.*?)\[\/list\]/s", 'diaspora_ol', $Text); + $Text = preg_replace_callback("/\[ul\](.*?)\[\/ul\]/is", 'diaspora_ul', $Text); + $Text = preg_replace_callback("/\[ol\](.*?)\[\/ol\]/is", 'diaspora_ol', $Text); } - $Text = preg_replace_callback("/\[ul\](.*?)\[\/ul\]/is", 'diaspora_ul', $Text); - $Text = preg_replace_callback("/\[ol\](.*?)\[\/ol\]/is", 'diaspora_ol', $Text); // Convert it to HTML - don't try oembed $Text = bbcode($Text, $preserve_nl, false); diff --git a/include/bbcode.php b/include/bbcode.php index f542ad263c..38d1e658f9 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -162,7 +162,9 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) { // handle nested lists $endlessloop = 0; - while ((strpos($Text, "[/list]") !== false) and (strpos($Text, "[list") !== false) and (++$endlessloop < 20)) { + while ((strpos($Text, "[/list]") !== false) && (strpos($Text, "[list") !== false) + (strpos($Text, "[/ol]") !== false) && (strpos($Text, "[ol]") !== false) && + (strpos($Text, "[/ul]") !== false) && (strpos($Text, "[ul]") !== false) && (++$endlessloop < 20)) { $Text = preg_replace("/\[list\](.*?)\[\/list\]/ism", '
      $1
    ' ,$Text); $Text = preg_replace("/\[list=\](.*?)\[\/list\]/ism", '
      $1
    ' ,$Text); $Text = preg_replace("/\[list=1\](.*?)\[\/list\]/ism", '
      $1
    ' ,$Text); @@ -170,11 +172,10 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) { $Text = preg_replace("/\[list=((?-i)I)\](.*?)\[\/list\]/ism", '
      $2
    ' ,$Text); $Text = preg_replace("/\[list=((?-i)a)\](.*?)\[\/list\]/ism", '
      $2
    ' ,$Text); $Text = preg_replace("/\[list=((?-i)A)\](.*?)\[\/list\]/ism", '
      $2
    ' ,$Text); + $Text = preg_replace("/\[ul\](.*?)\[\/ul\]/ism", '
      $1
    ' ,$Text); + $Text = preg_replace("/\[ol\](.*?)\[\/ol\]/ism", '
      $1
    ' ,$Text); } - $Text = preg_replace("/\[ul\](.*?)\[\/ul\]/ism", '
      $1
    ' ,$Text); - $Text = preg_replace("/\[ol\](.*?)\[\/ol\]/ism", '
      $1
    ' ,$Text); - $Text = preg_replace("/\[th\](.*?)\[\/th\]/sm", '$1' ,$Text); $Text = preg_replace("/\[td\](.*?)\[\/td\]/sm", '$1' ,$Text); $Text = preg_replace("/\[tr\](.*?)\[\/tr\]/sm", '$1' ,$Text); From fa7e803f73586ca056506a85dbb7b34f26498d2f Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Sat, 16 Jun 2012 21:41:23 -0600 Subject: [PATCH 11/30] fix check for parent of StatusNet API post --- include/api.php | 19 ++++++++++--------- include/onepoll.php | 2 +- mod/item.php | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/include/api.php b/include/api.php index b77156dfae..cee1fde23b 100644 --- a/include/api.php +++ b/include/api.php @@ -565,18 +565,19 @@ if(requestdata('lat') && requestdata('long')) $_REQUEST['coord'] = sprintf("%s %s",requestdata('lat'),requestdata('long')); $_REQUEST['profile_uid'] = local_user(); - if(requestdata('parent')) +// if(requestdata('parent')) + if($parent) $_REQUEST['type'] = 'net-comment'; else { $_REQUEST['type'] = 'wall'; - if(x($_FILES,'media')) { - // upload the image if we have one - $_REQUEST['hush']='yeah'; //tell wall_upload function to return img info instead of echo - require_once('mod/wall_upload.php'); - $media = wall_upload_post($a); - if(strlen($media)>0) - $_REQUEST['body'] .= "\n\n".$media; - } + if(x($_FILES,'media')) { + // upload the image if we have one + $_REQUEST['hush']='yeah'; //tell wall_upload function to return img info instead of echo + require_once('mod/wall_upload.php'); + $media = wall_upload_post($a); + if(strlen($media)>0) + $_REQUEST['body'] .= "\n\n".$media; + } } // set this so that the item_post() function is quiet and doesn't redirect or emit json diff --git a/include/onepoll.php b/include/onepoll.php index d68f268837..09e7bb7638 100644 --- a/include/onepoll.php +++ b/include/onepoll.php @@ -449,7 +449,7 @@ function onepoll_run($argv, $argc){ if($xml) { logger('poller: received xml : ' . $xml, LOGGER_DATA); - if((! strstr($xml,' Date: Mon, 25 Jun 2012 17:17:06 -0400 Subject: [PATCH 12/30] fix delete thingy, and minor clean up Signed-off-by: Simon L'nu --- view/theme/dispy/dark/style.css | 9 +++------ view/theme/dispy/dark/style.less | 17 ++++------------- view/theme/dispy/light/style.css | 9 +++------ view/theme/dispy/light/style.less | 17 ++++------------- 4 files changed, 14 insertions(+), 38 deletions(-) diff --git a/view/theme/dispy/dark/style.css b/view/theme/dispy/dark/style.css index bf23cf6256..6551d9a937 100644 --- a/view/theme/dispy/dark/style.css +++ b/view/theme/dispy/dark/style.css @@ -59,7 +59,7 @@ h6{font-size:xx-small;} .button{color:#eeeecc;-o-border-radius:5px;-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;border-radius:5px;padding:5px;cursor:pointer;}.button a{color:#eeeecc;font-weight:bold;} #profile-listing-desc a{color:#eeeecc;font-weight:bold;} [class$="-desc"],[id$="-desc"]{color:#eeeecc;background:#2e2f2e;border:2px outset #d4d580;-o-border-radius:5px;-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;border-radius:5px;margin:3px 10px 7px 0;padding:5px;font-weight:bold;font-size:smaller;} -#item-delete-selected-desc{float:left;margin-right:5px;}#item-delete-selected-desc:hover{text-decoration:underline;} +#item-delete-selected-desc{float:left;font-size:smaller;margin-right:5px;}#item-delete-selected-desc:hover{text-decoration:underline;} .intro-approve-as-friend-desc{margin-top:10px;} .intro-desc{margin-bottom:20px;font-weight:bold;} #group-edit-desc{margin:10px 0px;} @@ -226,7 +226,6 @@ nav #nav-notifications-linkmenu.on .icon.s22.notify,nav #nav-notifications-linkm .wallwall .wall-item-photo-end{clear:both;} .wall-item-arrowphoto-wrapper{position:absolute;left:35px;top:80px;z-index:10002;} .wall-item-photo-menu{min-width:92px;font-size:0.75em;border:2px solid #555753;border-top:0px;background:#555753;position:absolute;left:-2px;top:101px;display:none;z-index:10003;-o-border-radius:0 5px 5px 5px;-webkit-border-radius:0 5px 5px 5px;-moz-border-radius:0 5px 5px 5px;-ms-border-radius:0 5px 5px 5px;border-radius:0 5px 5px 5px;}.wall-item-photo-menu li a{white-space:nowrap;display:block;padding:5px 6px;color:#eeeeee;}.wall-item-photo-menu li a:hover{color:#555753;background:#eeeeee;} -#item-delete-selected{overflow:auto;width:100%;} #connect-services-header,#extra-help-header{margin:1.5em 0 0 0;} #connect-services,#extra-help{margin:0px;padding:0px;list-style:none;list-style-position:inside;margin:1em 0 0 0;}#connect-services li,#extra-help li{display:inline;} .ccollapse-wrapper{font-size:0.9em;margin-left:5em;} @@ -390,10 +389,8 @@ div[id$="wrapper"]{height:100%;}div[id$="wrapper"] br{clear:left;} .filesavetags:hover,.categorytags:hover{margin:20px 0;opacity:1.0 !important;} .item-select{opacity:0.1;margin:5px 0 0 6px !important;}.item-select:hover{opacity:1;} .checkeditem{opacity:1;} -#item-delete-selected{margin-top:30px;} -#item-delete-selected{position:absolute;left:35px;margin-top:20px;} -#item-delete-selected-icon{float:left;margin-right:5px;} -#item-delete-selected-desc{font-size:smaller;} +#item-delete-selected{margin-top:30px;position:absolute;left:35px;width:15em;overflow:auto;} +#item-delete-selected-icon{float:left;margin:11px 5px;} .fc-state-highlight{background:#eeeecc;color:#2e2f2e;} .directory-item{float:left;margin:0 5px 4px 0;padding:3px;width:180px;height:250px;position:relative;} #group-sidebar{margin-bottom:10px;} diff --git a/view/theme/dispy/dark/style.less b/view/theme/dispy/dark/style.less index 1c2dc0665d..5e68839640 100644 --- a/view/theme/dispy/dark/style.less +++ b/view/theme/dispy/dark/style.less @@ -325,6 +325,7 @@ h6 { } #item-delete-selected-desc { float: left; + font-size: smaller; margin-right: 5px; &:hover { text-decoration: underline; @@ -1533,10 +1534,6 @@ nav #nav-notifications-linkmenu { } } } -#item-delete-selected { - overflow: auto; - width: 100%; -} #connect-services-header, #extra-help-header { margin: 1.5em 0 0 0; @@ -2370,20 +2367,14 @@ div { } #item-delete-selected { margin-top: 30px; -} -/* was tired of having no way of moving it around, so -* here's a little 'hook' to do so */ -#item-delete-selected { position: absolute; left: 35px; - margin-top: 20px; + width: 15em; + overflow: auto; } #item-delete-selected-icon { float: left; - margin-right: 5px; -} -#item-delete-selected-desc { - font-size: smaller; + margin: 11px 5px; } .fc-state-highlight { background: @main_colour; diff --git a/view/theme/dispy/light/style.css b/view/theme/dispy/light/style.css index cbf0168f15..793feb6fc6 100644 --- a/view/theme/dispy/light/style.css +++ b/view/theme/dispy/light/style.css @@ -59,7 +59,7 @@ h6{font-size:xx-small;} .button{color:#111111;-o-border-radius:5px;-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;border-radius:5px;padding:5px;cursor:pointer;}.button a{color:#111111;font-weight:bold;} #profile-listing-desc a{color:#eeeeec;font-weight:bold;} [class$="-desc"],[id$="-desc"]{color:#eeeeec;background:#2e3436;border:2px outset #111111;-o-border-radius:5px;-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;border-radius:5px;margin:3px 10px 7px 0;padding:5px;font-weight:bold;font-size:smaller;} -#item-delete-selected-desc{float:left;margin-right:5px;}#item-delete-selected-desc:hover{text-decoration:underline;} +#item-delete-selected-desc{float:left;font-size:smaller;margin-right:5px;}#item-delete-selected-desc:hover{text-decoration:underline;} .intro-approve-as-friend-desc{margin-top:10px;} .intro-desc{margin-bottom:20px;font-weight:bold;} #group-edit-desc{margin:10px 0px;} @@ -226,7 +226,6 @@ nav #nav-notifications-linkmenu.on .icon.s22.notify,nav #nav-notifications-linkm .wallwall .wall-item-photo-end{clear:both;} .wall-item-arrowphoto-wrapper{position:absolute;left:35px;top:80px;z-index:10002;} .wall-item-photo-menu{min-width:92px;font-size:0.75em;border:2px solid #555753;border-top:0px;background:#555753;position:absolute;left:-2px;top:101px;display:none;z-index:10003;-o-border-radius:0 5px 5px 5px;-webkit-border-radius:0 5px 5px 5px;-moz-border-radius:0 5px 5px 5px;-ms-border-radius:0 5px 5px 5px;border-radius:0 5px 5px 5px;}.wall-item-photo-menu li a{white-space:nowrap;display:block;padding:5px 6px;color:#eeeeec;}.wall-item-photo-menu li a:hover{color:#555753;background:#eeeeec;} -#item-delete-selected{overflow:auto;width:100%;} #connect-services-header,#extra-help-header{margin:1.5em 0 0 0;} #connect-services,#extra-help{margin:0px;padding:0px;list-style:none;list-style-position:inside;margin:1em 0 0 0;}#connect-services li,#extra-help li{display:inline;} .ccollapse-wrapper{font-size:0.9em;margin-left:5em;} @@ -390,10 +389,8 @@ div[id$="wrapper"]{height:100%;}div[id$="wrapper"] br{clear:left;} .filesavetags:hover,.categorytags:hover{margin:20px 0;opacity:1.0 !important;} .item-select{opacity:0.1;margin:5px 0 0 6px !important;}.item-select:hover{opacity:1;} .checkeditem{opacity:1;} -#item-delete-selected{margin-top:30px;} -#item-delete-selected{position:absolute;left:35px;margin-top:20px;} -#item-delete-selected-icon{float:left;margin-right:5px;} -#item-delete-selected-desc{font-size:smaller;} +#item-delete-selected{margin-top:30px;position:absolute;left:35px;width:15em;overflow:auto;} +#item-delete-selected-icon{float:left;margin:11px 5px;} .fc-state-highlight{background:#eeeeec;color:#111111;} .directory-item{float:left;margin:0 5px 4px 0;padding:3px;width:180px;height:250px;position:relative;} #group-sidebar{margin-bottom:10px;} diff --git a/view/theme/dispy/light/style.less b/view/theme/dispy/light/style.less index c5624841eb..13f296d220 100644 --- a/view/theme/dispy/light/style.less +++ b/view/theme/dispy/light/style.less @@ -326,6 +326,7 @@ h6 { } #item-delete-selected-desc { float: left; + font-size: smaller; margin-right: 5px; &:hover { text-decoration: underline; @@ -1534,10 +1535,6 @@ nav #nav-notifications-linkmenu { } } } -#item-delete-selected { - overflow: auto; - width: 100%; -} #connect-services-header, #extra-help-header { margin: 1.5em 0 0 0; @@ -2371,20 +2368,14 @@ div { } #item-delete-selected { margin-top: 30px; -} -/* was tired of having no way of moving it around, so -* here's a little 'hook' to do so */ -#item-delete-selected { position: absolute; left: 35px; - margin-top: 20px; + width: 15em; + overflow: auto; } #item-delete-selected-icon { float: left; - margin-right: 5px; -} -#item-delete-selected-desc { - font-size: smaller; + margin: 11px 5px; } .fc-state-highlight { background: @bg_colour; From eebb2d2120b91c09238e970b2292059a04960aa7 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 25 Jun 2012 15:34:23 -0700 Subject: [PATCH 13/30] rev update --- boot.php | 2 +- util/messages.po | 524 +++++++++++++++++++++++++---------------------- 2 files changed, 282 insertions(+), 244 deletions(-) diff --git a/boot.php b/boot.php index 2c8723d26b..024ef0c054 100644 --- a/boot.php +++ b/boot.php @@ -10,7 +10,7 @@ require_once('include/nav.php'); require_once('include/cache.php'); define ( 'FRIENDICA_PLATFORM', 'Friendica'); -define ( 'FRIENDICA_VERSION', '3.0.1384' ); +define ( 'FRIENDICA_VERSION', '3.0.1385' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); define ( 'DB_UPDATE_VERSION', 1150 ); diff --git a/util/messages.po b/util/messages.po index 87e2e0ac6e..d9a4624467 100644 --- a/util/messages.po +++ b/util/messages.po @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: 3.0.1384\n" +"Project-Id-Version: 3.0.1385\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-06-24 10:00-0700\n" +"POT-Creation-Date: 2012-06-25 10:00-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -36,7 +36,7 @@ msgstr "" #: ../../mod/crepair.php:115 ../../mod/wall_attach.php:44 #: ../../mod/fsuggest.php:78 ../../mod/events.php:138 ../../mod/api.php:26 -#: ../../mod/api.php:31 ../../mod/photos.php:133 ../../mod/photos.php:931 +#: ../../mod/api.php:31 ../../mod/photos.php:135 ../../mod/photos.php:951 #: ../../mod/editpost.php:10 ../../mod/install.php:151 #: ../../mod/notifications.php:66 ../../mod/contacts.php:145 #: ../../mod/settings.php:106 ../../mod/settings.php:537 @@ -52,11 +52,11 @@ msgstr "" #: ../../mod/message.php:97 ../../mod/allfriends.php:9 #: ../../mod/nogroup.php:25 ../../mod/wall_upload.php:53 #: ../../mod/follow.php:9 ../../mod/display.php:138 ../../mod/profiles.php:7 -#: ../../mod/profiles.php:385 ../../mod/delegate.php:6 +#: ../../mod/profiles.php:400 ../../mod/delegate.php:6 #: ../../mod/suggest.php:28 ../../mod/invite.php:13 ../../mod/invite.php:81 #: ../../mod/dfrn_confirm.php:53 ../../addon/facebook/facebook.php:508 -#: ../../addon/dav/layout.fnk.php:353 ../../include/items.php:3411 -#: ../../index.php:309 +#: ../../addon/facebook/facebook.php:514 ../../addon/dav/layout.fnk.php:353 +#: ../../include/items.php:3411 ../../index.php:309 msgid "Permission denied." msgstr "" @@ -123,18 +123,18 @@ msgid "New photo from this URL" msgstr "" #: ../../mod/crepair.php:166 ../../mod/fsuggest.php:107 -#: ../../mod/events.php:428 ../../mod/photos.php:966 ../../mod/photos.php:1024 -#: ../../mod/photos.php:1270 ../../mod/photos.php:1310 -#: ../../mod/photos.php:1350 ../../mod/photos.php:1381 +#: ../../mod/events.php:428 ../../mod/photos.php:986 ../../mod/photos.php:1057 +#: ../../mod/photos.php:1303 ../../mod/photos.php:1343 +#: ../../mod/photos.php:1383 ../../mod/photos.php:1414 #: ../../mod/install.php:246 ../../mod/install.php:284 #: ../../mod/localtime.php:45 ../../mod/contacts.php:343 #: ../../mod/settings.php:555 ../../mod/settings.php:701 #: ../../mod/settings.php:762 ../../mod/settings.php:969 #: ../../mod/group.php:85 ../../mod/message.php:216 ../../mod/message.php:410 #: ../../mod/admin.php:420 ../../mod/admin.php:656 ../../mod/admin.php:792 -#: ../../mod/admin.php:991 ../../mod/admin.php:1078 ../../mod/profiles.php:554 +#: ../../mod/admin.php:991 ../../mod/admin.php:1078 ../../mod/profiles.php:569 #: ../../mod/invite.php:119 ../../addon/fromgplus/fromgplus.php:40 -#: ../../addon/facebook/facebook.php:610 +#: ../../addon/facebook/facebook.php:617 #: ../../addon/snautofollow/snautofollow.php:64 #: ../../addon/yourls/yourls.php:76 ../../addon/ljpost/ljpost.php:93 #: ../../addon/nsfw/nsfw.php:57 ../../addon/page/page.php:164 @@ -340,7 +340,7 @@ msgstr "" #: ../../mod/settings.php:956 ../../mod/settings.php:957 #: ../../mod/settings.php:958 ../../mod/settings.php:959 #: ../../mod/settings.php:960 ../../mod/register.php:234 -#: ../../mod/profiles.php:531 +#: ../../mod/profiles.php:546 msgid "Yes" msgstr "" @@ -352,36 +352,36 @@ msgstr "" #: ../../mod/settings.php:956 ../../mod/settings.php:957 #: ../../mod/settings.php:958 ../../mod/settings.php:959 #: ../../mod/settings.php:960 ../../mod/register.php:235 -#: ../../mod/profiles.php:532 +#: ../../mod/profiles.php:547 msgid "No" msgstr "" -#: ../../mod/photos.php:44 ../../boot.php:1540 +#: ../../mod/photos.php:46 ../../boot.php:1540 msgid "Photo Albums" msgstr "" -#: ../../mod/photos.php:52 ../../mod/photos.php:154 ../../mod/photos.php:945 -#: ../../mod/photos.php:1016 ../../mod/photos.php:1031 -#: ../../mod/photos.php:1459 ../../mod/photos.php:1471 +#: ../../mod/photos.php:54 ../../mod/photos.php:156 ../../mod/photos.php:965 +#: ../../mod/photos.php:1049 ../../mod/photos.php:1064 +#: ../../mod/photos.php:1492 ../../mod/photos.php:1504 #: ../../addon/communityhome/communityhome.php:110 #: ../../view/theme/diabook/theme.php:598 msgid "Contact Photos" msgstr "" -#: ../../mod/photos.php:59 ../../mod/photos.php:1041 ../../mod/photos.php:1509 +#: ../../mod/photos.php:61 ../../mod/photos.php:1074 ../../mod/photos.php:1542 msgid "Upload New Photos" msgstr "" -#: ../../mod/photos.php:70 ../../mod/settings.php:21 +#: ../../mod/photos.php:72 ../../mod/settings.php:21 msgid "everybody" msgstr "" -#: ../../mod/photos.php:143 +#: ../../mod/photos.php:145 msgid "Contact information unavailable" msgstr "" -#: ../../mod/photos.php:154 ../../mod/photos.php:658 ../../mod/photos.php:1016 -#: ../../mod/photos.php:1031 ../../mod/profile_photo.php:60 +#: ../../mod/photos.php:156 ../../mod/photos.php:660 ../../mod/photos.php:1049 +#: ../../mod/photos.php:1064 ../../mod/profile_photo.php:60 #: ../../mod/profile_photo.php:67 ../../mod/profile_photo.php:74 #: ../../mod/profile_photo.php:176 ../../mod/profile_photo.php:254 #: ../../mod/profile_photo.php:263 @@ -391,23 +391,23 @@ msgstr "" msgid "Profile Photos" msgstr "" -#: ../../mod/photos.php:164 +#: ../../mod/photos.php:166 msgid "Album not found." msgstr "" -#: ../../mod/photos.php:182 ../../mod/photos.php:1025 +#: ../../mod/photos.php:184 ../../mod/photos.php:1058 msgid "Delete Album" msgstr "" -#: ../../mod/photos.php:245 ../../mod/photos.php:1271 +#: ../../mod/photos.php:247 ../../mod/photos.php:1304 msgid "Delete Photo" msgstr "" -#: ../../mod/photos.php:589 +#: ../../mod/photos.php:591 msgid "was tagged in a" msgstr "" -#: ../../mod/photos.php:589 ../../mod/like.php:185 ../../mod/tagger.php:70 +#: ../../mod/photos.php:591 ../../mod/like.php:185 ../../mod/tagger.php:70 #: ../../addon/communityhome/communityhome.php:163 #: ../../view/theme/diabook/theme.php:570 ../../include/text.php:1316 #: ../../include/diaspora.php:1710 ../../include/conversation.php:53 @@ -415,176 +415,186 @@ msgstr "" msgid "photo" msgstr "" -#: ../../mod/photos.php:589 +#: ../../mod/photos.php:591 msgid "by" msgstr "" -#: ../../mod/photos.php:694 ../../addon/js_upload/js_upload.php:315 +#: ../../mod/photos.php:696 ../../addon/js_upload/js_upload.php:315 msgid "Image exceeds size limit of " msgstr "" -#: ../../mod/photos.php:702 +#: ../../mod/photos.php:704 msgid "Image file is empty." msgstr "" -#: ../../mod/photos.php:716 ../../mod/profile_photo.php:126 +#: ../../mod/photos.php:736 ../../mod/profile_photo.php:126 #: ../../mod/wall_upload.php:86 msgid "Unable to process image." msgstr "" -#: ../../mod/photos.php:737 ../../mod/profile_photo.php:259 +#: ../../mod/photos.php:757 ../../mod/profile_photo.php:259 #: ../../mod/wall_upload.php:105 msgid "Image upload failed." msgstr "" -#: ../../mod/photos.php:823 ../../mod/community.php:16 +#: ../../mod/photos.php:843 ../../mod/community.php:16 #: ../../mod/dfrn_request.php:759 ../../mod/viewcontacts.php:17 #: ../../mod/display.php:7 ../../mod/search.php:71 ../../mod/directory.php:29 msgid "Public access denied." msgstr "" -#: ../../mod/photos.php:833 +#: ../../mod/photos.php:853 msgid "No photos selected" msgstr "" -#: ../../mod/photos.php:912 +#: ../../mod/photos.php:932 msgid "Access to this item is restricted." msgstr "" -#: ../../mod/photos.php:973 +#: ../../mod/photos.php:996 +#, php-format +msgid "You have used %1$.2f Mbytes of %2$.2f Mbytes photo storage." +msgstr "" + +#: ../../mod/photos.php:999 +#, php-format +msgid "You have used %1$.2f Mbytes of photo storage." +msgstr "" + +#: ../../mod/photos.php:1005 msgid "Upload Photos" msgstr "" -#: ../../mod/photos.php:976 ../../mod/photos.php:1020 +#: ../../mod/photos.php:1009 ../../mod/photos.php:1053 msgid "New album name: " msgstr "" -#: ../../mod/photos.php:977 +#: ../../mod/photos.php:1010 msgid "or existing album name: " msgstr "" -#: ../../mod/photos.php:978 +#: ../../mod/photos.php:1011 msgid "Do not show a status post for this upload" msgstr "" -#: ../../mod/photos.php:980 ../../mod/photos.php:1266 +#: ../../mod/photos.php:1013 ../../mod/photos.php:1299 msgid "Permissions" msgstr "" -#: ../../mod/photos.php:1035 +#: ../../mod/photos.php:1068 msgid "Edit Album" msgstr "" -#: ../../mod/photos.php:1059 ../../mod/photos.php:1492 +#: ../../mod/photos.php:1092 ../../mod/photos.php:1525 msgid "View Photo" msgstr "" -#: ../../mod/photos.php:1094 +#: ../../mod/photos.php:1127 msgid "Permission denied. Access to this item may be restricted." msgstr "" -#: ../../mod/photos.php:1096 +#: ../../mod/photos.php:1129 msgid "Photo not available" msgstr "" -#: ../../mod/photos.php:1146 +#: ../../mod/photos.php:1179 msgid "View photo" msgstr "" -#: ../../mod/photos.php:1146 +#: ../../mod/photos.php:1179 msgid "Edit photo" msgstr "" -#: ../../mod/photos.php:1147 +#: ../../mod/photos.php:1180 msgid "Use as profile photo" msgstr "" -#: ../../mod/photos.php:1153 ../../include/conversation.php:490 +#: ../../mod/photos.php:1186 ../../include/conversation.php:490 msgid "Private Message" msgstr "" -#: ../../mod/photos.php:1175 +#: ../../mod/photos.php:1208 msgid "View Full Size" msgstr "" -#: ../../mod/photos.php:1243 +#: ../../mod/photos.php:1276 msgid "Tags: " msgstr "" -#: ../../mod/photos.php:1246 +#: ../../mod/photos.php:1279 msgid "[Remove any tag]" msgstr "" -#: ../../mod/photos.php:1256 +#: ../../mod/photos.php:1289 msgid "Rotate CW (right)" msgstr "" -#: ../../mod/photos.php:1257 +#: ../../mod/photos.php:1290 msgid "Rotate CCW (left)" msgstr "" -#: ../../mod/photos.php:1259 +#: ../../mod/photos.php:1292 msgid "New album name" msgstr "" -#: ../../mod/photos.php:1262 +#: ../../mod/photos.php:1295 msgid "Caption" msgstr "" -#: ../../mod/photos.php:1264 +#: ../../mod/photos.php:1297 msgid "Add a Tag" msgstr "" -#: ../../mod/photos.php:1268 +#: ../../mod/photos.php:1301 msgid "Example: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping" msgstr "" -#: ../../mod/photos.php:1288 ../../include/conversation.php:554 +#: ../../mod/photos.php:1321 ../../include/conversation.php:554 msgid "I like this (toggle)" msgstr "" -#: ../../mod/photos.php:1289 ../../include/conversation.php:555 +#: ../../mod/photos.php:1322 ../../include/conversation.php:555 msgid "I don't like this (toggle)" msgstr "" -#: ../../mod/photos.php:1290 ../../include/conversation.php:993 +#: ../../mod/photos.php:1323 ../../include/conversation.php:993 msgid "Share" msgstr "" -#: ../../mod/photos.php:1291 ../../mod/editpost.php:104 +#: ../../mod/photos.php:1324 ../../mod/editpost.php:104 #: ../../mod/wallmessage.php:145 ../../mod/message.php:215 #: ../../mod/message.php:411 ../../include/conversation.php:371 #: ../../include/conversation.php:731 ../../include/conversation.php:1012 msgid "Please wait" msgstr "" -#: ../../mod/photos.php:1307 ../../mod/photos.php:1347 -#: ../../mod/photos.php:1378 ../../include/conversation.php:577 +#: ../../mod/photos.php:1340 ../../mod/photos.php:1380 +#: ../../mod/photos.php:1411 ../../include/conversation.php:577 msgid "This is you" msgstr "" -#: ../../mod/photos.php:1309 ../../mod/photos.php:1349 -#: ../../mod/photos.php:1380 ../../include/conversation.php:579 +#: ../../mod/photos.php:1342 ../../mod/photos.php:1382 +#: ../../mod/photos.php:1413 ../../include/conversation.php:579 #: ../../boot.php:518 msgid "Comment" msgstr "" -#: ../../mod/photos.php:1311 ../../mod/editpost.php:125 +#: ../../mod/photos.php:1344 ../../mod/editpost.php:125 #: ../../include/conversation.php:589 ../../include/conversation.php:1030 msgid "Preview" msgstr "" -#: ../../mod/photos.php:1408 ../../mod/settings.php:618 +#: ../../mod/photos.php:1441 ../../mod/settings.php:618 #: ../../mod/settings.php:699 ../../mod/group.php:168 ../../mod/admin.php:663 #: ../../include/conversation.php:328 ../../include/conversation.php:609 msgid "Delete" msgstr "" -#: ../../mod/photos.php:1498 +#: ../../mod/photos.php:1531 msgid "View Album" msgstr "" -#: ../../mod/photos.php:1507 +#: ../../mod/photos.php:1540 msgid "Recent Photos" msgstr "" @@ -1726,8 +1736,8 @@ msgstr "" #: ../../mod/lostpass.php:45 ../../mod/lostpass.php:107 #: ../../mod/register.php:90 ../../mod/register.php:144 #: ../../mod/regmod.php:54 ../../mod/dfrn_confirm.php:752 -#: ../../addon/facebook/facebook.php:693 -#: ../../addon/facebook/facebook.php:1183 +#: ../../addon/facebook/facebook.php:700 +#: ../../addon/facebook/facebook.php:1190 #: ../../addon/public_server/public_server.php:62 #: ../../addon/testdrive/testdrive.php:67 ../../include/items.php:2814 #: ../../boot.php:720 @@ -2420,7 +2430,7 @@ msgid "Personal Notes" msgstr "" #: ../../mod/notes.php:63 ../../mod/filer.php:30 -#: ../../addon/facebook/facebook.php:761 +#: ../../addon/facebook/facebook.php:768 #: ../../addon/privacy_image_cache/privacy_image_cache.php:187 #: ../../addon/dav/layout.fnk.php:384 ../../include/text.php:652 msgid "Save" @@ -2665,7 +2675,7 @@ msgid "Profile Visibility Editor" msgstr "" #: ../../mod/profperm.php:103 ../../view/theme/diabook/theme.php:128 -#: ../../include/profile_advanced.php:7 ../../include/profile_advanced.php:79 +#: ../../include/profile_advanced.php:7 ../../include/profile_advanced.php:84 #: ../../include/nav.php:50 ../../boot.php:1531 msgid "Profile" msgstr "" @@ -2779,7 +2789,7 @@ msgid "People Search" msgstr "" #: ../../mod/like.php:185 ../../mod/like.php:260 ../../mod/tagger.php:70 -#: ../../addon/facebook/facebook.php:1577 +#: ../../addon/facebook/facebook.php:1584 #: ../../addon/communityhome/communityhome.php:158 #: ../../addon/communityhome/communityhome.php:167 #: ../../view/theme/diabook/theme.php:565 @@ -2789,7 +2799,7 @@ msgstr "" msgid "status" msgstr "" -#: ../../mod/like.php:202 ../../addon/facebook/facebook.php:1581 +#: ../../mod/like.php:202 ../../addon/facebook/facebook.php:1588 #: ../../addon/communityhome/communityhome.php:172 #: ../../view/theme/diabook/theme.php:579 ../../include/diaspora.php:1726 #: ../../include/conversation.php:65 @@ -3720,8 +3730,8 @@ msgstr "" msgid "Search" msgstr "" -#: ../../mod/profiles.php:21 ../../mod/profiles.php:395 -#: ../../mod/profiles.php:509 ../../mod/dfrn_confirm.php:62 +#: ../../mod/profiles.php:21 ../../mod/profiles.php:410 +#: ../../mod/profiles.php:524 ../../mod/dfrn_confirm.php:62 msgid "Profile not found." msgstr "" @@ -3729,285 +3739,301 @@ msgstr "" msgid "Profile Name is required." msgstr "" -#: ../../mod/profiles.php:152 +#: ../../mod/profiles.php:155 msgid "Marital Status" msgstr "" -#: ../../mod/profiles.php:156 +#: ../../mod/profiles.php:159 msgid "Romantic Partner" msgstr "" -#: ../../mod/profiles.php:160 -msgid "Work/Employment" -msgstr "" - #: ../../mod/profiles.php:163 -msgid "Religion" +msgid "Likes" msgstr "" #: ../../mod/profiles.php:167 -msgid "Political Views" +msgid "Dislikes" msgstr "" #: ../../mod/profiles.php:171 +msgid "Work/Employment" +msgstr "" + +#: ../../mod/profiles.php:174 +msgid "Religion" +msgstr "" + +#: ../../mod/profiles.php:178 +msgid "Political Views" +msgstr "" + +#: ../../mod/profiles.php:182 msgid "Gender" msgstr "" -#: ../../mod/profiles.php:175 +#: ../../mod/profiles.php:186 msgid "Sexual Preference" msgstr "" -#: ../../mod/profiles.php:179 +#: ../../mod/profiles.php:190 msgid "Homepage" msgstr "" -#: ../../mod/profiles.php:183 +#: ../../mod/profiles.php:194 msgid "Interests" msgstr "" -#: ../../mod/profiles.php:187 +#: ../../mod/profiles.php:198 msgid "Address" msgstr "" -#: ../../mod/profiles.php:194 ../../addon/dav/layout.fnk.php:310 +#: ../../mod/profiles.php:205 ../../addon/dav/layout.fnk.php:310 msgid "Location" msgstr "" -#: ../../mod/profiles.php:273 +#: ../../mod/profiles.php:288 msgid "Profile updated." msgstr "" -#: ../../mod/profiles.php:340 +#: ../../mod/profiles.php:355 msgid " and " msgstr "" -#: ../../mod/profiles.php:348 +#: ../../mod/profiles.php:363 msgid "public profile" msgstr "" -#: ../../mod/profiles.php:351 +#: ../../mod/profiles.php:366 #, php-format msgid "%1$s changed %2$s to “%3$s”" msgstr "" -#: ../../mod/profiles.php:352 +#: ../../mod/profiles.php:367 #, php-format msgid " - Visit %1$s's %2$s" msgstr "" -#: ../../mod/profiles.php:355 +#: ../../mod/profiles.php:370 #, php-format msgid "%1$s has an updated %2$s, changing %3$s." msgstr "" -#: ../../mod/profiles.php:414 +#: ../../mod/profiles.php:429 msgid "Profile deleted." msgstr "" -#: ../../mod/profiles.php:432 ../../mod/profiles.php:466 +#: ../../mod/profiles.php:447 ../../mod/profiles.php:481 msgid "Profile-" msgstr "" -#: ../../mod/profiles.php:451 ../../mod/profiles.php:493 +#: ../../mod/profiles.php:466 ../../mod/profiles.php:508 msgid "New profile created." msgstr "" -#: ../../mod/profiles.php:472 +#: ../../mod/profiles.php:487 msgid "Profile unavailable to clone." msgstr "" -#: ../../mod/profiles.php:530 +#: ../../mod/profiles.php:545 msgid "Hide your contact/friend list from viewers of this profile?" msgstr "" -#: ../../mod/profiles.php:553 +#: ../../mod/profiles.php:568 msgid "Edit Profile Details" msgstr "" -#: ../../mod/profiles.php:555 +#: ../../mod/profiles.php:570 msgid "View this profile" msgstr "" -#: ../../mod/profiles.php:556 +#: ../../mod/profiles.php:571 msgid "Create a new profile using these settings" msgstr "" -#: ../../mod/profiles.php:557 +#: ../../mod/profiles.php:572 msgid "Clone this profile" msgstr "" -#: ../../mod/profiles.php:558 +#: ../../mod/profiles.php:573 msgid "Delete this profile" msgstr "" -#: ../../mod/profiles.php:559 +#: ../../mod/profiles.php:574 msgid "Profile Name:" msgstr "" -#: ../../mod/profiles.php:560 +#: ../../mod/profiles.php:575 msgid "Your Full Name:" msgstr "" -#: ../../mod/profiles.php:561 +#: ../../mod/profiles.php:576 msgid "Title/Description:" msgstr "" -#: ../../mod/profiles.php:562 +#: ../../mod/profiles.php:577 msgid "Your Gender:" msgstr "" -#: ../../mod/profiles.php:563 +#: ../../mod/profiles.php:578 #, php-format msgid "Birthday (%s):" msgstr "" -#: ../../mod/profiles.php:564 +#: ../../mod/profiles.php:579 msgid "Street Address:" msgstr "" -#: ../../mod/profiles.php:565 +#: ../../mod/profiles.php:580 msgid "Locality/City:" msgstr "" -#: ../../mod/profiles.php:566 +#: ../../mod/profiles.php:581 msgid "Postal/Zip Code:" msgstr "" -#: ../../mod/profiles.php:567 +#: ../../mod/profiles.php:582 msgid "Country:" msgstr "" -#: ../../mod/profiles.php:568 +#: ../../mod/profiles.php:583 msgid "Region/State:" msgstr "" -#: ../../mod/profiles.php:569 +#: ../../mod/profiles.php:584 msgid " Marital Status:" msgstr "" -#: ../../mod/profiles.php:570 +#: ../../mod/profiles.php:585 msgid "Who: (if applicable)" msgstr "" -#: ../../mod/profiles.php:571 +#: ../../mod/profiles.php:586 msgid "Examples: cathy123, Cathy Williams, cathy@example.com" msgstr "" -#: ../../mod/profiles.php:572 +#: ../../mod/profiles.php:587 msgid "Since [date]:" msgstr "" -#: ../../mod/profiles.php:573 ../../include/profile_advanced.php:46 +#: ../../mod/profiles.php:588 ../../include/profile_advanced.php:46 msgid "Sexual Preference:" msgstr "" -#: ../../mod/profiles.php:574 +#: ../../mod/profiles.php:589 msgid "Homepage URL:" msgstr "" -#: ../../mod/profiles.php:575 ../../include/profile_advanced.php:50 +#: ../../mod/profiles.php:590 ../../include/profile_advanced.php:50 msgid "Hometown:" msgstr "" -#: ../../mod/profiles.php:576 ../../include/profile_advanced.php:54 +#: ../../mod/profiles.php:591 ../../include/profile_advanced.php:54 msgid "Political Views:" msgstr "" -#: ../../mod/profiles.php:577 +#: ../../mod/profiles.php:592 msgid "Religious Views:" msgstr "" -#: ../../mod/profiles.php:578 +#: ../../mod/profiles.php:593 msgid "Public Keywords:" msgstr "" -#: ../../mod/profiles.php:579 +#: ../../mod/profiles.php:594 msgid "Private Keywords:" msgstr "" -#: ../../mod/profiles.php:580 -msgid "Example: fishing photography software" +#: ../../mod/profiles.php:595 ../../include/profile_advanced.php:62 +msgid "Likes:" msgstr "" -#: ../../mod/profiles.php:581 -msgid "(Used for suggesting potential friends, can be seen by others)" -msgstr "" - -#: ../../mod/profiles.php:582 -msgid "(Used for searching profiles, never shown to others)" -msgstr "" - -#: ../../mod/profiles.php:583 -msgid "Tell us about yourself..." -msgstr "" - -#: ../../mod/profiles.php:584 -msgid "Hobbies/Interests" -msgstr "" - -#: ../../mod/profiles.php:585 -msgid "Contact information and Social Networks" -msgstr "" - -#: ../../mod/profiles.php:586 -msgid "Musical interests" -msgstr "" - -#: ../../mod/profiles.php:587 -msgid "Books, literature" -msgstr "" - -#: ../../mod/profiles.php:588 -msgid "Television" -msgstr "" - -#: ../../mod/profiles.php:589 -msgid "Film/dance/culture/entertainment" -msgstr "" - -#: ../../mod/profiles.php:590 -msgid "Love/romance" -msgstr "" - -#: ../../mod/profiles.php:591 -msgid "Work/employment" -msgstr "" - -#: ../../mod/profiles.php:592 -msgid "School/education" +#: ../../mod/profiles.php:596 ../../include/profile_advanced.php:64 +msgid "Dislikes:" msgstr "" #: ../../mod/profiles.php:597 +msgid "Example: fishing photography software" +msgstr "" + +#: ../../mod/profiles.php:598 +msgid "(Used for suggesting potential friends, can be seen by others)" +msgstr "" + +#: ../../mod/profiles.php:599 +msgid "(Used for searching profiles, never shown to others)" +msgstr "" + +#: ../../mod/profiles.php:600 +msgid "Tell us about yourself..." +msgstr "" + +#: ../../mod/profiles.php:601 +msgid "Hobbies/Interests" +msgstr "" + +#: ../../mod/profiles.php:602 +msgid "Contact information and Social Networks" +msgstr "" + +#: ../../mod/profiles.php:603 +msgid "Musical interests" +msgstr "" + +#: ../../mod/profiles.php:604 +msgid "Books, literature" +msgstr "" + +#: ../../mod/profiles.php:605 +msgid "Television" +msgstr "" + +#: ../../mod/profiles.php:606 +msgid "Film/dance/culture/entertainment" +msgstr "" + +#: ../../mod/profiles.php:607 +msgid "Love/romance" +msgstr "" + +#: ../../mod/profiles.php:608 +msgid "Work/employment" +msgstr "" + +#: ../../mod/profiles.php:609 +msgid "School/education" +msgstr "" + +#: ../../mod/profiles.php:614 msgid "" "This is your public profile.
    It may " "be visible to anybody using the internet." msgstr "" -#: ../../mod/profiles.php:607 ../../mod/directory.php:111 +#: ../../mod/profiles.php:624 ../../mod/directory.php:111 msgid "Age: " msgstr "" -#: ../../mod/profiles.php:644 +#: ../../mod/profiles.php:663 msgid "Edit/Manage Profiles" msgstr "" -#: ../../mod/profiles.php:645 ../../boot.php:1092 +#: ../../mod/profiles.php:664 ../../boot.php:1092 msgid "Change profile photo" msgstr "" -#: ../../mod/profiles.php:646 ../../boot.php:1093 +#: ../../mod/profiles.php:665 ../../boot.php:1093 msgid "Create New Profile" msgstr "" -#: ../../mod/profiles.php:657 ../../boot.php:1103 +#: ../../mod/profiles.php:676 ../../boot.php:1103 msgid "Profile Image" msgstr "" -#: ../../mod/profiles.php:659 ../../boot.php:1106 +#: ../../mod/profiles.php:678 ../../boot.php:1106 msgid "visible to everybody" msgstr "" -#: ../../mod/profiles.php:660 ../../boot.php:1107 +#: ../../mod/profiles.php:679 ../../boot.php:1107 msgid "Edit visibility" msgstr "" @@ -4281,83 +4307,83 @@ msgstr "" msgid "Google+ Import Settings saved." msgstr "" -#: ../../addon/facebook/facebook.php:514 +#: ../../addon/facebook/facebook.php:521 msgid "Facebook disabled" msgstr "" -#: ../../addon/facebook/facebook.php:519 +#: ../../addon/facebook/facebook.php:526 msgid "Updating contacts" msgstr "" -#: ../../addon/facebook/facebook.php:542 +#: ../../addon/facebook/facebook.php:549 msgid "Facebook API key is missing." msgstr "" -#: ../../addon/facebook/facebook.php:549 +#: ../../addon/facebook/facebook.php:556 msgid "Facebook Connect" msgstr "" -#: ../../addon/facebook/facebook.php:555 +#: ../../addon/facebook/facebook.php:562 msgid "Install Facebook connector for this account." msgstr "" -#: ../../addon/facebook/facebook.php:562 +#: ../../addon/facebook/facebook.php:569 msgid "Remove Facebook connector" msgstr "" -#: ../../addon/facebook/facebook.php:567 +#: ../../addon/facebook/facebook.php:574 msgid "" "Re-authenticate [This is necessary whenever your Facebook password is " "changed.]" msgstr "" -#: ../../addon/facebook/facebook.php:574 +#: ../../addon/facebook/facebook.php:581 msgid "Post to Facebook by default" msgstr "" -#: ../../addon/facebook/facebook.php:580 +#: ../../addon/facebook/facebook.php:587 msgid "" "Facebook friend linking has been disabled on this site. The following " "settings will have no effect." msgstr "" -#: ../../addon/facebook/facebook.php:584 +#: ../../addon/facebook/facebook.php:591 msgid "" "Facebook friend linking has been disabled on this site. If you disable it, " "you will be unable to re-enable it." msgstr "" -#: ../../addon/facebook/facebook.php:587 +#: ../../addon/facebook/facebook.php:594 msgid "Link all your Facebook friends and conversations on this website" msgstr "" -#: ../../addon/facebook/facebook.php:589 +#: ../../addon/facebook/facebook.php:596 msgid "" "Facebook conversations consist of your profile wall and your friend " "stream." msgstr "" -#: ../../addon/facebook/facebook.php:590 +#: ../../addon/facebook/facebook.php:597 msgid "On this website, your Facebook friend stream is only visible to you." msgstr "" -#: ../../addon/facebook/facebook.php:591 +#: ../../addon/facebook/facebook.php:598 msgid "" "The following settings determine the privacy of your Facebook profile wall " "on this website." msgstr "" -#: ../../addon/facebook/facebook.php:595 +#: ../../addon/facebook/facebook.php:602 msgid "" "On this website your Facebook profile wall conversations will only be " "visible to you" msgstr "" -#: ../../addon/facebook/facebook.php:600 +#: ../../addon/facebook/facebook.php:607 msgid "Do not import your Facebook profile wall conversations" msgstr "" -#: ../../addon/facebook/facebook.php:602 +#: ../../addon/facebook/facebook.php:609 msgid "" "If you choose to link conversations and leave both of these boxes unchecked, " "your Facebook profile wall will be merged with your profile wall on this " @@ -4365,120 +4391,120 @@ msgid "" "who may see the conversations." msgstr "" -#: ../../addon/facebook/facebook.php:607 +#: ../../addon/facebook/facebook.php:614 msgid "Comma separated applications to ignore" msgstr "" -#: ../../addon/facebook/facebook.php:691 +#: ../../addon/facebook/facebook.php:698 msgid "Problems with Facebook Real-Time Updates" msgstr "" -#: ../../addon/facebook/facebook.php:719 +#: ../../addon/facebook/facebook.php:726 #: ../../include/contact_selectors.php:81 msgid "Facebook" msgstr "" -#: ../../addon/facebook/facebook.php:720 +#: ../../addon/facebook/facebook.php:727 msgid "Facebook Connector Settings" msgstr "" -#: ../../addon/facebook/facebook.php:735 +#: ../../addon/facebook/facebook.php:742 msgid "Facebook API Key" msgstr "" -#: ../../addon/facebook/facebook.php:745 +#: ../../addon/facebook/facebook.php:752 msgid "" "Error: it appears that you have specified the App-ID and -Secret in your ." "htconfig.php file. As long as they are specified there, they cannot be set " "using this form.

    " msgstr "" -#: ../../addon/facebook/facebook.php:750 +#: ../../addon/facebook/facebook.php:757 msgid "" "Error: the given API Key seems to be incorrect (the application access token " "could not be retrieved)." msgstr "" -#: ../../addon/facebook/facebook.php:752 +#: ../../addon/facebook/facebook.php:759 msgid "The given API Key seems to work correctly." msgstr "" -#: ../../addon/facebook/facebook.php:754 +#: ../../addon/facebook/facebook.php:761 msgid "" "The correctness of the API Key could not be detected. Somthing strange's " "going on." msgstr "" -#: ../../addon/facebook/facebook.php:757 +#: ../../addon/facebook/facebook.php:764 msgid "App-ID / API-Key" msgstr "" -#: ../../addon/facebook/facebook.php:758 +#: ../../addon/facebook/facebook.php:765 msgid "Application secret" msgstr "" -#: ../../addon/facebook/facebook.php:759 +#: ../../addon/facebook/facebook.php:766 #, php-format msgid "Polling Interval in minutes (minimum %1$s minutes)" msgstr "" -#: ../../addon/facebook/facebook.php:760 +#: ../../addon/facebook/facebook.php:767 msgid "" "Synchronize comments (no comments on Facebook are missed, at the cost of " "increased system load)" msgstr "" -#: ../../addon/facebook/facebook.php:764 +#: ../../addon/facebook/facebook.php:771 msgid "Real-Time Updates" msgstr "" -#: ../../addon/facebook/facebook.php:768 +#: ../../addon/facebook/facebook.php:775 msgid "Real-Time Updates are activated." msgstr "" -#: ../../addon/facebook/facebook.php:769 +#: ../../addon/facebook/facebook.php:776 msgid "Deactivate Real-Time Updates" msgstr "" -#: ../../addon/facebook/facebook.php:771 +#: ../../addon/facebook/facebook.php:778 msgid "Real-Time Updates not activated." msgstr "" -#: ../../addon/facebook/facebook.php:771 +#: ../../addon/facebook/facebook.php:778 msgid "Activate Real-Time Updates" msgstr "" -#: ../../addon/facebook/facebook.php:790 ../../addon/dav/layout.fnk.php:360 +#: ../../addon/facebook/facebook.php:797 ../../addon/dav/layout.fnk.php:360 msgid "The new values have been saved." msgstr "" -#: ../../addon/facebook/facebook.php:814 +#: ../../addon/facebook/facebook.php:821 msgid "Post to Facebook" msgstr "" -#: ../../addon/facebook/facebook.php:912 +#: ../../addon/facebook/facebook.php:919 msgid "" "Post to Facebook cancelled because of multi-network access permission " "conflict." msgstr "" -#: ../../addon/facebook/facebook.php:1132 +#: ../../addon/facebook/facebook.php:1139 msgid "View on Friendica" msgstr "" -#: ../../addon/facebook/facebook.php:1165 +#: ../../addon/facebook/facebook.php:1172 msgid "Facebook post failed. Queued for retry." msgstr "" -#: ../../addon/facebook/facebook.php:1205 +#: ../../addon/facebook/facebook.php:1212 msgid "Your Facebook connection became invalid. Please Re-authenticate." msgstr "" -#: ../../addon/facebook/facebook.php:1206 +#: ../../addon/facebook/facebook.php:1213 msgid "Facebook connection became invalid" msgstr "" -#: ../../addon/facebook/facebook.php:1207 +#: ../../addon/facebook/facebook.php:1214 #, php-format msgid "" "Hi %1$s,\n" @@ -6139,35 +6165,35 @@ msgstr "" msgid "Hobbies/Interests:" msgstr "" -#: ../../include/profile_advanced.php:62 +#: ../../include/profile_advanced.php:67 msgid "Contact information and Social Networks:" msgstr "" -#: ../../include/profile_advanced.php:64 +#: ../../include/profile_advanced.php:69 msgid "Musical interests:" msgstr "" -#: ../../include/profile_advanced.php:66 +#: ../../include/profile_advanced.php:71 msgid "Books, literature:" msgstr "" -#: ../../include/profile_advanced.php:68 +#: ../../include/profile_advanced.php:73 msgid "Television:" msgstr "" -#: ../../include/profile_advanced.php:70 +#: ../../include/profile_advanced.php:75 msgid "Film/dance/culture/entertainment:" msgstr "" -#: ../../include/profile_advanced.php:72 +#: ../../include/profile_advanced.php:77 msgid "Love/Romance:" msgstr "" -#: ../../include/profile_advanced.php:74 +#: ../../include/profile_advanced.php:79 msgid "Work/employment:" msgstr "" -#: ../../include/profile_advanced.php:76 +#: ../../include/profile_advanced.php:81 msgid "School/education:" msgstr "" @@ -7159,49 +7185,49 @@ msgid "" "This site is not configured to allow communications with other networks." msgstr "" -#: ../../include/follow.php:60 ../../include/follow.php:75 +#: ../../include/follow.php:60 ../../include/follow.php:80 msgid "No compatible communication protocols or feeds were discovered." msgstr "" -#: ../../include/follow.php:73 +#: ../../include/follow.php:78 msgid "The profile address specified does not provide adequate information." msgstr "" -#: ../../include/follow.php:77 +#: ../../include/follow.php:82 msgid "An author or name was not found." msgstr "" -#: ../../include/follow.php:79 +#: ../../include/follow.php:84 msgid "No browser URL could be matched to this address." msgstr "" -#: ../../include/follow.php:81 +#: ../../include/follow.php:86 msgid "" "Unable to match @-style Identity Address with a known protocol or email " "contact." msgstr "" -#: ../../include/follow.php:82 +#: ../../include/follow.php:87 msgid "Use mailto: in front of address to force email check." msgstr "" -#: ../../include/follow.php:88 +#: ../../include/follow.php:93 msgid "" "The profile address specified belongs to a network which has been disabled " "on this site." msgstr "" -#: ../../include/follow.php:93 +#: ../../include/follow.php:103 msgid "" "Limited profile. This person will be unable to receive direct/personal " "notifications from you." msgstr "" -#: ../../include/follow.php:169 +#: ../../include/follow.php:205 msgid "Unable to retrieve contact information." msgstr "" -#: ../../include/follow.php:223 +#: ../../include/follow.php:259 msgid "following" msgstr "" @@ -7556,6 +7582,18 @@ msgstr "" msgid "permissions" msgstr "" +#: ../../include/plugin.php:385 +msgid "Click here to upgrade." +msgstr "" + +#: ../../include/plugin.php:393 +msgid "This action exceeds the limits set by your subscription plan." +msgstr "" + +#: ../../include/plugin.php:398 +msgid "This action is not available under your subscription plan." +msgstr "" + #: ../../boot.php:517 msgid "Delete this item?" msgstr "" From eb6bf7e7fad9877e25eda1cbf4f6d0044b984341 Mon Sep 17 00:00:00 2001 From: Simon L'nu Date: Mon, 25 Jun 2012 18:42:18 -0400 Subject: [PATCH 14/30] fix margin of wall-item-body Signed-off-by: Simon L'nu --- view/theme/dispy/dark/style.css | 2 +- view/theme/dispy/dark/style.less | 2 +- view/theme/dispy/light/style.css | 2 +- view/theme/dispy/light/style.less | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/view/theme/dispy/dark/style.css b/view/theme/dispy/dark/style.css index 6551d9a937..a7763ecfb4 100644 --- a/view/theme/dispy/dark/style.css +++ b/view/theme/dispy/dark/style.css @@ -214,7 +214,7 @@ nav #nav-notifications-linkmenu.on .icon.s22.notify,nav #nav-notifications-linkm .wall-item-subtools1{width:30px;height:30px;list-style:none outside none;margin:18px 0 30px -20px;padding:0;} .wall-item-subtools2{width:25px;height:25px;list-style:none outside none;margin:-78px 0 0 5px;padding:0;} .wall-item-title{font-size:1.2em;font-weight:bold;margin-bottom:1.4em;} -.wall-item-body{margin:15px 10px 10px 0px;text-align:left;overflow-x:auto;} +.wall-item-body{margin:1em;text-align:left;overflow-x:auto;} .wall-item-lock-wrapper{float:right;width:22px;height:22px;margin:0 -5px 0 0;opacity:1;} .wall-item-dislike,.wall-item-like{clear:left;font-size:0.8em;color:#888b85;margin:5px 0 5px 10.2em;-webkit-transition:all 0.75s ease-in-out;-moz-transition:all 0.75s ease-in-out;-o-transition:all 0.75s ease-in-out;-ms-transition:all 0.75s ease-in-out;transition:all 0.75s ease-in-out;opacity:0.5;}.wall-item-dislike:hover,.wall-item-like:hover{opacity:1;} .wall-item-author,.wall-item-actions-author,.wall-item-ago{color:#eeeecc;line-height:1;display:inline-block;font-size:x-small;margin:0.5em auto;font-weight:bold;} diff --git a/view/theme/dispy/dark/style.less b/view/theme/dispy/dark/style.less index 5e68839640..32b9aa4b3e 100644 --- a/view/theme/dispy/dark/style.less +++ b/view/theme/dispy/dark/style.less @@ -1429,7 +1429,7 @@ nav #nav-notifications-linkmenu { margin-bottom: 1.4em; } .wall-item-body { - margin: 15px 10px 10px 0px; + margin: 1em; text-align: left; overflow-x: auto; } diff --git a/view/theme/dispy/light/style.css b/view/theme/dispy/light/style.css index 793feb6fc6..3d44cc8c44 100644 --- a/view/theme/dispy/light/style.css +++ b/view/theme/dispy/light/style.css @@ -214,7 +214,7 @@ nav #nav-notifications-linkmenu.on .icon.s22.notify,nav #nav-notifications-linkm .wall-item-subtools1{width:30px;height:30px;list-style:none outside none;margin:18px 0 30px -20px;padding:0;} .wall-item-subtools2{width:25px;height:25px;list-style:none outside none;margin:-78px 0 0 5px;padding:0;} .wall-item-title{font-size:1.2em;font-weight:bold;margin-bottom:1.4em;} -.wall-item-body{margin:15px 10px 10px 0px;text-align:left;overflow-x:auto;} +.wall-item-body{margin:1em;text-align:left;overflow-x:auto;} .wall-item-lock-wrapper{float:right;width:22px;height:22px;margin:0 -5px 0 0;opacity:1;} .wall-item-dislike,.wall-item-like{clear:left;font-size:0.8em;color:#111111;margin:5px 0 5px 10.2em;-webkit-transition:all 0.75s ease-in-out;-moz-transition:all 0.75s ease-in-out;-o-transition:all 0.75s ease-in-out;-ms-transition:all 0.75s ease-in-out;transition:all 0.75s ease-in-out;opacity:0.5;}.wall-item-dislike:hover,.wall-item-like:hover{opacity:1;} .wall-item-author,.wall-item-actions-author,.wall-item-ago{color:#111111;line-height:1;display:inline-block;font-size:x-small;margin:0.5em auto;font-weight:bold;} diff --git a/view/theme/dispy/light/style.less b/view/theme/dispy/light/style.less index 13f296d220..c5641605e2 100644 --- a/view/theme/dispy/light/style.less +++ b/view/theme/dispy/light/style.less @@ -1430,7 +1430,7 @@ nav #nav-notifications-linkmenu { margin-bottom: 1.4em; } .wall-item-body { - margin: 15px 10px 10px 0px; + margin: 1em; text-align: left; overflow-x: auto; } From 939ebe16f82f4aca9b4d0cf70960fe6495fae49c Mon Sep 17 00:00:00 2001 From: Simon L'nu Date: Mon, 25 Jun 2012 18:49:36 -0400 Subject: [PATCH 15/30] fix typo and syntax error Signed-off-by: Simon L'nu --- include/bbcode.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/bbcode.php b/include/bbcode.php index 38d1e658f9..36d480a178 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -162,7 +162,7 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) { // handle nested lists $endlessloop = 0; - while ((strpos($Text, "[/list]") !== false) && (strpos($Text, "[list") !== false) + while ((strpos($Text, "[/list]") !== false) && (strpos($Text, "[list]") !== false) && (strpos($Text, "[/ol]") !== false) && (strpos($Text, "[ol]") !== false) && (strpos($Text, "[/ul]") !== false) && (strpos($Text, "[ul]") !== false) && (++$endlessloop < 20)) { $Text = preg_replace("/\[list\](.*?)\[\/list\]/ism", '
      $1
    ' ,$Text); From b044cd922d389b5bb9367ce1004d00a711562cf9 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 25 Jun 2012 16:03:46 -0700 Subject: [PATCH 16/30] typos in bbcode, add service class restrictions to jot uploads --- include/bb2diaspora.php | 2 +- include/bbcode.php | 2 +- include/plugin.php | 21 ++++++++++++--------- mod/wall_attach.php | 13 +++++++++++++ mod/wall_upload.php | 13 +++++++++++++ 5 files changed, 40 insertions(+), 11 deletions(-) diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index a0d114a372..25edb28d7d 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -113,7 +113,7 @@ function bb2diaspora($Text,$preserve_nl = false) { // to define the closing tag for the list elements. So nested lists // are going to be flattened out in Diaspora for now $endlessloop = 0; - while ((strpos($Text, "[/list]") !== false) && (strpos($Text, "[list") !== false) + while ((strpos($Text, "[/list]") !== false) && (strpos($Text, "[list") !== false) && (strpos($Text, "[/ol]") !== false) && (strpos($Text, "[ol]") !== false) && (strpos($Text, "[/ul]") !== false) && (strpos($Text, "[ul]") !== false) && (++$endlessloop < 20)) { $Text = preg_replace_callback("/\[list\](.*?)\[\/list\]/is", 'diaspora_ul', $Text); diff --git a/include/bbcode.php b/include/bbcode.php index 38d1e658f9..2c1c2378f1 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -162,7 +162,7 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) { // handle nested lists $endlessloop = 0; - while ((strpos($Text, "[/list]") !== false) && (strpos($Text, "[list") !== false) + while ((strpos($Text, "[/list]") !== false) && (strpos($Text, "[list") !== false) && (strpos($Text, "[/ol]") !== false) && (strpos($Text, "[ol]") !== false) && (strpos($Text, "[/ul]") !== false) && (strpos($Text, "[ul]") !== false) && (++$endlessloop < 20)) { $Text = preg_replace("/\[list\](.*?)\[\/list\]/ism", '
      $1
    ' ,$Text); diff --git a/include/plugin.php b/include/plugin.php index d762e8717f..ffa562273f 100644 --- a/include/plugin.php +++ b/include/plugin.php @@ -380,20 +380,23 @@ function service_class_fetch($uid,$property) { } -function upgrade_link() { +function upgrade_link($bbcode = false) { $l = get_config('service_class','upgrade_link'); - $t = sprintf('' . t('Click here to upgrade.') . '', $l); - if($l) - return $t; - return ''; + if(! $l) + return ''; + if($bbcode) + $t = sprintf('[url=%s]' . t('Click here to upgrade.') . '[/url]', $l); + else + $t = sprintf('' . t('Click here to upgrade.') . '', $l); + return $t; } -function upgrade_message() { - $x = upgrade_link(); +function upgrade_message($bbcode = false) { + $x = upgrade_link($bbcode); return t('This action exceeds the limits set by your subscription plan.') . (($x) ? ' ' . $x : '') ; } -function upgrade_bool_message() { - $x = upgrade_link(); +function upgrade_bool_message($bbcode = false) { + $x = upgrade_link($bbcode); return t('This action is not available under your subscription plan.') . (($x) ? ' ' . $x : '') ; } diff --git a/mod/wall_attach.php b/mod/wall_attach.php index 03d9f51055..f179b3ca50 100644 --- a/mod/wall_attach.php +++ b/mod/wall_attach.php @@ -60,6 +60,19 @@ function wall_attach_post(&$a) { return; } + $r = q("select sum(octet_length(data)) as total from attach where uid = %d ", + intval($page_owner_uid) + ); + + $limit = service_class_fetch($page_owner_uid,'attach_upload_limit'); + + if(($limit !== false) && (($r[0]['total'] + strlen($imagedata)) > $limit)) { + echo upgrade_message(true) . EOL ; + @unlink($src); + killme(); + } + + $filedata = @file_get_contents($src); $mimetype = z_mime_content_type($filename); $hash = random_string(); diff --git a/mod/wall_upload.php b/mod/wall_upload.php index 4b81f8d1c2..5990f28344 100644 --- a/mod/wall_upload.php +++ b/mod/wall_upload.php @@ -79,6 +79,19 @@ function wall_upload_post(&$a) { killme(); } + $r = q("select sum(octet_length(data)) as total from photo where uid = %d and scale = 0 and album != 'Contact Photos' ", + intval($page_owner_uid) + ); + + $limit = service_class_fetch($page_owner_uid,'photo_upload_limit'); + + if(($limit !== false) && (($r[0]['total'] + strlen($imagedata)) > $limit)) { + echo upgrade_message(true) . EOL ; + @unlink($src); + killme(); + } + + $imagedata = @file_get_contents($src); $ph = new Photo($imagedata, $filetype); From f0b41709eb40237334de5d9a0ae7adbcd95fb841 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 25 Jun 2012 17:45:33 -0700 Subject: [PATCH 17/30] improve remote delete forwarding --- include/api.php | 2 +- include/items.php | 64 ++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 64 insertions(+), 2 deletions(-) diff --git a/include/api.php b/include/api.php index cee1fde23b..09cca8d8db 100644 --- a/include/api.php +++ b/include/api.php @@ -565,7 +565,7 @@ if(requestdata('lat') && requestdata('long')) $_REQUEST['coord'] = sprintf("%s %s",requestdata('lat'),requestdata('long')); $_REQUEST['profile_uid'] = local_user(); -// if(requestdata('parent')) + if($parent) $_REQUEST['type'] = 'net-comment'; else { diff --git a/include/items.php b/include/items.php index e495393fa5..b90b5434ff 100755 --- a/include/items.php +++ b/include/items.php @@ -2148,6 +2148,66 @@ function local_delivery($importer,$data) { } if($deleted) { + + $is_reply = false; + $r = q("select * from item where uri = '%s' and id = parent limit 1", + dbesc($uri) + ); + if(count($r)) { + $parent_uri = $r[0]['parent-uri']; + if($r[0]['parent-uri'] != $uri && $r[0]['thr-parent'] != $uri) + $is_reply = true; + } + + + if($is_reply) { + $community = false; + + if($importer['page-flags'] == PAGE_COMMUNITY || $importer['page-flags'] == PAGE_PRVGROUP ) { + $sql_extra = ''; + $community = true; + logger('local_delivery: possible community delete'); + } + else + $sql_extra = " and contact.self = 1 and item.wall = 1 "; + + // was the top-level post for this reply written by somebody on this site? + // Specifically, the recipient? + + $is_a_remote_delete = false; + + $r = q("select `item`.`id`, `item`.`uri`, `item`.`tag`, `item`.`forum_mode`,`item`.`origin`,`item`.`wall`, + `contact`.`name`, `contact`.`url`, `contact`.`thumb` from `item` + LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` + WHERE `item`.`uri` = '%s' AND (`item`.`parent-uri` = '%s' or `item`.`thr-parent` = '%s') + AND `item`.`uid` = %d + $sql_extra + LIMIT 1", + dbesc($parent_uri), + dbesc($parent_uri), + dbesc($parent_uri), + intval($importer['importer_uid']) + ); + if($r && count($r)) + $is_a_remote_delete = true; + + // Does this have the characteristics of a community or private group comment? + // If it's a reply to a wall post on a community/prvgroup page it's a + // valid community comment. Also forum_mode makes it valid for sure. + // If neither, it's not. + + if($is_a_remote_delete && $community) { + if((! $r[0]['forum_mode']) && (! $r[0]['wall'])) { + $is_a_remote_delete = false; + logger('local_delivery: not a community delete'); + } + } + + if($is_a_remote_delete) { + logger('local_delivery: received remote delete'); + } + } + $r = q("SELECT `item`.*, `contact`.`self` FROM `item` left join contact on `item`.`contact-id` = `contact`.`id` WHERE `uri` = '%s' AND `item`.`uid` = %d AND `contact-id` = %d AND NOT `item`.`file` LIKE '%%[%%' LIMIT 1", dbesc($uri), @@ -2235,7 +2295,9 @@ function local_delivery($importer,$data) { ); } } - } + if($is_a_remote_delete) + proc_run('php',"include/notifier.php","delete",$item['id']); + } } } } From 8bb7ab88fb8a1bfef198f6a2aff53a15e667aa59 Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Sat, 9 Jun 2012 18:39:21 -0600 Subject: [PATCH 18/30] Clean up the Diaspora connectivity: - Move Diaspora code into separate functions to make it more modular - Create more checks for whether Diaspora connectivity has been enabled --- include/delivery.php | 6 +- include/items.php | 133 +++++++++++++++++++++++++---------------- include/notifier.php | 10 +++- mod/item.php | 58 ++++++++++++------ mod/like.php | 138 ++++++++++++++++++++++++++----------------- 5 files changed, 216 insertions(+), 129 deletions(-) diff --git a/include/delivery.php b/include/delivery.php index e6cfc81554..b60fef3bf7 100644 --- a/include/delivery.php +++ b/include/delivery.php @@ -492,6 +492,9 @@ function delivery_run($argv, $argc){ break; case NETWORK_DIASPORA : + if(get_config('system','dfrn_only') || (! get_config('system','diaspora_enabled')) || (! $normal_mode)) + break; + if($public_message) $loc = 'public batch ' . $contact['batch']; else @@ -499,9 +502,6 @@ function delivery_run($argv, $argc){ logger('delivery: diaspora batch deliver: ' . $loc); - if(get_config('system','dfrn_only') || (! get_config('system','diaspora_enabled')) || (! $normal_mode)) - break; - if((! $contact['pubkey']) && (! $public_message)) break; diff --git a/include/items.php b/include/items.php index e495393fa5..af46eaaa12 100755 --- a/include/items.php +++ b/include/items.php @@ -383,16 +383,21 @@ function get_atom_elements($feed,$item) { $res['app'] = 'OStatus'; } - // base64 encoded json structure representing Diaspora signature - $dsig = $item->get_item_tags(NAMESPACE_DFRN,'diaspora_signature'); - if($dsig) { - $res['dsprsig'] = unxmlify($dsig[0]['data']); + // base64 encoded json structure representing Diaspora signature + $dspr_enabled = intval(get_config('system','diaspora_enabled')); + + if( $dspr_enabled) { + $dsig = $item->get_item_tags(NAMESPACE_DFRN,'diaspora_signature'); + if($dsig) { + $res['dsprsig'] = unxmlify($dsig[0]['data']); + } + + $dguid = $item->get_item_tags(NAMESPACE_DFRN,'diaspora_guid'); + if($dguid) + $res['guid'] = unxmlify($dguid[0]['data']); } - $dguid = $item->get_item_tags(NAMESPACE_DFRN,'diaspora_guid'); - if($dguid) - $res['guid'] = unxmlify($dguid[0]['data']); $bm = $item->get_item_tags(NAMESPACE_DFRN,'bookmark'); if($bm) @@ -699,13 +704,17 @@ function item_store($arr,$force_parent = false) { // If a Diaspora signature structure was passed in, pull it out of the // item array and set it aside for later storage. + $dspr_enabled = intval(get_config('system','diaspora_enabled')); $dsprsig = null; + if(x($arr,'dsprsig')) { - $dsprsig = json_decode(base64_decode($arr['dsprsig'])); + if($dspr_enabled) + $dsprsig = json_decode(base64_decode($arr['dsprsig'])); unset($arr['dsprsig']); } + if(x($arr, 'gravity')) $arr['gravity'] = intval($arr['gravity']); elseif($arr['parent-uri'] === $arr['uri']) @@ -934,7 +943,9 @@ function item_store($arr,$force_parent = false) { intval($parent_id) ); - if($dsprsig) { + + // Store the Diaspora signature if there is one + if($dspr_enabled && $dsprsig) { q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ", intval($current_post), dbesc($dsprsig->signed_text), @@ -1008,6 +1019,7 @@ function tag_deliver($uid,$item_id) { $dlink = normalise_link($a->get_baseurl() . '/u/' . $u[0]['nickname']); + $cnt = preg_match_all('/[\@\!]\[url\=(.*?)\](.*?)\[\/url\]/ism',$item['body'],$matches,PREG_SET_ORDER); if($cnt) { foreach($matches as $mtch) { @@ -2973,12 +2985,15 @@ function atom_entry($item,$type,$author,$owner,$comment = false,$cid = 0) { if($item['app']) $o .= '' . "\r\n"; - if($item['guid']) - $o .= '' . $item['guid'] . '' . "\r\n"; + $dspr_enabled = intval(get_config('system','diaspora_enabled')); + if( $dspr_enabled) { + if($item['guid']) + $o .= '' . $item['guid'] . '' . "\r\n"; - if($item['signed_text']) { - $sign = base64_encode(json_encode(array('signed_text' => $item['signed_text'],'signature' => $item['signature'],'signer' => $item['signer']))); - $o .= '' . xmlify($sign) . '' . "\r\n"; + if($item['signed_text']) { + $sign = base64_encode(json_encode(array('signed_text' => $item['signed_text'],'signature' => $item['signature'],'signer' => $item['signer']))); + $o .= '' . xmlify($sign) . '' . "\r\n"; + } } $verb = construct_verb($item); @@ -3317,7 +3332,9 @@ function drop_item($id,$interactive = true) { // ignore the result } - // clean up item_id and sign meta-data tables + // clean up item_id and sign (Diaspora signature) meta-data tables + // Clean up the sign table even if Diaspora support is disabled. We may still need to + // clean it up if Diaspora support had been enabled in the past $r = q("DELETE FROM item_id where iid in (select id from item where parent = %d and uid = %d)", intval($item['id']), @@ -3359,40 +3376,8 @@ function drop_item($id,$interactive = true) { ); } - // Add a relayable_retraction signature for Diaspora. Note that we can't add a target_author_signature - // if the comment was deleted by a remote user. That should be ok, because if a remote user is deleting - // the comment, that means we're the home of the post, and Diaspora will only - // check the parent_author_signature of retractions that it doesn't have to relay further - // - // I don't think this function gets called for an "unlike," but I'll check anyway - $signed_text = $item['guid'] . ';' . ( ($item['verb'] === ACTIVITY_LIKE) ? 'Like' : 'Comment'); - - if(local_user() == $item['uid']) { - - $handle = $a->user['nickname'] . '@' . substr($a->get_baseurl(), strpos($a->get_baseurl(),'://') + 3); - $authorsig = base64_encode(rsa_sign($signed_text,$a->user['prvkey'],'sha256')); - } - else { - $r = q("SELECT `nick`, `url` FROM `contact` WHERE `id` = '%d' LIMIT 1", - $item['contact-id'] - ); - if(count($r)) { - // The below handle only works for NETWORK_DFRN. I think that's ok, because this function - // only handles DFRN deletes - $handle_baseurl_start = strpos($r['url'],'://') + 3; - $handle_baseurl_length = strpos($r['url'],'/profile') - $handle_baseurl_start; - $handle = $r['nick'] . '@' . substr($r['url'], $handle_baseurl_start, $handle_baseurl_length); - $authorsig = ''; - } - } - - if(isset($handle)) - q("insert into sign (`retract_iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ", - intval($item['id']), - dbesc($signed_text), - dbesc($authorsig), - dbesc($handle) - ); + // Add a relayable_retraction signature for Diaspora. + store_diaspora_retract_sig($item, $a->user, $a->get_baseurl()); } $drop_id = intval($item['id']); @@ -3479,4 +3464,52 @@ function posted_date_widget($url,$uid,$wall) { '$dates' => $ret )); return $o; -} \ No newline at end of file +} + + +function store_diaspora_retract_sig($item, $user, $baseurl) { + // Note that we can't add a target_author_signature + // if the comment was deleted by a remote user. That should be ok, because if a remote user is deleting + // the comment, that means we're the home of the post, and Diaspora will only + // check the parent_author_signature of retractions that it doesn't have to relay further + // + // I don't think this function gets called for an "unlike," but I'll check anyway + + $enabled = intval(get_config('system','diaspora_enabled')); + if(! $enabled) { + return; + } + + logger('drop_item: storing diaspora retraction signature'); + + $signed_text = $item['guid'] . ';' . ( ($item['verb'] === ACTIVITY_LIKE) ? 'Like' : 'Comment'); + + if(local_user() == $item['uid']) { + + $handle = $user['nickname'] . '@' . substr($baseurl, strpos($baseurl,'://') + 3); + $authorsig = base64_encode(rsa_sign($signed_text,$user['prvkey'],'sha256')); + } + else { + $r = q("SELECT `nick`, `url` FROM `contact` WHERE `id` = '%d' LIMIT 1", + $item['contact-id'] + ); + if(count($r)) { + // The below handle only works for NETWORK_DFRN. I think that's ok, because this function + // only handles DFRN deletes + $handle_baseurl_start = strpos($r['url'],'://') + 3; + $handle_baseurl_length = strpos($r['url'],'/profile') - $handle_baseurl_start; + $handle = $r['nick'] . '@' . substr($r['url'], $handle_baseurl_start, $handle_baseurl_length); + $authorsig = ''; + } + } + + if(isset($handle)) + q("insert into sign (`retract_iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ", + intval($item['id']), + dbesc($signed_text), + dbesc($authorsig), + dbesc($handle) + ); + + return; +} diff --git a/include/notifier.php b/include/notifier.php index f0a1940d49..fe6cc394ed 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -709,11 +709,11 @@ function notifier_run($argv, $argc){ } break; case NETWORK_DIASPORA: - require_once('include/diaspora.php'); - if(get_config('system','dfrn_only') || (! get_config('system','diaspora_enabled'))) break; + require_once('include/diaspora.php'); + if($mail) { diaspora_send_mail($item,$owner,$contact); break; @@ -860,13 +860,17 @@ function notifier_run($argv, $argc){ } - // If the item was deleted, clean up the `sign` table + + // If the item was deleted, clean up the `sign` table (for Diaspora signatures) + // Do this even if Diaspora support is disabled, as it may have been enabled in + // the past if($target_item['deleted']) { $r = q("DELETE FROM sign where `retract_iid` = %d", intval($target_item['id']) ); } + logger('notifier: calling hooks', LOGGER_DEBUG); if($normal_mode) diff --git a/mod/item.php b/mod/item.php index 54f9fc06aa..5c179bc7a1 100644 --- a/mod/item.php +++ b/mod/item.php @@ -728,26 +728,13 @@ function item_post(&$a) { } - // We won't be able to sign Diaspora comments for authenticated visitors - we don't have their private key - if($self) { - require_once('include/bb2diaspora.php'); - $signed_body = html_entity_decode(bb2diaspora($datarray['body'])); - $myaddr = $a->user['nickname'] . '@' . substr($a->get_baseurl(), strpos($a->get_baseurl(),'://') + 3); - if($datarray['verb'] === ACTIVITY_LIKE) - $signed_text = $datarray['guid'] . ';' . 'Post' . ';' . $parent_item['guid'] . ';' . 'true' . ';' . $myaddr; - else - $signed_text = $datarray['guid'] . ';' . $parent_item['guid'] . ';' . $signed_body . ';' . $myaddr; + // Store the comment signature information in case we need to relay to Diaspora + // May want to have this run for remote users too, in which case the function needs to be + // expanded + if($self) + store_diaspora_comment_sig($datarray, $a->user, $a->get_baseurl(), $parent_item, $post_id); - $authorsig = base64_encode(rsa_sign($signed_text,$a->user['prvkey'],'sha256')); - - q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ", - intval($post_id), - dbesc($signed_text), - dbesc(base64_encode($authorsig)), - dbesc($myaddr) - ); - } } else { $parent = $post_id; @@ -1038,3 +1025,38 @@ function handle_tag($a, &$body, &$inform, &$str_tags, $profile_uid, $tag) { return array('replaced' => $replaced, 'contact' => $r[0]); } + + +function store_diaspora_comment_sig($datarray, $user, $baseurl, $parent_item, $post_id) { + // We won't be able to sign Diaspora comments for authenticated visitors - we don't have their private key + + // May want to have this run for remote users too, in which case the function needs to be + // expanded + + $enabled = intval(get_config('system','diaspora_enabled')); + if(! $enabled) { + return; + } + + + logger('mod_item: storing diaspora comment signature'); + + require_once('include/bb2diaspora.php'); + $signed_body = html_entity_decode(bb2diaspora($datarray['body'])); + $myaddr = $user['nickname'] . '@' . substr($baseurl, strpos($baseurl,'://') + 3); + if($datarray['verb'] === ACTIVITY_LIKE) + $signed_text = $datarray['guid'] . ';' . 'Post' . ';' . $parent_item['guid'] . ';' . 'true' . ';' . $myaddr; + else + $signed_text = $datarray['guid'] . ';' . $parent_item['guid'] . ';' . $signed_body . ';' . $myaddr; + + $authorsig = base64_encode(rsa_sign($signed_text,$user['prvkey'],'sha256')); + + q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ", + intval($post_id), + dbesc($signed_text), + dbesc(base64_encode($authorsig)), + dbesc($myaddr) + ); + + return; +} diff --git a/mod/like.php b/mod/like.php index 642e948fdd..29a77aa135 100755 --- a/mod/like.php +++ b/mod/like.php @@ -121,57 +121,16 @@ function like_content(&$a) { intval($like_item['id']) ); - // Clean up the `sign` table + + // Clean up the Diaspora signatures for this like + // Go ahead and do it even if Diaspora support is disabled. We still want to clean up + // if it had been enabled in the past $r = q("DELETE FROM `sign` WHERE `iid` = %d", intval($like_item['id']) ); // Save the author information for the unlike in case we need to relay to Diaspora - // Note that we can only create a signature for a user of the local server. We don't have - // a key for remote users. That is ok, because if a remote user is "unlike"ing a post, it - // means we are the relay, and for relayable_retractions, Diaspora - // only checks the parent_author_signature if it doesn't have to relay further - // - // If $item['resource-id'] exists, it means the item is a photo. Diaspora doesn't support - // likes on photos, so don't bother. - - if(($activity === ACTIVITY_LIKE) && (! $item['resource-id'])) { - $signed_text = $like_item['guid'] . ';' . 'Like'; - - if( $contact['network'] === NETWORK_DIASPORA) - $diaspora_handle = $contact['addr']; - else { // Only works for NETWORK_DFRN - $contact_baseurl_start = strpos($contact['url'],'://') + 3; - $contact_baseurl_length = strpos($contact['url'],'/profile') - $contact_baseurl_start; - $contact_baseurl = substr($contact['url'], $contact_baseurl_start, $contact_baseurl_length); - $diaspora_handle = $contact['nick'] . '@' . $contact_baseurl; - - // Get contact's private key if he's a user of the local Friendica server - $r = q("SELECT `contact`.`uid` FROM `contact` WHERE `url` = '%s' AND `self` = 1 LIMIT 1", - dbesc($contact['url']) - ); - - if( $r) { - $contact_uid = $r['uid']; - $r = q("SELECT prvkey FROM user WHERE uid = %d LIMIT 1", - intval($contact_uid) - ); - - if( $r) - $authorsig = base64_encode(rsa_sign($signed_text,$r['prvkey'],'sha256')); - } - } - - if(! isset($authorsig)) - $authorsig = ''; - - q("insert into sign (`retract_iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ", - intval($like_item['id']), - dbesc($signed_text), - dbesc($authorsig), - dbesc($diaspora_handle) - ); - } + store_diaspora_like_retract_sig($activity, $item, $like_item, $contact); // proc_run('php',"include/notifier.php","like","$post_id"); // $post_id isn't defined here! @@ -252,10 +211,87 @@ EOT; // Save the author information for the like in case we need to relay to Diaspora + store_diaspora_like_sig($activity, $item, $like_item, $contact); + + + $arr['id'] = $post_id; + + call_hooks('post_local_end', $arr); + + proc_run('php',"include/notifier.php","like","$post_id"); + + killme(); +// return; // NOTREACHED +} + + +function store_diaspora_like_retract_sig($activity, $item, $like_item, $contact) { // Note that we can only create a signature for a user of the local server. We don't have // a key for remote users. That is ok, because if a remote user is "unlike"ing a post, it // means we are the relay, and for relayable_retractions, Diaspora // only checks the parent_author_signature if it doesn't have to relay further + // + // If $item['resource-id'] exists, it means the item is a photo. Diaspora doesn't support + // likes on photos, so don't bother. + + $enabled = intval(get_config('system','diaspora_enabled')); + if(! $enabled) + return; + + logger('mod_like: storing diaspora like retraction signature'); + + if(($activity === ACTIVITY_LIKE) && (! $item['resource-id'])) { + $signed_text = $like_item['guid'] . ';' . 'Like'; + + if( $contact['network'] === NETWORK_DIASPORA) + $diaspora_handle = $contact['addr']; + else { // Only works for NETWORK_DFRN + $contact_baseurl_start = strpos($contact['url'],'://') + 3; + $contact_baseurl_length = strpos($contact['url'],'/profile') - $contact_baseurl_start; + $contact_baseurl = substr($contact['url'], $contact_baseurl_start, $contact_baseurl_length); + $diaspora_handle = $contact['nick'] . '@' . $contact_baseurl; + + // Get contact's private key if he's a user of the local Friendica server + $r = q("SELECT `contact`.`uid` FROM `contact` WHERE `url` = '%s' AND `self` = 1 LIMIT 1", + dbesc($contact['url']) + ); + + if( $r) { + $contact_uid = $r['uid']; + $r = q("SELECT prvkey FROM user WHERE uid = %d LIMIT 1", + intval($contact_uid) + ); + + if( $r) + $authorsig = base64_encode(rsa_sign($signed_text,$r['prvkey'],'sha256')); + } + } + + if(! isset($authorsig)) + $authorsig = ''; + + q("insert into sign (`retract_iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ", + intval($like_item['id']), + dbesc($signed_text), + dbesc($authorsig), + dbesc($diaspora_handle) + ); + } + + return; +} + +function store_diaspora_like_sig($activity, $post_type, $contact, $post_id) { + // Note that we can only create a signature for a user of the local server. We don't have + // a key for remote users. That is ok, because if a remote user is "unlike"ing a post, it + // means we are the relay, and for relayable_retractions, Diaspora + // only checks the parent_author_signature if it doesn't have to relay further + + $enabled = intval(get_config('system','diaspora_enabled')); + if(! $enabled) + return; + + logger('mod_like: storing diaspora like signature'); if(($activity === ACTIVITY_LIKE) && ($post_type === t('status'))) { if( $contact['network'] === NETWORK_DIASPORA) @@ -308,13 +344,5 @@ EOT; } } - - $arr['id'] = $post_id; - - call_hooks('post_local_end', $arr); - - proc_run('php',"include/notifier.php","like","$post_id"); - - killme(); -// return; // NOTREACHED + return; } From c0c50ece0fa625b9b1c6bd89045b8f16057d8eb2 Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Tue, 12 Jun 2012 18:38:24 -0600 Subject: [PATCH 19/30] revert extra Diaspora disabling changes to try to eliminate Mustard double-posting --- include/delivery.php | 8 ++++---- include/items.php | 46 +++++++++++++++----------------------------- include/notifier.php | 12 ++++-------- 3 files changed, 23 insertions(+), 43 deletions(-) diff --git a/include/delivery.php b/include/delivery.php index b60fef3bf7..8152876683 100644 --- a/include/delivery.php +++ b/include/delivery.php @@ -113,7 +113,7 @@ function delivery_run($argv, $argc){ $uid = $r[0]['uid']; $updated = $r[0]['edited']; - // The following seems superfluous. We've already checked for "if (! intval($r[0]['parent']))" a few lines up + // POSSIBLE CLEANUP --> The following seems superfluous. We've already checked for "if (! intval($r[0]['parent']))" a few lines up if(! $parent_id) continue; @@ -492,9 +492,6 @@ function delivery_run($argv, $argc){ break; case NETWORK_DIASPORA : - if(get_config('system','dfrn_only') || (! get_config('system','diaspora_enabled')) || (! $normal_mode)) - break; - if($public_message) $loc = 'public batch ' . $contact['batch']; else @@ -502,6 +499,9 @@ function delivery_run($argv, $argc){ logger('delivery: diaspora batch deliver: ' . $loc); + if(get_config('system','dfrn_only') || (! get_config('system','diaspora_enabled')) || (! $normal_mode)) + break; + if((! $contact['pubkey']) && (! $public_message)) break; diff --git a/include/items.php b/include/items.php index af46eaaa12..7e8b8af4cc 100755 --- a/include/items.php +++ b/include/items.php @@ -383,21 +383,16 @@ function get_atom_elements($feed,$item) { $res['app'] = 'OStatus'; } - // base64 encoded json structure representing Diaspora signature - $dspr_enabled = intval(get_config('system','diaspora_enabled')); - if( $dspr_enabled) { - $dsig = $item->get_item_tags(NAMESPACE_DFRN,'diaspora_signature'); - if($dsig) { - $res['dsprsig'] = unxmlify($dsig[0]['data']); - } - - $dguid = $item->get_item_tags(NAMESPACE_DFRN,'diaspora_guid'); - if($dguid) - $res['guid'] = unxmlify($dguid[0]['data']); + $dsig = $item->get_item_tags(NAMESPACE_DFRN,'diaspora_signature'); + if($dsig) { + $res['dsprsig'] = unxmlify($dsig[0]['data']); } + $dguid = $item->get_item_tags(NAMESPACE_DFRN,'diaspora_guid'); + if($dguid) + $res['guid'] = unxmlify($dguid[0]['data']); $bm = $item->get_item_tags(NAMESPACE_DFRN,'bookmark'); if($bm) @@ -704,17 +699,13 @@ function item_store($arr,$force_parent = false) { // If a Diaspora signature structure was passed in, pull it out of the // item array and set it aside for later storage. - $dspr_enabled = intval(get_config('system','diaspora_enabled')); $dsprsig = null; - if(x($arr,'dsprsig')) { - if($dspr_enabled) - $dsprsig = json_decode(base64_decode($arr['dsprsig'])); + $dsprsig = json_decode(base64_decode($arr['dsprsig'])); unset($arr['dsprsig']); } - if(x($arr, 'gravity')) $arr['gravity'] = intval($arr['gravity']); elseif($arr['parent-uri'] === $arr['uri']) @@ -943,9 +934,7 @@ function item_store($arr,$force_parent = false) { intval($parent_id) ); - - // Store the Diaspora signature if there is one - if($dspr_enabled && $dsprsig) { + if($dsprsig) { q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ", intval($current_post), dbesc($dsprsig->signed_text), @@ -1019,7 +1008,6 @@ function tag_deliver($uid,$item_id) { $dlink = normalise_link($a->get_baseurl() . '/u/' . $u[0]['nickname']); - $cnt = preg_match_all('/[\@\!]\[url\=(.*?)\](.*?)\[\/url\]/ism',$item['body'],$matches,PREG_SET_ORDER); if($cnt) { foreach($matches as $mtch) { @@ -2280,6 +2268,7 @@ function local_delivery($importer,$data) { $is_a_remote_comment = false; + // POSSIBLE CLEANUP --> Why select so many fields when only forum_mode and wall are used? $r = q("select `item`.`id`, `item`.`uri`, `item`.`tag`, `item`.`forum_mode`,`item`.`origin`,`item`.`wall`, `contact`.`name`, `contact`.`url`, `contact`.`thumb` from `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` @@ -2985,15 +2974,12 @@ function atom_entry($item,$type,$author,$owner,$comment = false,$cid = 0) { if($item['app']) $o .= '' . "\r\n"; - $dspr_enabled = intval(get_config('system','diaspora_enabled')); - if( $dspr_enabled) { - if($item['guid']) - $o .= '' . $item['guid'] . '' . "\r\n"; + if($item['guid']) + $o .= '' . $item['guid'] . '' . "\r\n"; - if($item['signed_text']) { - $sign = base64_encode(json_encode(array('signed_text' => $item['signed_text'],'signature' => $item['signature'],'signer' => $item['signer']))); - $o .= '' . xmlify($sign) . '' . "\r\n"; - } + if($item['signed_text']) { + $sign = base64_encode(json_encode(array('signed_text' => $item['signed_text'],'signature' => $item['signature'],'signer' => $item['signer']))); + $o .= '' . xmlify($sign) . '' . "\r\n"; } $verb = construct_verb($item); @@ -3332,9 +3318,7 @@ function drop_item($id,$interactive = true) { // ignore the result } - // clean up item_id and sign (Diaspora signature) meta-data tables - // Clean up the sign table even if Diaspora support is disabled. We may still need to - // clean it up if Diaspora support had been enabled in the past + // clean up item_id and sign meta-data tables $r = q("DELETE FROM item_id where iid in (select id from item where parent = %d and uid = %d)", intval($item['id']), diff --git a/include/notifier.php b/include/notifier.php index fe6cc394ed..443cc30141 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -125,7 +125,7 @@ function notifier_run($argv, $argc){ $uid = $r[0]['uid']; $updated = $r[0]['edited']; - // The following seems superfluous. We've already checked for "if (! intval($r[0]['parent']))" a few lines up + // POSSIBLE CLEANUP --> The following seems superfluous. We've already checked for "if (! intval($r[0]['parent']))" a few lines up if(! $parent_id) return; @@ -709,11 +709,11 @@ function notifier_run($argv, $argc){ } break; case NETWORK_DIASPORA: + require_once('include/diaspora.php'); + if(get_config('system','dfrn_only') || (! get_config('system','diaspora_enabled'))) break; - require_once('include/diaspora.php'); - if($mail) { diaspora_send_mail($item,$owner,$contact); break; @@ -860,17 +860,13 @@ function notifier_run($argv, $argc){ } - - // If the item was deleted, clean up the `sign` table (for Diaspora signatures) - // Do this even if Diaspora support is disabled, as it may have been enabled in - // the past + // If the item was deleted, clean up the `sign` table if($target_item['deleted']) { $r = q("DELETE FROM sign where `retract_iid` = %d", intval($target_item['id']) ); } - logger('notifier: calling hooks', LOGGER_DEBUG); if($normal_mode) From 5773241537b09aa411c48b4d67eefcebb1ea9c84 Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Tue, 12 Jun 2012 19:05:01 -0600 Subject: [PATCH 20/30] add some debug logging --- include/items.php | 1 + mod/item.php | 1 + mod/like.php | 8 ++++++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/items.php b/include/items.php index 7e8b8af4cc..7d51261db9 100755 --- a/include/items.php +++ b/include/items.php @@ -3461,6 +3461,7 @@ function store_diaspora_retract_sig($item, $user, $baseurl) { $enabled = intval(get_config('system','diaspora_enabled')); if(! $enabled) { + logger('drop_item: diaspora support disabled, not storing retraction signature', LOGGER_DEBUG); return; } diff --git a/mod/item.php b/mod/item.php index 5c179bc7a1..b8afe76d14 100644 --- a/mod/item.php +++ b/mod/item.php @@ -1035,6 +1035,7 @@ function store_diaspora_comment_sig($datarray, $user, $baseurl, $parent_item, $p $enabled = intval(get_config('system','diaspora_enabled')); if(! $enabled) { + logger('mod_item: diaspora support disabled, not storing comment signature', LOGGER_DEBUG); return; } diff --git a/mod/like.php b/mod/like.php index 29a77aa135..3c6dfa59b5 100755 --- a/mod/like.php +++ b/mod/like.php @@ -235,8 +235,10 @@ function store_diaspora_like_retract_sig($activity, $item, $like_item, $contact) // likes on photos, so don't bother. $enabled = intval(get_config('system','diaspora_enabled')); - if(! $enabled) + if(! $enabled) { + logger('mod_like: diaspora support disabled, not storing like retraction signature', LOGGER_DEBUG); return; + } logger('mod_like: storing diaspora like retraction signature'); @@ -288,8 +290,10 @@ function store_diaspora_like_sig($activity, $post_type, $contact, $post_id) { // only checks the parent_author_signature if it doesn't have to relay further $enabled = intval(get_config('system','diaspora_enabled')); - if(! $enabled) + if(! $enabled) { + logger('mod_like: diaspora support disabled, not storing like signature', LOGGER_DEBUG); return; + } logger('mod_like: storing diaspora like signature'); From f495ba2bcbf3d80e6919672f0d0e5f375aa1a20d Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Sat, 16 Jun 2012 11:29:56 -0600 Subject: [PATCH 21/30] was passing the wrong arguments to the signature storage function --- mod/like.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/like.php b/mod/like.php index 3c6dfa59b5..54d63b1456 100755 --- a/mod/like.php +++ b/mod/like.php @@ -211,7 +211,7 @@ EOT; // Save the author information for the like in case we need to relay to Diaspora - store_diaspora_like_sig($activity, $item, $like_item, $contact); + store_diaspora_like_sig($activity, $post_type, $contact, $post_id); $arr['id'] = $post_id; From 9e8573507e311d139ac7c83dff496d85408d9b8d Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Sat, 23 Jun 2012 12:09:01 -0600 Subject: [PATCH 22/30] store signature info for remote users too --- mod/item.php | 35 ++++++++++++++++++++--------------- mod/like.php | 6 ++++-- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/mod/item.php b/mod/item.php index b8afe76d14..000f466446 100644 --- a/mod/item.php +++ b/mod/item.php @@ -730,10 +730,7 @@ function item_post(&$a) { // Store the comment signature information in case we need to relay to Diaspora - // May want to have this run for remote users too, in which case the function needs to be - // expanded - if($self) - store_diaspora_comment_sig($datarray, $a->user, $a->get_baseurl(), $parent_item, $post_id); + store_diaspora_comment_sig($datarray, $author, ($self ? $a->user['prvkey'] : false), $parent_item, $post_id); } else { @@ -1027,12 +1024,9 @@ function handle_tag($a, &$body, &$inform, &$str_tags, $profile_uid, $tag) { } -function store_diaspora_comment_sig($datarray, $user, $baseurl, $parent_item, $post_id) { +function store_diaspora_comment_sig($datarray, $author, $uprvkey, $parent_item, $post_id) { // We won't be able to sign Diaspora comments for authenticated visitors - we don't have their private key - // May want to have this run for remote users too, in which case the function needs to be - // expanded - $enabled = intval(get_config('system','diaspora_enabled')); if(! $enabled) { logger('mod_item: diaspora support disabled, not storing comment signature', LOGGER_DEBUG); @@ -1044,19 +1038,30 @@ function store_diaspora_comment_sig($datarray, $user, $baseurl, $parent_item, $p require_once('include/bb2diaspora.php'); $signed_body = html_entity_decode(bb2diaspora($datarray['body'])); - $myaddr = $user['nickname'] . '@' . substr($baseurl, strpos($baseurl,'://') + 3); - if($datarray['verb'] === ACTIVITY_LIKE) - $signed_text = $datarray['guid'] . ';' . 'Post' . ';' . $parent_item['guid'] . ';' . 'true' . ';' . $myaddr; - else - $signed_text = $datarray['guid'] . ';' . $parent_item['guid'] . ';' . $signed_body . ';' . $myaddr; - $authorsig = base64_encode(rsa_sign($signed_text,$user['prvkey'],'sha256')); +// $myaddr = $user['nickname'] . '@' . substr($baseurl, strpos($baseurl,'://') + 3); + if( $author['network'] === NETWORK_DIASPORA) + $diaspora_handle = $author['addr']; + else { + // Only works for NETWORK_DFRN + $contact_baseurl_start = strpos($author['url'],'://') + 3; + $contact_baseurl_length = strpos($author['url'],'/profile') - $contact_baseurl_start; + $contact_baseurl = substr($author['url'], $contact_baseurl_start, $contact_baseurl_length); + $diaspora_handle = $author['nick'] . '@' . $contact_baseurl; + } + + $signed_text = $datarray['guid'] . ';' . $parent_item['guid'] . ';' . $signed_body . ';' . $diaspora_handle; + + if( $uprvkey !== false ) + $authorsig = base64_encode(rsa_sign($signed_text,$uprvkey,'sha256')); + else + $authorsig = ''; q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ", intval($post_id), dbesc($signed_text), dbesc(base64_encode($authorsig)), - dbesc($myaddr) + dbesc($diaspora_handle) ); return; diff --git a/mod/like.php b/mod/like.php index 54d63b1456..dce40a68e1 100755 --- a/mod/like.php +++ b/mod/like.php @@ -247,7 +247,8 @@ function store_diaspora_like_retract_sig($activity, $item, $like_item, $contact) if( $contact['network'] === NETWORK_DIASPORA) $diaspora_handle = $contact['addr']; - else { // Only works for NETWORK_DFRN + else { + // Only works for NETWORK_DFRN $contact_baseurl_start = strpos($contact['url'],'://') + 3; $contact_baseurl_length = strpos($contact['url'],'/profile') - $contact_baseurl_start; $contact_baseurl = substr($contact['url'], $contact_baseurl_start, $contact_baseurl_length); @@ -300,7 +301,8 @@ function store_diaspora_like_sig($activity, $post_type, $contact, $post_id) { if(($activity === ACTIVITY_LIKE) && ($post_type === t('status'))) { if( $contact['network'] === NETWORK_DIASPORA) $diaspora_handle = $contact['addr']; - else { // Only works for NETWORK_DFRN + else { + // Only works for NETWORK_DFRN $contact_baseurl_start = strpos($contact['url'],'://') + 3; $contact_baseurl_length = strpos($contact['url'],'/profile') - $contact_baseurl_start; $contact_baseurl = substr($contact['url'], $contact_baseurl_start, $contact_baseurl_length); From 28526dbf2179619582bec5ab456b49f6ce3e8bd3 Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Sat, 23 Jun 2012 12:40:53 -0600 Subject: [PATCH 23/30] remove possibly unnecessary checks for likes or comments created by Diaspora users --- mod/item.php | 18 ++++++------ mod/like.php | 80 ++++++++++++++++++++++++++-------------------------- 2 files changed, 49 insertions(+), 49 deletions(-) diff --git a/mod/item.php b/mod/item.php index 000f466446..aa022d37d8 100644 --- a/mod/item.php +++ b/mod/item.php @@ -1040,15 +1040,15 @@ function store_diaspora_comment_sig($datarray, $author, $uprvkey, $parent_item, $signed_body = html_entity_decode(bb2diaspora($datarray['body'])); // $myaddr = $user['nickname'] . '@' . substr($baseurl, strpos($baseurl,'://') + 3); - if( $author['network'] === NETWORK_DIASPORA) - $diaspora_handle = $author['addr']; - else { - // Only works for NETWORK_DFRN - $contact_baseurl_start = strpos($author['url'],'://') + 3; - $contact_baseurl_length = strpos($author['url'],'/profile') - $contact_baseurl_start; - $contact_baseurl = substr($author['url'], $contact_baseurl_start, $contact_baseurl_length); - $diaspora_handle = $author['nick'] . '@' . $contact_baseurl; - } +// if( $author['network'] === NETWORK_DIASPORA) +// $diaspora_handle = $author['addr']; +// else { + // Only works for NETWORK_DFRN + $contact_baseurl_start = strpos($author['url'],'://') + 3; + $contact_baseurl_length = strpos($author['url'],'/profile') - $contact_baseurl_start; + $contact_baseurl = substr($author['url'], $contact_baseurl_start, $contact_baseurl_length); + $diaspora_handle = $author['nick'] . '@' . $contact_baseurl; +// } $signed_text = $datarray['guid'] . ';' . $parent_item['guid'] . ';' . $signed_body . ';' . $diaspora_handle; diff --git a/mod/like.php b/mod/like.php index dce40a68e1..1176c31101 100755 --- a/mod/like.php +++ b/mod/like.php @@ -245,30 +245,30 @@ function store_diaspora_like_retract_sig($activity, $item, $like_item, $contact) if(($activity === ACTIVITY_LIKE) && (! $item['resource-id'])) { $signed_text = $like_item['guid'] . ';' . 'Like'; - if( $contact['network'] === NETWORK_DIASPORA) - $diaspora_handle = $contact['addr']; - else { - // Only works for NETWORK_DFRN - $contact_baseurl_start = strpos($contact['url'],'://') + 3; - $contact_baseurl_length = strpos($contact['url'],'/profile') - $contact_baseurl_start; - $contact_baseurl = substr($contact['url'], $contact_baseurl_start, $contact_baseurl_length); - $diaspora_handle = $contact['nick'] . '@' . $contact_baseurl; +// if( $contact['network'] === NETWORK_DIASPORA) +// $diaspora_handle = $contact['addr']; +// else { + // Only works for NETWORK_DFRN + $contact_baseurl_start = strpos($contact['url'],'://') + 3; + $contact_baseurl_length = strpos($contact['url'],'/profile') - $contact_baseurl_start; + $contact_baseurl = substr($contact['url'], $contact_baseurl_start, $contact_baseurl_length); + $diaspora_handle = $contact['nick'] . '@' . $contact_baseurl; - // Get contact's private key if he's a user of the local Friendica server - $r = q("SELECT `contact`.`uid` FROM `contact` WHERE `url` = '%s' AND `self` = 1 LIMIT 1", - dbesc($contact['url']) + // Get contact's private key if he's a user of the local Friendica server + $r = q("SELECT `contact`.`uid` FROM `contact` WHERE `url` = '%s' AND `self` = 1 LIMIT 1", + dbesc($contact['url']) + ); + + if( $r) { + $contact_uid = $r['uid']; + $r = q("SELECT prvkey FROM user WHERE uid = %d LIMIT 1", + intval($contact_uid) ); - if( $r) { - $contact_uid = $r['uid']; - $r = q("SELECT prvkey FROM user WHERE uid = %d LIMIT 1", - intval($contact_uid) - ); - - if( $r) - $authorsig = base64_encode(rsa_sign($signed_text,$r['prvkey'],'sha256')); - } + if( $r) + $authorsig = base64_encode(rsa_sign($signed_text,$r['prvkey'],'sha256')); } +// } if(! isset($authorsig)) $authorsig = ''; @@ -299,30 +299,30 @@ function store_diaspora_like_sig($activity, $post_type, $contact, $post_id) { logger('mod_like: storing diaspora like signature'); if(($activity === ACTIVITY_LIKE) && ($post_type === t('status'))) { - if( $contact['network'] === NETWORK_DIASPORA) - $diaspora_handle = $contact['addr']; - else { - // Only works for NETWORK_DFRN - $contact_baseurl_start = strpos($contact['url'],'://') + 3; - $contact_baseurl_length = strpos($contact['url'],'/profile') - $contact_baseurl_start; - $contact_baseurl = substr($contact['url'], $contact_baseurl_start, $contact_baseurl_length); - $diaspora_handle = $contact['nick'] . '@' . $contact_baseurl; +// if( $contact['network'] === NETWORK_DIASPORA) +// $diaspora_handle = $contact['addr']; +// else { + // Only works for NETWORK_DFRN + $contact_baseurl_start = strpos($contact['url'],'://') + 3; + $contact_baseurl_length = strpos($contact['url'],'/profile') - $contact_baseurl_start; + $contact_baseurl = substr($contact['url'], $contact_baseurl_start, $contact_baseurl_length); + $diaspora_handle = $contact['nick'] . '@' . $contact_baseurl; - // Get contact's private key if he's a user of the local Friendica server - $r = q("SELECT `contact`.`uid` FROM `contact` WHERE `url` = '%s' AND `self` = 1 LIMIT 1", - dbesc($contact['url']) + // Get contact's private key if he's a user of the local Friendica server + $r = q("SELECT `contact`.`uid` FROM `contact` WHERE `url` = '%s' AND `self` = 1 LIMIT 1", + dbesc($contact['url']) + ); + + if( $r) { + $contact_uid = $r['uid']; + $r = q("SELECT prvkey FROM user WHERE uid = %d LIMIT 1", + intval($contact_uid) ); - if( $r) { - $contact_uid = $r['uid']; - $r = q("SELECT prvkey FROM user WHERE uid = %d LIMIT 1", - intval($contact_uid) - ); - - if( $r) - $contact_uprvkey = $r['prvkey']; - } + if( $r) + $contact_uprvkey = $r['prvkey']; } +// } $r = q("SELECT guid, parent FROM `item` WHERE id = %d LIMIT 1", intval($post_id) From f1991a59524ce36eea0b982954d90a6c55e59e41 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 25 Jun 2012 18:15:56 -0700 Subject: [PATCH 24/30] propagate remote deletes --- include/items.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/include/items.php b/include/items.php index b90b5434ff..7578bf155a 100755 --- a/include/items.php +++ b/include/items.php @@ -2148,18 +2148,19 @@ function local_delivery($importer,$data) { } if($deleted) { + // check for relayed deletes to our conversation $is_reply = false; - $r = q("select * from item where uri = '%s' and id = parent limit 1", - dbesc($uri) + $r = q("select * from item where uri = '%s' and uid = %d limit 1", + dbesc($uri), + intval($importer['importer_uid']) ); if(count($r)) { $parent_uri = $r[0]['parent-uri']; - if($r[0]['parent-uri'] != $uri && $r[0]['thr-parent'] != $uri) + if($r[0]['id'] != $r[0]['parent']) $is_reply = true; } - if($is_reply) { $community = false; @@ -2295,8 +2296,10 @@ function local_delivery($importer,$data) { ); } } + // if this is a relayed delete, propagate it to other recipients + if($is_a_remote_delete) - proc_run('php',"include/notifier.php","delete",$item['id']); + proc_run('php',"include/notifier.php","drop",$item['id']); } } } From fbaca4b74237c80c380d6ccf2bdddeec5ad4f013 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 25 Jun 2012 20:55:27 -0700 Subject: [PATCH 25/30] event summary/title --- boot.php | 2 +- database.sql | 10 +++++++++- include/bbcode.php | 1 + include/event.php | 16 ++++++++++++++-- mod/events.php | 14 +++++++++++--- update.php | 11 ++++++++++- view/event_form.tpl | 4 ++++ view/theme/diabook/jot.tpl | 2 +- view/theme/duepuntozero/style.css | 7 +++++++ 9 files changed, 58 insertions(+), 9 deletions(-) diff --git a/boot.php b/boot.php index 024ef0c054..47e5b8600f 100644 --- a/boot.php +++ b/boot.php @@ -12,7 +12,7 @@ require_once('include/cache.php'); define ( 'FRIENDICA_PLATFORM', 'Friendica'); define ( 'FRIENDICA_VERSION', '3.0.1385' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); -define ( 'DB_UPDATE_VERSION', 1150 ); +define ( 'DB_UPDATE_VERSION', 1151 ); define ( 'EOL', "
    \r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); diff --git a/database.sql b/database.sql index 8178ffa866..b3b8c3a060 100644 --- a/database.sql +++ b/database.sql @@ -254,6 +254,7 @@ CREATE TABLE IF NOT EXISTS `event` ( `edited` datetime NOT NULL, `start` datetime NOT NULL, `finish` datetime NOT NULL, + `summary` text NOT NULL, `desc` text NOT NULL, `location` text NOT NULL, `type` char(255) NOT NULL, @@ -263,7 +264,14 @@ CREATE TABLE IF NOT EXISTS `event` ( `allow_gid` mediumtext NOT NULL, `deny_cid` mediumtext NOT NULL, `deny_gid` mediumtext NOT NULL, - PRIMARY KEY (`id`) + PRIMARY KEY (`id`), + KEY `uid` ( `uid` ), + KEY `cid` ( `cid` ), + KEY `uri` ( `uri` ), + KEY `type` ( `type` ), + KEY `start` ( `start` ), + KEY `finish` ( `finish` ), + KEY `adjust` ( `adjust` ) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- diff --git a/include/bbcode.php b/include/bbcode.php index e219d53836..effdd0be89 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -301,6 +301,7 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) { if(x($ev,'desc') && x($ev,'start')) { $sub = format_event_html($ev); + $Text = preg_replace("/\[event\-summary\](.*?)\[\/event\-summary\]/ism",'',$Text); $Text = preg_replace("/\[event\-description\](.*?)\[\/event\-description\]/ism",$sub,$Text); $Text = preg_replace("/\[event\-start\](.*?)\[\/event\-start\]/ism",'',$Text); $Text = preg_replace("/\[event\-finish\](.*?)\[\/event\-finish\]/ism",'',$Text); diff --git a/include/event.php b/include/event.php index 866ae8c3f0..8aef0a2636 100644 --- a/include/event.php +++ b/include/event.php @@ -12,6 +12,9 @@ function format_event_html($ev) { $o = '
    ' . "\r\n"; + + $o .= '

    ' . bbcode($ev['summary']) . '

    ' . "\r\n"; + $o .= '

    ' . bbcode($ev['desc']) . '

    ' . "\r\n"; $o .= '

    ' . t('Starts:') . ' get_baseurl().'/events/event/'.$rr['id'],t('Edit event'),'','') : null); - - list($title, $_trash) = explode(" $eid, '$cid' => $cid, '$uri' => $uri, + '$title' => t('Event details'), '$desc' => sprintf( t('Format is %s %s. Starting date and Description are required.'),$dateformat,$timeformat), @@ -422,6 +428,8 @@ function events_content(&$a) { '$d_orig' => $d_orig, '$l_text' => t('Location:'), '$l_orig' => $l_orig, + '$t_text' => t('Title:'), + '$t_orig' => $t_orig, '$sh_text' => t('Share this event'), '$sh_checked' => $sh_checked, '$acl' => (($cid) ? '' : populate_acl(((x($orig_event)) ? $orig_event : $a->user),false)), diff --git a/update.php b/update.php index eeb8b07b15..b8e247f57c 100644 --- a/update.php +++ b/update.php @@ -1,6 +1,6 @@

    +
    $t_text
    + + +
    $d_text
    diff --git a/view/theme/diabook/jot.tpl b/view/theme/diabook/jot.tpl index 79151aeedb..1d94cb6d3c 100755 --- a/view/theme/diabook/jot.tpl +++ b/view/theme/diabook/jot.tpl @@ -70,7 +70,7 @@
    $acl -
    +
    $emailcc
    $jotnets diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index ea3a2da9c6..41c747045e 100644 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -2424,6 +2424,13 @@ aside input[type='text'] { .vevent { border: 1px solid #CCCCCC; } + +.vevent .event-summary { + margin-left: 10px; + margin-right: 10px; + font-weight: bold; +} + .vevent .event-description, .vevent .event-location { margin-left: 10px; margin-right: 10px; From 359a98cd22318badd9c5bb1115678181b75c9edc Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 25 Jun 2012 21:20:08 -0700 Subject: [PATCH 26/30] change event behaviour so that title is required but description is not --- include/bbcode.php | 4 ++-- mod/events.php | 12 ++++++------ view/theme/duepuntozero/style.css | 24 ++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 8 deletions(-) diff --git a/include/bbcode.php b/include/bbcode.php index effdd0be89..c64d5d0366 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -302,8 +302,8 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) { $sub = format_event_html($ev); $Text = preg_replace("/\[event\-summary\](.*?)\[\/event\-summary\]/ism",'',$Text); - $Text = preg_replace("/\[event\-description\](.*?)\[\/event\-description\]/ism",$sub,$Text); - $Text = preg_replace("/\[event\-start\](.*?)\[\/event\-start\]/ism",'',$Text); + $Text = preg_replace("/\[event\-description\](.*?)\[\/event\-description\]/ism",'',$Text); + $Text = preg_replace("/\[event\-start\](.*?)\[\/event\-start\]/ism",$sub,$Text); $Text = preg_replace("/\[event\-finish\](.*?)\[\/event\-finish\]/ism",'',$Text); $Text = preg_replace("/\[event\-location\](.*?)\[\/event\-location\]/ism",'',$Text); $Text = preg_replace("/\[event\-adjust\](.*?)\[\/event\-adjust\]/ism",'',$Text); diff --git a/mod/events.php b/mod/events.php index e7b95d27ad..4a6d3f100e 100755 --- a/mod/events.php +++ b/mod/events.php @@ -62,8 +62,8 @@ function events_post(&$a) { $location = escape_tags(trim($_POST['location'])); $type = 'event'; - if((! $desc) || (! $start)) { - notice( t('Event description and start time are required.') . EOL); + if((! $summary) || (! $start)) { + notice( t('Event title and start time are required.') . EOL); goaway($a->get_baseurl() . '/events/new'); } @@ -412,9 +412,9 @@ function events_content(&$a) { '$uri' => $uri, '$title' => t('Event details'), - '$desc' => sprintf( t('Format is %s %s. Starting date and Description are required.'),$dateformat,$timeformat), + '$desc' => sprintf( t('Format is %s %s. Starting date and Title are required.'),$dateformat,$timeformat), - '$s_text' => t('Event Starts:') . ' * ', + '$s_text' => t('Event Starts:') . ' *', '$s_dsel' => datesel($f,'start',$syear+5,$syear,false,$syear,$smonth,$sday), '$s_tsel' => timesel('start',$shour,$sminute), '$n_text' => t('Finish date/time is not known or not relevant'), @@ -424,11 +424,11 @@ function events_content(&$a) { '$f_tsel' => timesel('finish',$fhour,$fminute), '$a_text' => t('Adjust for viewer timezone'), '$a_checked' => $a_checked, - '$d_text' => t('Description:') . ' *', + '$d_text' => t('Description:'), '$d_orig' => $d_orig, '$l_text' => t('Location:'), '$l_orig' => $l_orig, - '$t_text' => t('Title:'), + '$t_text' => t('Title:') . ' *', '$t_orig' => $t_orig, '$sh_text' => t('Share this event'), '$sh_checked' => $sh_checked, diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index 41c747045e..997c6d315a 100644 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -2421,6 +2421,30 @@ aside input[type='text'] { font-size: 20px; } +#event-summary-text { + margin-top: 15px; +} + +#event-share-checkbox { + float: left; + margin-top: 10px; +} + +#event-share-text { + float: left; + margin-top: 10px; + margin-left: 5px; +} + +#event-share-break { + clear: both; + margin-bottom: 10px; +} + +#event-summary { + width: 400px; +} + .vevent { border: 1px solid #CCCCCC; } From 0f0ffce1b652897663ec5a8bea9a5c6a4fd37b0d Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 25 Jun 2012 21:27:34 -0700 Subject: [PATCH 27/30] change required doco --- include/bbcode.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/bbcode.php b/include/bbcode.php index c64d5d0366..dcffe82c5b 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -1,4 +1,4 @@ - Date: Mon, 25 Jun 2012 21:37:38 -0700 Subject: [PATCH 28/30] add event titles to discovered birthday events --- include/datetime.php | 9 ++++++--- include/items.php | 8 +++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/include/datetime.php b/include/datetime.php index 58a6186108..e3e9b9dbf6 100644 --- a/include/datetime.php +++ b/include/datetime.php @@ -447,11 +447,13 @@ function update_contact_birthdays() { * */ - $bdtext = t('Birthday:') . ' [url=' . $rr['url'] . ']' . $rr['name'] . '[/url]' ; + $bdtext = sprintf( t('%s\'s birthday'), $rr['name']); + $bdtext2 = sprintf( t('Happy Birthday %s'), ' [url=' . $rr['url'] . ']' . $rr['name'] . '[/url]' ; - $r = q("INSERT INTO `event` (`uid`,`cid`,`created`,`edited`,`start`,`finish`,`desc`,`type`,`adjust`) - VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%d' ) ", + + $r = q("INSERT INTO `event` (`uid`,`cid`,`created`,`edited`,`start`,`finish`,`summary`,`desc`,`type`,`adjust`) + VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%d' ) ", intval($rr['uid']), intval($rr['id']), dbesc(datetime_convert()), @@ -459,6 +461,7 @@ function update_contact_birthdays() { dbesc(datetime_convert('UTC','UTC', $nextbd)), dbesc(datetime_convert('UTC','UTC', $nextbd . ' + 1 day ')), dbesc($bdtext), + dbesc($bdtext2), dbesc('birthday'), intval(0) ); diff --git a/include/items.php b/include/items.php index e19d729ba5..a4faf3adc3 100755 --- a/include/items.php +++ b/include/items.php @@ -1457,11 +1457,12 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) * */ - $bdtext = t('Birthday:') . ' [url=' . $contact['url'] . ']' . $contact['name'] . '[/url]' ; + $bdtext = sprintf( t('%s\'s birthday'), $contact['name']); + $bdtext2 = sprintf( t('Happy Birthday %s'), ' [url=' . $contact['url'] . ']' . $contact['name'] . '[/url]' ; - $r = q("INSERT INTO `event` (`uid`,`cid`,`created`,`edited`,`start`,`finish`,`desc`,`type`) - VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s' ) ", + $r = q("INSERT INTO `event` (`uid`,`cid`,`created`,`edited`,`start`,`finish`,`summary`,`desc`,`type`) + VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s' ) ", intval($contact['uid']), intval($contact['id']), dbesc(datetime_convert()), @@ -1469,6 +1470,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) dbesc(datetime_convert('UTC','UTC', $birthday)), dbesc(datetime_convert('UTC','UTC', $birthday . ' + 1 day ')), dbesc($bdtext), + dbesc($bdtext2), dbesc('birthday') ); From d32d0e21544ffc487042f855280f05ba63651e7d Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 25 Jun 2012 21:39:07 -0700 Subject: [PATCH 29/30] typos --- include/datetime.php | 2 +- include/items.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/datetime.php b/include/datetime.php index e3e9b9dbf6..75ae685f3a 100644 --- a/include/datetime.php +++ b/include/datetime.php @@ -448,7 +448,7 @@ function update_contact_birthdays() { */ $bdtext = sprintf( t('%s\'s birthday'), $rr['name']); - $bdtext2 = sprintf( t('Happy Birthday %s'), ' [url=' . $rr['url'] . ']' . $rr['name'] . '[/url]' ; + $bdtext2 = sprintf( t('Happy Birthday %s'), ' [url=' . $rr['url'] . ']' . $rr['name'] . '[/url]') ; diff --git a/include/items.php b/include/items.php index a4faf3adc3..1f05719688 100755 --- a/include/items.php +++ b/include/items.php @@ -1458,7 +1458,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) */ $bdtext = sprintf( t('%s\'s birthday'), $contact['name']); - $bdtext2 = sprintf( t('Happy Birthday %s'), ' [url=' . $contact['url'] . ']' . $contact['name'] . '[/url]' ; + $bdtext2 = sprintf( t('Happy Birthday %s'), ' [url=' . $contact['url'] . ']' . $contact['name'] . '[/url]' ) ; $r = q("INSERT INTO `event` (`uid`,`cid`,`created`,`edited`,`start`,`finish`,`summary`,`desc`,`type`) From a4b407eb54c67a0c9b8137b44fbd20b43eccb224 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 25 Jun 2012 22:01:32 -0700 Subject: [PATCH 30/30] stray s --- include/bbcode.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/bbcode.php b/include/bbcode.php index dcffe82c5b..ee31b4a1aa 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -1,4 +1,4 @@ -s