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/78] 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/78] 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/78] 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/78] 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/78] 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/78] 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/78] 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/78] 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 c14270ac648391660c989d9b5d28fd2d1070c4db Mon Sep 17 00:00:00 2001 From: Sebastian Egbers Date: Fri, 22 Jun 2012 13:35:36 +0200 Subject: [PATCH 09/78] modified conversion to use x function for parameter checking. --- include/api.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/include/api.php b/include/api.php index b77156dfae..730e1fa2ff 100644 --- a/include/api.php +++ b/include/api.php @@ -864,8 +864,13 @@ logger('API: api_statuses_show: '.$id); //$include_entities = (x($_REQUEST,'include_entities')?$_REQUEST['include_entities']:false); - //$sql_extra = ""; - if ($_GET["conversation"] == "true") $sql_extra .= " AND `item`.`parent` = %d ORDER BY `received` ASC "; else $sql_extra .= " AND `item`.`id` = %d"; + $conversation = (x($_REQUEST,'conversation')?1:0); + + $sql_extra = ''; + if ($conversation) + $sql_extra .= " AND `item`.`parent` = %d ORDER BY `received` ASC "; + else + $sql_extra .= " AND `item`.`id` = %d"; $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, @@ -875,16 +880,15 @@ WHERE `item`.`visible` = 1 and `item`.`moderated` = 0 AND `item`.`deleted` = 0 AND `contact`.`id` = `item`.`contact-id` AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 - $sql_extra - ", + $sql_extra", intval($id) ); -//var_dump($r); + $ret = api_format_items($r,$user_info); -//var_dump($ret); - if ($_GET["conversation"] == "true") { + + if ($conversation) { $data = array('$statuses' => $ret); - return api_apply_template("timeline", $type, $data); + return api_apply_template("timeline", $type, $data); } else { $data = array('$status' => $ret[0]); /*switch($type){ From cd25c3b5dd61755791dcde8dfd09e0032bcfb197 Mon Sep 17 00:00:00 2001 From: Sebastian Egbers Date: Fri, 22 Jun 2012 14:54:31 +0200 Subject: [PATCH 10/78] added replyto and subject to direct messages. --- include/api.php | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/include/api.php b/include/api.php index 730e1fa2ff..ac9c2cc849 100644 --- a/include/api.php +++ b/include/api.php @@ -1507,21 +1507,32 @@ if (local_user()===false) return false; if (!x($_POST, "text") || !x($_POST,"screen_name")) return; - + $sender = api_get_user($a); $r = q("SELECT `id` FROM `contact` WHERE `uid`=%d AND `nick`='%s'", intval(local_user()), dbesc($_POST['screen_name'])); - $recipient = api_get_user($a, $r[0]['id']); - - require_once("include/message.php"); - $sub = ( (strlen($_POST['text'])>10)?substr($_POST['text'],0,10)."...":$_POST['text']); - $id = send_message($recipient['id'], $_POST['text'], $sub); - - + + $recipient = api_get_user($a, $r[0]['id']); + $replyto = ''; + if (x($_REQUEST,'replyto')) { + $r = q('SELECT `uri` FROM `mail` WHERE `uid`=%d AND `id`=%d', + intval(local_user()), + intval($_REQUEST['replyto'])); + $replyto = $r[0]['uri']; + } + + if (x($_REQUEST,'title')) { + $sub = $_REQUEST['title']; + } + else { + $sub = ((strlen($_POST['text'])>10)?substr($_POST['text'],0,10)."...":$_POST['text']); + } + $id = send_message($recipient['id'], $_POST['text'], $sub, $replyto); + if ($id>-1) { $r = q("SELECT * FROM `mail` WHERE id=%d", intval($id)); $item = $r[0]; From 7614d35cadb274a48434a61cdab205ca120462a3 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 23 Jun 2012 04:44:48 -0700 Subject: [PATCH 11/78] liking comments backend --- include/conversation.php | 20 ++++++++++++-------- view/theme/duepuntozero/style.css | 4 ++++ view/wall_item.tpl | 4 ++-- view/wallwall_item.tpl | 4 ++-- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index 2244e8df7f..d0ced1d18a 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -659,8 +659,8 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { else $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']) : ''); + $like = ((x($alike,$item['uri'])) ? format_like($alike[$item['uri']],$alike[$item['uri'] . '-l'],'like',$item['uri']) : ''); + $dislike = ((x($dlike,$item['uri'])) ? format_like($dlike[$item['uri']],$dlike[$item['uri'] . '-l'],'dislike',$item['uri']) : ''); $locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => ''); call_hooks('render_location',$locate); @@ -876,13 +876,17 @@ function like_puller($a,$item,&$arr,$mode) { } else $url = zrl($url); - if(! ((isset($arr[$item['parent'] . '-l'])) && (is_array($arr[$item['parent'] . '-l'])))) - $arr[$item['parent'] . '-l'] = array(); - if(! isset($arr[$item['parent']])) - $arr[$item['parent']] = 1; + + if(! $item['thr-parent']) + $item['thr-parent'] = $item['parent-uri']; + + if(! ((isset($arr[$item['thr-parent'] . '-l'])) && (is_array($arr[$item['thr-parent'] . '-l'])))) + $arr[$item['thr-parent'] . '-l'] = array(); + if(! isset($arr[$item['thr-parent']])) + $arr[$item['thr-parent']] = 1; else - $arr[$item['parent']] ++; - $arr[$item['parent'] . '-l'][] = '' . $item['author-name'] . ''; + $arr[$item['thr-parent']] ++; + $arr[$item['thr-parent'] . '-l'][] = '' . $item['author-name'] . ''; } return; }} diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index be755d4111..de366210b6 100644 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -935,6 +935,10 @@ input#dfrn-url { background: #EEEEEE; } +.wall-item-like.comment, .wall-item-dislike.comment { + margin-left: 50px; +} + .wall-item-info { display: block; float: left; diff --git a/view/wall_item.tpl b/view/wall_item.tpl index a6a96d8792..dae33b3f75 100644 --- a/view/wall_item.tpl +++ b/view/wall_item.tpl @@ -69,8 +69,8 @@
- -
$item.dislike
+ +
$item.dislike
$item.comment
diff --git a/view/wallwall_item.tpl b/view/wallwall_item.tpl index 9cbfc991ea..a48acfec5b 100644 --- a/view/wallwall_item.tpl +++ b/view/wallwall_item.tpl @@ -74,8 +74,8 @@
- -
$item.dislike
+ +
$item.dislike
$item.comment From 22ca358a8c01144c8172b5108514d85906f1ff7d Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 23 Jun 2012 05:46:15 -0700 Subject: [PATCH 12/78] like comments --- include/conversation.php | 4 ++-- mod/like.php | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index d0ced1d18a..946014b6d4 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -549,13 +549,13 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { $shareable = ((($profile_owner == local_user()) && ((! $item['private']) || $item['network'] === NETWORK_FEED)) ? true : false); if($page_writeable) { - if($toplevelpost) { + /* if($toplevelpost) { */ $likebuttons = array( 'like' => array( t("I like this \x28toggle\x29"), t("like")), 'dislike' => array( t("I don't like this \x28toggle\x29"), t("dislike")), ); if ($shareable) $likebuttons['share'] = array( t('Share this'), t('share')); - } + /* } */ $qc = $qcomment = null; diff --git a/mod/like.php b/mod/like.php index 942a04fe7f..642e948fdd 100755 --- a/mod/like.php +++ b/mod/like.php @@ -37,7 +37,7 @@ function like_content(&$a) { logger('like: verb ' . $verb . ' item ' . $item_id); - $r = q("SELECT * FROM `item` WHERE ( `id` = '%s' OR `uri` = '%s') AND `id` = `parent` LIMIT 1", + $r = q("SELECT * FROM `item` WHERE `id` = '%s' OR `uri` = '%s' LIMIT 1", dbesc($item_id), dbesc($item_id) ); @@ -217,6 +217,7 @@ EOT; $arr['gravity'] = GRAVITY_LIKE; $arr['parent'] = $item['id']; $arr['parent-uri'] = $item['uri']; + $arr['thr-parent'] = $item['uri']; $arr['owner-name'] = $remote_owner['name']; $arr['owner-link'] = $remote_owner['url']; $arr['owner-avatar'] = $remote_owner['thumb']; From f55e8e831c3becb0bf981d637179226550b9907c Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 23 Jun 2012 06:04:56 -0700 Subject: [PATCH 13/78] typo --- include/items.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/items.php b/include/items.php index a0dd1c8159..87aaeaa323 100755 --- a/include/items.php +++ b/include/items.php @@ -2931,8 +2931,10 @@ function atom_entry($item,$type,$author,$owner,$comment = false,$cid = 0) { if(strlen($item['owner-name'])) $o .= atom_author('dfrn:owner',$item['owner-name'],$item['owner-link'],80,80,$item['owner-avatar']); - if(($item['parent'] != $item['id']) || ($item['parent-uri'] !== $item['uri'])) - $o .= '' . "\r\n"; + if(($item['parent'] != $item['id']) || ($item['parent-uri'] !== $item['uri'])) { + $parent_item = (($item['thr-parent']) ? $item['thr-parent'] : $item['parent-uri']); + $o .= '' . "\r\n"; + } $o .= '' . xmlify($item['uri']) . '' . "\r\n"; $o .= '' . xmlify($item['title']) . '' . "\r\n"; From 1ba0d73a9aef3fd8469cd886bf6647e966a272b2 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 23 Jun 2012 06:13:11 -0700 Subject: [PATCH 14/78] make feeds work with comment likes/dislikes --- include/items.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/items.php b/include/items.php index 87aaeaa323..5bbceb1982 100755 --- a/include/items.php +++ b/include/items.php @@ -2931,7 +2931,7 @@ function atom_entry($item,$type,$author,$owner,$comment = false,$cid = 0) { if(strlen($item['owner-name'])) $o .= atom_author('dfrn:owner',$item['owner-name'],$item['owner-link'],80,80,$item['owner-avatar']); - if(($item['parent'] != $item['id']) || ($item['parent-uri'] !== $item['uri'])) { + if(($item['parent'] != $item['id']) || ($item['parent-uri'] !== $item['uri']) || ($item['thr-parent'])) { $parent_item = (($item['thr-parent']) ? $item['thr-parent'] : $item['parent-uri']); $o .= '' . "\r\n"; } From a132eda2cf8524e98d94088e9130f50163ade8cb Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 23 Jun 2012 06:41:37 -0700 Subject: [PATCH 15/78] cokmment likes not propagating --- include/items.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/items.php b/include/items.php index 5bbceb1982..9f90d66e47 100755 --- a/include/items.php +++ b/include/items.php @@ -2362,10 +2362,13 @@ function local_delivery($importer,$data) { $datarray['gravity'] = GRAVITY_LIKE; $datarray['last-child'] = 0; // only one like or dislike per person - $r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 limit 1", + $r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and (`thr-parent` = '%s' or `parent-uri` = '%s') and deleted = 0 limit 1", intval($datarray['uid']), intval($datarray['contact-id']), - dbesc($datarray['verb']) + dbesc($datarray['verb']), + dbesc($datarray['parent-uri']), + dbesc($datarray['parent-uri']) + ); if($r && count($r)) continue; From 63141c73d8d87e4f861e914bda01426830824996 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 23 Jun 2012 07:26:45 -0700 Subject: [PATCH 16/78] debugging --- include/items.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/items.php b/include/items.php index 9f90d66e47..91ed6762cf 100755 --- a/include/items.php +++ b/include/items.php @@ -2269,12 +2269,13 @@ function local_delivery($importer,$data) { $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' + 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)) From 7a346bc7560c068e084155c98108b404eafc78b2 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 23 Jun 2012 07:43:56 -0700 Subject: [PATCH 17/78] this is going to take some more debug before it can be roller out --- include/conversation.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index 946014b6d4..d830c8daa6 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -549,13 +549,13 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { $shareable = ((($profile_owner == local_user()) && ((! $item['private']) || $item['network'] === NETWORK_FEED)) ? true : false); if($page_writeable) { - /* if($toplevelpost) { */ + if($toplevelpost) { $likebuttons = array( 'like' => array( t("I like this \x28toggle\x29"), t("like")), 'dislike' => array( t("I don't like this \x28toggle\x29"), t("dislike")), ); if ($shareable) $likebuttons['share'] = array( t('Share this'), t('share')); - /* } */ + } $qc = $qcomment = null; From 90f8454190612db8582f14d55029aed381a22898 Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Tue, 19 Jun 2012 20:45:24 -0600 Subject: [PATCH 18/78] allow linking to Diaspora's scaled-down images --- include/diaspora.php | 3 ++- include/network.php | 18 +++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/include/diaspora.php b/include/diaspora.php index 80fb104046..fdb85f15f1 100755 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -1560,7 +1560,8 @@ function diaspora_photo($importer,$xml,$msg) { $link_text = '[img]' . $remote_photo_path . $remote_photo_name . '[/img]' . "\n"; - $link_text = scale_external_images($link_text); + $link_text = scale_external_images($link_text, true, + array($remote_photo_name, 'scaled_full_' . $remote_photo_name)); if(strpos($parent_item['body'],$link_text) === false) { $r = q("update item set `body` = '%s', `visible` = 1 where `id` = %d and `uid` = %d limit 1", diff --git a/include/network.php b/include/network.php index 446413cd83..c1a76000ef 100644 --- a/include/network.php +++ b/include/network.php @@ -793,7 +793,7 @@ function add_fcontact($arr,$update = false) { } -function scale_external_images($s,$include_link = true) { +function scale_external_images($s, $include_link = true, $scale_replace = false) { $a = get_app(); @@ -803,10 +803,22 @@ function scale_external_images($s,$include_link = true) { require_once('include/Photo.php'); foreach($matches as $mtch) { logger('scale_external_image: ' . $mtch[1]); + $hostname = str_replace('www.','',substr($a->get_baseurl(),strpos($a->get_baseurl(),'://')+3)); if(stristr($mtch[1],$hostname)) continue; - $i = fetch_url($mtch[1]); + + // $scale_replace, if passed, is an array of two elements. The + // first is the name of the full-size image. The second is the + // name of a remote, scaled-down version of the full size image. + // This allows Friendica to display the smaller remote image if + // one exists, while still linking to the full-size image + if($scale_replace) + $scaled = str_replace($scale_replace[0], $scale_replace[1], $mtch[1]); + else + $scaled = $mtch[1]; + $i = fetch_url($scaled); + // guess mimetype from headers or filename $type = guess_image_type($mtch[1],true); @@ -822,7 +834,7 @@ function scale_external_images($s,$include_link = true) { $new_width = $ph->getWidth(); $new_height = $ph->getHeight(); logger('scale_external_images: ' . $orig_width . '->' . $new_width . 'w ' . $orig_height . '->' . $new_height . 'h' . ' match: ' . $mtch[0], LOGGER_DEBUG); - $s = str_replace($mtch[0],'[img=' . $new_width . 'x' . $new_height. ']' . $mtch[1] . '[/img]' + $s = str_replace($mtch[0],'[img=' . $new_width . 'x' . $new_height. ']' . $scaled . '[/img]' . "\n" . (($include_link) ? '[url=' . $mtch[1] . ']' . t('view full size') . '[/url]' . "\n" : ''),$s); From d8a376666c0f56baf96f88b74fdcb9575df9ec73 Mon Sep 17 00:00:00 2001 From: Max Weller Date: Sat, 23 Jun 2012 19:21:48 +0200 Subject: [PATCH 19/78] modified direct_messages --- include/api.php | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/include/api.php b/include/api.php index b77156dfae..e0e759b618 100644 --- a/include/api.php +++ b/include/api.php @@ -1566,16 +1566,19 @@ if ($box=="sentbox") { - $sql_extra = "`from-url`='%s'"; - } else { - $sql_extra = "`from-url`!='%s'"; + $sql_extra = "`from-url`='".dbesc( $a->get_baseurl() . '/profile/' . $a->user['nickname'] )."'"; + } elseif ($box=="conversation") { + $sql_extra = "`parent-uri`='".dbesc( $_GET["uri"] ) ."'"; + } elseif ($box=="all") { + $sql_extra = "true"; + } elseif ($box=="inbox") { + $sql_extra = "`from-url`!='".dbesc( $a->get_baseurl() . '/profile/' . $a->user['nickname'] )."'"; } $r = q("SELECT * FROM `mail` WHERE uid=%d AND $sql_extra ORDER BY created DESC LIMIT %d,%d", intval(local_user()), - dbesc( $a->get_baseurl() . '/profile/' . $a->user['nickname'] ), intval($start), intval($count) - ); + ); $ret = Array(); foreach($r as $item){ @@ -1595,15 +1598,26 @@ 'created_at'=> api_date($item['created']), 'sender_id'=> $sender['id'] , 'sender_screen_name'=> $sender['screen_name'], + 'sender_profile_img'=> $item['from-photo'], 'sender'=> $sender, 'recipient_id'=> $recipient['id'], 'recipient_screen_name'=> $recipient['screen_name'], 'recipient'=> $recipient, - 'text'=> $item['title']."\n".html2plain(bbcode($item['body']), 0) , ); - + //don't send title to regular StatusNET requests to avoid confusing these apps + if (isset($_GET["getText"])) { + $ret['title'] = $item['title'] ; + if ($_GET["getText"] == "true") { + $ret['text'] = html2plain(bbcode($item['body']), 0); + } + } else { + $ret['text'] = $item['title']."\n".html2plain(bbcode($item['body']), 0); + } + + + } @@ -1624,6 +1638,14 @@ function api_direct_messages_inbox(&$a, $type){ return api_direct_messages_box($a, $type, "inbox"); } + function api_direct_messages_all(&$a, $type){ + return api_direct_messages_box($a, $type, "all"); + } + function api_direct_messages_conversation(&$a, $type){ + return api_direct_messages_box($a, $type, "conversation"); + } + api_register_func('api/direct_messages/conversation','api_direct_messages_conversation',true); + api_register_func('api/direct_messages/all','api_direct_messages_all',true); api_register_func('api/direct_messages/sent','api_direct_messages_sentbox',true); api_register_func('api/direct_messages','api_direct_messages_inbox',true); From f45c881815d1e3ab2cc494f47a836f18044aae5b Mon Sep 17 00:00:00 2001 From: Max Weller Date: Sat, 23 Jun 2012 19:29:58 +0200 Subject: [PATCH 20/78] changes on api_direct_messages_box to allow to retrieve conversations and all messages --- include/api.php | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/include/api.php b/include/api.php index e0e759b618..e22bcc9e9a 100644 --- a/include/api.php +++ b/include/api.php @@ -1564,15 +1564,15 @@ $start = $page*$count; - + $profile_url = $a->get_baseurl() . '/profile/' . $a->user['nickname']; if ($box=="sentbox") { - $sql_extra = "`from-url`='".dbesc( $a->get_baseurl() . '/profile/' . $a->user['nickname'] )."'"; + $sql_extra = "`from-url`='".dbesc( $profile_url )."'"; } elseif ($box=="conversation") { $sql_extra = "`parent-uri`='".dbesc( $_GET["uri"] ) ."'"; } elseif ($box=="all") { $sql_extra = "true"; } elseif ($box=="inbox") { - $sql_extra = "`from-url`!='".dbesc( $a->get_baseurl() . '/profile/' . $a->user['nickname'] )."'"; + $sql_extra = "`from-url`!='".dbesc( $profile_url )."'"; } $r = q("SELECT * FROM `mail` WHERE uid=%d AND $sql_extra ORDER BY created DESC LIMIT %d,%d", @@ -1582,15 +1582,12 @@ $ret = Array(); foreach($r as $item){ - switch ($box){ - case "inbox": + if ($box == "inbox" || $item['from-url'] != $profile_url){ $recipient = $user_info; $sender = api_get_user($a,$item['contact-id']); - break; - case "sentbox": + } elseif ($box == "sentbox" || $item['from-url'] != $profile_url){ $recipient = api_get_user($a,$item['contact-id']); $sender = $user_info; - break; } $ret[]=Array( @@ -1603,8 +1600,6 @@ 'recipient_id'=> $recipient['id'], 'recipient_screen_name'=> $recipient['screen_name'], 'recipient'=> $recipient, - - ); //don't send title to regular StatusNET requests to avoid confusing these apps if (isset($_GET["getText"])) { @@ -1615,9 +1610,6 @@ } else { $ret['text'] = $item['title']."\n".html2plain(bbcode($item['body']), 0); } - - - } From 3b1d9d969547e08c3a421c7a3b870cfcb45f3bc5 Mon Sep 17 00:00:00 2001 From: Simon L'nu Date: Sat, 23 Jun 2012 13:33:58 -0400 Subject: [PATCH 21/78] update jquery to 1.7.2; fix some dispy templates to be more in sync with view/ Signed-off-by: Simon L'nu --- js/jquery.js | 8 ++--- view/theme/dispy/conversation.tpl | 5 +-- view/theme/dispy/dark/style.css | 3 +- view/theme/dispy/dark/style.less | 5 ++- view/theme/dispy/jot.tpl | 55 +++++++++++++++--------------- view/theme/dispy/light/style.css | 3 +- view/theme/dispy/light/style.less | 5 ++- view/theme/dispy/wall_item.tpl | 6 ++-- view/theme/dispy/wallwall_item.tpl | 6 ++-- 9 files changed, 53 insertions(+), 43 deletions(-) diff --git a/js/jquery.js b/js/jquery.js index 198b3ff07d..16ad06c5ac 100644 --- a/js/jquery.js +++ b/js/jquery.js @@ -1,4 +1,4 @@ -/*! jQuery v1.7.1 jquery.com | jquery.org/license */ -(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
"+""+"
",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
t
",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; -f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() -{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file +/*! jQuery v1.7.2 jquery.com | jquery.org/license */ +(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"":"")+""),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;e=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="
"+""+"
",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="
t
",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="
",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function( +a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&j.push({elem:this,matches:d.slice(e)});for(k=0;k0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f +.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(;d1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]===""&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/view/theme/dispy/conversation.tpl b/view/theme/dispy/conversation.tpl index ca1b560a68..4a93dacf37 100644 --- a/view/theme/dispy/conversation.tpl +++ b/view/theme/dispy/conversation.tpl @@ -19,8 +19,9 @@
{{ if $dropping }} -
-$dropping +
{{ endif }} diff --git a/view/theme/dispy/dark/style.css b/view/theme/dispy/dark/style.css index 327b053aba..bf23cf6256 100644 --- a/view/theme/dispy/dark/style.css +++ b/view/theme/dispy/dark/style.css @@ -391,8 +391,9 @@ div[id$="wrapper"]{height:100%;}div[id$="wrapper"] br{clear:left;} .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;} -.delete-checked{position:absolute;left:35px;margin-top:20px;} +#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;} .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 e3966683bf..1c2dc0665d 100644 --- a/view/theme/dispy/dark/style.less +++ b/view/theme/dispy/dark/style.less @@ -2373,7 +2373,7 @@ div { } /* was tired of having no way of moving it around, so * here's a little 'hook' to do so */ -.delete-checked { +#item-delete-selected { position: absolute; left: 35px; margin-top: 20px; @@ -2382,6 +2382,9 @@ div { float: left; margin-right: 5px; } +#item-delete-selected-desc { + font-size: smaller; +} .fc-state-highlight { background: @main_colour; color: @bg_colour; diff --git a/view/theme/dispy/jot.tpl b/view/theme/dispy/jot.tpl index c6b3394572..563d58ce49 100644 --- a/view/theme/dispy/jot.tpl +++ b/view/theme/dispy/jot.tpl @@ -19,31 +19,32 @@
- -
$item.dislike
-
+ +
$item.dislike
+
$item.comment
diff --git a/view/theme/dispy/wallwall_item.tpl b/view/theme/dispy/wallwall_item.tpl index da5fa13b3e..84da598cd6 100644 --- a/view/theme/dispy/wallwall_item.tpl +++ b/view/theme/dispy/wallwall_item.tpl @@ -64,7 +64,7 @@ class="icon recycle wall-item-share-buttons" title="$item.vote.share.0" onclick {{ if $item.edpost }}
  • {{ endif }} - +
  • {{ if $item.drop.dropping }}{{ endif }} {{ if $item.drop.dropping }}{{ endif }} @@ -86,8 +86,8 @@ class="icon recycle wall-item-share-buttons" title="$item.vote.share.0" onclick
  • - -
    $item.dislike
    + +
    $item.dislike
    $item.comment From 2c992c5969b44dce24c638af32879eac9e55f719 Mon Sep 17 00:00:00 2001 From: Max Weller Date: Sat, 23 Jun 2012 19:35:01 +0200 Subject: [PATCH 22/78] bugfix --- include/api.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/api.php b/include/api.php index e22bcc9e9a..78e628386c 100644 --- a/include/api.php +++ b/include/api.php @@ -1590,7 +1590,7 @@ $sender = $user_info; } - $ret[]=Array( + $d=Array( 'id' => $item['id'], 'created_at'=> api_date($item['created']), 'sender_id'=> $sender['id'] , @@ -1603,13 +1603,14 @@ ); //don't send title to regular StatusNET requests to avoid confusing these apps if (isset($_GET["getText"])) { - $ret['title'] = $item['title'] ; + $d['title'] = $item['title'] ; if ($_GET["getText"] == "true") { - $ret['text'] = html2plain(bbcode($item['body']), 0); + $d['text'] = html2plain(bbcode($item['body']), 0); } } else { - $ret['text'] = $item['title']."\n".html2plain(bbcode($item['body']), 0); + $d['text'] = $item['title']."\n".html2plain(bbcode($item['body']), 0); } + $ret[]=$d; } From 9d462c6b6a2d0b2eb859781d5de26f6a2275536b Mon Sep 17 00:00:00 2001 From: Max Weller Date: Sat, 23 Jun 2012 19:38:15 +0200 Subject: [PATCH 23/78] new param getUserObjects to avoid retransmitting the whole user info objects --- include/api.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/api.php b/include/api.php index 78e628386c..7466c199ae 100644 --- a/include/api.php +++ b/include/api.php @@ -1610,6 +1610,9 @@ } else { $d['text'] = $item['title']."\n".html2plain(bbcode($item['body']), 0); } + if (isset($_GET["getUserObjects"]) && $_GET["getUserObjects"] == "false") { + unset($d['sender']); unset($d['recipient']); + } $ret[]=$d; } From 111ace5abd855a0c4f248b34d468285b825abbd0 Mon Sep 17 00:00:00 2001 From: Max Weller Date: Sat, 23 Jun 2012 22:35:43 +0200 Subject: [PATCH 24/78] I want HTML code! --- include/api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/api.php b/include/api.php index 7466c199ae..32579fe7d3 100644 --- a/include/api.php +++ b/include/api.php @@ -1605,7 +1605,7 @@ if (isset($_GET["getText"])) { $d['title'] = $item['title'] ; if ($_GET["getText"] == "true") { - $d['text'] = html2plain(bbcode($item['body']), 0); + $d['text'] = bbcode($item['body']); } } else { $d['text'] = $item['title']."\n".html2plain(bbcode($item['body']), 0); From 11b6beae061d0536ea70c01c28a19b16826bfb8e Mon Sep 17 00:00:00 2001 From: Max Weller Date: Sat, 23 Jun 2012 22:39:11 +0200 Subject: [PATCH 25/78] make it selectable --- include/api.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/api.php b/include/api.php index 32579fe7d3..52ae2fd695 100644 --- a/include/api.php +++ b/include/api.php @@ -1604,8 +1604,10 @@ //don't send title to regular StatusNET requests to avoid confusing these apps if (isset($_GET["getText"])) { $d['title'] = $item['title'] ; - if ($_GET["getText"] == "true") { + if ($_GET["getText"] == "html") { $d['text'] = bbcode($item['body']); + } elseif ($_GET["getText"] == "plain") { + $d['text'] = html2plain(bbcode($item['body']), 0); } } else { $d['text'] = $item['title']."\n".html2plain(bbcode($item['body']), 0); From e3c36dfd1d1fea0b6d3ba6d6b58fcc8ed0c2dd36 Mon Sep 17 00:00:00 2001 From: Max Weller Date: Sat, 23 Jun 2012 22:52:50 +0200 Subject: [PATCH 26/78] add reliable way to get server version --- include/api.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/api.php b/include/api.php index 52ae2fd695..49286d262c 100644 --- a/include/api.php +++ b/include/api.php @@ -1429,7 +1429,13 @@ 'logo' => $logo, 'fancy' => 'true', 'language' => 'en', 'email' => $email, 'broughtby' => '', 'broughtbyurl' => '', 'timezone' => 'UTC', 'closed' => $closed, 'inviteonly' => 'false', 'private' => $private, 'textlimit' => $textlimit, 'sslserver' => $sslserver, 'ssl' => $ssl, - 'shorturllength' => '30' + 'shorturllength' => '30', + 'friendica' => array( + 'FRIENDICA_PLATFORM' => FRIENDICA_PLATFORM, + 'FRIENDICA_VERSION' => FRIENDICA_VERSION, + 'DFRN_PROTOCOL_VERSION' => DFRN_PROTOCOL_VERSION, + 'DB_UPDATE_VERSION' => DB_UPDATE_VERSION + ) ), ); From 4ef33ac6ebbf7418742a9ee7a4a549808754eb1f Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Sat, 23 Jun 2012 19:57:59 -0600 Subject: [PATCH 27/78] fix BB-to-Diaspora list formatting --- include/bb2diaspora.php | 46 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index 96cc735bdb..d509a2e31c 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -68,9 +68,14 @@ function stripdcode_br_cb($s) { function diaspora_ul($s) { - // Replace "[\\*]" followed by any number (including zero) of + // Replace "[*]" followed by any number (including zero) of // spaces by "* " to match Diaspora's list format - return preg_replace("/\[\\\\\*\]( *)/", "* ", $s[1]); + if( strpos($s[0], "[list]") === 0 ) + return '
      ' . preg_replace("/\[\*\]( *)/", "* ", $s[1]) . '
    '; + elseif( strpos($s[0], "[ul]") === 0 ) + return '
      ' . preg_replace("/\[\*\]( *)/", "* ", $s[1]) . '
    '; + else + return $s[0]; } @@ -80,12 +85,47 @@ function diaspora_ol($s) { // 1. First element // 1. Second element // 1. Third element - return preg_replace("/\[\\\\\*\]( *)/", "1. ", $s[1]); + if( strpos($s[0], "[list=1]") === 0 ) + return '
      ' . preg_replace("/\[\*\]( *)/", "1. ", $s[1]) . '
    '; + elseif( strpos($s[0], "[list=i]") === 0 ) + return '
      ' . preg_replace("/\[\*\]( *)/", "1. ", $s[1]) . '
    '; + elseif( strpos($s[0], "[list=I]") === 0 ) + return '
      ' . preg_replace("/\[\*\]( *)/", "1. ", $s[1]) . '
    '; + elseif( strpos($s[0], "[list=a]") === 0 ) + return '
      ' . preg_replace("/\[\*\]( *)/", "1. ", $s[1]) . '
    '; + elseif( strpos($s[0], "[list=A]") === 0 ) + return '
      ' . preg_replace("/\[\*\]( *)/", "1. ", $s[1]) . '
    '; + elseif( strpos($s[0], "[ol]") === 0 ) + return '
      ' . preg_replace("/\[\*\]( *)/", "1. ", $s[1]) . '
    '; + else + return $s[0]; } function bb2diaspora($Text,$preserve_nl = false) { + // bbcode() will convert "[*]" into "
  • " with no closing "
  • " + // Markdownify() is unable to handle these, as it makes each new + // "
  • " 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 + $endlessloop = 0; + while ((strpos($Text, "[/list]") !== false) && (strpos($Text, "[list") !== false) && + (strpos($Text, "[/ul]") !== false) && (strpos($Text, "[ul]") !== false) && + (strpos($Text, "[/ol]") !== false) && (strpos($Text, "[ol]") !== false) && (++$endlessloop < 20)) { + $Text = preg_replace_callback("/\[list\](.*?)\[\/list\]/is", 'diaspora_ul', $Text); + $Text = preg_replace_callback("/\[ul\](.*?)\[\/ul\]/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("/\[ol\](.*?)\[\/ol\]/is", 'diaspora_ol', $Text); + } + // Convert it to HTML - don't try oembed $Text = bbcode($Text, $preserve_nl, false); From 1f968396749f8cac31aaeee770ae7fc5aff48f38 Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Sat, 23 Jun 2012 20:01:29 -0600 Subject: [PATCH 28/78] small optimization --- include/bb2diaspora.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index d509a2e31c..75ba57dff8 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -113,18 +113,16 @@ function bb2diaspora($Text,$preserve_nl = false) { // text with opening and closing tags, so nested lists may make things // wonky $endlessloop = 0; - while ((strpos($Text, "[/list]") !== false) && (strpos($Text, "[list") !== false) && - (strpos($Text, "[/ul]") !== false) && (strpos($Text, "[ul]") !== false) && - (strpos($Text, "[/ol]") !== false) && (strpos($Text, "[ol]") !== false) && (++$endlessloop < 20)) { + while ((strpos($Text, "[/list]") !== false) && (strpos($Text, "[list") !== false) && (++$endlessloop < 20)) { $Text = preg_replace_callback("/\[list\](.*?)\[\/list\]/is", 'diaspora_ul', $Text); - $Text = preg_replace_callback("/\[ul\](.*?)\[\/ul\]/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("/\[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); From 5d2eed35177da3debacc6db6db2f7a74bc4b64c7 Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Sat, 23 Jun 2012 22:02:08 -0600 Subject: [PATCH 29/78] allow bare URLS to make it through to Diaspora --- include/bb2diaspora.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index 75ba57dff8..ac693127ba 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -131,6 +131,12 @@ function bb2diaspora($Text,$preserve_nl = false) { $md = new Markdownify(false, false, false); $Text = $md->parseString($Text); + // If the text going into bbcode() has a plain URL in it, i.e. + // with no [url] tags around it, it will come out of parseString() + // looking like: , which gets removed by strip_tags(). + // So take off the angle brackets of any such URL + $Text = preg_replace("//is", "http$1", $Text); + // Remove all unconverted tags $Text = strip_tags($Text); From 0877c5b687e208955dfe31830815f408d50ccbb4 Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Sat, 23 Jun 2012 22:04:20 -0600 Subject: [PATCH 30/78] use author handle instead of sender handle --- include/diaspora.php | 108 +++++++++++++++++++++++++++++++++---------- 1 file changed, 84 insertions(+), 24 deletions(-) diff --git a/include/diaspora.php b/include/diaspora.php index fdb85f15f1..ab43b4608b 100755 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -5,6 +5,7 @@ require_once('include/items.php'); require_once('include/bb2diaspora.php'); require_once('include/contact_selectors.php'); require_once('include/queue_fn.php'); +require_once('include/lock.php'); function diaspora_dispatch_public($msg) { @@ -113,27 +114,83 @@ function diaspora_get_contact_by_handle($uid,$handle) { } function find_diaspora_person_by_handle($handle) { + + $person = false; $update = false; - $r = q("select * from fcontact where network = '%s' and addr = '%s' limit 1", - dbesc(NETWORK_DIASPORA), - dbesc($handle) - ); - if(count($r)) { - logger('find_diaspora_person_by handle: in cache ' . print_r($r,true), LOGGER_DEBUG); - // update record occasionally so it doesn't get stale - $d = strtotime($r[0]['updated'] . ' +00:00'); - if($d > strtotime('now - 14 days')) - return $r[0]; - $update = true; - } - logger('find_diaspora_person_by_handle: refresh',LOGGER_DEBUG); - require_once('include/Scrape.php'); - $r = probe_url($handle, PROBE_DIASPORA); - if((count($r)) && ($r['network'] === NETWORK_DIASPORA)) { - add_fcontact($r,$update); - return ($r); - } - return false; + $got_lock = false; + + do { + $r = q("select * from fcontact where network = '%s' and addr = '%s' limit 1", + dbesc(NETWORK_DIASPORA), + dbesc($handle) + ); + if(count($r)) { + $person = $r[0]; + logger('find_diaspora_person_by handle: in cache ' . print_r($r,true), LOGGER_DEBUG); + + // update record occasionally so it doesn't get stale + $d = strtotime($person['updated'] . ' +00:00'); + if($d < strtotime('now - 14 days')) + $update = true; + } + + + // FETCHING PERSON INFORMATION FROM REMOTE SERVER + // + // If the person isn't in our 'fcontact' table, or if he/she is but + // his/her information hasn't been updated for more than 14 days, then + // we want to fetch the person's information from the remote server. + // + // Note that $person isn't changed by this block of code unless the + // person's information has been successfully fetched from the remote + // server. So if $person was 'false' to begin with (because he/she wasn't + // in the local cache), it'll stay false, and if $person held the local + // cache information to begin with, it'll keep that information. That way + // if there's a problem with the remote fetch, we can at least use our + // cached information--it's better than nothing. + + if((! $person) || ($update)) { + // Lock the function to prevent race conditions if multiple items + // come in at the same time from a person who doesn't exist in + // fcontact + $got_lock = lock_function('find_diaspora_person_by_handle', false); + + if($got_lock) { + logger('find_diaspora_person_by_handle: create or refresh', LOGGER_DEBUG); + require_once('include/Scrape.php'); + $r = probe_url($handle, PROBE_DIASPORA); + + // Note that Friendica contacts can return a "Diaspora person" + // if Diaspora connectivity is enabled on their server + if((count($r)) && ($r['network'] === NETWORK_DIASPORA)) { + add_fcontact($r,$update); + $person = ($r); + } + + unlock_function('find_diaspora_person_by_handle'); + } + else { + logger('find_diaspora_person_by_handle: couldn\'t lock function', LOGGER_DEBUG); + if(! $person) + block_on_function_lock('find_diaspora_person_by_handle'); + } + } + } while((! $person) && (! $got_lock)); + // We need to try again if the person wasn't in 'fcontact' but the function was locked. + // The fact that the function was locked may mean that another process was creating the + // person's record. It could also mean another process was creating or updating an unrelated + // person. + // + // At any rate, we need to keep trying until we've either got the person or had a chance to + // try to fetch his/her remote information. But we don't want to block on locking the + // function, because if the other process is creating the record, then when we acquire the lock + // we'll dive right into creating another, duplicate record. We DO want to at least wait + // until the lock is released, so we don't flood the database with requests. + // + // If the person was in the 'fcontact' table, don't try again. It's not worth the time, since + // we do have some information for the person + + return $person; } @@ -2252,7 +2309,6 @@ function diaspora_send_relay($item,$owner,$contact,$public_batch = false) { $relay_retract = true; $target_type = ( ($item['verb'] === ACTIVITY_LIKE) ? 'Like' : 'Comment'); - $sender_signed_text = $item['guid'] . ';' . $target_type ; $sql_sign_id = 'retract_iid'; $tpl = get_markup_template('diaspora_relayable_retraction.tpl'); @@ -2263,13 +2319,10 @@ function diaspora_send_relay($item,$owner,$contact,$public_batch = false) { $target_type = 'Post'; // $positive = (($item['deleted']) ? 'false' : 'true'); $positive = 'true'; - $sender_signed_text = $item['guid'] . ';' . $target_type . ';' . $parent_guid . ';' . $positive . ';' . $myaddr; $tpl = get_markup_template('diaspora_like_relay.tpl'); } else { // item is a comment - $sender_signed_text = $item['guid'] . ';' . $parent_guid . ';' . $text . ';' . $myaddr; - $tpl = get_markup_template('diaspora_comment_relay.tpl'); } @@ -2295,6 +2348,13 @@ function diaspora_send_relay($item,$owner,$contact,$public_batch = false) { return; } + if($relay_retract) + $sender_signed_text = $item['guid'] . ';' . $target_type; + elseif($like) + $sender_signed_text = $item['guid'] . ';' . $target_type . ';' . $parent_guid . ';' . $positive . ';' . $handle; + else + $sender_signed_text = $item['guid'] . ';' . $parent_guid . ';' . $text . ';' . $handle; + // Sign the relayable with the top-level owner's signature // // We'll use the $sender_signed_text that we just created, instead of the $signed_text From 1574396d04ead2e410aa992b049fe63422080bab Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 23 Jun 2012 21:11:18 -0700 Subject: [PATCH 31/78] sort out some "like" issues --- boot.php | 2 +- include/conversation.php | 8 +-- include/items.php | 14 +++-- util/messages.po | 127 ++++++++++++++++++--------------------- 4 files changed, 73 insertions(+), 78 deletions(-) diff --git a/boot.php b/boot.php index be47184aa2..971762634a 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.1382' ); +define ( 'FRIENDICA_VERSION', '3.0.1383' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); define ( 'DB_UPDATE_VERSION', 1149 ); diff --git a/include/conversation.php b/include/conversation.php index d830c8daa6..c2113dead4 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -427,8 +427,8 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { // We've already parsed out like/dislike for special treatment. We can ignore them now if(((activity_match($item['verb'],ACTIVITY_LIKE)) - || (activity_match($item['verb'],ACTIVITY_DISLIKE))) - && ($item['id'] != $item['parent'])) + || (activity_match($item['verb'],ACTIVITY_DISLIKE)))) +// && ($item['id'] != $item['parent'])) continue; $toplevelpost = (($item['id'] == $item['parent']) ? true : false); @@ -549,13 +549,13 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { $shareable = ((($profile_owner == local_user()) && ((! $item['private']) || $item['network'] === NETWORK_FEED)) ? true : false); if($page_writeable) { - if($toplevelpost) { +/* if($toplevelpost) { */ $likebuttons = array( 'like' => array( t("I like this \x28toggle\x29"), t("like")), 'dislike' => array( t("I don't like this \x28toggle\x29"), t("dislike")), ); if ($shareable) $likebuttons['share'] = array( t('Share this'), t('share')); - } +/* } */ $qc = $qcomment = null; diff --git a/include/items.php b/include/items.php index 91ed6762cf..e495393fa5 100755 --- a/include/items.php +++ b/include/items.php @@ -1726,10 +1726,12 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) $datarray['type'] = 'activity'; $datarray['gravity'] = GRAVITY_LIKE; // only one like or dislike per person - $r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 limit 1", + $r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 and (`parent-uri` = '%s' OR `thr_parent` = '%s') limit 1", intval($datarray['uid']), intval($datarray['contact-id']), - dbesc($datarray['verb']) + dbesc($datarray['verb']), + dbesc($parent_uri), + dbesc($parent_uri) ); if($r && count($r)) continue; @@ -2363,7 +2365,7 @@ function local_delivery($importer,$data) { $datarray['gravity'] = GRAVITY_LIKE; $datarray['last-child'] = 0; // only one like or dislike per person - $r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and (`thr-parent` = '%s' or `parent-uri` = '%s') and deleted = 0 limit 1", + $r = q("select id from item where uid = %d and `contact-id` = %d and verb = '%s' and (`thr-parent` = '%s' or `parent-uri` = '%s') and deleted = 0 limit 1", intval($datarray['uid']), intval($datarray['contact-id']), dbesc($datarray['verb']), @@ -2537,10 +2539,12 @@ function local_delivery($importer,$data) { $datarray['type'] = 'activity'; $datarray['gravity'] = GRAVITY_LIKE; // only one like or dislike per person - $r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 limit 1", + $r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 and (`parent-uri` = '%s' OR `thr-parent` = '%s') limit 1", intval($datarray['uid']), intval($datarray['contact-id']), - dbesc($datarray['verb']) + dbesc($datarray['verb']), + dbesc($parent_uri), + dbesc($parent_uri) ); if($r && count($r)) continue; diff --git a/util/messages.po b/util/messages.po index 416e30ef8e..0bde2488cc 100644 --- a/util/messages.po +++ b/util/messages.po @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: 3.0.1382\n" +"Project-Id-Version: 3.0.1383\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-06-22 10:00-0700\n" +"POT-Creation-Date: 2012-06-23 10:00-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -55,7 +55,7 @@ msgstr "" #: ../../mod/profiles.php:385 ../../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:507 -#: ../../addon/dav/layout.fnk.php:353 ../../include/items.php:3401 +#: ../../addon/dav/layout.fnk.php:353 ../../include/items.php:3407 #: ../../index.php:309 msgid "Permission denied." msgstr "" @@ -278,7 +278,7 @@ msgid "Description:" msgstr "" #: ../../mod/events.php:423 ../../include/event.php:37 -#: ../../include/bb2diaspora.php:265 ../../boot.php:1126 +#: ../../include/bb2diaspora.php:311 ../../boot.php:1126 msgid "Location:" msgstr "" @@ -546,14 +546,14 @@ msgstr "" msgid "I don't like this (toggle)" msgstr "" -#: ../../mod/photos.php:1290 ../../include/conversation.php:989 +#: ../../mod/photos.php:1290 ../../include/conversation.php:993 msgid "Share" msgstr "" #: ../../mod/photos.php:1291 ../../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:1008 +#: ../../include/conversation.php:731 ../../include/conversation.php:1012 msgid "Please wait" msgstr "" @@ -569,7 +569,7 @@ msgid "Comment" msgstr "" #: ../../mod/photos.php:1311 ../../mod/editpost.php:125 -#: ../../include/conversation.php:589 ../../include/conversation.php:1026 +#: ../../include/conversation.php:589 ../../include/conversation.php:1030 msgid "Preview" msgstr "" @@ -640,7 +640,7 @@ msgstr "" msgid "Edit post" msgstr "" -#: ../../mod/editpost.php:80 ../../include/conversation.php:975 +#: ../../mod/editpost.php:80 ../../include/conversation.php:979 msgid "Post to Email" msgstr "" @@ -651,17 +651,17 @@ msgstr "" #: ../../mod/editpost.php:96 ../../mod/wallmessage.php:143 #: ../../mod/message.php:213 ../../mod/message.php:408 -#: ../../include/conversation.php:990 +#: ../../include/conversation.php:994 msgid "Upload photo" msgstr "" -#: ../../mod/editpost.php:97 ../../include/conversation.php:992 +#: ../../mod/editpost.php:97 ../../include/conversation.php:996 msgid "Attach file" msgstr "" #: ../../mod/editpost.php:98 ../../mod/wallmessage.php:144 #: ../../mod/message.php:214 ../../mod/message.php:409 -#: ../../include/conversation.php:994 +#: ../../include/conversation.php:998 msgid "Insert web link" msgstr "" @@ -677,35 +677,35 @@ msgstr "" msgid "Insert Vorbis [.ogg] audio" msgstr "" -#: ../../mod/editpost.php:102 ../../include/conversation.php:1000 +#: ../../mod/editpost.php:102 ../../include/conversation.php:1004 msgid "Set your location" msgstr "" -#: ../../mod/editpost.php:103 ../../include/conversation.php:1002 +#: ../../mod/editpost.php:103 ../../include/conversation.php:1006 msgid "Clear browser location" msgstr "" -#: ../../mod/editpost.php:105 ../../include/conversation.php:1009 +#: ../../mod/editpost.php:105 ../../include/conversation.php:1013 msgid "Permission settings" msgstr "" -#: ../../mod/editpost.php:113 ../../include/conversation.php:1018 +#: ../../mod/editpost.php:113 ../../include/conversation.php:1022 msgid "CC: email addresses" msgstr "" -#: ../../mod/editpost.php:114 ../../include/conversation.php:1019 +#: ../../mod/editpost.php:114 ../../include/conversation.php:1023 msgid "Public post" msgstr "" -#: ../../mod/editpost.php:117 ../../include/conversation.php:1005 +#: ../../mod/editpost.php:117 ../../include/conversation.php:1009 msgid "Set title" msgstr "" -#: ../../mod/editpost.php:119 ../../include/conversation.php:1007 +#: ../../mod/editpost.php:119 ../../include/conversation.php:1011 msgid "Categories (comma-separated list)" msgstr "" -#: ../../mod/editpost.php:120 ../../include/conversation.php:1021 +#: ../../mod/editpost.php:120 ../../include/conversation.php:1025 msgid "Example: bob@example.com, mary@example.com" msgstr "" @@ -826,7 +826,7 @@ msgstr "" msgid "Confirm" msgstr "" -#: ../../mod/dfrn_request.php:715 ../../include/items.php:2797 +#: ../../mod/dfrn_request.php:715 ../../include/items.php:2801 msgid "[Name Withheld]" msgstr "" @@ -1152,7 +1152,7 @@ msgid "" msgstr "" #: ../../mod/localtime.php:12 ../../include/event.php:11 -#: ../../include/bb2diaspora.php:243 +#: ../../include/bb2diaspora.php:289 msgid "l F d, Y \\@ g:i A" msgstr "" @@ -1728,7 +1728,7 @@ msgstr "" #: ../../addon/facebook/facebook.php:692 #: ../../addon/facebook/facebook.php:1182 #: ../../addon/public_server/public_server.php:62 -#: ../../addon/testdrive/testdrive.php:67 ../../include/items.php:2806 +#: ../../addon/testdrive/testdrive.php:67 ../../include/items.php:2810 #: ../../boot.php:720 msgid "Administrator" msgstr "" @@ -2455,7 +2455,7 @@ msgid "No recipient." msgstr "" #: ../../mod/wallmessage.php:124 ../../mod/message.php:172 -#: ../../include/conversation.php:943 +#: ../../include/conversation.php:947 msgid "Please enter a link URL:" msgstr "" @@ -2777,7 +2777,7 @@ msgstr "" msgid "People Search" msgstr "" -#: ../../mod/like.php:185 ../../mod/like.php:259 ../../mod/tagger.php:70 +#: ../../mod/like.php:185 ../../mod/like.php:260 ../../mod/tagger.php:70 #: ../../addon/facebook/facebook.php:1576 #: ../../addon/communityhome/communityhome.php:158 #: ../../addon/communityhome/communityhome.php:167 @@ -2803,7 +2803,7 @@ msgstr "" #: ../../mod/notice.php:15 ../../mod/viewsrc.php:15 ../../mod/admin.php:159 #: ../../mod/admin.php:700 ../../mod/admin.php:899 ../../mod/display.php:37 -#: ../../mod/display.php:142 ../../include/items.php:3248 +#: ../../mod/display.php:142 ../../include/items.php:3254 msgid "Item not found." msgstr "" @@ -4010,7 +4010,7 @@ msgstr "" msgid "Edit visibility" msgstr "" -#: ../../mod/filer.php:29 ../../include/conversation.php:947 +#: ../../mod/filer.php:29 ../../include/conversation.php:951 msgid "Save to Folder:" msgstr "" @@ -6458,11 +6458,11 @@ msgstr "" msgid "Ask me" msgstr "" -#: ../../include/event.php:17 ../../include/bb2diaspora.php:249 +#: ../../include/event.php:17 ../../include/bb2diaspora.php:295 msgid "Starts:" msgstr "" -#: ../../include/event.php:27 ../../include/bb2diaspora.php:257 +#: ../../include/event.php:27 ../../include/bb2diaspora.php:303 msgid "Finishes:" msgstr "" @@ -6634,7 +6634,7 @@ msgstr "" msgid "Sharing notification from Diaspora network" msgstr "" -#: ../../include/diaspora.php:2074 +#: ../../include/diaspora.php:2084 msgid "Attachments:" msgstr "" @@ -6642,11 +6642,11 @@ msgstr "" msgid "view full size" msgstr "" -#: ../../include/oembed.php:134 +#: ../../include/oembed.php:135 msgid "Embedded content" msgstr "" -#: ../../include/oembed.php:143 +#: ../../include/oembed.php:144 msgid "Embedding disabled" msgstr "" @@ -6943,11 +6943,11 @@ msgstr "" msgid "From: " msgstr "" -#: ../../include/bbcode.php:210 ../../include/bbcode.php:230 +#: ../../include/bbcode.php:214 ../../include/bbcode.php:234 msgid "$1 wrote:" msgstr "" -#: ../../include/bbcode.php:245 ../../include/bbcode.php:314 +#: ../../include/bbcode.php:249 ../../include/bbcode.php:322 msgid "Image/photo" msgstr "" @@ -7188,27 +7188,18 @@ msgstr "" msgid "following" msgstr "" -#: ../../include/items.php:2804 +#: ../../include/items.php:2808 msgid "A new person is sharing with you at " msgstr "" -#: ../../include/items.php:2804 +#: ../../include/items.php:2808 msgid "You have a new follower at " msgstr "" -#: ../../include/items.php:3466 +#: ../../include/items.php:3472 msgid "Archives" msgstr "" -#: ../../include/bb2diaspora.php:102 ../../include/bb2diaspora.php:112 -#: ../../include/bb2diaspora.php:113 -msgid "image/photo" -msgstr "" - -#: ../../include/bb2diaspora.php:102 -msgid "link" -msgstr "" - #: ../../include/user.php:38 msgid "An invitation is required." msgstr "" @@ -7449,102 +7440,102 @@ msgstr "" msgid "Delete Selected Items" msgstr "" -#: ../../include/conversation.php:901 +#: ../../include/conversation.php:905 #, php-format msgid "%s likes this." msgstr "" -#: ../../include/conversation.php:901 +#: ../../include/conversation.php:905 #, php-format msgid "%s doesn't like this." msgstr "" -#: ../../include/conversation.php:905 +#: ../../include/conversation.php:909 #, php-format msgid "%2$d people like this." msgstr "" -#: ../../include/conversation.php:907 +#: ../../include/conversation.php:911 #, php-format msgid "%2$d people don't like this." msgstr "" -#: ../../include/conversation.php:913 +#: ../../include/conversation.php:917 msgid "and" msgstr "" -#: ../../include/conversation.php:916 +#: ../../include/conversation.php:920 #, php-format msgid ", and %d other people" msgstr "" -#: ../../include/conversation.php:917 +#: ../../include/conversation.php:921 #, php-format msgid "%s like this." msgstr "" -#: ../../include/conversation.php:917 +#: ../../include/conversation.php:921 #, php-format msgid "%s don't like this." msgstr "" -#: ../../include/conversation.php:942 +#: ../../include/conversation.php:946 msgid "Visible to everybody" msgstr "" -#: ../../include/conversation.php:944 +#: ../../include/conversation.php:948 msgid "Please enter a video link/URL:" msgstr "" -#: ../../include/conversation.php:945 +#: ../../include/conversation.php:949 msgid "Please enter an audio link/URL:" msgstr "" -#: ../../include/conversation.php:946 +#: ../../include/conversation.php:950 msgid "Tag term:" msgstr "" -#: ../../include/conversation.php:948 +#: ../../include/conversation.php:952 msgid "Where are you right now?" msgstr "" -#: ../../include/conversation.php:991 +#: ../../include/conversation.php:995 msgid "upload photo" msgstr "" -#: ../../include/conversation.php:993 +#: ../../include/conversation.php:997 msgid "attach file" msgstr "" -#: ../../include/conversation.php:995 +#: ../../include/conversation.php:999 msgid "web link" msgstr "" -#: ../../include/conversation.php:996 +#: ../../include/conversation.php:1000 msgid "Insert video link" msgstr "" -#: ../../include/conversation.php:997 +#: ../../include/conversation.php:1001 msgid "video link" msgstr "" -#: ../../include/conversation.php:998 +#: ../../include/conversation.php:1002 msgid "Insert audio link" msgstr "" -#: ../../include/conversation.php:999 +#: ../../include/conversation.php:1003 msgid "audio link" msgstr "" -#: ../../include/conversation.php:1001 +#: ../../include/conversation.php:1005 msgid "set location" msgstr "" -#: ../../include/conversation.php:1003 +#: ../../include/conversation.php:1007 msgid "clear location" msgstr "" -#: ../../include/conversation.php:1010 +#: ../../include/conversation.php:1014 msgid "permissions" msgstr "" From 59ebe6f111865d0528ac34a237dc3f6a34782252 Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Sat, 23 Jun 2012 22:28:28 -0600 Subject: [PATCH 32/78] ok now I'm just making silly mistakes--take out premature function locking code --- include/diaspora.php | 97 +++++++++----------------------------------- 1 file changed, 20 insertions(+), 77 deletions(-) diff --git a/include/diaspora.php b/include/diaspora.php index ab43b4608b..a398007e19 100755 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -5,7 +5,6 @@ require_once('include/items.php'); require_once('include/bb2diaspora.php'); require_once('include/contact_selectors.php'); require_once('include/queue_fn.php'); -require_once('include/lock.php'); function diaspora_dispatch_public($msg) { @@ -114,83 +113,27 @@ function diaspora_get_contact_by_handle($uid,$handle) { } function find_diaspora_person_by_handle($handle) { - - $person = false; $update = false; - $got_lock = false; - - do { - $r = q("select * from fcontact where network = '%s' and addr = '%s' limit 1", - dbesc(NETWORK_DIASPORA), - dbesc($handle) - ); - if(count($r)) { - $person = $r[0]; - logger('find_diaspora_person_by handle: in cache ' . print_r($r,true), LOGGER_DEBUG); - - // update record occasionally so it doesn't get stale - $d = strtotime($person['updated'] . ' +00:00'); - if($d < strtotime('now - 14 days')) - $update = true; - } - - - // FETCHING PERSON INFORMATION FROM REMOTE SERVER - // - // If the person isn't in our 'fcontact' table, or if he/she is but - // his/her information hasn't been updated for more than 14 days, then - // we want to fetch the person's information from the remote server. - // - // Note that $person isn't changed by this block of code unless the - // person's information has been successfully fetched from the remote - // server. So if $person was 'false' to begin with (because he/she wasn't - // in the local cache), it'll stay false, and if $person held the local - // cache information to begin with, it'll keep that information. That way - // if there's a problem with the remote fetch, we can at least use our - // cached information--it's better than nothing. - - if((! $person) || ($update)) { - // Lock the function to prevent race conditions if multiple items - // come in at the same time from a person who doesn't exist in - // fcontact - $got_lock = lock_function('find_diaspora_person_by_handle', false); - - if($got_lock) { - logger('find_diaspora_person_by_handle: create or refresh', LOGGER_DEBUG); - require_once('include/Scrape.php'); - $r = probe_url($handle, PROBE_DIASPORA); - - // Note that Friendica contacts can return a "Diaspora person" - // if Diaspora connectivity is enabled on their server - if((count($r)) && ($r['network'] === NETWORK_DIASPORA)) { - add_fcontact($r,$update); - $person = ($r); - } - - unlock_function('find_diaspora_person_by_handle'); - } - else { - logger('find_diaspora_person_by_handle: couldn\'t lock function', LOGGER_DEBUG); - if(! $person) - block_on_function_lock('find_diaspora_person_by_handle'); - } - } - } while((! $person) && (! $got_lock)); - // We need to try again if the person wasn't in 'fcontact' but the function was locked. - // The fact that the function was locked may mean that another process was creating the - // person's record. It could also mean another process was creating or updating an unrelated - // person. - // - // At any rate, we need to keep trying until we've either got the person or had a chance to - // try to fetch his/her remote information. But we don't want to block on locking the - // function, because if the other process is creating the record, then when we acquire the lock - // we'll dive right into creating another, duplicate record. We DO want to at least wait - // until the lock is released, so we don't flood the database with requests. - // - // If the person was in the 'fcontact' table, don't try again. It's not worth the time, since - // we do have some information for the person - - return $person; + $r = q("select * from fcontact where network = '%s' and addr = '%s' limit 1", + dbesc(NETWORK_DIASPORA), + dbesc($handle) + ); + if(count($r)) { + logger('find_diaspora_person_by handle: in cache ' . print_r($r,true), LOGGER_DEBUG); + // update record occasionally so it doesn't get stale + $d = strtotime($r[0]['updated'] . ' +00:00'); + if($d > strtotime('now - 14 days')) + return $r[0]; + $update = true; + } + logger('find_diaspora_person_by_handle: refresh',LOGGER_DEBUG); + require_once('include/Scrape.php'); + $r = probe_url($handle, PROBE_DIASPORA); + if((count($r)) && ($r['network'] === NETWORK_DIASPORA)) { + add_fcontact($r,$update); + return ($r); + } + return false; } From 7f3813e9b066ab7290963e378dafd010de5416fe Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 24 Jun 2012 00:56:27 -0700 Subject: [PATCH 33/78] service class basics --- boot.php | 6 +++--- include/plugin.php | 38 ++++++++++++++++++++++++++++++++++++++ include/user.php | 14 ++++++++++---- mod/dfrn_confirm.php | 2 +- 4 files changed, 52 insertions(+), 8 deletions(-) diff --git a/boot.php b/boot.php index 971762634a..ac561edf6c 100644 --- a/boot.php +++ b/boot.php @@ -1374,9 +1374,9 @@ if(! function_exists('proc_run')) { if(count($args) && $args[0] === 'php') $args[0] = ((x($a->config,'php_path')) && (strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); - foreach ($args as $arg){ - $arg = escapeshellarg($arg); - } + for($x = 0; $x < count($args); $x ++) + $args[$x] = escapeshellarg($args[$x]); + $cmdline = implode($args," "); proc_close(proc_open($cmdline." &",array(),$foo)); } diff --git a/include/plugin.php b/include/plugin.php index c6b61ae6e9..3b6faa072a 100644 --- a/include/plugin.php +++ b/include/plugin.php @@ -316,3 +316,41 @@ function get_theme_screenshot($theme) { } return($a->get_baseurl() . '/images/blank.png'); } + + +// check service_class restrictions. If there are no service_classes defined, everything is allowed. +// if $usage is supplied, we check against a maximum count and return true if the current usage is +// less than the subscriber plan allows. Otherwise we return boolean true or false if the property +// is allowed (or not) in this subscriber plan. An unset property for this service plan means +// the property is allowed, so it is only necessary to provide negative properties for each plan, +// or what the subscriber is not allowed to do. + + +function service_class_allows($uid,$property,$usage = false) { + + if($uid == local_user()) { + $service_class = $a->user['service_class']; + } + else { + $r = q("select service_class from user where uid = %d limit 1", + intval($uid) + ); + if($r !== false and count($r)) { + $service_class = $r[0]['service_class']; + } + } + if(! x($service_class)) + return true; // everything is allowed + + $arr = get_config('service_class',$service_class); + if(! is_array($arr) || (! count($arr))) + return true; + + if($usage === false) + return ((x($arr[$property])) ? (bool) $arr['property'] : true); + else { + if(! array_key_exists($property,$arr)) + return true; + return (((intval($usage)) < intval($arr[$property])) ? true : false); + } +} \ No newline at end of file diff --git a/include/user.php b/include/user.php index 2477438bf4..383a3b3e1c 100644 --- a/include/user.php +++ b/include/user.php @@ -147,13 +147,18 @@ function create_user($arr) { require_once('include/crypto.php'); - $keys = new_keypair(1024); + $keys = new_keypair(4096); if($keys === false) { $result['message'] .= t('SERIOUS ERROR: Generation of security keys failed.') . EOL; return $result; } + $default_service_class = get_config('system','default_service_class'); + if(! $default_service_class) + $default_service_class = ''; + + $prvkey = $keys['prvkey']; $pubkey = $keys['pubkey']; @@ -173,8 +178,8 @@ function create_user($arr) { $spubkey = $sres['pubkey']; $r = q("INSERT INTO `user` ( `guid`, `username`, `password`, `email`, `openid`, `nickname`, - `pubkey`, `prvkey`, `spubkey`, `sprvkey`, `register_date`, `verified`, `blocked`, `timezone` ) - VALUES ( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, 'UTC' )", + `pubkey`, `prvkey`, `spubkey`, `sprvkey`, `register_date`, `verified`, `blocked`, `timezone`, `service_class` ) + VALUES ( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, 'UTC', '%s' )", dbesc(generate_user_guid()), dbesc($username), dbesc($new_password_encoded), @@ -187,7 +192,8 @@ function create_user($arr) { dbesc($sprvkey), dbesc(datetime_convert()), intval($verified), - intval($blocked) + intval($blocked), + dbesc($default_service_class) ); if($r) { diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php index 76b99cbca7..8e39f5fd0b 100644 --- a/mod/dfrn_confirm.php +++ b/mod/dfrn_confirm.php @@ -146,7 +146,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) { */ require_once('include/crypto.php'); - $res = new_keypair(1024); + $res = new_keypair(4096); $private_key = $res['prvkey']; $public_key = $res['pubkey']; From 9528beac34389f8d8f20de1816bca8d516a556cc Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 24 Jun 2012 16:51:39 -0700 Subject: [PATCH 34/78] sidebar photo album list not visible to anybody if user['hidewall'] set --- boot.php | 2 +- mod/photos.php | 6 +- util/messages.po | 203 +++++++++++++++++++++++++---------------------- 3 files changed, 115 insertions(+), 96 deletions(-) diff --git a/boot.php b/boot.php index ac561edf6c..8aa36f18ab 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.1383' ); +define ( 'FRIENDICA_VERSION', '3.0.1384' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); define ( 'DB_UPDATE_VERSION', 1149 ); diff --git a/mod/photos.php b/mod/photos.php index d96bc135e4..31046565d8 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -38,8 +38,10 @@ function photos_init(&$a) { $o .= '
    ' . $a->data['user']['username'] . '
    '; $o .= '
    ' . $a->data['user']['username'] . '
    '; $o .= '
  • '; - - if(! intval($a->data['user']['hidewall'])) { + + $albums_visible = ((intval($a->data['user']['hidewall']) && (! local_user()) && (! remote_user())) ? false : true); + + if($albums_visible) { $o .= ' +
    +

    +$lbl_likes +

    + + + +
    +
    + + + +
    +

    +$lbl_dislikes +

    + + + +
    +
    + + +

    $lbl_social From ad6c82bdea11e4c35284e18608f78ad4c355405d Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 24 Jun 2012 22:23:17 -0700 Subject: [PATCH 36/78] implement "follow" service limits --- include/follow.php | 36 ++++++++++++++++++++++++++++++++++++ include/plugin.php | 15 ++++++++++++++- view/en/update_fail_eml.tpl | 2 +- 3 files changed, 51 insertions(+), 2 deletions(-) diff --git a/include/follow.php b/include/follow.php index 22288a0daf..b4d1732b88 100644 --- a/include/follow.php +++ b/include/follow.php @@ -62,6 +62,11 @@ function new_contact($uid,$url,$interactive = false) { } } + + + + + // This extra param just confuses things, remove it if($ret['network'] === NETWORK_DIASPORA) $ret['url'] = str_replace('?absolute=true','',$ret['url']); @@ -89,6 +94,11 @@ function new_contact($uid,$url,$interactive = false) { $ret['notify'] = ''; } + + + + + if(! $ret['notify']) { $result['message'] .= t('Limited profile. This person will be unable to receive direct/personal notifications from you.') . EOL; } @@ -129,6 +139,32 @@ function new_contact($uid,$url,$interactive = false) { } else { + + // check service class limits + + $r = q("select count(*) as total from contact where uid = %d and pending = 0 and self = 0", + intval($uid) + ); + if(count($r)) + $total_contacts = $r[0]['total']; + + if(! service_class_allows($uid,'total_contacts',$total_contacts)) { + $result['message'] .= upgrade_message(); + return $result; + } + + $r = q("select count(network) as total from contact where uid = %d and network = '%s' and pending = 0 and self = 0", + intval($uid), + dbesc($network) + ); + if(count($r)) + $total_network = $r[0]['total']; + + if(! service_class_allows($uid,'total_contacts_' . $network,$total_network)) { + $result['message'] .= upgrade_message(); + return $result; + } + $new_relation = (($ret['network'] === NETWORK_MAIL) ? CONTACT_IS_FRIEND : CONTACT_IS_SHARING); if($ret['network'] === NETWORK_DIASPORA) $new_relation = CONTACT_IS_FOLLOWER; diff --git a/include/plugin.php b/include/plugin.php index 3b6faa072a..89715485ee 100644 --- a/include/plugin.php +++ b/include/plugin.php @@ -353,4 +353,17 @@ function service_class_allows($uid,$property,$usage = false) { return true; return (((intval($usage)) < intval($arr[$property])) ? true : false); } -} \ No newline at end of file +} + +function upgrade_link() { + $l = get_config('service_class','upgrade_link'); + $t = sprintf('' . t('Click here to upgrade.') . '

    ', $l); + if($l) + return $t; + return ''; +} + +function upgrade_message() { + $x = upgrade_link(); + return t('This action exceeds the limits set by your subscription plan.') . (($x) ? ' ' . $x : '') ; +} diff --git a/view/en/update_fail_eml.tpl b/view/en/update_fail_eml.tpl index f68a3dece1..548e1a0df1 100644 --- a/view/en/update_fail_eml.tpl +++ b/view/en/update_fail_eml.tpl @@ -1,5 +1,5 @@ Hey, -I'm $sitename. +I'm $sitename; The friendica developers released update $update recently, but when I tried to install it, something went terribly wrong. This needs to be fixed soon and I can't do it alone. Please contact a From 35a098e0dc7940974132d8d65bbc4418d92fb204 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 25 Jun 2012 01:37:44 -0700 Subject: [PATCH 37/78] service limits for photo uploads --- include/plugin.php | 25 +++++++++++++++++++++++ mod/photos.php | 33 ++++++++++++++++++++++++++++++- view/photos_upload.tpl | 3 +++ view/theme/duepuntozero/style.css | 3 +++ 4 files changed, 63 insertions(+), 1 deletion(-) diff --git a/include/plugin.php b/include/plugin.php index 89715485ee..e8fec4cbea 100644 --- a/include/plugin.php +++ b/include/plugin.php @@ -355,6 +355,31 @@ function service_class_allows($uid,$property,$usage = false) { } } + +function service_class_fetch($uid,$property) { + + if($uid == local_user()) { + $service_class = $a->user['service_class']; + } + else { + $r = q("select service_class from user where uid = %d limit 1", + intval($uid) + ); + if($r !== false and count($r)) { + $service_class = $r[0]['service_class']; + } + } + if(! x($service_class)) + return false; // everything is allowed + + $arr = get_config('service_class',$service_class); + if(! is_array($arr) || (! count($arr))) + return false; + + return((array_key_exists($property,$arr)) ? $arr[$property] : false); + +} + function upgrade_link() { $l = get_config('service_class','upgrade_link'); $t = sprintf('' . t('Click here to upgrade.') . '', $l); diff --git a/mod/photos.php b/mod/photos.php index 31046565d8..ea4d7f81f5 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -711,6 +711,24 @@ function photos_post(&$a) { logger('mod/photos.php: photos_post(): loading the contents of ' . $src , LOGGER_DEBUG); $imagedata = @file_get_contents($src); + + + + $r = q("select sum(octet_length(data)) as total from photo where uid = %d and scale = 0 and album != 'Contact Photos' ", + intval($a->data['user']['uid']) + ); + + $limit = service_class_fetch($a->data['user']['uid'],'photo_upload_limit'); + + if(($limit !== false) && (($r[0]['total'] + strlen($imagedata)) > $limit)) { + notice( upgrade_message() . EOL ); + @unlink($src); + $foo = 0; + call_hooks('photo_post_end',$foo); + killme(); + } + + $ph = new Photo($imagedata, $type); if(! $ph->is_valid()) { @@ -968,12 +986,25 @@ function photos_content(&$a) { '; - + $r = q("select sum(octet_length(data)) as total from photo where uid = %d and scale = 0 and album != 'Contact Photos' ", + intval($a->data['user']['uid']) + ); + + + $limit = service_class_fetch($a->data['user']['uid'],'photo_upload_limit'); + if($limit !== false) { + $usage_message = sprintf( t("You have used %1$.2f Mbytes of %2$.2f Mbytes photo storage."), $r[0]['total'] / 1024000, $limit / 1024000 ); + } + else { + $usage_message = sprintf( t('You have used %1$.2f Mbytes of photo storage.'), $r[0]['total'] / 1024000 ); + } + $tpl = get_markup_template('photos_upload.tpl'); $o .= replace_macros($tpl,array( '$pagename' => t('Upload Photos'), '$sessid' => session_id(), + '$usage' => $usage_message, '$nickname' => $a->data['user']['nickname'], '$newalbum' => t('New album name: '), '$existalbumtext' => t('or existing album name: '), diff --git a/view/photos_upload.tpl b/view/photos_upload.tpl index 318a924277..706b3398dd 100644 --- a/view/photos_upload.tpl +++ b/view/photos_upload.tpl @@ -1,4 +1,7 @@

    $pagename

    + +
    $usage
    +
    diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index de366210b6..ea3a2da9c6 100644 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -1644,6 +1644,9 @@ input#dfrn-url { display:block!important; } +#photos-usage-message { + margin-bottom: 15px; +} #acl-wrapper { From 7ea5917bf794c431fe304fa25380f19a6927cf63 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 25 Jun 2012 03:25:06 -0700 Subject: [PATCH 38/78] more service class functionality --- include/plugin.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/plugin.php b/include/plugin.php index e8fec4cbea..d762e8717f 100644 --- a/include/plugin.php +++ b/include/plugin.php @@ -392,3 +392,8 @@ function upgrade_message() { $x = upgrade_link(); return t('This action exceeds the limits set by your subscription plan.') . (($x) ? ' ' . $x : '') ; } + +function upgrade_bool_message() { + $x = upgrade_link(); + return t('This action is not available under your subscription plan.') . (($x) ? ' ' . $x : '') ; +} 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 39/78] 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 af1d4bb632aa1f6c9fb9f756f1d8606f9fe947e1 Mon Sep 17 00:00:00 2001 From: Sebastian Egbers Date: Mon, 25 Jun 2012 15:53:56 +0200 Subject: [PATCH 40/78] modified api message reply to set title to conversion title, when replying. --- include/api.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/include/api.php b/include/api.php index 1db9d020be..2da183f019 100644 --- a/include/api.php +++ b/include/api.php @@ -1516,27 +1516,31 @@ $sender = api_get_user($a); + require_once("include/message.php"); + $r = q("SELECT `id` FROM `contact` WHERE `uid`=%d AND `nick`='%s'", intval(local_user()), dbesc($_POST['screen_name'])); - - require_once("include/message.php"); $recipient = api_get_user($a, $r[0]['id']); $replyto = ''; + $sub = ''; if (x($_REQUEST,'replyto')) { - $r = q('SELECT `uri` FROM `mail` WHERE `uid`=%d AND `id`=%d', + $r = q('SELECT `uri`, `title` FROM `mail` WHERE `uid`=%d AND `id`=%d', intval(local_user()), intval($_REQUEST['replyto'])); $replyto = $r[0]['uri']; - } - - if (x($_REQUEST,'title')) { - $sub = $_REQUEST['title']; + $sub = $r[0]['title']; } else { - $sub = ((strlen($_POST['text'])>10)?substr($_POST['text'],0,10)."...":$_POST['text']); + if (x($_REQUEST,'title')) { + $sub = $_REQUEST['title']; + } + else { + $sub = ((strlen($_POST['text'])>10)?substr($_POST['text'],0,10)."...":$_POST['text']); + } } + $id = send_message($recipient['id'], $_POST['text'], $sub, $replyto); if ($id>-1) { From 8c251aebc77a6daacfe20598fc861df4c243a726 Mon Sep 17 00:00:00 2001 From: Sebastian Egbers Date: Mon, 25 Jun 2012 16:25:34 +0200 Subject: [PATCH 41/78] fixed direct message reply in api call. --- include/api.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/api.php b/include/api.php index 2da183f019..191ed6fcd8 100644 --- a/include/api.php +++ b/include/api.php @@ -1526,10 +1526,10 @@ $replyto = ''; $sub = ''; if (x($_REQUEST,'replyto')) { - $r = q('SELECT `uri`, `title` FROM `mail` WHERE `uid`=%d AND `id`=%d', + $r = q('SELECT `parent-uri`, `title` FROM `mail` WHERE `uid`=%d AND `id`=%d', intval(local_user()), intval($_REQUEST['replyto'])); - $replyto = $r[0]['uri']; + $replyto = $r[0]['parent-uri']; $sub = $r[0]['title']; } else { From 4293de75546249256e438b87f869a99d864117d6 Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Sun, 24 Jun 2012 09:37:31 -0600 Subject: [PATCH 42/78] 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", '
  • ' ,$Text); $Text = preg_replace("/\[td\](.*?)\[\/td\]/sm", '' ,$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 43/78] 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 44/78] 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 45/78] 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 46/78] 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 47/78] 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 48/78] 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 49/78] 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 50/78] 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 51/78] 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 52/78] 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 53/78] 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 54/78] 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 55/78] 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 56/78] 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 57/78] 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 58/78] 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 59/78] 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 60/78] 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 61/78] 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 62/78] 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 Date: Tue, 26 Jun 2012 08:54:01 +0200 Subject: [PATCH 63/78] moved api direct message formating to own function. added same formating to direct reply message, when posting a new message. --- include/api.php | 108 ++++++++++++++++++++++++------------------------ 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/include/api.php b/include/api.php index 0a038b0381..d790b4b875 100644 --- a/include/api.php +++ b/include/api.php @@ -1238,6 +1238,40 @@ return($as); } + function api_format_messages($item, $recipient, $sender) { + // standard meta information + $ret=Array( + 'id' => $item['id'], + 'created_at' => api_date($item['created']), + 'sender_id' => $sender['id'] , + 'sender_screen_name' => $sender['screen_name'], + 'sender' => $sender, + 'recipient_id' => $recipient['id'], + 'recipient_screen_name' => $recipient['screen_name'], + 'recipient' => $recipient, + ); + + //don't send title to regular StatusNET requests to avoid confusing these apps + if (x($_GET, 'getText')) { + $ret['title'] = $item['title'] ; + if ($_GET["getText"] == "html") { + $ret['text'] = bbcode($item['body']); + } + elseif ($_GET["getText"] == "plain") { + $ret['text'] = html2plain(bbcode($item['body']), 0); + } + } + else { + $ret['text'] = $item['title']."\n".html2plain(bbcode($item['body']), 0); + } + if (isset($_GET["getUserObjects"]) && $_GET["getUserObjects"] == "false") { + unset($ret['sender']); + unset($ret['recipient']); + } + + return $ret; + } + function api_format_items($r,$user_info) { //logger('api_format_items: ' . print_r($r,true)); @@ -1546,20 +1580,7 @@ if ($id>-1) { $r = q("SELECT * FROM `mail` WHERE id=%d", intval($id)); - $item = $r[0]; - $ret=Array( - 'id' => $item['id'], - 'created_at'=> api_date($item['created']), - 'sender_id'=> $sender['id'] , - 'sender_screen_name'=> $sender['screen_name'], - 'sender'=> $sender, - 'recipient_id'=> $recipient['id'], - 'recipient_screen_name'=> $recipient['screen_name'], - 'recipient'=> $recipient, - - 'text'=> $item['title']."\n".html2plain(bbcode($item['body']), 0) , - - ); + $ret = api_format_messages($r[0], $recipient, $sender); } else { $ret = array("error"=>$id); @@ -1578,7 +1599,7 @@ } api_register_func('api/direct_messages/new','api_direct_messages_new',true); - function api_direct_messages_box(&$a, $type, $box) { + function api_direct_messages_box(&$a, $type, $box) { if (local_user()===false) return false; $user_info = api_get_user($a); @@ -1590,14 +1611,17 @@ $start = $page*$count; - $profile_url = $a->get_baseurl() . '/profile/' . $a->user['nickname']; + $profile_url = $a->get_baseurl() . '/profile/' . $a->user['nickname']; if ($box=="sentbox") { $sql_extra = "`from-url`='".dbesc( $profile_url )."'"; - } elseif ($box=="conversation") { - $sql_extra = "`parent-uri`='".dbesc( $_GET["uri"] ) ."'"; - } elseif ($box=="all") { - $sql_extra = "true"; - } elseif ($box=="inbox") { + } + elseif ($box=="conversation") { + $sql_extra = "`parent-uri`='".dbesc( $_GET["uri"] ) ."'"; + } + elseif ($box=="all") { + $sql_extra = "true"; + } + elseif ($box=="inbox") { $sql_extra = "`from-url`!='".dbesc( $profile_url )."'"; } @@ -1607,41 +1631,17 @@ ); $ret = Array(); - foreach($r as $item){ + foreach($r as $item) { if ($box == "inbox" || $item['from-url'] != $profile_url){ - $recipient = $user_info; - $sender = api_get_user($a,$item['contact-id']); - } elseif ($box == "sentbox" || $item['from-url'] != $profile_url){ - $recipient = api_get_user($a,$item['contact-id']); - $sender = $user_info; + $recipient = $user_info; + $sender = api_get_user($a,$item['contact-id']); } - - $d=Array( - 'id' => $item['id'], - 'created_at'=> api_date($item['created']), - 'sender_id'=> $sender['id'] , - 'sender_screen_name'=> $sender['screen_name'], - 'sender_profile_img'=> $item['from-photo'], - 'sender'=> $sender, - 'recipient_id'=> $recipient['id'], - 'recipient_screen_name'=> $recipient['screen_name'], - 'recipient'=> $recipient, - ); - //don't send title to regular StatusNET requests to avoid confusing these apps - if (isset($_GET["getText"])) { - $d['title'] = $item['title'] ; - if ($_GET["getText"] == "html") { - $d['text'] = bbcode($item['body']); - } elseif ($_GET["getText"] == "plain") { - $d['text'] = html2plain(bbcode($item['body']), 0); - } - } else { - $d['text'] = $item['title']."\n".html2plain(bbcode($item['body']), 0); - } - if (isset($_GET["getUserObjects"]) && $_GET["getUserObjects"] == "false") { - unset($d['sender']); unset($d['recipient']); - } - $ret[]=$d; + elseif ($box == "sentbox" || $item['from-url'] != $profile_url){ + $recipient = api_get_user($a,$item['contact-id']); + $sender = $user_info; + } + + $ret[]=api_format_messages($item, $recipient, $sender); } From b02c7339671179aa7f4644bbde804791d8fefa25 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 26 Jun 2012 18:30:20 -0700 Subject: [PATCH 64/78] service class restrict the email connector --- boot.php | 2 +- mod/settings.php | 27 ++++------ util/messages.po | 129 +++++++++++++++++++++++++++-------------------- 3 files changed, 83 insertions(+), 75 deletions(-) diff --git a/boot.php b/boot.php index 47e5b8600f..3d7e0c488f 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.1385' ); +define ( 'FRIENDICA_VERSION', '3.0.1386' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); define ( 'DB_UPDATE_VERSION', 1151 ); diff --git a/mod/settings.php b/mod/settings.php index 92593d7a84..b1c3cf7d40 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -677,6 +677,14 @@ function settings_content(&$a) { $tpl = get_markup_template("settings_connectors.tpl"); + + if(! service_class_allows(local_user(),'email_connect')) { + $mail_disabled_message = upgrade_bool_message(); + } + else { + $mail_disabled_message = (($mail_disabled) ? t('Email access is disabled on this site.') : ''); + } + $o .= replace_macros($tpl, array( '$form_security_token' => get_form_security_token("settings_connectors"), @@ -688,7 +696,7 @@ function settings_content(&$a) { '$h_imap' => t('Email/Mailbox Setup'), '$imap_desc' => t("If you wish to communicate with email contacts using this service \x28optional\x29, please specify how to connect to your mailbox."), '$imap_lastcheck' => array('imap_lastcheck', t('Last successful email check:'), $mail_chk,''), - '$mail_disabled' => (($mail_disabled) ? t('Email access is disabled on this site.') : ''), + '$mail_disabled' => $mail_disabled_message, '$mail_server' => array('mail_server', t('IMAP server name:'), $mail_server, ''), '$mail_port' => array('mail_port', t('IMAP port:'), $mail_port, ''), '$mail_ssl' => array('mail_ssl', t('Security:'), strtoupper($mail_ssl), '', array( 'notls'=>t('None'), 'TLS'=>'TLS', 'SSL'=>'SSL')), @@ -921,18 +929,12 @@ function settings_content(&$a) { )); - - - $invisible = (((! $profile['publish']) && (! $profile['net-publish'])) ? true : false); if($invisible) info( t('Profile is not published.') . EOL ); - - - $subdir = ((strlen($a->get_path())) ? '
    ' . t('or') . ' ' . $a->get_baseurl(true) . '/profile/' . $nickname : ''); @@ -1029,17 +1031,6 @@ function settings_content(&$a) { '$h_descadvn' => t('Change the behaviour of this account for special situations'), '$pagetype' => $pagetype, - - - - - - - - - - - )); call_hooks('settings_form',$o); diff --git a/util/messages.po b/util/messages.po index d9a4624467..0ce5eb5266 100644 --- a/util/messages.po +++ b/util/messages.po @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: 3.0.1385\n" +"Project-Id-Version: 3.0.1386\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-06-25 10:00-0700\n" +"POT-Creation-Date: 2012-06-26 10:00-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -35,7 +35,7 @@ msgid "Contact update failed." msgstr "" #: ../../mod/crepair.php:115 ../../mod/wall_attach.php:44 -#: ../../mod/fsuggest.php:78 ../../mod/events.php:138 ../../mod/api.php:26 +#: ../../mod/fsuggest.php:78 ../../mod/events.php:140 ../../mod/api.php:26 #: ../../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 @@ -56,7 +56,7 @@ msgstr "" #: ../../mod/suggest.php:28 ../../mod/invite.php:13 ../../mod/invite.php:81 #: ../../mod/dfrn_confirm.php:53 ../../addon/facebook/facebook.php:508 #: ../../addon/facebook/facebook.php:514 ../../addon/dav/layout.fnk.php:353 -#: ../../include/items.php:3411 ../../index.php:309 +#: ../../include/items.php:3447 ../../index.php:309 msgid "Permission denied." msgstr "" @@ -123,7 +123,7 @@ msgid "New photo from this URL" msgstr "" #: ../../mod/crepair.php:166 ../../mod/fsuggest.php:107 -#: ../../mod/events.php:428 ../../mod/photos.php:986 ../../mod/photos.php:1057 +#: ../../mod/events.php:436 ../../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 @@ -194,7 +194,7 @@ msgstr "" msgid "File exceeds size limit of %d" msgstr "" -#: ../../mod/wall_attach.php:86 ../../mod/wall_attach.php:97 +#: ../../mod/wall_attach.php:99 ../../mod/wall_attach.php:110 msgid "File upload failed." msgstr "" @@ -211,79 +211,87 @@ msgstr "" msgid "Suggest a friend for %s" msgstr "" -#: ../../mod/events.php:65 -msgid "Event description and start time are required." +#: ../../mod/events.php:66 +msgid "Event title and start time are required." msgstr "" -#: ../../mod/events.php:258 +#: ../../mod/events.php:260 msgid "l, F j" msgstr "" -#: ../../mod/events.php:280 +#: ../../mod/events.php:282 msgid "Edit event" msgstr "" -#: ../../mod/events.php:300 ../../include/text.php:1065 +#: ../../mod/events.php:304 ../../include/text.php:1065 msgid "link to source" msgstr "" -#: ../../mod/events.php:324 ../../view/theme/diabook/theme.php:131 +#: ../../mod/events.php:328 ../../view/theme/diabook/theme.php:131 #: ../../include/nav.php:52 ../../boot.php:1546 msgid "Events" msgstr "" -#: ../../mod/events.php:325 +#: ../../mod/events.php:329 msgid "Create New Event" msgstr "" -#: ../../mod/events.php:326 ../../addon/dav/layout.fnk.php:154 +#: ../../mod/events.php:330 ../../addon/dav/layout.fnk.php:154 msgid "Previous" msgstr "" -#: ../../mod/events.php:327 ../../mod/install.php:205 +#: ../../mod/events.php:331 ../../mod/install.php:205 #: ../../addon/dav/layout.fnk.php:157 msgid "Next" msgstr "" -#: ../../mod/events.php:399 +#: ../../mod/events.php:404 msgid "hour:minute" msgstr "" -#: ../../mod/events.php:408 +#: ../../mod/events.php:414 msgid "Event details" msgstr "" -#: ../../mod/events.php:409 +#: ../../mod/events.php:415 #, php-format -msgid "Format is %s %s. Starting date and Description are required." +msgid "Format is %s %s. Starting date and Title are required." msgstr "" -#: ../../mod/events.php:411 +#: ../../mod/events.php:417 msgid "Event Starts:" msgstr "" -#: ../../mod/events.php:414 +#: ../../mod/events.php:417 ../../mod/events.php:431 +msgid "Required" +msgstr "" + +#: ../../mod/events.php:420 msgid "Finish date/time is not known or not relevant" msgstr "" -#: ../../mod/events.php:416 +#: ../../mod/events.php:422 msgid "Event Finishes:" msgstr "" -#: ../../mod/events.php:419 +#: ../../mod/events.php:425 msgid "Adjust for viewer timezone" msgstr "" -#: ../../mod/events.php:421 +#: ../../mod/events.php:427 msgid "Description:" msgstr "" -#: ../../mod/events.php:423 ../../include/event.php:37 -#: ../../include/bb2diaspora.php:355 ../../boot.php:1126 +#: ../../mod/events.php:429 ../../include/event.php:40 +#: ../../include/bb2diaspora.php:357 ../../boot.php:1126 msgid "Location:" msgstr "" -#: ../../mod/events.php:425 +#: ../../mod/events.php:431 +msgid "Title:" +msgstr "" + +#: ../../mod/events.php:433 msgid "Share this event" msgstr "" @@ -407,7 +415,7 @@ msgstr "" msgid "was tagged in a" msgstr "" -#: ../../mod/photos.php:591 ../../mod/like.php:185 ../../mod/tagger.php:70 +#: ../../mod/photos.php:591 ../../mod/like.php:144 ../../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 @@ -428,12 +436,12 @@ msgid "Image file is empty." msgstr "" #: ../../mod/photos.php:736 ../../mod/profile_photo.php:126 -#: ../../mod/wall_upload.php:86 +#: ../../mod/wall_upload.php:99 msgid "Unable to process image." msgstr "" #: ../../mod/photos.php:757 ../../mod/profile_photo.php:259 -#: ../../mod/wall_upload.php:105 +#: ../../mod/wall_upload.php:118 msgid "Image upload failed." msgstr "" @@ -837,7 +845,7 @@ msgstr "" msgid "Confirm" msgstr "" -#: ../../mod/dfrn_request.php:715 ../../include/items.php:2805 +#: ../../mod/dfrn_request.php:715 ../../include/items.php:2873 msgid "[Name Withheld]" msgstr "" @@ -1163,7 +1171,7 @@ msgid "" msgstr "" #: ../../mod/localtime.php:12 ../../include/event.php:11 -#: ../../include/bb2diaspora.php:333 +#: ../../include/bb2diaspora.php:335 msgid "l F d, Y \\@ g:i A" msgstr "" @@ -1739,7 +1747,7 @@ msgstr "" #: ../../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 +#: ../../addon/testdrive/testdrive.php:67 ../../include/items.php:2882 #: ../../boot.php:720 msgid "Administrator" msgstr "" @@ -2788,7 +2796,7 @@ msgstr "" msgid "People Search" msgstr "" -#: ../../mod/like.php:185 ../../mod/like.php:260 ../../mod/tagger.php:70 +#: ../../mod/like.php:144 ../../mod/like.php:301 ../../mod/tagger.php:70 #: ../../addon/facebook/facebook.php:1584 #: ../../addon/communityhome/communityhome.php:158 #: ../../addon/communityhome/communityhome.php:167 @@ -2799,7 +2807,7 @@ msgstr "" msgid "status" msgstr "" -#: ../../mod/like.php:202 ../../addon/facebook/facebook.php:1588 +#: ../../mod/like.php:161 ../../addon/facebook/facebook.php:1588 #: ../../addon/communityhome/communityhome.php:172 #: ../../view/theme/diabook/theme.php:579 ../../include/diaspora.php:1726 #: ../../include/conversation.php:65 @@ -2807,14 +2815,14 @@ msgstr "" msgid "%1$s likes %2$s's %3$s" msgstr "" -#: ../../mod/like.php:204 ../../include/conversation.php:68 +#: ../../mod/like.php:163 ../../include/conversation.php:68 #, php-format msgid "%1$s doesn't like %2$s's %3$s" msgstr "" #: ../../mod/notice.php:15 ../../mod/viewsrc.php:15 ../../mod/admin.php:159 #: ../../mod/admin.php:700 ../../mod/admin.php:899 ../../mod/display.php:37 -#: ../../mod/display.php:142 ../../include/items.php:3258 +#: ../../mod/display.php:142 ../../include/items.php:3326 msgid "Item not found." msgstr "" @@ -2852,34 +2860,34 @@ msgstr "" msgid "Empty post discarded." msgstr "" -#: ../../mod/item.php:379 ../../mod/wall_upload.php:102 -#: ../../mod/wall_upload.php:111 ../../mod/wall_upload.php:118 +#: ../../mod/item.php:379 ../../mod/wall_upload.php:115 +#: ../../mod/wall_upload.php:124 ../../mod/wall_upload.php:131 #: ../../include/message.php:144 msgid "Wall Photos" msgstr "" -#: ../../mod/item.php:800 +#: ../../mod/item.php:784 msgid "System error. Post not saved." msgstr "" -#: ../../mod/item.php:825 +#: ../../mod/item.php:809 #, php-format msgid "" "This message was sent to you by %s, a member of the Friendica social network." msgstr "" -#: ../../mod/item.php:827 +#: ../../mod/item.php:811 #, php-format msgid "You may visit them online at %s" msgstr "" -#: ../../mod/item.php:828 +#: ../../mod/item.php:812 msgid "" "Please contact the sender by replying to this post if you do not wish to " "receive these messages." msgstr "" -#: ../../mod/item.php:830 +#: ../../mod/item.php:814 #, php-format msgid "%s posted an update." msgstr "" @@ -6127,8 +6135,7 @@ msgstr "" msgid "j F" msgstr "" -#: ../../include/profile_advanced.php:30 ../../include/datetime.php:450 -#: ../../include/items.php:1460 +#: ../../include/profile_advanced.php:30 msgid "Birthday:" msgstr "" @@ -6501,11 +6508,11 @@ msgstr "" msgid "Ask me" msgstr "" -#: ../../include/event.php:17 ../../include/bb2diaspora.php:339 +#: ../../include/event.php:20 ../../include/bb2diaspora.php:341 msgid "Starts:" msgstr "" -#: ../../include/event.php:27 ../../include/bb2diaspora.php:347 +#: ../../include/event.php:30 ../../include/bb2diaspora.php:349 msgid "Finishes:" msgstr "" @@ -6982,15 +6989,25 @@ msgstr "" msgid "%1$d %2$s ago" msgstr "" +#: ../../include/datetime.php:450 ../../include/items.php:1460 +#, php-format +msgid "%s's birthday" +msgstr "" + +#: ../../include/datetime.php:451 ../../include/items.php:1461 +#, php-format +msgid "Happy Birthday %s" +msgstr "" + #: ../../include/onepoll.php:399 msgid "From: " msgstr "" -#: ../../include/bbcode.php:214 ../../include/bbcode.php:234 +#: ../../include/bbcode.php:216 ../../include/bbcode.php:236 msgid "$1 wrote:" msgstr "" -#: ../../include/bbcode.php:249 ../../include/bbcode.php:322 +#: ../../include/bbcode.php:251 ../../include/bbcode.php:328 msgid "Image/photo" msgstr "" @@ -7231,15 +7248,15 @@ msgstr "" msgid "following" msgstr "" -#: ../../include/items.php:2812 +#: ../../include/items.php:2880 msgid "A new person is sharing with you at " msgstr "" -#: ../../include/items.php:2812 +#: ../../include/items.php:2880 msgid "You have a new follower at " msgstr "" -#: ../../include/items.php:3476 +#: ../../include/items.php:3512 msgid "Archives" msgstr "" @@ -7582,15 +7599,15 @@ msgstr "" msgid "permissions" msgstr "" -#: ../../include/plugin.php:385 +#: ../../include/plugin.php:388 ../../include/plugin.php:390 msgid "Click here to upgrade." msgstr "" -#: ../../include/plugin.php:393 +#: ../../include/plugin.php:396 msgid "This action exceeds the limits set by your subscription plan." msgstr "" -#: ../../include/plugin.php:398 +#: ../../include/plugin.php:401 msgid "This action is not available under your subscription plan." msgstr "" From fa2a8fa9bd9ffbf8b7615f79e39c87b449c9c27d Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 27 Jun 2012 13:49:35 +1000 Subject: [PATCH 65/78] highlight js events-reminder on birthday events --- view/theme/slackr/birthdays_reminder.tpl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/view/theme/slackr/birthdays_reminder.tpl b/view/theme/slackr/birthdays_reminder.tpl index 8b13789179..3f07b262d6 100644 --- a/view/theme/slackr/birthdays_reminder.tpl +++ b/view/theme/slackr/birthdays_reminder.tpl @@ -1 +1,7 @@ - +{{ if $classtoday }} + +{{ endif }} From f995a11641a47f1351eca1fc5447ec64a9f0a2c8 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 26 Jun 2012 21:35:03 -0700 Subject: [PATCH 66/78] have no idea why the if/endif macro block was getting printed and not processed. --- view/theme/slackr/birthdays_reminder.tpl | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/view/theme/slackr/birthdays_reminder.tpl b/view/theme/slackr/birthdays_reminder.tpl index 3f07b262d6..4a691dea3f 100644 --- a/view/theme/slackr/birthdays_reminder.tpl +++ b/view/theme/slackr/birthdays_reminder.tpl @@ -1,7 +1,5 @@ -{{ if $classtoday }} -{{ endif }} + $(document).ready(function() { + $('#events-reminder').addClass($.trim('$classtoday')); + }); + From eb3bbd9081b384d1e1e503d8019eadc9f151edeb Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 26 Jun 2012 22:32:07 -0700 Subject: [PATCH 67/78] insidious little parsing bug --- boot.php | 3 +++ view/theme/slackr/birthdays_reminder.tpl | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/boot.php b/boot.php index 3d7e0c488f..c27b0baaab 100644 --- a/boot.php +++ b/boot.php @@ -1252,6 +1252,9 @@ if(! function_exists('get_birthdays')) { '$event_reminders' => t('Birthday Reminders'), '$event_title' => t('Birthdays this week:'), '$events' => $r, + '$lbr' => '{', // raw brackets mess up if/endif macro processing + '$rbr' => '}' + )); } } diff --git a/view/theme/slackr/birthdays_reminder.tpl b/view/theme/slackr/birthdays_reminder.tpl index 4a691dea3f..1dc65295a9 100644 --- a/view/theme/slackr/birthdays_reminder.tpl +++ b/view/theme/slackr/birthdays_reminder.tpl @@ -1,5 +1,8 @@ +{{ if $classtoday }} +{{ endif }} + From 3968e71d4c24a0dfd37a14545dc159c5f83155c6 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Wed, 27 Jun 2012 16:06:02 +0100 Subject: [PATCH 68/78] Friendicaland - couple of new 'countries' --- js/country.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/country.js b/js/country.js index c3add477f0..cc7697a1f5 100644 --- a/js/country.js +++ b/js/country.js @@ -275,7 +275,7 @@ aStates[249]="|'Adan|'Ataq|Abyan|Al Bayda'|Al Hudaydah|Al Jawf|Al Mahrah|Al Mahw aStates[250]="|Kosovo|Montenegro|Serbia|Vojvodina"; aStates[251]="|Central|Copperbelt|Eastern|Luapula|Lusaka|North-Western|Northern|Southern|Western"; aStates[252]="|Bulawayo|Harare|ManicalandMashonaland Central|Mashonaland East|Mashonaland West|Masvingo|Matabeleland North|Matabeleland South|Midlands"; -aStates[253]="|Self Hosted|Private Server|Architects Of Sleep|DFRN|Distributed Friend Network|Free-Beer.ch|Foojbook|Free-Haven|Friendica.eu|Friendika.me.4.it|Friendika - I Ask Questions|Frndc.com|Hipatia|Hungerfreunde|Kaluguran Community|Kak Ste?|Karl.Markx.pm|Loozah Social Club|MyFriendica.net|MyFriendNetwork|Oi!|OpenMindSpace|Recolutionari.es|Sysfu Social Club|theshi.re|Tumpambae|Uzmiac|Other"; +aStates[253]="|Self Hosted|Private Server|Architects Of Sleep|DFRN|Distributed Friend Network|Free-Beer.ch|Foojbook|Free-Haven|Friendica.eu|Friendika.me.4.it|Friendika - I Ask Questions|Frndc.com|Hikado|Hipatia|Hungerfreunde|Kaluguran Community|Kak Ste?|Karl.Markx.pm|Loozah Social Club|MyFriendica.net|MyFriendNetwork|Oi!|OpenMindSpace|Recolutionari.es|SPRACI|Sysfu Social Club|theshi.re|Tumpambae|Uzmiac|Other"; /* * gArCountryInfo * (0) Country name From cd9ce0ecb3162a9d1a24cf1a1398891aa035becb Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Wed, 27 Jun 2012 21:21:26 -0600 Subject: [PATCH 69/78] fix logic for nested lists--should be OR, not AND --- include/bb2diaspora.php | 6 +++--- include/bbcode.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index 25edb28d7d..77a5f5c2a0 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -113,9 +113,9 @@ 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) && - (strpos($Text, "[/ol]") !== false) && (strpos($Text, "[ol]") !== false) && - (strpos($Text, "[/ul]") !== false) && (strpos($Text, "[ul]") !== 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); diff --git a/include/bbcode.php b/include/bbcode.php index ee31b4a1aa..9071c767b6 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -163,9 +163,9 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) { // handle nested lists $endlessloop = 0; - 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)) { + 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); From ecf9ad9a082e12e3f77469ef2c16b1898a39c47c Mon Sep 17 00:00:00 2001 From: Simon L'nu Date: Thu, 28 Jun 2012 12:15:32 -0400 Subject: [PATCH 70/78] fix item-delete-selected* css Signed-off-by: Simon L'nu --- view/theme/dispy/dark/style.css | 4 ++-- view/theme/dispy/dark/style.less | 8 ++++---- view/theme/dispy/light/style.css | 4 ++-- view/theme/dispy/light/style.less | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/view/theme/dispy/dark/style.css b/view/theme/dispy/dark/style.css index a7763ecfb4..8ab1923685 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;font-size:smaller;margin-right:5px;}#item-delete-selected-desc:hover{text-decoration:underline;} +#item-delete-selected-desc{float:left;font-size:x-small;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;} @@ -389,7 +389,7 @@ 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;position:absolute;left:35px;width:15em;overflow:auto;} +#item-delete-selected{margin:3em 5px;position:relative;left:4em;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;} diff --git a/view/theme/dispy/dark/style.less b/view/theme/dispy/dark/style.less index 32b9aa4b3e..60b49865e9 100644 --- a/view/theme/dispy/dark/style.less +++ b/view/theme/dispy/dark/style.less @@ -325,7 +325,7 @@ h6 { } #item-delete-selected-desc { float: left; - font-size: smaller; + font-size: x-small; margin-right: 5px; &:hover { text-decoration: underline; @@ -2366,9 +2366,9 @@ div { opacity: 1; } #item-delete-selected { - margin-top: 30px; - position: absolute; - left: 35px; + margin: 3em 5px; + position: relative; + left: 4em; width: 15em; overflow: auto; } diff --git a/view/theme/dispy/light/style.css b/view/theme/dispy/light/style.css index 3d44cc8c44..de2717f0c4 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;font-size:smaller;margin-right:5px;}#item-delete-selected-desc:hover{text-decoration:underline;} +#item-delete-selected-desc{float:left;font-size:x-small;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;} @@ -389,7 +389,7 @@ 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;position:absolute;left:35px;width:15em;overflow:auto;} +#item-delete-selected{margin:3em 5px;position:relative;left:4em;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;} diff --git a/view/theme/dispy/light/style.less b/view/theme/dispy/light/style.less index c5641605e2..e18f9a01b0 100644 --- a/view/theme/dispy/light/style.less +++ b/view/theme/dispy/light/style.less @@ -326,7 +326,7 @@ h6 { } #item-delete-selected-desc { float: left; - font-size: smaller; + font-size: x-small; margin-right: 5px; &:hover { text-decoration: underline; @@ -2367,9 +2367,9 @@ div { opacity: 1; } #item-delete-selected { - margin-top: 30px; - position: absolute; - left: 35px; + margin: 3em 5px; + position: relative; + left: 4em; width: 15em; overflow: auto; } From de93c61e0de2c4bd9c48ba15aae4855ddfabd0d5 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 28 Jun 2012 16:04:00 -0700 Subject: [PATCH 71/78] remove titles in ostatus even when edited date differs from created date --- boot.php | 2 +- include/items.php | 40 ++++---- util/messages.po | 248 +++++++++++++++++++++++----------------------- 3 files changed, 147 insertions(+), 143 deletions(-) diff --git a/boot.php b/boot.php index c27b0baaab..231f42a14c 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.1386' ); +define ( 'FRIENDICA_VERSION', '3.0.1388' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); define ( 'DB_UPDATE_VERSION', 1151 ); diff --git a/include/items.php b/include/items.php index 1f05719688..7d3ed4fa9d 100755 --- a/include/items.php +++ b/include/items.php @@ -1660,6 +1660,21 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) continue; } + $force_parent = false; + if($contact['network'] === NETWORK_OSTATUS || stristr($contact['url'],'twitter.com')) { + if($contact['network'] === NETWORK_OSTATUS) + $force_parent = true; + if(strlen($datarray['title'])) + unset($datarray['title']); + $r = q("UPDATE `item` SET `last-child` = 0, `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d", + dbesc(datetime_convert()), + dbesc($parent_uri), + intval($importer['uid']) + ); + $datarray['last-child'] = 1; + } + + $r = q("SELECT `uid`, `last-child`, `edited`, `body` FROM `item` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1", dbesc($item_id), intval($importer['uid']) @@ -1703,19 +1718,6 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) continue; } - $force_parent = false; - if($contact['network'] === NETWORK_OSTATUS || stristr($contact['url'],'twitter.com')) { - if($contact['network'] === NETWORK_OSTATUS) - $force_parent = true; - if(strlen($datarray['title'])) - unset($datarray['title']); - $r = q("UPDATE `item` SET `last-child` = 0, `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d", - dbesc(datetime_convert()), - dbesc($parent_uri), - intval($importer['uid']) - ); - $datarray['last-child'] = 1; - } if(($contact['network'] === NETWORK_FEED) || (! strlen($contact['notify']))) { // one way feed - no remote comment ability @@ -1813,6 +1815,13 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) } } + if($contact['network'] === NETWORK_OSTATUS || stristr($contact['url'],'twitter.com')) { + if(strlen($datarray['title'])) + unset($datarray['title']); + $datarray['last-child'] = 1; + } + + $r = q("SELECT `uid`, `last-child`, `edited`, `body` FROM `item` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1", dbesc($item_id), intval($importer['uid']) @@ -1875,11 +1884,6 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) if(! is_array($contact)) return; - if($contact['network'] === NETWORK_OSTATUS || stristr($contact['url'],'twitter.com')) { - if(strlen($datarray['title'])) - unset($datarray['title']); - $datarray['last-child'] = 1; - } if(($contact['network'] === NETWORK_FEED) || (! strlen($contact['notify']))) { // one way feed - no remote comment ability diff --git a/util/messages.po b/util/messages.po index 0ce5eb5266..8519651ae4 100644 --- a/util/messages.po +++ b/util/messages.po @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: 3.0.1386\n" +"Project-Id-Version: 3.0.1388\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-06-26 10:00-0700\n" +"POT-Creation-Date: 2012-06-28 10:00-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -128,8 +128,8 @@ msgstr "" #: ../../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/settings.php:555 ../../mod/settings.php:709 +#: ../../mod/settings.php:770 ../../mod/settings.php:971 #: ../../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:569 @@ -228,7 +228,7 @@ msgid "link to source" msgstr "" #: ../../mod/events.php:328 ../../view/theme/diabook/theme.php:131 -#: ../../include/nav.php:52 ../../boot.php:1546 +#: ../../include/nav.php:52 ../../boot.php:1549 msgid "Events" msgstr "" @@ -341,30 +341,30 @@ msgid "" msgstr "" #: ../../mod/api.php:105 ../../mod/dfrn_request.php:833 -#: ../../mod/settings.php:879 ../../mod/settings.php:885 -#: ../../mod/settings.php:893 ../../mod/settings.php:897 -#: ../../mod/settings.php:902 ../../mod/settings.php:908 -#: ../../mod/settings.php:914 ../../mod/settings.php:920 -#: ../../mod/settings.php:956 ../../mod/settings.php:957 +#: ../../mod/settings.php:887 ../../mod/settings.php:893 +#: ../../mod/settings.php:901 ../../mod/settings.php:905 +#: ../../mod/settings.php:910 ../../mod/settings.php:916 +#: ../../mod/settings.php:922 ../../mod/settings.php:928 #: ../../mod/settings.php:958 ../../mod/settings.php:959 -#: ../../mod/settings.php:960 ../../mod/register.php:234 +#: ../../mod/settings.php:960 ../../mod/settings.php:961 +#: ../../mod/settings.php:962 ../../mod/register.php:234 #: ../../mod/profiles.php:546 msgid "Yes" msgstr "" #: ../../mod/api.php:106 ../../mod/dfrn_request.php:834 -#: ../../mod/settings.php:879 ../../mod/settings.php:885 -#: ../../mod/settings.php:893 ../../mod/settings.php:897 -#: ../../mod/settings.php:902 ../../mod/settings.php:908 -#: ../../mod/settings.php:914 ../../mod/settings.php:920 -#: ../../mod/settings.php:956 ../../mod/settings.php:957 +#: ../../mod/settings.php:887 ../../mod/settings.php:893 +#: ../../mod/settings.php:901 ../../mod/settings.php:905 +#: ../../mod/settings.php:910 ../../mod/settings.php:916 +#: ../../mod/settings.php:922 ../../mod/settings.php:928 #: ../../mod/settings.php:958 ../../mod/settings.php:959 -#: ../../mod/settings.php:960 ../../mod/register.php:235 +#: ../../mod/settings.php:960 ../../mod/settings.php:961 +#: ../../mod/settings.php:962 ../../mod/register.php:235 #: ../../mod/profiles.php:547 msgid "No" msgstr "" -#: ../../mod/photos.php:46 ../../boot.php:1540 +#: ../../mod/photos.php:46 ../../boot.php:1543 msgid "Photo Albums" msgstr "" @@ -593,7 +593,7 @@ msgid "Preview" msgstr "" #: ../../mod/photos.php:1441 ../../mod/settings.php:618 -#: ../../mod/settings.php:699 ../../mod/group.php:168 ../../mod/admin.php:663 +#: ../../mod/settings.php:707 ../../mod/group.php:168 ../../mod/admin.php:663 #: ../../include/conversation.php:328 ../../include/conversation.php:609 msgid "Delete" msgstr "" @@ -1969,357 +1969,357 @@ msgstr "" msgid "StatusNet" msgstr "" -#: ../../mod/settings.php:683 +#: ../../mod/settings.php:685 +msgid "Email access is disabled on this site." +msgstr "" + +#: ../../mod/settings.php:691 msgid "Connector Settings" msgstr "" -#: ../../mod/settings.php:688 +#: ../../mod/settings.php:696 msgid "Email/Mailbox Setup" msgstr "" -#: ../../mod/settings.php:689 +#: ../../mod/settings.php:697 msgid "" "If you wish to communicate with email contacts using this service " "(optional), please specify how to connect to your mailbox." msgstr "" -#: ../../mod/settings.php:690 +#: ../../mod/settings.php:698 msgid "Last successful email check:" msgstr "" -#: ../../mod/settings.php:691 -msgid "Email access is disabled on this site." -msgstr "" - -#: ../../mod/settings.php:692 +#: ../../mod/settings.php:700 msgid "IMAP server name:" msgstr "" -#: ../../mod/settings.php:693 +#: ../../mod/settings.php:701 msgid "IMAP port:" msgstr "" -#: ../../mod/settings.php:694 +#: ../../mod/settings.php:702 msgid "Security:" msgstr "" -#: ../../mod/settings.php:694 ../../mod/settings.php:699 +#: ../../mod/settings.php:702 ../../mod/settings.php:707 msgid "None" msgstr "" -#: ../../mod/settings.php:695 +#: ../../mod/settings.php:703 msgid "Email login name:" msgstr "" -#: ../../mod/settings.php:696 +#: ../../mod/settings.php:704 msgid "Email password:" msgstr "" -#: ../../mod/settings.php:697 +#: ../../mod/settings.php:705 msgid "Reply-to address:" msgstr "" -#: ../../mod/settings.php:698 +#: ../../mod/settings.php:706 msgid "Send public posts to all email contacts:" msgstr "" -#: ../../mod/settings.php:699 +#: ../../mod/settings.php:707 msgid "Action after import:" msgstr "" -#: ../../mod/settings.php:699 +#: ../../mod/settings.php:707 msgid "Mark as seen" msgstr "" -#: ../../mod/settings.php:699 +#: ../../mod/settings.php:707 msgid "Move to folder" msgstr "" -#: ../../mod/settings.php:700 +#: ../../mod/settings.php:708 msgid "Move to folder:" msgstr "" -#: ../../mod/settings.php:760 +#: ../../mod/settings.php:768 msgid "Display Settings" msgstr "" -#: ../../mod/settings.php:766 +#: ../../mod/settings.php:774 msgid "Display Theme:" msgstr "" -#: ../../mod/settings.php:767 +#: ../../mod/settings.php:775 msgid "Update browser every xx seconds" msgstr "" -#: ../../mod/settings.php:767 +#: ../../mod/settings.php:775 msgid "Minimum of 10 seconds, no maximum" msgstr "" -#: ../../mod/settings.php:768 +#: ../../mod/settings.php:776 msgid "Number of items to display on the network page:" msgstr "" -#: ../../mod/settings.php:768 +#: ../../mod/settings.php:776 msgid "Maximum of 100 items" msgstr "" -#: ../../mod/settings.php:769 +#: ../../mod/settings.php:777 msgid "Don't show emoticons" msgstr "" -#: ../../mod/settings.php:840 +#: ../../mod/settings.php:848 msgid "Normal Account Page" msgstr "" -#: ../../mod/settings.php:841 +#: ../../mod/settings.php:849 msgid "This account is a normal personal profile" msgstr "" -#: ../../mod/settings.php:844 +#: ../../mod/settings.php:852 msgid "Soapbox Page" msgstr "" -#: ../../mod/settings.php:845 +#: ../../mod/settings.php:853 msgid "Automatically approve all connection/friend requests as read-only fans" msgstr "" -#: ../../mod/settings.php:848 +#: ../../mod/settings.php:856 msgid "Community Forum/Celebrity Account" msgstr "" -#: ../../mod/settings.php:849 +#: ../../mod/settings.php:857 msgid "Automatically approve all connection/friend requests as read-write fans" msgstr "" -#: ../../mod/settings.php:852 +#: ../../mod/settings.php:860 msgid "Automatic Friend Page" msgstr "" -#: ../../mod/settings.php:853 +#: ../../mod/settings.php:861 msgid "Automatically approve all connection/friend requests as friends" msgstr "" -#: ../../mod/settings.php:856 +#: ../../mod/settings.php:864 msgid "Private Forum [Experimental]" msgstr "" -#: ../../mod/settings.php:857 +#: ../../mod/settings.php:865 msgid "Private forum - approved members only" msgstr "" -#: ../../mod/settings.php:869 +#: ../../mod/settings.php:877 msgid "OpenID:" msgstr "" -#: ../../mod/settings.php:869 +#: ../../mod/settings.php:877 msgid "(Optional) Allow this OpenID to login to this account." msgstr "" -#: ../../mod/settings.php:879 +#: ../../mod/settings.php:887 msgid "Publish your default profile in your local site directory?" msgstr "" -#: ../../mod/settings.php:885 +#: ../../mod/settings.php:893 msgid "Publish your default profile in the global social directory?" msgstr "" -#: ../../mod/settings.php:893 +#: ../../mod/settings.php:901 msgid "Hide your contact/friend list from viewers of your default profile?" msgstr "" -#: ../../mod/settings.php:897 +#: ../../mod/settings.php:905 msgid "Hide your profile details from unknown viewers?" msgstr "" -#: ../../mod/settings.php:902 +#: ../../mod/settings.php:910 msgid "Allow friends to post to your profile page?" msgstr "" -#: ../../mod/settings.php:908 +#: ../../mod/settings.php:916 msgid "Allow friends to tag your posts?" msgstr "" -#: ../../mod/settings.php:914 +#: ../../mod/settings.php:922 msgid "Allow us to suggest you as a potential friend to new members?" msgstr "" -#: ../../mod/settings.php:920 +#: ../../mod/settings.php:928 msgid "Permit unknown people to send you private mail?" msgstr "" -#: ../../mod/settings.php:931 +#: ../../mod/settings.php:936 msgid "Profile is not published." msgstr "" -#: ../../mod/settings.php:937 ../../mod/profile_photo.php:213 +#: ../../mod/settings.php:939 ../../mod/profile_photo.php:213 msgid "or" msgstr "" -#: ../../mod/settings.php:942 +#: ../../mod/settings.php:944 msgid "Your Identity Address is" msgstr "" -#: ../../mod/settings.php:953 +#: ../../mod/settings.php:955 msgid "Automatically expire posts after this many days:" msgstr "" -#: ../../mod/settings.php:953 +#: ../../mod/settings.php:955 msgid "If empty, posts will not expire. Expired posts will be deleted" msgstr "" -#: ../../mod/settings.php:954 +#: ../../mod/settings.php:956 msgid "Advanced expiration settings" msgstr "" -#: ../../mod/settings.php:955 +#: ../../mod/settings.php:957 msgid "Advanced Expiration" msgstr "" -#: ../../mod/settings.php:956 +#: ../../mod/settings.php:958 msgid "Expire posts:" msgstr "" -#: ../../mod/settings.php:957 +#: ../../mod/settings.php:959 msgid "Expire personal notes:" msgstr "" -#: ../../mod/settings.php:958 +#: ../../mod/settings.php:960 msgid "Expire starred posts:" msgstr "" -#: ../../mod/settings.php:959 +#: ../../mod/settings.php:961 msgid "Expire photos:" msgstr "" -#: ../../mod/settings.php:960 +#: ../../mod/settings.php:962 msgid "Only expire posts by others:" msgstr "" -#: ../../mod/settings.php:967 +#: ../../mod/settings.php:969 msgid "Account Settings" msgstr "" -#: ../../mod/settings.php:975 +#: ../../mod/settings.php:977 msgid "Password Settings" msgstr "" -#: ../../mod/settings.php:976 +#: ../../mod/settings.php:978 msgid "New Password:" msgstr "" -#: ../../mod/settings.php:977 +#: ../../mod/settings.php:979 msgid "Confirm:" msgstr "" -#: ../../mod/settings.php:977 +#: ../../mod/settings.php:979 msgid "Leave password fields blank unless changing" msgstr "" -#: ../../mod/settings.php:981 +#: ../../mod/settings.php:983 msgid "Basic Settings" msgstr "" -#: ../../mod/settings.php:982 ../../include/profile_advanced.php:15 +#: ../../mod/settings.php:984 ../../include/profile_advanced.php:15 msgid "Full Name:" msgstr "" -#: ../../mod/settings.php:983 +#: ../../mod/settings.php:985 msgid "Email Address:" msgstr "" -#: ../../mod/settings.php:984 +#: ../../mod/settings.php:986 msgid "Your Timezone:" msgstr "" -#: ../../mod/settings.php:985 +#: ../../mod/settings.php:987 msgid "Default Post Location:" msgstr "" -#: ../../mod/settings.php:986 +#: ../../mod/settings.php:988 msgid "Use Browser Location:" msgstr "" -#: ../../mod/settings.php:989 +#: ../../mod/settings.php:991 msgid "Security and Privacy Settings" msgstr "" -#: ../../mod/settings.php:991 +#: ../../mod/settings.php:993 msgid "Maximum Friend Requests/Day:" msgstr "" -#: ../../mod/settings.php:991 ../../mod/settings.php:1010 +#: ../../mod/settings.php:993 ../../mod/settings.php:1012 msgid "(to prevent spam abuse)" msgstr "" -#: ../../mod/settings.php:992 +#: ../../mod/settings.php:994 msgid "Default Post Permissions" msgstr "" -#: ../../mod/settings.php:993 +#: ../../mod/settings.php:995 msgid "(click to open/close)" msgstr "" -#: ../../mod/settings.php:1010 +#: ../../mod/settings.php:1012 msgid "Maximum private messages per day from unknown people:" msgstr "" -#: ../../mod/settings.php:1013 +#: ../../mod/settings.php:1015 msgid "Notification Settings" msgstr "" -#: ../../mod/settings.php:1014 +#: ../../mod/settings.php:1016 msgid "By default post a status message when:" msgstr "" -#: ../../mod/settings.php:1015 +#: ../../mod/settings.php:1017 msgid "accepting a friend request" msgstr "" -#: ../../mod/settings.php:1016 +#: ../../mod/settings.php:1018 msgid "joining a forum/community" msgstr "" -#: ../../mod/settings.php:1017 +#: ../../mod/settings.php:1019 msgid "making an interesting profile change" msgstr "" -#: ../../mod/settings.php:1018 +#: ../../mod/settings.php:1020 msgid "Send a notification email when:" msgstr "" -#: ../../mod/settings.php:1019 +#: ../../mod/settings.php:1021 msgid "You receive an introduction" msgstr "" -#: ../../mod/settings.php:1020 +#: ../../mod/settings.php:1022 msgid "Your introductions are confirmed" msgstr "" -#: ../../mod/settings.php:1021 +#: ../../mod/settings.php:1023 msgid "Someone writes on your profile wall" msgstr "" -#: ../../mod/settings.php:1022 +#: ../../mod/settings.php:1024 msgid "Someone writes a followup comment" msgstr "" -#: ../../mod/settings.php:1023 +#: ../../mod/settings.php:1025 msgid "You receive a private message" msgstr "" -#: ../../mod/settings.php:1024 +#: ../../mod/settings.php:1026 msgid "You receive a friend suggestion" msgstr "" -#: ../../mod/settings.php:1025 +#: ../../mod/settings.php:1027 msgid "You are tagged in a post" msgstr "" -#: ../../mod/settings.php:1028 +#: ../../mod/settings.php:1030 msgid "Advanced Account/Page Type Settings" msgstr "" -#: ../../mod/settings.php:1029 +#: ../../mod/settings.php:1031 msgid "Change the behaviour of this account for special situations" msgstr "" @@ -2433,7 +2433,7 @@ msgstr "" msgid "Invalid contact." msgstr "" -#: ../../mod/notes.php:44 ../../boot.php:1552 +#: ../../mod/notes.php:44 ../../boot.php:1555 msgid "Personal Notes" msgstr "" @@ -2684,7 +2684,7 @@ msgstr "" #: ../../mod/profperm.php:103 ../../view/theme/diabook/theme.php:128 #: ../../include/profile_advanced.php:7 ../../include/profile_advanced.php:84 -#: ../../include/nav.php:50 ../../boot.php:1531 +#: ../../include/nav.php:50 ../../boot.php:1534 msgid "Profile" msgstr "" @@ -2831,7 +2831,7 @@ msgid "Access denied." msgstr "" #: ../../mod/fbrowser.php:25 ../../view/theme/diabook/theme.php:130 -#: ../../include/nav.php:51 ../../boot.php:1537 +#: ../../include/nav.php:51 ../../boot.php:1540 msgid "Photos" msgstr "" @@ -6743,7 +6743,7 @@ msgstr "" msgid "End this session" msgstr "" -#: ../../include/nav.php:49 ../../boot.php:1525 +#: ../../include/nav.php:49 ../../boot.php:1528 msgid "Status" msgstr "" @@ -7657,15 +7657,15 @@ msgstr "" msgid "Message" msgstr "" -#: ../../boot.php:1194 ../../boot.php:1270 +#: ../../boot.php:1194 ../../boot.php:1273 msgid "g A l F d" msgstr "" -#: ../../boot.php:1195 ../../boot.php:1271 +#: ../../boot.php:1195 ../../boot.php:1274 msgid "F d" msgstr "" -#: ../../boot.php:1240 ../../boot.php:1311 +#: ../../boot.php:1240 ../../boot.php:1314 msgid "[today]" msgstr "" @@ -7677,30 +7677,30 @@ msgstr "" msgid "Birthdays this week:" msgstr "" -#: ../../boot.php:1304 +#: ../../boot.php:1307 msgid "[No description]" msgstr "" -#: ../../boot.php:1322 +#: ../../boot.php:1325 msgid "Event Reminders" msgstr "" -#: ../../boot.php:1323 +#: ../../boot.php:1326 msgid "Events this week:" msgstr "" -#: ../../boot.php:1528 +#: ../../boot.php:1531 msgid "Status Messages and Posts" msgstr "" -#: ../../boot.php:1534 +#: ../../boot.php:1537 msgid "Profile Details" msgstr "" -#: ../../boot.php:1549 +#: ../../boot.php:1552 msgid "Events and Calendar" msgstr "" -#: ../../boot.php:1555 +#: ../../boot.php:1558 msgid "Only You Can See This" msgstr "" From 43d3721fa92f21007f45427eea35810a3b8545c6 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 28 Jun 2012 16:42:40 -0700 Subject: [PATCH 72/78] css smiley class --- include/text.php | 70 ++++++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/include/text.php b/include/text.php index cc4bee268f..0b3ebdf854 100644 --- a/include/text.php +++ b/include/text.php @@ -750,40 +750,40 @@ function smilies($s, $sample = false) { ); $icons = array( - '<3', - '</3', - '<\\3', - ':-)', - ';-)', - ':-(', - ':-P', - ':-p', - ':-\', - ':-\', - ':-x', - ':-X', - ':-D', - '8-|', - '8-O', - ':-O', - '\\o/', - 'o.O', - 'O.o', - 'o_O', - 'O_o', - ':\'(', - ':-!', - ':-/', - ':-[', - '8-)', - ':beer', - ':homebrew', - ':coffee', - ':facepalm', - ':like', - ':dislike', - '
    ~friendika ~friendika', - '~friendica ~friendica' + '<3', + '</3', + '<\\3', + ':-)', + ';-)', + ':-(', + ':-P', + ':-p', + ':-\', + ':-\', + ':-x', + ':-X', + ':-D', + '8-|', + '8-O', + ':-O', + '\\o/', + 'o.O', + 'O.o', + 'o_O', + 'O_o', + ':\'(', + ':-!', + ':-/', + ':-[', + '8-)', + ':beer', + ':homebrew', + ':coffee', + ':facepalm', + ':like', + ':dislike', + '~friendika ~friendika', + '~friendica ~friendica' ); $params = array('texts' => $texts, 'icons' => $icons, 'string' => $s); @@ -823,7 +823,7 @@ function preg_heart($x) { return $x[0]; $t = ''; for($cnt = 0; $cnt < strlen($x[1]); $cnt ++) - $t .= '<3'; + $t .= '<3'; $r = str_replace($x[0],$t,$x[0]); return $r; } From a3edbf7e5d0d89e99c2249cf30657b1fbc57982a Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 28 Jun 2012 17:43:29 -0700 Subject: [PATCH 73/78] create third privacy state - public post but not searchable or publicly visible --- include/conversation.php | 12 ++++++------ include/delivery.php | 4 ++-- include/items.php | 10 +++++----- include/notifier.php | 2 +- include/text.php | 5 +++-- mod/events.php | 2 +- mod/item.php | 2 +- mod/lockview.php | 2 +- mod/share.php | 2 +- 9 files changed, 21 insertions(+), 20 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index c2113dead4..f2fb2e97b4 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -427,12 +427,12 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { // We've already parsed out like/dislike for special treatment. We can ignore them now if(((activity_match($item['verb'],ACTIVITY_LIKE)) - || (activity_match($item['verb'],ACTIVITY_DISLIKE)))) -// && ($item['id'] != $item['parent'])) + || (activity_match($item['verb'],ACTIVITY_DISLIKE))) + && ($item['id'] != $item['parent'])) continue; $toplevelpost = (($item['id'] == $item['parent']) ? true : false); - $toplevelprivate = false; + // Take care of author collapsing and comment collapsing // (author collapsing is currently disabled) @@ -440,7 +440,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { // If there are more than two comments, squash all but the last 2. if($toplevelpost) { - $toplevelprivate = (($toplevelpost && $item['private']) ? true : false); + $item_writeable = (($item['writable'] || $item['self']) ? true : false); $comments_seen = 0; @@ -485,7 +485,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { $redirect_url = $a->get_baseurl($ssl_state) . '/redir/' . $item['cid'] ; - $lock = ((($item['private']) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) + $lock = ((($item['private'] == 1) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) || strlen($item['deny_cid']) || strlen($item['deny_gid'])))) ? t('Private Message') : false); @@ -546,7 +546,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { } $likebuttons = ''; - $shareable = ((($profile_owner == local_user()) && ((! $item['private']) || $item['network'] === NETWORK_FEED)) ? true : false); + $shareable = ((($profile_owner == local_user()) && (! $item['private'] == 1)) ? true : false); if($page_writeable) { /* if($toplevelpost) { */ diff --git a/include/delivery.php b/include/delivery.php index 8152876683..1328771a67 100644 --- a/include/delivery.php +++ b/include/delivery.php @@ -280,7 +280,7 @@ function delivery_run($argv, $argc){ continue; // private emails may be in included in public conversations. Filter them. - if(($public_message) && $item['private']) + if(($public_message) && $item['private'] == 1) continue; $item_contact = get_item_contact($item,$icontacts); @@ -383,7 +383,7 @@ function delivery_run($argv, $argc){ continue; // private emails may be in included in public conversations. Filter them. - if(($public_message) && $item['private']) + if(($public_message) && $item['private'] == 1) continue; $item_contact = get_item_contact($item,$icontacts); diff --git a/include/items.php b/include/items.php index 7d3ed4fa9d..494a547341 100755 --- a/include/items.php +++ b/include/items.php @@ -466,8 +466,8 @@ function get_atom_elements($feed,$item) { $res['last-child'] = 0; $private = $item->get_item_tags(NAMESPACE_DFRN,'private'); - if($private && $private[0]['data'] == 1) - $res['private'] = 1; + if($private && intval($private[0]['data']) > 0) + $res['private'] = intval($private[0]['data']); else $res['private'] = 0; @@ -814,7 +814,7 @@ function item_store($arr,$force_parent = false) { // email correspondents to be private even if the overall thread is not. if($r[0]['private']) - $arr['private'] = 1; + $arr['private'] = $r[0]['private']; // Edge case. We host a public forum that was originally posted to privately. // The original author commented, but as this is a comment, the permissions @@ -1890,7 +1890,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) $datarray['last-child'] = 0; } if($contact['network'] === NETWORK_FEED) - $datarray['private'] = 1; + $datarray['private'] = 2; // This is my contact on another system, but it's really me. // Turn this into a wall post. @@ -3035,7 +3035,7 @@ function atom_entry($item,$type,$author,$owner,$comment = false,$cid = 0) { $o .= '' . xmlify($item['coord']) . '' . "\r\n"; if(($item['private']) || strlen($item['allow_cid']) || strlen($item['allow_gid']) || strlen($item['deny_cid']) || strlen($item['deny_gid'])) - $o .= '1' . "\r\n"; + $o .= '' . (($item['private']) ? $item['private'] : 1) . '' . "\r\n"; if($item['extid']) $o .= '' . xmlify($item['extid']) . '' . "\r\n"; diff --git a/include/notifier.php b/include/notifier.php index 443cc30141..f54efba31d 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -399,7 +399,7 @@ function notifier_run($argv, $argc){ // private emails may be in included in public conversations. Filter them. - if(($public_message) && $item['private']) + if(($public_message) && $item['private'] == 1) continue; diff --git a/include/text.php b/include/text.php index 0b3ebdf854..3b0050d387 100644 --- a/include/text.php +++ b/include/text.php @@ -1059,12 +1059,13 @@ function feed_salmonlinks($nick) { if(! function_exists('get_plink')) { function get_plink($item) { $a = get_app(); - if (x($item,'plink') && ((! $item['private']) || ($item['network'] === NETWORK_FEED))){ + if (x($item,'plink') && ($item['private'] != 1)) { return array( 'href' => $item['plink'], 'title' => t('link to source'), ); - } else { + } + else { return false; } }} diff --git a/mod/events.php b/mod/events.php index 4a6d3f100e..7940e79a42 100755 --- a/mod/events.php +++ b/mod/events.php @@ -120,7 +120,7 @@ function events_post(&$a) { $datarray['allow_gid'] = $str_group_allow; $datarray['deny_cid'] = $str_contact_deny; $datarray['deny_gid'] = $str_group_deny; - $datarray['private'] = $private_event; + $datarray['private'] = (($private_event) ? 1 : 0); $datarray['id'] = $event_id; $datarray['created'] = $created; $datarray['edited'] = $edited; diff --git a/mod/item.php b/mod/item.php index aa022d37d8..554e97fe46 100644 --- a/mod/item.php +++ b/mod/item.php @@ -228,7 +228,7 @@ function item_post(&$a) { || strlen($parent_item['allow_gid']) || strlen($parent_item['deny_cid']) || strlen($parent_item['deny_gid'])) { - $private = 1; + $private = (($parent_item['private']) ? $parent_item['private'] : 1); } $str_contact_allow = $parent_item['allow_cid']; diff --git a/mod/lockview.php b/mod/lockview.php index 9e64e2608b..a832629f19 100644 --- a/mod/lockview.php +++ b/mod/lockview.php @@ -33,7 +33,7 @@ function lockview_content(&$a) { $deny_users = expand_acl($item['deny_cid']); $deny_groups = expand_acl($item['deny_gid']); - if(($item['private']) && (! strlen($item['allow_cid'])) && (! strlen($item['allow_gid'])) + if(($item['private'] == 1) && (! strlen($item['allow_cid'])) && (! strlen($item['allow_gid'])) && (! strlen($item['deny_cid'])) && (! strlen($item['deny_gid']))) { echo t('Remote privacy information not available.') . '
    '; diff --git a/mod/share.php b/mod/share.php index 08c63105e3..29d31f6b51 100644 --- a/mod/share.php +++ b/mod/share.php @@ -15,7 +15,7 @@ function share_init(&$a) { intval($post_id), intval(local_user()) ); - if(! count($r) || ($r[0]['private'] && ($r[0]['network'] != NETWORK_FEED))) + if(! count($r) || ($r[0]['private'] == 1)) killme(); $o = ''; From 1830ecc9baa13b7d28f6a8250832832f2cc6a537 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 28 Jun 2012 18:52:49 -0700 Subject: [PATCH 74/78] remote_self feeds are not private --- include/items.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/items.php b/include/items.php index 494a547341..74ffc2f840 100755 --- a/include/items.php +++ b/include/items.php @@ -1895,8 +1895,12 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) // This is my contact on another system, but it's really me. // Turn this into a wall post. - if($contact['remote_self']) + if($contact['remote_self']) { $datarray['wall'] = 1; + if($contact['network'] === NETWORK_FEED) { + $datarray['private'] = 0; + } + } $datarray['parent-uri'] = $item_id; $datarray['uid'] = $importer['uid']; From 0ecba605030dfa8a69e7c0483732b17cd5c3c0a2 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 28 Jun 2012 21:15:43 -0700 Subject: [PATCH 75/78] undefined fn --- mod/parse_url.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/parse_url.php b/mod/parse_url.php index cdf2223a86..a38f7e2702 100644 --- a/mod/parse_url.php +++ b/mod/parse_url.php @@ -215,10 +215,10 @@ function parse_url_content(&$a) { $i = fetch_url($image); if($i) { + require_once('include/Photo.php'); // guess mimetype from headers or filename $type = guess_image_type($image,true); - - require_once('include/Photo.php'); + $ph = new Photo($i, $type); if($ph->is_valid()) { if($ph->getWidth() > 300 || $ph->getHeight() > 300) { From 43036bee98ffddbd396379f12a3ca87b9da461a7 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 28 Jun 2012 21:32:49 -0700 Subject: [PATCH 76/78] wrong column name (- vs _) --- include/items.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/items.php b/include/items.php index 74ffc2f840..f5821961b0 100755 --- a/include/items.php +++ b/include/items.php @@ -1730,7 +1730,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) $datarray['type'] = 'activity'; $datarray['gravity'] = GRAVITY_LIKE; // only one like or dislike per person - $r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 and (`parent-uri` = '%s' OR `thr_parent` = '%s') limit 1", + $r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 and (`parent-uri` = '%s' OR `thr-parent` = '%s') limit 1", intval($datarray['uid']), intval($datarray['contact-id']), dbesc($datarray['verb']), From 7b63e5792add647ad2156d81c52f40a33e0faef6 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 28 Jun 2012 21:39:02 -0700 Subject: [PATCH 77/78] more pager limits --- boot.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/boot.php b/boot.php index 231f42a14c..973e3578a6 100644 --- a/boot.php +++ b/boot.php @@ -434,6 +434,8 @@ if(! class_exists('App')) { $this->pager['page'] = ((x($_GET,'page') && intval($_GET['page']) > 0) ? intval($_GET['page']) : 1); $this->pager['itemspage'] = 50; $this->pager['start'] = ($this->pager['page'] * $this->pager['itemspage']) - $this->pager['itemspage']; + if($this->pager['start'] < 1) + $this->pager['start'] = 1; $this->pager['total'] = 0; } From be658788de3632599d00483511439a3df537b854 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 28 Jun 2012 22:19:12 -0700 Subject: [PATCH 78/78] maintain page position when hovering on pop-outs --- view/theme/slackr/style.css | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/view/theme/slackr/style.css b/view/theme/slackr/style.css index ea10cc377a..4c0fdc22da 100644 --- a/view/theme/slackr/style.css +++ b/view/theme/slackr/style.css @@ -67,6 +67,8 @@ nav #site-location { opacity: 1.0; filter:alpha(opacity=100); box-shadow: 4px 4px 3px 0 #444444; + margin-left: 0px; + margin-top: 0px; } #events-reminder:hover { @@ -108,6 +110,8 @@ nav #site-location { #posted-date-selector { margin-left: 30px !important; margin-top: 5px !important; + margin-right: 0px !important; + margin-bottom: 0px !important; } @@ -115,6 +119,9 @@ nav #site-location { box-shadow: 4px 4px 3px 0 #444444; margin-left: 25px !important; margin-top: 0px !important; + margin-right: 5px !important; + margin-bottom: 5px !important; + } .contact-entry-photo img, .profile-match-photo img, #photo-photo img, .directory-photo-img, .photo-album-photo, .photo-top-photo, .profile-jot-text, .group-selected, .nets-selected, .fileas-selected, #profile-jot-submit, .categories-selected {
    $1$1