From 6e2f04583728714ff937eb1fa3ab34e99bcdb6a6 Mon Sep 17 00:00:00 2001 From: Meitar Moscovitz Date: Mon, 9 Feb 2009 00:02:51 +1100 Subject: Add machine-readable pagination using HTML4.01 ``, etc. These extra `` elements only appear on pages where pagination makes sense. They trigger functionality in some user agents, such as Opera's Navigation Bar for more easily navigating forward and backwards across a paged set of notices, messages, or group lists, etc. --- actions/all.php | 22 ++++++++++++++++++++++ actions/favorited.php | 20 ++++++++++++++++++++ actions/groupmembers.php | 24 +++++++++++++++++++++++- actions/groups.php | 20 ++++++++++++++++++++ actions/inbox.php | 22 ++++++++++++++++++++++ actions/outbox.php | 22 ++++++++++++++++++++++ actions/public.php | 20 ++++++++++++++++++++ actions/replies.php | 22 ++++++++++++++++++++++ actions/showfavorites.php | 22 ++++++++++++++++++++++ actions/showgroup.php | 22 ++++++++++++++++++++++ actions/showstream.php | 22 ++++++++++++++++++++++ actions/tag.php | 22 ++++++++++++++++++++++ lib/action.php | 14 ++++++++++++++ 13 files changed, 273 insertions(+), 1 deletion(-) diff --git a/actions/all.php b/actions/all.php index d75d1b946..76b1bbcdf 100644 --- a/actions/all.php +++ b/actions/all.php @@ -78,6 +78,28 @@ class AllAction extends Action 'title' => sprintf(_('Feed for friends of %s'), $this->user->nickname))); } + /** + * Output document relationship links + * + * @return void + */ + function showRelationshipLinks() + { + // Machine-readable pagination + if ($this->page > 1) { + $this->element('link', array('rel' => 'next', + 'href' => common_local_url('all', + array('nickname' => $this->user->nickname, + 'page' => $this->page - 1)), + 'title' => _('Next Notices'))); + } + $this->element('link', array('rel' => 'prev', + 'href' => common_local_url('all', + array('nickname' => $this->user->nickname, + 'page' => $this->page + 1)), + 'title' => _('Previous Notices'))); + } + function showLocalNav() { $nav = new PersonalGroupNav($this); diff --git a/actions/favorited.php b/actions/favorited.php index fd5ff413c..367fb6dd6 100644 --- a/actions/favorited.php +++ b/actions/favorited.php @@ -195,4 +195,24 @@ class FavoritedAction extends Action $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, $this->page, 'favorited'); } + + /** + * Output document relationship links + * + * @return void + */ + function showRelationshipLinks() + { + // Machine-readable pagination + if ($this->page > 1) { + $this->element('link', array('rel' => 'next', + 'href' => common_local_url('favorited', + array('page' => $this->page - 1)), + 'title' => _('Next Notices'))); + } + $this->element('link', array('rel' => 'prev', + 'href' => common_local_url('favorited', + array('page' => $this->page + 1)), + 'title' => _('Previous Notices'))); + } } diff --git a/actions/groupmembers.php b/actions/groupmembers.php index 00f43a9f5..2b2bdba93 100644 --- a/actions/groupmembers.php +++ b/actions/groupmembers.php @@ -137,4 +137,26 @@ class GroupmembersAction extends Action $this->page, 'groupmembers', array('nickname' => $this->group->nickname)); } -} \ No newline at end of file + + /** + * Output document relationship links + * + * @return void + */ + function showRelationshipLinks() + { + // Machine-readable pagination + if ($this->page > 1) { + $this->element('link', array('rel' => 'next', + 'href' => common_local_url('groupmembers', + array('nickname' => $this->group->nickname, + 'page' => $this->page - 1)), + 'title' => _('Next Group Members'))); + } + $this->element('link', array('rel' => 'prev', + 'href' => common_local_url('groupmembers', + array('nickname' => $this->group->nickname, + 'page' => $this->page + 1)), + 'title' => _('Previous Group Members'))); + } +} diff --git a/actions/groups.php b/actions/groups.php index 39dc2232b..b0bf7cfc2 100644 --- a/actions/groups.php +++ b/actions/groups.php @@ -129,4 +129,24 @@ class GroupsAction extends Action $gbm = new GroupsByMembersSection($this); $gbm->show(); } + + /** + * Output document relationship links + * + * @return void + */ + function showRelationshipLinks() + { + // Machine-readable pagination + if ($this->page > 1) { + $this->element('link', array('rel' => 'next', + 'href' => common_local_url('groups', + array('page' => $this->page - 1)), + 'title' => _('Next Groups'))); + } + $this->element('link', array('rel' => 'prev', + 'href' => common_local_url('groups', + array('page' => $this->page + 1)), + 'title' => _('Previous Groups'))); + } } diff --git a/actions/inbox.php b/actions/inbox.php index b553ab26c..d12f3f20a 100644 --- a/actions/inbox.php +++ b/actions/inbox.php @@ -63,6 +63,28 @@ class InboxAction extends MailboxAction } } + /** + * Output document relationship links + * + * @return void + */ + function showRelationshipLinks() + { + // Machine-readable pagination + if ($this->page > 1) { + $this->element('link', array('rel' => 'next', + 'href' => common_local_url('inbox', + array('nickname' => $this->user->nickname, + 'page' => $this->page - 1)), + 'title' => _('Next Messages'))); + } + $this->element('link', array('rel' => 'prev', + 'href' => common_local_url('inbox', + array('nickname' => $this->user->nickname, + 'page' => $this->page + 1)), + 'title' => _('Previous Messages'))); + } + /** * Retrieve the messages for this user and this page * diff --git a/actions/outbox.php b/actions/outbox.php index c8d7f2812..043b74edc 100644 --- a/actions/outbox.php +++ b/actions/outbox.php @@ -62,6 +62,28 @@ class OutboxAction extends MailboxAction } } + /** + * Output document relationship links + * + * @return void + */ + function showRelationshipLinks() + { + // Machine-readable pagination + if ($this->page > 1) { + $this->element('link', array('rel' => 'next', + 'href' => common_local_url('outbox', + array('nickname' => $this->user->nickname, + 'page' => $this->page - 1)), + 'title' => _('Next Messages'))); + } + $this->element('link', array('rel' => 'prev', + 'href' => common_local_url('outbox', + array('nickname' => $this->user->nickname, + 'page' => $this->page + 1)), + 'title' => _('Previous Messages'))); + } + /** * retrieve the messages for this user and this page * diff --git a/actions/public.php b/actions/public.php index cc6537f74..25889eee5 100644 --- a/actions/public.php +++ b/actions/public.php @@ -127,6 +127,26 @@ class PublicAction extends Action 'title' => _('Public Stream Feed'))); } + /** + * Output document relationship links + * + * @return void + */ + function showRelationshipLinks() + { + // Machine-readable pagination + if ($this->page > 1) { + $this->element('link', array('rel' => 'next', + 'href' => common_local_url('public', + array('page' => $this->page - 1)), + 'title' => _('Next Notices'))); + } + $this->element('link', array('rel' => 'prev', + 'href' => common_local_url('public', + array('page' => $this->page + 1)), + 'title' => _('Previous Notices'))); + } + /** * Extra head elements * diff --git a/actions/replies.php b/actions/replies.php index 7eff74a66..5ae99e165 100644 --- a/actions/replies.php +++ b/actions/replies.php @@ -141,6 +141,28 @@ class RepliesAction extends Action 'title' => $rsstitle)); } + /** + * Output document relationship links + * + * @return void + */ + function showRelationshipLinks() + { + // Machine-readable pagination + if ($this->page > 1) { + $this->element('link', array('rel' => 'next', + 'href' => common_local_url('replies', + array('nickname' => $this->user->nickname, + 'page' => $this->page - 1)), + 'title' => _('Next Notices'))); + } + $this->element('link', array('rel' => 'prev', + 'href' => common_local_url('replies', + array('nickname' => $this->user->nickname, + 'page' => $this->page + 1)), + 'title' => _('Previous Notices'))); + } + /** * show the personal group nav * diff --git a/actions/showfavorites.php b/actions/showfavorites.php index 31479e1a7..f0297172a 100644 --- a/actions/showfavorites.php +++ b/actions/showfavorites.php @@ -153,6 +153,28 @@ class ShowfavoritesAction extends Action 'title' => $feedtitle)); } + /** + * Output document relationship links + * + * @return void + */ + function showRelationshipLinks() + { + // Machine-readable pagination + if ($this->page > 1) { + $this->element('link', array('rel' => 'next', + 'href' => common_local_url('showfavorites', + array('nickname' => $this->user->nickname, + 'page' => $this->page - 1)), + 'title' => _('Next Favorite Notices'))); + } + $this->element('link', array('rel' => 'prev', + 'href' => common_local_url('showfavorites', + array('nickname' => $this->user->nickname, + 'page' => $this->page + 1)), + 'title' => _('Previous Favorite Notices'))); + } + /** * show the personal group nav * diff --git a/actions/showgroup.php b/actions/showgroup.php index 7bc68fbc6..7599a8de6 100644 --- a/actions/showgroup.php +++ b/actions/showgroup.php @@ -326,6 +326,28 @@ class ShowgroupAction extends Action $this->group->nickname))); } + /** + * Output document relationship links + * + * @return void + */ + function showRelationshipLinks() + { + // Machine-readable pagination + if ($this->page > 1) { + $this->element('link', array('rel' => 'next', + 'href' => common_local_url('showgroup', + array('nickname' => $this->group->nickname, + 'page' => $this->page - 1)), + 'title' => _('Next Notices'))); + } + $this->element('link', array('rel' => 'prev', + 'href' => common_local_url('showgroup', + array('nickname' => $this->group->nickname, + 'page' => $this->page + 1)), + 'title' => _('Previous Notices'))); + } + /** * Fill in the sidebar. * diff --git a/actions/showstream.php b/actions/showstream.php index 28bb8453f..11615ebb0 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -195,6 +195,28 @@ class ShowstreamAction extends Action $this->user->nickname))); } + /** + * Output document relationship links + * + * @return void + */ + function showRelationshipLinks() + { + // Machine-readable pagination + if ($this->page > 1) { + $this->element('link', array('rel' => 'next', + 'href' => common_local_url('showstream', + array('nickname' => $this->user->nickname, + 'page' => $this->page - 1)), + 'title' => _('Next Notices'))); + } + $this->element('link', array('rel' => 'prev', + 'href' => common_local_url('showstream', + array('nickname' => $this->user->nickname, + 'page' => $this->page + 1)), + 'title' => _('Previous Notices'))); + } + function extraHead() { // FOAF diff --git a/actions/tag.php b/actions/tag.php index 4401f892a..f71f6d342 100644 --- a/actions/tag.php +++ b/actions/tag.php @@ -69,6 +69,28 @@ class TagAction extends Action 'title' => sprintf(_('Feed for tag %s'), $this->tag))); } + /** + * Output document relationship links + * + * @return void + */ + function showRelationshipLinks() + { + // Machine-readable pagination + if ($this->page > 1) { + $this->element('link', array('rel' => 'next', + 'href' => common_local_url('tag', + array('tag' => $this->tag, + 'page' => $this->page - 1)), + 'title' => _('Next Notices'))); + } + $this->element('link', array('rel' => 'prev', + 'href' => common_local_url('tag', + array('tag' => $this->tag, + 'page' => $this->page + 1)), + 'title' => _('Previous Notices'))); + } + function showPageNotice() { return sprintf(_('Messages tagged "%s", most recent first'), $this->tag); diff --git a/lib/action.php b/lib/action.php index c4172ada1..ab51d0252 100644 --- a/lib/action.php +++ b/lib/action.php @@ -111,6 +111,7 @@ class Action extends HTMLOutputter // lawsuit $this->showTitle(); $this->showStylesheets(); $this->showScripts(); + $this->showRelationshipLinks(); $this->showOpenSearch(); $this->showFeeds(); $this->showDescription(); @@ -193,6 +194,19 @@ class Action extends HTMLOutputter // lawsuit ' '); } + /** + * Show document relationship links + * + * SHOULD overload + * + * @return nothing + */ + function showRelationshipLinks() + { + // output elements with appropriate HTML4.01 link types: + // http://www.w3.org/TR/html401/types.html#type-links + } + /** * Show OpenSearch headers * -- cgit v1.2.3 From b240a1719485b15c4a6497b6053c24e8a40a4e3c Mon Sep 17 00:00:00 2001 From: Meitar Moscovitz Date: Tue, 10 Feb 2009 19:42:01 +1100 Subject: Beginning to refactor document relationship links to reduce common code. My attempts here are to mimic the `pagination()` method shared by actions. I'm tentatively adding the `$count` property to actions so that we can query the number of notices ''being displayed'' per page prior to calling the actual `pagination()` method itself, since document relationship `` elements need to be output inside of `showHead()`, before `showContent()`, which is where `pagination()` is, gets called. --- actions/all.php | 15 ++------------- actions/favorited.php | 13 ++----------- actions/groupmembers.php | 15 ++------------- actions/groups.php | 13 ++----------- actions/inbox.php | 15 ++------------- actions/outbox.php | 15 ++------------- actions/public.php | 25 ++++++++++++++----------- actions/replies.php | 15 ++------------- actions/showfavorites.php | 16 +++------------- actions/showgroup.php | 15 ++------------- actions/showstream.php | 15 ++------------- actions/tag.php | 15 ++------------- lib/action.php | 34 ++++++++++++++++++++++++++++++++++ 13 files changed, 71 insertions(+), 150 deletions(-) diff --git a/actions/all.php b/actions/all.php index 76b1bbcdf..4a625207a 100644 --- a/actions/all.php +++ b/actions/all.php @@ -85,19 +85,8 @@ class AllAction extends Action */ function showRelationshipLinks() { - // Machine-readable pagination - if ($this->page > 1) { - $this->element('link', array('rel' => 'next', - 'href' => common_local_url('all', - array('nickname' => $this->user->nickname, - 'page' => $this->page - 1)), - 'title' => _('Next Notices'))); - } - $this->element('link', array('rel' => 'prev', - 'href' => common_local_url('all', - array('nickname' => $this->user->nickname, - 'page' => $this->page + 1)), - 'title' => _('Previous Notices'))); + $this->sequenceRelationships($this->page > 1, $this->count > NOTICES_PER_PAGE, // FIXME + $this->page, 'all', array('nickname' => $this->user->nickname)); } function showLocalNav() diff --git a/actions/favorited.php b/actions/favorited.php index 367fb6dd6..74920ca7e 100644 --- a/actions/favorited.php +++ b/actions/favorited.php @@ -203,16 +203,7 @@ class FavoritedAction extends Action */ function showRelationshipLinks() { - // Machine-readable pagination - if ($this->page > 1) { - $this->element('link', array('rel' => 'next', - 'href' => common_local_url('favorited', - array('page' => $this->page - 1)), - 'title' => _('Next Notices'))); - } - $this->element('link', array('rel' => 'prev', - 'href' => common_local_url('favorited', - array('page' => $this->page + 1)), - 'title' => _('Previous Notices'))); + $this->sequenceRelationships($this->page > 1, $this->count > NOTICES_PER_PAGE, // FIXME + $this->page, 'favorited'); } } diff --git a/actions/groupmembers.php b/actions/groupmembers.php index 2b2bdba93..b80f3d90d 100644 --- a/actions/groupmembers.php +++ b/actions/groupmembers.php @@ -145,18 +145,7 @@ class GroupmembersAction extends Action */ function showRelationshipLinks() { - // Machine-readable pagination - if ($this->page > 1) { - $this->element('link', array('rel' => 'next', - 'href' => common_local_url('groupmembers', - array('nickname' => $this->group->nickname, - 'page' => $this->page - 1)), - 'title' => _('Next Group Members'))); - } - $this->element('link', array('rel' => 'prev', - 'href' => common_local_url('groupmembers', - array('nickname' => $this->group->nickname, - 'page' => $this->page + 1)), - 'title' => _('Previous Group Members'))); + $this->sequenceRelationships($this->page > 1, $this->count > NOTICES_PER_PAGE, // FIXME + $this->page, 'groupmembers', array('nickname' => $this->group->nickname)); } } diff --git a/actions/groups.php b/actions/groups.php index b0bf7cfc2..e158698de 100644 --- a/actions/groups.php +++ b/actions/groups.php @@ -137,16 +137,7 @@ class GroupsAction extends Action */ function showRelationshipLinks() { - // Machine-readable pagination - if ($this->page > 1) { - $this->element('link', array('rel' => 'next', - 'href' => common_local_url('groups', - array('page' => $this->page - 1)), - 'title' => _('Next Groups'))); - } - $this->element('link', array('rel' => 'prev', - 'href' => common_local_url('groups', - array('page' => $this->page + 1)), - 'title' => _('Previous Groups'))); + $this->sequenceRelationships($this->page > 1, $this->count > NOTICES_PER_PAGE, // FIXME + $this->page, 'groups', array('nickname' => $this->group->nickname)); } } diff --git a/actions/inbox.php b/actions/inbox.php index d12f3f20a..7b5cf2d20 100644 --- a/actions/inbox.php +++ b/actions/inbox.php @@ -70,19 +70,8 @@ class InboxAction extends MailboxAction */ function showRelationshipLinks() { - // Machine-readable pagination - if ($this->page > 1) { - $this->element('link', array('rel' => 'next', - 'href' => common_local_url('inbox', - array('nickname' => $this->user->nickname, - 'page' => $this->page - 1)), - 'title' => _('Next Messages'))); - } - $this->element('link', array('rel' => 'prev', - 'href' => common_local_url('inbox', - array('nickname' => $this->user->nickname, - 'page' => $this->page + 1)), - 'title' => _('Previous Messages'))); + $this->sequenceRelationships($this->page > 1, $this->count > NOTICES_PER_PAGE, // FIXME + $this->page, 'inbox', array('nickname' => $this->user->nickname)); } /** diff --git a/actions/outbox.php b/actions/outbox.php index 043b74edc..deef1cc87 100644 --- a/actions/outbox.php +++ b/actions/outbox.php @@ -69,19 +69,8 @@ class OutboxAction extends MailboxAction */ function showRelationshipLinks() { - // Machine-readable pagination - if ($this->page > 1) { - $this->element('link', array('rel' => 'next', - 'href' => common_local_url('outbox', - array('nickname' => $this->user->nickname, - 'page' => $this->page - 1)), - 'title' => _('Next Messages'))); - } - $this->element('link', array('rel' => 'prev', - 'href' => common_local_url('outbox', - array('nickname' => $this->user->nickname, - 'page' => $this->page + 1)), - 'title' => _('Previous Messages'))); + $this->sequenceRelationships($this->page > 1, $this->count > NOTICES_PER_PAGE, // FIXME + $this->page, 'outbox', array('nickname' => $this->user->nickname)); } /** diff --git a/actions/public.php b/actions/public.php index 25889eee5..eb2a4b1b0 100644 --- a/actions/public.php +++ b/actions/public.php @@ -56,6 +56,18 @@ class PublicAction extends Action var $page = null; + /** + * Number of notices being shown on this page. + */ + // Does this need to be here? Should it be? + // If it does, this property needs to be + // added to other actions as well, like $page. + // I'm trying to find a way to capture the + // output of the $cnt variable from this + // action's showContent() method but need + // to do so earlier, I think...? + var $count = null; + function isReadOnly() { return true; @@ -134,17 +146,8 @@ class PublicAction extends Action */ function showRelationshipLinks() { - // Machine-readable pagination - if ($this->page > 1) { - $this->element('link', array('rel' => 'next', - 'href' => common_local_url('public', - array('page' => $this->page - 1)), - 'title' => _('Next Notices'))); - } - $this->element('link', array('rel' => 'prev', - 'href' => common_local_url('public', - array('page' => $this->page + 1)), - 'title' => _('Previous Notices'))); + $this->sequenceRelationships($this->page > 1, $this->count > NOTICES_PER_PAGE, // FIXME + $this->page, 'public'); } /** diff --git a/actions/replies.php b/actions/replies.php index 5ae99e165..7c24b554e 100644 --- a/actions/replies.php +++ b/actions/replies.php @@ -148,19 +148,8 @@ class RepliesAction extends Action */ function showRelationshipLinks() { - // Machine-readable pagination - if ($this->page > 1) { - $this->element('link', array('rel' => 'next', - 'href' => common_local_url('replies', - array('nickname' => $this->user->nickname, - 'page' => $this->page - 1)), - 'title' => _('Next Notices'))); - } - $this->element('link', array('rel' => 'prev', - 'href' => common_local_url('replies', - array('nickname' => $this->user->nickname, - 'page' => $this->page + 1)), - 'title' => _('Previous Notices'))); + $this->sequenceRelationships($this->page > 1, $this->count > NOTICES_PER_PAGE, // FIXME + $this->page, 'replies', array('nickname' => $this->user->nickname)); } /** diff --git a/actions/showfavorites.php b/actions/showfavorites.php index f0297172a..585b3b75a 100644 --- a/actions/showfavorites.php +++ b/actions/showfavorites.php @@ -160,21 +160,11 @@ class ShowfavoritesAction extends Action */ function showRelationshipLinks() { - // Machine-readable pagination - if ($this->page > 1) { - $this->element('link', array('rel' => 'next', - 'href' => common_local_url('showfavorites', - array('nickname' => $this->user->nickname, - 'page' => $this->page - 1)), - 'title' => _('Next Favorite Notices'))); - } - $this->element('link', array('rel' => 'prev', - 'href' => common_local_url('showfavorites', - array('nickname' => $this->user->nickname, - 'page' => $this->page + 1)), - 'title' => _('Previous Favorite Notices'))); + $this->sequenceRelationships($this->page > 1, $this->count > NOTICES_PER_PAGE, // FIXME + $this->page, 'showfavorites', array('nickname' => $this->user->nickname)); } + /** * show the personal group nav * diff --git a/actions/showgroup.php b/actions/showgroup.php index 7599a8de6..a2b40f994 100644 --- a/actions/showgroup.php +++ b/actions/showgroup.php @@ -333,19 +333,8 @@ class ShowgroupAction extends Action */ function showRelationshipLinks() { - // Machine-readable pagination - if ($this->page > 1) { - $this->element('link', array('rel' => 'next', - 'href' => common_local_url('showgroup', - array('nickname' => $this->group->nickname, - 'page' => $this->page - 1)), - 'title' => _('Next Notices'))); - } - $this->element('link', array('rel' => 'prev', - 'href' => common_local_url('showgroup', - array('nickname' => $this->group->nickname, - 'page' => $this->page + 1)), - 'title' => _('Previous Notices'))); + $this->sequenceRelationships($this->page > 1, $this->count > NOTICES_PER_PAGE, // FIXME + $this->page, 'showgroup', array('nickname' => $this->group->nickname)); } /** diff --git a/actions/showstream.php b/actions/showstream.php index 0c8fea182..1779c70f2 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -202,19 +202,8 @@ class ShowstreamAction extends Action */ function showRelationshipLinks() { - // Machine-readable pagination - if ($this->page > 1) { - $this->element('link', array('rel' => 'next', - 'href' => common_local_url('showstream', - array('nickname' => $this->user->nickname, - 'page' => $this->page - 1)), - 'title' => _('Next Notices'))); - } - $this->element('link', array('rel' => 'prev', - 'href' => common_local_url('showstream', - array('nickname' => $this->user->nickname, - 'page' => $this->page + 1)), - 'title' => _('Previous Notices'))); + $this->sequenceRelationships($this->page > 1, $this->count > NOTICES_PER_PAGE, // FIXME + $this->page, 'showstream', array('nickname' => $this->user->nickname)); } function extraHead() diff --git a/actions/tag.php b/actions/tag.php index f71f6d342..2a564a25d 100644 --- a/actions/tag.php +++ b/actions/tag.php @@ -76,19 +76,8 @@ class TagAction extends Action */ function showRelationshipLinks() { - // Machine-readable pagination - if ($this->page > 1) { - $this->element('link', array('rel' => 'next', - 'href' => common_local_url('tag', - array('tag' => $this->tag, - 'page' => $this->page - 1)), - 'title' => _('Next Notices'))); - } - $this->element('link', array('rel' => 'prev', - 'href' => common_local_url('tag', - array('tag' => $this->tag, - 'page' => $this->page + 1)), - 'title' => _('Previous Notices'))); + $this->sequenceRelationships($this->page > 1, $this->count > NOTICES_PER_PAGE, // FIXME + $this->page, 'tag', array('tag' => $this->tag)); } function showPageNotice() diff --git a/lib/action.php b/lib/action.php index 8d0fea7af..80a8969fa 100644 --- a/lib/action.php +++ b/lib/action.php @@ -938,4 +938,38 @@ class Action extends HTMLOutputter // lawsuit $this->elementEnd('div'); } } + + /** + * Generate document metadata for sequential navigation + * + * @param boolean $have_before is there something before? + * @param boolean $have_after is there something after? + * @param integer $page current page + * @param string $action current action + * @param array $args rest of query arguments + * + * @return nothing + */ + function sequenceRelationships($have_next, $have_previous, $page, $action, $args=null) + { + // Outputs machine-readable pagination in elements. + // Pattern taken from $this->pagination() method. + + // "next" is equivalent to "after" + if ($have_next) { + $pargs = array('page' => $page-1); + $newargs = $args ? array_merge($args, $pargs) : $pargs; + $this->element('link', array('rel' => 'next', + 'href' => common_local_url($action, $newargs), + 'title' => _('Next'))); + } + // "previous" is equivalent to "before" + if ($have_previous=true) { // FIXME + $pargs = array('page' => $page+1); + $newargs = $args ? array_merge($args, $pargs) : $pargs; + $this->element('link', array('rel' => 'prev', + 'href' => common_local_url($action, $newargs), + 'title' => _('Previous'))); + } + } } -- cgit v1.2.3 From 1ba3ac9ee3f00472e0b7f8f25955967ab816a3fd Mon Sep 17 00:00:00 2001 From: Adrian Lang Date: Sun, 8 Mar 2009 08:45:32 +0100 Subject: Make OMB work if the configured domain name does not exclusively contain lower case letters. If the configured domain is mixed-case OAuth throws invalidsignature errors. The current URL is part of the signated parts; since the consumer does not pass the current URL, the service has to get it itself and add it to the other OAuth params for signature rebuilding. OAuth.php uses $_SERVER for this, however, the domain is lcased in $_SERVER. Hence we pass the complete current URL as generated by common_local_url to OAuthRequest. --- actions/accesstoken.php | 2 +- actions/finishremotesubscribe.php | 2 +- actions/postnotice.php | 2 +- actions/requesttoken.php | 2 +- actions/updateprofile.php | 2 +- actions/userauthorization.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/actions/accesstoken.php b/actions/accesstoken.php index 77fdf6aef..bb68d3314 100644 --- a/actions/accesstoken.php +++ b/actions/accesstoken.php @@ -59,7 +59,7 @@ class AccesstokenAction extends Action try { common_debug('getting request from env variables', __FILE__); common_remove_magic_from_request(); - $req = OAuthRequest::from_request(); + $req = OAuthRequest::from_request('POST', common_locale_url('accesstoken')); common_debug('getting a server', __FILE__); $server = omb_oauth_server(); common_debug('fetching the access token', __FILE__); diff --git a/actions/finishremotesubscribe.php b/actions/finishremotesubscribe.php index eaf57c2d8..6d73ee234 100644 --- a/actions/finishremotesubscribe.php +++ b/actions/finishremotesubscribe.php @@ -44,7 +44,7 @@ class FinishremotesubscribeAction extends Action common_debug('stored request: '.print_r($omb,true), __FILE__); common_remove_magic_from_request(); - $req = OAuthRequest::from_request(); + $req = OAuthRequest::from_request('POST', common_local_url('finishuserauthorization')); $token = $req->get_parameter('oauth_token'); diff --git a/actions/postnotice.php b/actions/postnotice.php index c32d8ca94..3e98b3cd5 100644 --- a/actions/postnotice.php +++ b/actions/postnotice.php @@ -28,7 +28,7 @@ class PostnoticeAction extends Action parent::handle($args); try { common_remove_magic_from_request(); - $req = OAuthRequest::from_request(); + $req = OAuthRequest::from_request('POST', common_local_url('postnotice')); # Note: server-to-server function! $server = omb_oauth_server(); list($consumer, $token) = $server->verify_request($req); diff --git a/actions/requesttoken.php b/actions/requesttoken.php index ca253b97a..4e6f92913 100644 --- a/actions/requesttoken.php +++ b/actions/requesttoken.php @@ -69,7 +69,7 @@ class RequesttokenAction extends Action parent::handle($args); try { common_remove_magic_from_request(); - $req = OAuthRequest::from_request(); + $req = OAuthRequest::from_request('POST', common_local_url('requesttoken')); $server = omb_oauth_server(); $token = $server->fetch_request_token($req); print $token; diff --git a/actions/updateprofile.php b/actions/updateprofile.php index 7dc52fda9..08cb31ae0 100644 --- a/actions/updateprofile.php +++ b/actions/updateprofile.php @@ -29,7 +29,7 @@ class UpdateprofileAction extends Action parent::handle($args); try { common_remove_magic_from_request(); - $req = OAuthRequest::from_request(); + $req = OAuthRequest::from_request('POST', common_local_url('updateprofile')); # Note: server-to-server function! $server = omb_oauth_server(); list($consumer, $token) = $server->verify_request($req); diff --git a/actions/userauthorization.php b/actions/userauthorization.php index 6a76e3a4c..9eb1e8836 100644 --- a/actions/userauthorization.php +++ b/actions/userauthorization.php @@ -382,7 +382,7 @@ class UserauthorizationAction extends Action function getNewRequest() { common_remove_magic_from_request(); - $req = OAuthRequest::from_request(); + $req = OAuthRequest::from_request('GET', common_local_url('userauthorization')); return $req; } -- cgit v1.2.3 From 042c61ed6de1bbc993eefe47552028157f3e1e28 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 13 Mar 2009 13:21:35 +0100 Subject: Piwik Analytics Plugin This is a rewrite of the Google Analytics Plugin to support Piwik. --- plugins/PiwikAnalyticsPlugin.php | 86 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 plugins/PiwikAnalyticsPlugin.php diff --git a/plugins/PiwikAnalyticsPlugin.php b/plugins/PiwikAnalyticsPlugin.php new file mode 100644 index 000000000..458b577fa --- /dev/null +++ b/plugins/PiwikAnalyticsPlugin.php @@ -0,0 +1,86 @@ +. + * + * @category Plugin + * @package Laconica + * @author Evan Prodromou + * @copyright 2008 Control Yourself, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + */ + +if (!defined('LACONICA')) { + exit(1); +} + +/** + * Plugin to use Piwik Analytics (based on the Google Analytics plugin by Evan) + * + * This plugin will spoot out the correct JavaScript spell to invoke Piwik Analytics on a page. + * + * To use this plugin please add the following three lines to your config.php +#Add Piwik Analytics +require_once('plugins/PiwikAnalyticsPlugin.php'); +$pa = new PiwikAnalyticsPlugin("example.com/piwik/","id"); + * + * exchange example.com/piwik/ with the url (without http:// or https:// !) to your + * piwik installation and make sure you don't forget the final / + * exchange id with the ID your laconica installation has in your Piwik analytics + * + * @category Plugin + * @package Laconica + * @author Tobias Diekershoff + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + * + * @see Event + */ + +class PiwikAnalyticsPlugin extends Plugin +{ + // the base of your Piwik installation + var $piwikroot = null; + // the Piwik Id of your laconica installation + var $piwikId = null; + + function __construct($root=null, $id=null) + { + $this->piwikroot = $root; + $this->piwikid = $id; + parent::__construct(); + } + + function onEndShowScripts($action) + { + $js1 = 'var pkBaseURL = (("https:" == document.location.protocol) ? "https://'. + $this->piwikroot.'" : "http://'.$this->piwikroot. + '"); document.write(unescape("%3Cscript src=\'" + pkBaseURL + "piwik.js\''. + ' type=\'text/javascript\'%3E%3C/script%3E"));'; + $js2 = 'piwik_action_name = ""; piwik_idsite = '.$this->piwikid. + '; piwik_url = pkBaseURL + "piwik.php"; piwik_log(piwik_action_name, piwik_idsite, piwik_url);'; + $action->elementStart('script', array('type' => 'text/javascript')); + $action->raw($js1); + $action->elementEnd('script'); + $action->elementStart('script', array('type' => 'text/javascript')); + $action->raw($js2); + $action->elementEnd('script'); + } +} \ No newline at end of file -- cgit v1.2.3 From fba02499327aa18083b590cf38ee6e144be06a6f Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 10 Apr 2009 11:36:46 -0400 Subject: add cliqset --- db/notice_source.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/db/notice_source.sql b/db/notice_source.sql index 76aadc673..ac23f14aa 100644 --- a/db/notice_source.sql +++ b/db/notice_source.sql @@ -14,6 +14,7 @@ VALUES ('Updating.Me','Updating.Me','http://updating.me/', now()), ('betwittered','BeTwittered','http://www.32hours.com/betwitteredinfo/', now()), ('bti','bti','http://gregkh.github.com/bti/', now()), + ('cliqset', 'Cliqset', 'http://www.cliqset.com/', now()), ('deskbar','Deskbar-Applet','http://www.gnome.org/projects/deskbar-applet/', now()), ('identicatools','Laconica Tools','http://bitbucketlabs.net/laconica-tools/', now()), ('identichat','identichat','http://identichat.prosody.im/', now()), -- cgit v1.2.3 From 925ac16e1f878b44940b1a2970b91bcf9c09e314 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 10 Apr 2009 22:47:40 -0400 Subject: tag stream is read-only --- actions/tag.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/actions/tag.php b/actions/tag.php index d15f64498..c413bf8c3 100644 --- a/actions/tag.php +++ b/actions/tag.php @@ -86,4 +86,9 @@ class TagAction extends Action $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, $this->page, 'tag', array('tag' => $this->tag)); } + + function isReadOnly() + { + return true; + } } -- cgit v1.2.3 From 5033c057f8544f0d4a1139908a1d5fe59905716e Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Sun, 12 Apr 2009 18:33:56 +0000 Subject: =?UTF-8?q?Updated=20Polish=20translations=20made=20by=20Piotr=20D?= =?UTF-8?q?r=C4=85g.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locale/pl_PL/LC_MESSAGES/laconica.mo | Bin 32614 -> 100014 bytes locale/pl_PL/LC_MESSAGES/laconica.po | 3241 +++++++++++++++++++++------------- 2 files changed, 2007 insertions(+), 1234 deletions(-) diff --git a/locale/pl_PL/LC_MESSAGES/laconica.mo b/locale/pl_PL/LC_MESSAGES/laconica.mo index faf549054..9a9cdccf3 100644 Binary files a/locale/pl_PL/LC_MESSAGES/laconica.mo and b/locale/pl_PL/LC_MESSAGES/laconica.mo differ diff --git a/locale/pl_PL/LC_MESSAGES/laconica.po b/locale/pl_PL/LC_MESSAGES/laconica.po index 9a61ada6b..8da9dd59b 100644 --- a/locale/pl_PL/LC_MESSAGES/laconica.po +++ b/locale/pl_PL/LC_MESSAGES/laconica.po @@ -1,41 +1,33 @@ -# #-#-#-#-# laconica.pot (PACKAGE VERSION) #-#-#-#-# -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. +# translation of pl.po to Polish # Paweł Wilk , 2008. +# Piotr Drąg , 2009. # -# #-#-#-#-# laconica.new.pot (PACKAGE VERSION) #-#-#-#-# -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. +# Polish language has 3 plural forms. +# Special case is used for one and some numbers ending in 2, 3, or 4. +# Example: +# 1 WINDOW -> 1 OKNO +# x2 to x4 WINDOWS -> x2 do x4 OKNA (x != 1) +# 5 or more WINDOWS -> 5 lub więcej OKIEN # msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" +"Project-Id-Version: pl\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-01-25 16:24+0000\n" -"PO-Revision-Date: 2009-02-28 17:14+0000\n" -"Last-Translator: Ryba \n" -"Language-Team: LANGUAGE \n" +"POT-Creation-Date: 2009-03-11 09:33+0000\n" +"PO-Revision-Date: 2009-04-10 00:39+0200\n" +"Last-Translator: Piotr Drąg \n" +"Language-Team: Polish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " -"|| n%100>=20) ? 1 : 2);\n" -"X-Generator: Pootle 1.1.0\n" - -# Polish language has 3 plural forms. -# Special case is used for one and some numbers ending in 2, 3, or 4. -# Example: -# 1 WINDOW -> 1 OKNO -# x2 to x4 WINDOWS -> x2 do x4 OKNA (x != 1) -# 5 or more WINDOWS -> 5 lub więcej OKIEN +"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%" +"100<10 || n%100>=20) ? 1 : 2);\n" + #: ../actions/noticesearchrss.php:64 actions/noticesearchrss.php:68 #: actions/noticesearchrss.php:88 #, php-format msgid " Search Stream for \"%s\"" -msgstr "Szukaj strumienia dla \"%s\"" +msgstr " Znajdź strumień dla \"%s\"" #: ../actions/finishopenidlogin.php:82 ../actions/register.php:191 #: actions/finishopenidlogin.php:88 actions/register.php:205 @@ -43,26 +35,27 @@ msgstr "Szukaj strumienia dla \"%s\"" msgid "" " except this private data: password, email address, IM address, phone number." msgstr "" -"z wyłączeniem tych prywatnych danych: e-maila, identyfikatora IM, numeru " +" poza tymi prywatnymi danymi: hasło, adres e-mail, adres komunikatora, numer " "telefonu." #: ../actions/showstream.php:400 ../lib/stream.php:109 #: actions/showstream.php:418 lib/mailbox.php:164 lib/stream.php:76 msgid " from " -msgstr "" +msgstr " od " #: ../actions/twitapistatuses.php:478 actions/twitapistatuses.php:412 -#: actions/twitapistatuses.php:347 +#: actions/twitapistatuses.php:347 actions/twitapistatuses.php:363 #, php-format msgid "%1$s / Updates replying to %2$s" -msgstr "" +msgstr "%1$s/aktualizacje odpowiadające na %2$s" #: ../actions/invite.php:168 actions/invite.php:176 actions/invite.php:211 +#: actions/invite.php:218 #, php-format msgid "%1$s has invited you to join them on %2$s" -msgstr "%1$s zapraszają Cię byś dołączył do nich w %2$s" +msgstr "%1$s zapraszają Cię, abyś dołączył do nich w %2$s" -#: ../actions/invite.php:170 +#: ../actions/invite.php:170 actions/invite.php:220 #, php-format msgid "" "%1$s has invited you to join them on %2$s (%3$s).\n" @@ -92,11 +85,38 @@ msgid "" "\n" "Sincerely, %2$s\n" msgstr "" +"Użytkownik %1$s zapraszają Cię, abyś dołączył do nich w %2$s (%3$s).\n" +"\n" +"%2$s jest usługą mikroblogowania, która umożliwia pozostawanie w kontakcie z " +"osobami, których znasz i z tymi, którzy Cię interesują.\n" +"\n" +"Możesz także dzielić się w sieci nowinkami o sobie, swoimi przemyśleniami, " +"lub swoim życiem z osobami, którzy Cię znają. To także wspaniały sposób na " +"poznawanie nowych osób, którzy dzielą Twoje zainteresowania.\n" +"\n" +"Użytkownik %1$s powiedział:\n" +"\n" +"%4$s\n" +"\n" +"Możesz zobaczyć stronę profilu %1$s na %2$s tutaj:\n" +"\n" +"%5$s\n" +"\n" +"Jeśli chcesz wypróbować usługę, naciśnij na poniższy odnośnik, aby " +"zaakceptować zaproszenie.\n" +"\n" +"%6$s\n" +"\n" +"Jeśli nie, możesz zignorować tę wiadomość. Dziękujemy za Twoją cierpliwość i " +"czas.\n" +"\n" +"Z poważaniem, %2$s\n" #: ../lib/mail.php:124 lib/mail.php:124 lib/mail.php:126 lib/mail.php:241 +#: lib/mail.php:236 #, php-format msgid "%1$s is now listening to your notices on %2$s." -msgstr "%1$s obserwuje teraz Twoje wpisy na %2$s." +msgstr "Użytkownik %1$s obserwuje teraz Twoje wpisy na %2$s." #: ../lib/mail.php:126 #, php-format @@ -108,16 +128,18 @@ msgid "" "Faithfully yours,\n" "%4$s.\n" msgstr "" -"%1$s obserwuje teraz Twoje wpisy na %2$s.\n" +"Użytkownik %1$s obserwuje teraz Twoje wpisy na %2$s.\n" +"\n" +"\t%3$s\n" "\n" -"Kłaniam się,\n" +"Z poważaniem,\n" "%4$s.\n" #: ../actions/twitapistatuses.php:482 actions/twitapistatuses.php:415 -#: actions/twitapistatuses.php:350 +#: actions/twitapistatuses.php:350 actions/twitapistatuses.php:367 #, php-format msgid "%1$s updates that reply to updates from %2$s / %3$s." -msgstr "" +msgstr "%1$s aktualizuje tę odpowiedź na aktualizacje od %2$s/%3$s." #: ../actions/shownotice.php:45 actions/shownotice.php:45 #: actions/shownotice.php:161 @@ -129,7 +151,7 @@ msgstr "Status użytkownika %1$s na %2$s" #: actions/invite.php:99 actions/invite.php:123 actions/invite.php:131 #, php-format msgid "%s (%s)" -msgstr "" +msgstr "%s (%s)" #: ../actions/publicrss.php:62 actions/publicrss.php:48 #: actions/publicrss.php:90 @@ -142,68 +164,74 @@ msgstr "Publiczny strumień %s" #: actions/allrss.php:60 actions/twitapistatuses.php:155 lib/personal.php:51 #: actions/all.php:65 actions/allrss.php:103 actions/facebookhome.php:164 #: actions/twitapistatuses.php:126 lib/personalgroupnav.php:99 +#: actions/all.php:68 actions/all.php:114 actions/allrss.php:106 +#: actions/facebookhome.php:163 actions/twitapistatuses.php:130 #, php-format msgid "%s and friends" msgstr "%s i przyjaciele" #: ../actions/twitapistatuses.php:49 actions/twitapistatuses.php:49 -#: actions/twitapistatuses.php:33 +#: actions/twitapistatuses.php:33 actions/twitapistatuses.php:32 #, php-format msgid "%s public timeline" msgstr "Publiczna oś czasu %s" -#: ../lib/mail.php:206 lib/mail.php:212 lib/mail.php:411 +#: ../lib/mail.php:206 lib/mail.php:212 lib/mail.php:411 lib/mail.php:412 #, php-format msgid "%s status" -msgstr "status %s" +msgstr "Status %s" #: ../actions/twitapistatuses.php:338 actions/twitapistatuses.php:265 -#: actions/twitapistatuses.php:199 +#: actions/twitapistatuses.php:199 actions/twitapistatuses.php:209 #, php-format msgid "%s timeline" -msgstr "oś czasu %s" +msgstr "Oś czasu %s" #: ../actions/twitapistatuses.php:52 actions/twitapistatuses.php:52 -#: actions/twitapistatuses.php:36 +#: actions/twitapistatuses.php:36 actions/twitapistatuses.php:38 #, php-format msgid "%s updates from everyone!" -msgstr "" +msgstr "%s aktualizuje od każdego!" -#: ../actions/register.php:213 +#: ../actions/register.php:213 actions/register.php:497 msgid "" "(You should receive a message by email momentarily, with instructions on how " "to confirm your email address.)" msgstr "" +"(Powinieneś właśnie otrzymać wiadomość e-mail, zawierającą instrukcje " +"potwierdzenia adresu e-mail)" -#: ../lib/util.php:257 lib/util.php:273 lib/action.php:605 +#: ../lib/util.php:257 lib/util.php:273 lib/action.php:605 lib/action.php:702 #, php-format msgid "" "**%%site.name%%** is a microblogging service brought to you by [%%site." "broughtby%%](%%site.broughtbyurl%%). " msgstr "" -"**%%site.name%%** to serwis z mikroblogami prowadzony przez [%%site.broughtby" -"%%](%%site.broughtbyurl%%)." +"**%%site.name%%** jest usługą mikroblogowania prowadzony przez [%%site." +"broughtby%%](%%site.broughtbyurl%%). " -#: ../lib/util.php:259 lib/util.php:275 lib/action.php:607 +#: ../lib/util.php:259 lib/util.php:275 lib/action.php:607 lib/action.php:704 #, php-format msgid "**%%site.name%%** is a microblogging service. " -msgstr "**%%site.name%%** to serwis do mikroblogowania." +msgstr "**%%site.name%%** jest usługą mikroblogowania. " #: ../lib/util.php:274 lib/util.php:290 msgid ". Contributors should be attributed by full name or nickname." msgstr "" -". Współpracownicy powinni być wymienieni z imienia i nazwiska lub pseudonimu." +". Współtwórcy powinni być wymienieni z imienia i nazwiska lub pseudonimu." #: ../actions/finishopenidlogin.php:73 ../actions/profilesettings.php:43 #: actions/finishopenidlogin.php:79 actions/profilesettings.php:76 #: actions/finishopenidlogin.php:101 actions/profilesettings.php:100 #: lib/groupeditform.php:139 msgid "1-64 lowercase letters or numbers, no punctuation or spaces" -msgstr "Max. 64 znaki alfanumeryczne, bez spacji i znaków przestankowych" +msgstr "1-64 małe litery lub liczby, bez spacji i znaków przestankowych" #: ../actions/register.php:152 actions/register.php:166 +#: actions/register.php:368 msgid "1-64 lowercase letters or numbers, no punctuation or spaces. Required." msgstr "" +"1-64 małe litery lub liczby, bez spacji i znaków przestankowych. Wymagane." #: ../actions/password.php:42 actions/profilesettings.php:181 #: actions/passwordsettings.php:102 @@ -213,39 +241,41 @@ msgstr "6 lub więcej znaków" #: ../actions/recoverpassword.php:180 actions/recoverpassword.php:186 #: actions/recoverpassword.php:220 msgid "6 or more characters, and don't forget it!" -msgstr "6 lub więcej znaków – nie zapomnij go!" +msgstr "6 lub więcej znaków, i nie zapomnij go!" #: ../actions/register.php:154 actions/register.php:168 #: actions/register.php:373 msgid "6 or more characters. Required." -msgstr "" +msgstr "6 lub więcej znaków. Wymagane." #: ../actions/imsettings.php:197 actions/imsettings.php:205 +#: actions/imsettings.php:321 #, php-format msgid "" "A confirmation code was sent to the IM address you added. You must approve %" "s for sending messages to you." msgstr "" -"Na Twój adres komunikatora został wysłany kod potwierdzający. Musisz " +"Kod potwierdzający został wysłany na dodany adres komunikatora. Musisz " "zaakceptować otrzymywanie wiadomości od %s." #: ../actions/emailsettings.php:213 actions/emailsettings.php:231 +#: actions/emailsettings.php:350 msgid "" "A confirmation code was sent to the email address you added. Check your " "inbox (and spam box!) for the code and instructions on how to use it." msgstr "" -"Kod potwierdzający został wysłany na podany przez Ciebie adres e-mail. " -"Sprawdź w swojej skrzynce odbiorczej (także w folderze SPAM) czy otrzymałeś " -"kod i instrukcje dotyczące jego użycia. " +"Kod potwierdzający został wysłany na dodany adres e-mail. Sprawdź w swojej " +"skrzynce odbiorczej (także w wiadomościach niechcianych!), czy otrzymałeś " +"kod i instrukcje dotyczące jego użycia." #: ../actions/smssettings.php:216 actions/smssettings.php:224 msgid "" "A confirmation code was sent to the phone number you added. Check your inbox " "(and spam box!) for the code and instructions on how to use it." msgstr "" -"Kod potwierdzający został wysłany na podany przez Ciebie numer telefonu. " -"Sprawdź w swojej skrzynce odbiorczej (także w folderze SPAM) czy otrzymałeś " -"kod i instrukcje dotyczące jego użycia. " +"Kod potwierdzający został wysłany na dodany numer telefonu. Sprawdź w swojej " +"skrzynce odbiorczej (także w wiadomościach niechcianych!), czy otrzymałeś " +"kod i instrukcje dotyczące jego użycia." #: ../actions/twitapiaccount.php:49 ../actions/twitapihelp.php:45 #: ../actions/twitapistatuses.php:88 ../actions/twitapistatuses.php:259 @@ -265,9 +295,14 @@ msgstr "" #: actions/twitapistatuses.php:147 actions/twitapistatuses.php:228 #: actions/twitapistatuses.php:239 actions/twitapistatuses.php:392 #: actions/twitapistatuses.php:402 actions/twitapistatuses.php:429 -#: actions/twitapiusers.php:32 +#: actions/twitapiusers.php:32 actions/twitapidirect_messages.php:120 +#: actions/twitapifavorites.php:91 actions/twitapifavorites.php:108 +#: actions/twitapistatuses.php:82 actions/twitapistatuses.php:159 +#: actions/twitapistatuses.php:246 actions/twitapistatuses.php:257 +#: actions/twitapistatuses.php:416 actions/twitapistatuses.php:426 +#: actions/twitapistatuses.php:453 msgid "API method not found!" -msgstr "metoda API nie znaleziona!" +msgstr "Nie znaleziono metody API!" #: ../actions/twitapiaccount.php:57 ../actions/twitapiaccount.php:113 #: ../actions/twitapiaccount.php:119 ../actions/twitapiblocks.php:28 @@ -288,18 +323,21 @@ msgstr "metoda API nie znaleziona!" #: actions/twitapidirect_messages.php:184 actions/twitapifavorites.php:143 #: actions/twitapihelp.php:52 actions/twitapilaconica.php:172 #: actions/twitapinotifications.php:31 actions/twitapinotifications.php:37 -#: actions/twitapistatuses.php:562 +#: actions/twitapistatuses.php:562 actions/twitapiaccount.php:46 +#: actions/twitapiaccount.php:98 actions/twitapiaccount.php:104 +#: actions/twitapidirect_messages.php:193 actions/twitapifavorites.php:149 +#: actions/twitapistatuses.php:625 actions/twitapitrends.php:87 msgid "API method under construction." -msgstr "metoda API w trakcie powstawania." +msgstr "Metoda API jest w trakcie tworzenia." -#: ../lib/util.php:324 lib/util.php:340 lib/action.php:568 +#: ../lib/util.php:324 lib/util.php:340 lib/action.php:568 lib/action.php:661 msgid "About" -msgstr "O serwisie" +msgstr "O usłudze" #: ../actions/userauthorization.php:119 actions/userauthorization.php:126 #: actions/userauthorization.php:143 msgid "Accept" -msgstr "Akceptuj" +msgstr "Zaakceptuj" #: ../actions/emailsettings.php:62 ../actions/imsettings.php:63 #: ../actions/openidsettings.php:57 ../actions/smssettings.php:71 @@ -308,6 +346,7 @@ msgstr "Akceptuj" #: actions/twittersettings.php:85 actions/emailsettings.php:120 #: actions/imsettings.php:127 actions/openidsettings.php:111 #: actions/smssettings.php:133 actions/twittersettings.php:163 +#: actions/twittersettings.php:166 msgid "Add" msgstr "Dodaj" @@ -330,13 +369,14 @@ msgid "Address" msgstr "Adres" #: ../actions/invite.php:131 actions/invite.php:139 actions/invite.php:176 +#: actions/invite.php:181 msgid "Addresses of friends to invite (one per line)" -msgstr "Adresy subskrybentów, których zapraszasz (jeden w każdej linii)" +msgstr "Adresy przyjaciół, których zapraszasz (jeden na wiersz)" #: ../actions/showstream.php:273 actions/showstream.php:288 #: actions/showstream.php:422 msgid "All subscriptions" -msgstr "Wszyscy obserwowani" +msgstr "Wszystkie subskrypcje" #: ../actions/publicrss.php:64 actions/publicrss.php:50 #: actions/publicrss.php:92 @@ -348,7 +388,7 @@ msgstr "Wszystkie aktualizacje od %s" #: actions/noticesearchrss.php:90 #, php-format msgid "All updates matching search term \"%s\"" -msgstr "Wszystkie aktualizacje pasujące do wzorca wyszukiwania \"%s\"" +msgstr "Wszystkie aktualizacje pasujące do wyszukiwanego terminu \"%s\"" #: ../actions/finishopenidlogin.php:29 ../actions/login.php:31 #: ../actions/openidlogin.php:29 ../actions/register.php:30 @@ -361,68 +401,72 @@ msgstr "Jesteś już zalogowany." #: ../lib/subs.php:42 lib/subs.php:42 lib/subs.php:49 msgid "Already subscribed!." -msgstr "Już obserwujesz!" +msgstr "Już subskrybowane!" #: ../actions/deletenotice.php:54 actions/deletenotice.php:55 -#: actions/deletenotice.php:113 +#: actions/deletenotice.php:113 actions/deletenotice.php:114 msgid "Are you sure you want to delete this notice?" msgstr "Jesteś pewien, że chcesz usunąć ten wpis?" #: ../actions/userauthorization.php:77 actions/userauthorization.php:83 #: actions/userauthorization.php:81 msgid "Authorize subscription" -msgstr "Pozwól na obserwację" +msgstr "Upoważnij subskrypcję" #: ../actions/login.php:104 ../actions/register.php:178 -#: actions/register.php:192 +#: actions/register.php:192 actions/login.php:218 actions/openidlogin.php:117 +#: actions/register.php:416 msgid "Automatically login in the future; not for shared computers!" msgstr "" -"Automatycznie loguj mnie na konto. Nie używać w przypadku współdzielonych " -"komputerów!" +"Automatyczne logowanie. Nie użyj na komputerach używanych przez wiele osób!" #: ../actions/profilesettings.php:65 actions/profilesettings.php:98 +#: actions/profilesettings.php:144 msgid "" "Automatically subscribe to whoever subscribes to me (best for non-humans)" msgstr "" -"Automatycznie zasubskrybuj każdego kto mnie zasubskrybuje (najlepsze dla " +"Automatycznie zasubskrybuj każdego, kto mnie zasubskrybuje (najlepsze dla " "botów)" #: ../actions/avatar.php:32 ../lib/settingsaction.php:90 #: actions/profilesettings.php:34 actions/avatarsettings.php:65 #: actions/showgroup.php:209 lib/accountsettingsaction.php:107 +#: actions/avatarsettings.php:67 actions/showgroup.php:211 msgid "Avatar" msgstr "Awatar" #: ../actions/avatar.php:113 actions/profilesettings.php:350 -#: actions/avatarsettings.php:395 +#: actions/avatarsettings.php:395 actions/avatarsettings.php:346 msgid "Avatar updated." -msgstr "Awatar załadowany." +msgstr "Zaktualizowano awatar." #: ../actions/imsettings.php:55 actions/imsettings.php:56 +#: actions/imsettings.php:108 #, php-format msgid "" "Awaiting confirmation on this address. Check your Jabber/GTalk account for a " "message with further instructions. (Did you add %s to your buddy list?)" msgstr "" -"Oczekiwanie na potwierdzenie dla tego adresu. Sprawdź czy na Twoje konto " -"Jabbera/GTalka przyszła wiadomość z dalszymi instrukcjami. (Nie zapomnij " -"dodać %s do listy znajomych.)" +"Oczekiwanie na potwierdzenie tego adresu. Sprawdź swoje konto Jabbera/GTalk, " +"czy otrzymałeś wiadomość z dalszymi instrukcjami (dodałeś %s do listy " +"znajomych?)." #: ../actions/emailsettings.php:54 actions/emailsettings.php:55 +#: actions/emailsettings.php:107 msgid "" "Awaiting confirmation on this address. Check your inbox (and spam box!) for " "a message with further instructions." msgstr "" -"Ten adres oczekuje potwierdzenia. Sprawdź swoją skrzynkę odbiorczą (także " -"folder SPAM!) czy dostałeś wiadomość z dalszymi instrukcjami. " +"Oczekiwanie na potwierdzenie tego adresu. Sprawdź swoją skrzynkę odbiorczą " +"(także w wiadomościach niechcianych!), czy otrzymałeś wiadomość z dalszymi " +"instrukcjami." #: ../actions/smssettings.php:58 actions/smssettings.php:58 #: actions/smssettings.php:111 msgid "Awaiting confirmation on this phone number." -msgstr "Oczekiwanie na potwierdzenie dla tego numeru telefonu." +msgstr "Oczekiwanie na potwierdzenie tego numeru telefonu." #: ../lib/util.php:1318 lib/util.php:1452 -#, fuzzy msgid "Before »" msgstr "Wcześniej »" @@ -436,23 +480,24 @@ msgstr "O mnie" #: ../actions/updateprofile.php:103 actions/profilesettings.php:216 #: actions/register.php:89 actions/updateprofile.php:104 #: actions/profilesettings.php:205 actions/register.php:174 -#: actions/updateprofile.php:107 +#: actions/updateprofile.php:107 actions/updateprofile.php:109 msgid "Bio is too long (max 140 chars)." -msgstr "Wpis \"O mnie\" jest za długi (maks. 140 znaków)" +msgstr "Wpis \"O mnie\" jest za długi (maksymalnie 140 znaków)." #: ../lib/deleteaction.php:41 lib/deleteaction.php:41 lib/deleteaction.php:69 msgid "Can't delete this notice." -msgstr "Nie można usunąć tego wpisu. " +msgstr "Nie można usunąć tego wpisu." #: ../actions/updateprofile.php:119 actions/updateprofile.php:120 -#: actions/updateprofile.php:123 +#: actions/updateprofile.php:123 actions/updateprofile.php:125 #, php-format msgid "Can't read avatar URL '%s'" -msgstr "Nie można odczytać URL-a awatara '%s'" +msgstr "Nie można odczytać adresu URL awatara \"%s\"" #: ../actions/password.php:85 ../actions/recoverpassword.php:300 #: actions/profilesettings.php:404 actions/recoverpassword.php:313 #: actions/passwordsettings.php:169 actions/recoverpassword.php:347 +#: actions/passwordsettings.php:174 msgid "Can't save new password." msgstr "Nie można zapisać nowego hasła." @@ -465,8 +510,9 @@ msgid "Cancel" msgstr "Anuluj" #: ../lib/openid.php:121 lib/openid.php:121 lib/openid.php:130 +#: lib/openid.php:133 msgid "Cannot instantiate OpenID consumer object." -msgstr "Nie można stworzyć instancji obiektu OpenID." +msgstr "Nie można utworzyć instancji obiektu klienta OpenID." #: ../actions/imsettings.php:163 actions/imsettings.php:171 #: actions/imsettings.php:286 @@ -474,9 +520,9 @@ msgid "Cannot normalize that Jabber ID" msgstr "Nie można znormalizować tego identyfikatora Jabbera" #: ../actions/emailsettings.php:181 actions/emailsettings.php:199 -#: actions/emailsettings.php:311 +#: actions/emailsettings.php:311 actions/emailsettings.php:318 msgid "Cannot normalize that email address" -msgstr "" +msgstr "Nie można znormalizować tego adresu e-mail" #: ../actions/password.php:45 actions/profilesettings.php:184 #: actions/passwordsettings.php:110 @@ -486,7 +532,7 @@ msgstr "Zmień" #: ../lib/settingsaction.php:88 lib/settingsaction.php:88 #: lib/accountsettingsaction.php:114 msgid "Change email handling" -msgstr "" +msgstr "Zmień obsługę adresu e-mail" #: ../actions/password.php:32 actions/profilesettings.php:36 #: actions/passwordsettings.php:58 @@ -495,12 +541,12 @@ msgstr "Zmień hasło" #: ../lib/settingsaction.php:94 lib/accountsettingsaction.php:111 msgid "Change your password" -msgstr "" +msgstr "Zmień hasło" #: ../lib/settingsaction.php:85 lib/settingsaction.php:85 #: lib/accountsettingsaction.php:105 msgid "Change your profile settings" -msgstr "" +msgstr "Zmień ustawienia profilu" #: ../actions/password.php:43 ../actions/recoverpassword.php:181 #: ../actions/register.php:155 ../actions/smssettings.php:65 @@ -520,21 +566,21 @@ msgstr "Potwierdź adres" #: ../actions/smssettings.php:245 actions/emailsettings.php:256 #: actions/imsettings.php:230 actions/smssettings.php:253 #: actions/emailsettings.php:379 actions/imsettings.php:361 -#: actions/smssettings.php:374 +#: actions/smssettings.php:374 actions/emailsettings.php:386 msgid "Confirmation cancelled." msgstr "Anulowano potwierdzenie." #: ../actions/smssettings.php:63 actions/smssettings.php:63 #: actions/smssettings.php:118 msgid "Confirmation code" -msgstr "" +msgstr "Kod potwierdzający" #: ../actions/confirmaddress.php:38 actions/confirmaddress.php:38 #: actions/confirmaddress.php:80 msgid "Confirmation code not found." msgstr "Nie znaleziono kodu potwierdzającego." -#: ../actions/register.php:202 +#: ../actions/register.php:202 actions/register.php:473 #, php-format msgid "" "Congratulations, %s! And welcome to %%%%site.name%%%%. From here, you may " @@ -552,9 +598,24 @@ msgid "" "\n" "Thanks for signing up and we hope you enjoy using this service." msgstr "" +"Gratulacje, %s! Witaj na %%%%site.name%%%%. Stąd możesz chcieć...\n" +"\n" +"* Przejść do [swojego profilu](%s) i wysłać swoją pierwszą wiadomość.\n" +"* Dodać [adres Jabbera/GTalk](%%%%action.imsettings%%%%), abyś mógł wysyłać " +"wpisy przez komunikatora.\n" +"* [Poszukać osób](%%%%action.peoplesearch%%%%), których możesz znać lub " +"którzy dzielą Twoje zainteresowania. \n" +"* Zaktualizować swoje [ustawienia profilu](%%%%action.profilesettings%%%%), " +"aby powiedzieć innym więcej o sobie. \n" +"* Przeczytać [dokumentację w sieci](%%%%doc.help%%%%), aby dowiedzieć się o " +"funkcjach, które mogłeś pominąć. \n" +"\n" +"Dziękujemy za zarejestrowanie się i mamy nadzieję, że używanie tej usługi " +"sprawi Ci przyjemność." #: ../actions/finishopenidlogin.php:91 actions/finishopenidlogin.php:97 -#: actions/finishopenidlogin.php:119 lib/action.php:330 +#: actions/finishopenidlogin.php:119 lib/action.php:330 lib/action.php:403 +#: lib/action.php:406 msgid "Connect" msgstr "Połącz" @@ -563,11 +624,12 @@ msgstr "Połącz" msgid "Connect existing account" msgstr "Połącz z istniejącym kontem" -#: ../lib/util.php:332 lib/util.php:348 lib/action.php:576 +#: ../lib/util.php:332 lib/util.php:348 lib/action.php:576 lib/action.php:669 msgid "Contact" msgstr "Kontakt" #: ../lib/openid.php:178 lib/openid.php:178 lib/openid.php:187 +#: lib/openid.php:190 #, php-format msgid "Could not create OpenID form: %s" msgstr "Nie można utworzyć formularza OpenID: %s" @@ -577,45 +639,46 @@ msgstr "Nie można utworzyć formularza OpenID: %s" #: actions/twitapifriendships.php:48 actions/twitapifriendships.php:64 #, php-format msgid "Could not follow user: %s is already on your list." -msgstr "" +msgstr "Nie można obserwować użytkownika: %s jest już na Twojej liście." #: ../actions/twitapifriendships.php:53 actions/twitapifriendships.php:53 #: actions/twitapifriendships.php:41 msgid "Could not follow user: User not found." -msgstr "" +msgstr "Nie można obserwować użytkownika: nie znaleziono użytkownika." #: ../lib/openid.php:160 lib/openid.php:160 lib/openid.php:169 +#: lib/openid.php:172 #, php-format msgid "Could not redirect to server: %s" msgstr "Nie można przekierować do serwera: %s" #: ../actions/updateprofile.php:162 actions/updateprofile.php:163 -#: actions/updateprofile.php:166 +#: actions/updateprofile.php:166 actions/updateprofile.php:176 msgid "Could not save avatar info" msgstr "Nie można zapisać informacji o awatarze" #: ../actions/updateprofile.php:155 actions/updateprofile.php:156 -#: actions/updateprofile.php:159 +#: actions/updateprofile.php:159 actions/updateprofile.php:163 msgid "Could not save new profile info" msgstr "Nie można zapisać informacji o nowym profilu" #: ../lib/subs.php:54 lib/subs.php:61 lib/subs.php:72 msgid "Could not subscribe other to you." -msgstr "" +msgstr "Nie można zasubskrybować innych do Ciebie." #: ../lib/subs.php:46 lib/subs.php:46 lib/subs.php:57 msgid "Could not subscribe." -msgstr "" +msgstr "Nie można zasubskrybować." #: ../actions/recoverpassword.php:102 actions/recoverpassword.php:105 #: actions/recoverpassword.php:111 msgid "Could not update user with confirmed email address." -msgstr "" +msgstr "Nie można zaktualizować użytkownika z potwierdzonym adresem e-mail." #: ../actions/finishremotesubscribe.php:99 #: actions/finishremotesubscribe.php:101 actions/finishremotesubscribe.php:114 msgid "Couldn't convert request tokens to access tokens." -msgstr "Nie można przekształcić tokenów z żądaniami na tokeny dostępu." +msgstr "Nie można przekonwertować tokenów żądań na tokeny dostępu." #: ../actions/confirmaddress.php:84 ../actions/emailsettings.php:234 #: ../actions/imsettings.php:218 ../actions/smssettings.php:241 @@ -623,52 +686,56 @@ msgstr "Nie można przekształcić tokenów z żądaniami na tokeny dostępu." #: actions/imsettings.php:226 actions/smssettings.php:249 #: actions/confirmaddress.php:126 actions/emailsettings.php:375 #: actions/imsettings.php:357 actions/smssettings.php:370 +#: actions/emailsettings.php:382 msgid "Couldn't delete email confirmation." -msgstr "Nie można skasować potwierdzenia adresu e-mail." +msgstr "Nie można usunąć potwierdzenia adresu e-mail." #: ../lib/subs.php:103 lib/subs.php:116 lib/subs.php:134 msgid "Couldn't delete subscription." -msgstr "Nie można usunąć obserwacji." +msgstr "Nie można usunąć subskrypcji." #: ../actions/twitapistatuses.php:93 actions/twitapistatuses.php:98 -#: actions/twitapistatuses.php:84 +#: actions/twitapistatuses.php:84 actions/twitapistatuses.php:87 msgid "Couldn't find any statuses." -msgstr "" +msgstr "Nie można znaleźć żadnych statusów." #: ../actions/remotesubscribe.php:127 actions/remotesubscribe.php:136 #: actions/remotesubscribe.php:178 msgid "Couldn't get a request token." -msgstr "Nie można uzyskać tokena z żądaniem." +msgstr "Nie można uzyskać tokenu żądana." #: ../actions/emailsettings.php:205 ../actions/imsettings.php:187 #: ../actions/smssettings.php:206 actions/emailsettings.php:223 #: actions/imsettings.php:195 actions/smssettings.php:214 #: actions/emailsettings.php:337 actions/imsettings.php:311 -#: actions/smssettings.php:325 +#: actions/smssettings.php:325 actions/emailsettings.php:344 msgid "Couldn't insert confirmation code." msgstr "Nie można wprowadzić kodu potwierdzającego." #: ../actions/finishremotesubscribe.php:180 #: actions/finishremotesubscribe.php:182 actions/finishremotesubscribe.php:218 msgid "Couldn't insert new subscription." -msgstr "Nie można wprowadzić nowej obserwacji." +msgstr "Nie można wprowadzić nowej subskrypcji." #: ../actions/profilesettings.php:184 ../actions/twitapiaccount.php:96 #: actions/profilesettings.php:299 actions/twitapiaccount.php:94 #: actions/profilesettings.php:302 actions/twitapiaccount.php:81 +#: actions/twitapiaccount.php:82 msgid "Couldn't save profile." msgstr "Nie można zapisać profilu." #: ../actions/profilesettings.php:161 actions/profilesettings.php:276 #: actions/profilesettings.php:279 msgid "Couldn't update user for autosubscribe." -msgstr "" +msgstr "Nie można zaktualizować użytkownika do automatycznej subskrypcji." #: ../actions/emailsettings.php:280 ../actions/emailsettings.php:294 #: actions/emailsettings.php:298 actions/emailsettings.php:312 #: actions/emailsettings.php:440 actions/emailsettings.php:462 +#: actions/emailsettings.php:447 actions/emailsettings.php:469 +#: actions/smssettings.php:515 actions/smssettings.php:539 msgid "Couldn't update user record." -msgstr "" +msgstr "Nie można zaktualizować wpisu użytkownika." #: ../actions/confirmaddress.php:72 ../actions/emailsettings.php:156 #: ../actions/emailsettings.php:259 ../actions/imsettings.php:138 @@ -682,7 +749,8 @@ msgstr "" #: actions/emailsettings.php:411 actions/imsettings.php:252 #: actions/imsettings.php:395 actions/othersettings.php:162 #: actions/profilesettings.php:259 actions/smssettings.php:266 -#: actions/smssettings.php:408 +#: actions/smssettings.php:408 actions/emailsettings.php:287 +#: actions/emailsettings.php:418 msgid "Couldn't update user." msgstr "Nie można zaktualizować użytkownika." @@ -694,57 +762,61 @@ msgstr "Utwórz" #: ../actions/finishopenidlogin.php:70 actions/finishopenidlogin.php:76 #: actions/finishopenidlogin.php:98 msgid "Create a new user with this nickname." -msgstr "Załóż użytkownika o tym pseudonimie." +msgstr "Utwórz nowego użytkownika o tym pseudonimie." #: ../actions/finishopenidlogin.php:68 actions/finishopenidlogin.php:74 #: actions/finishopenidlogin.php:96 msgid "Create new account" -msgstr "Załóż nowe konto" +msgstr "Utwórz nowe konto" #: ../actions/finishopenidlogin.php:191 actions/finishopenidlogin.php:197 #: actions/finishopenidlogin.php:231 msgid "Creating new account for OpenID that already has a user." -msgstr "Tworzenie nowego konta użytkownika na podstawie identyfikatora OpenID." +msgstr "" +"Tworzenie nowego konta dla identyfikatora OpenID, który posiada już " +"użytkownika." #: ../actions/imsettings.php:45 actions/imsettings.php:46 #: actions/imsettings.php:100 msgid "Current confirmed Jabber/GTalk address." -msgstr "Potwierdzone adresy Jabbera/GTalka" +msgstr "Obecnie potwierdzone adresy Jabbera/GTalk." #: ../actions/smssettings.php:46 actions/smssettings.php:46 #: actions/smssettings.php:100 msgid "Current confirmed SMS-enabled phone number." -msgstr "" +msgstr "Obecnie potwierdzone numery telefonów z włączoną usługą SMS." #: ../actions/emailsettings.php:44 actions/emailsettings.php:45 #: actions/emailsettings.php:99 msgid "Current confirmed email address." -msgstr "" +msgstr "Obecnie potwierdzone adresy e-mail." #: ../actions/showstream.php:356 actions/showstream.php:367 msgid "Currently" msgstr "Obecnie" #: ../classes/Notice.php:72 classes/Notice.php:86 classes/Notice.php:91 +#: classes/Notice.php:114 #, php-format msgid "DB error inserting hashtag: %s" -msgstr "" +msgstr "Błąd bazy danych podczas wprowadzania znacznika hasha: %s" #: ../lib/util.php:1061 lib/util.php:1110 classes/Notice.php:698 +#: classes/Notice.php:757 #, php-format msgid "DB error inserting reply: %s" -msgstr "Błąd przy dodawaniu do bazy danych: %s" +msgstr "Błąd bazy danych podczas wprowadzania odpowiedzi: %s" #: ../actions/deletenotice.php:41 actions/deletenotice.php:41 -#: actions/deletenotice.php:79 +#: actions/deletenotice.php:79 actions/deletenotice.php:111 msgid "Delete notice" -msgstr "" +msgstr "Usuń wpis" #: ../actions/profilesettings.php:51 ../actions/register.php:172 #: actions/profilesettings.php:84 actions/register.php:186 -#: actions/profilesettings.php:114 +#: actions/profilesettings.php:114 actions/register.php:404 msgid "Describe yourself and your interests in 140 chars" -msgstr "Opisz się w 140 znakach" +msgstr "Opisz się i swoje zainteresowania w 140 znakach" #: ../actions/register.php:158 ../actions/register.php:161 #: ../lib/settingsaction.php:87 actions/register.php:172 @@ -756,59 +828,60 @@ msgstr "E-mail" #: ../actions/emailsettings.php:59 actions/emailsettings.php:60 #: actions/emailsettings.php:115 msgid "Email Address" -msgstr "" +msgstr "Adres e-mail" #: ../actions/emailsettings.php:32 actions/emailsettings.php:32 #: actions/emailsettings.php:60 msgid "Email Settings" -msgstr "" +msgstr "Ustawienia adresu e-mail" #: ../actions/register.php:73 actions/register.php:80 actions/register.php:163 msgid "Email address already exists." -msgstr "Taki e-mail już istnieje" +msgstr "Adres e-mail już istnieje." #: ../lib/mail.php:90 lib/mail.php:90 lib/mail.php:173 msgid "Email address confirmation" -msgstr "Potwierdzenie adresu e-mailowego" +msgstr "Potwierdzenie adresu e-mail" #: ../actions/emailsettings.php:61 actions/emailsettings.php:62 #: actions/emailsettings.php:117 msgid "Email address, like \"UserName@example.org\"" -msgstr "" +msgstr "Adres e-mail, taki jak \"NazwaUżytkownika@przykład.org\"" #: ../actions/invite.php:129 actions/invite.php:137 actions/invite.php:174 +#: actions/invite.php:179 msgid "Email addresses" -msgstr "" +msgstr "Adresy e-mail" #: ../actions/recoverpassword.php:191 actions/recoverpassword.php:197 #: actions/recoverpassword.php:231 msgid "Enter a nickname or email address." -msgstr "Podaj pseudonim lub adres e-mailowy" +msgstr "Podaj pseudonim lub adres e-mail." #: ../actions/smssettings.php:64 actions/smssettings.php:64 #: actions/smssettings.php:119 msgid "Enter the code you received on your phone." -msgstr "" +msgstr "Podaj kod, który otrzymałeś na telefonie." #: ../actions/userauthorization.php:137 actions/userauthorization.php:144 #: actions/userauthorization.php:161 msgid "Error authorizing token" -msgstr "Błąd podczas autoryzacji tokena" +msgstr "Błąd podczas upoważniania tokena" #: ../actions/finishopenidlogin.php:253 actions/finishopenidlogin.php:259 -#: actions/finishopenidlogin.php:297 +#: actions/finishopenidlogin.php:297 actions/finishopenidlogin.php:302 msgid "Error connecting user to OpenID." -msgstr "Błąd w podłączaniu użytkownika do OpenID." +msgstr "Błąd podczas łączenia użytkownika z OpenID." #: ../actions/finishaddopenid.php:78 actions/finishaddopenid.php:78 #: actions/finishaddopenid.php:126 msgid "Error connecting user." -msgstr "Błąd w podłączaniu użytkownika." +msgstr "Błąd podczas łączenia użytkownika." #: ../actions/finishremotesubscribe.php:151 #: actions/finishremotesubscribe.php:153 actions/finishremotesubscribe.php:166 msgid "Error inserting avatar" -msgstr "Błąd we wstawianiu awatara" +msgstr "Błąd podczas wprowadzania awatara" #: ../actions/finishremotesubscribe.php:143 #: actions/finishremotesubscribe.php:145 actions/finishremotesubscribe.php:158 @@ -823,33 +896,36 @@ msgstr "Błąd podczas wprowadzania zdalnego profilu" #: ../actions/recoverpassword.php:240 actions/recoverpassword.php:246 #: actions/recoverpassword.php:280 msgid "Error saving address confirmation." -msgstr "Błąd w zapisie potwierdzenia adresu." +msgstr "Błąd podczas zapisywania potwierdzenia adresu." #: ../actions/userauthorization.php:140 actions/userauthorization.php:147 #: actions/userauthorization.php:164 msgid "Error saving remote profile" -msgstr "Błąd w zapisie zdalnego profilu." +msgstr "Błąd podczas zapisie zdalnego profilu" #: ../lib/openid.php:226 lib/openid.php:226 lib/openid.php:235 +#: lib/openid.php:238 msgid "Error saving the profile." -msgstr "Błąd w zapisie profilu." +msgstr "Błąd podczas zapisywania profilu." #: ../lib/openid.php:237 lib/openid.php:237 lib/openid.php:246 +#: lib/openid.php:249 msgid "Error saving the user." -msgstr "Błąd w zapisie użytkownika." +msgstr "Błąd podczas zapisywanie użytkownika." #: ../actions/password.php:80 actions/profilesettings.php:399 -#: actions/passwordsettings.php:164 +#: actions/passwordsettings.php:164 actions/passwordsettings.php:169 msgid "Error saving user; invalid." -msgstr "Błąd podczas zapisywania użytkownika; niepoprawne dane." +msgstr "Błąd podczas zapisywania użytkownika; nieprawidłowy." #: ../actions/login.php:47 ../actions/login.php:73 #: ../actions/recoverpassword.php:307 ../actions/register.php:98 #: actions/login.php:47 actions/login.php:73 actions/recoverpassword.php:320 #: actions/register.php:108 actions/login.php:112 actions/login.php:138 #: actions/recoverpassword.php:354 actions/register.php:198 +#: actions/login.php:120 msgid "Error setting user." -msgstr "Błąd w ustawianiu danych użytkownika." +msgstr "Błąd podczas ustawiania użytkownika." #: ../actions/finishaddopenid.php:83 actions/finishaddopenid.php:83 #: actions/finishaddopenid.php:131 @@ -869,78 +945,83 @@ msgstr "Błąd kodu potwierdzającego." #: ../actions/finishopenidlogin.php:89 actions/finishopenidlogin.php:95 #: actions/finishopenidlogin.php:117 msgid "Existing nickname" -msgstr "Dotychczasowy pseudonim" +msgstr "Istniejący pseudonim" -#: ../lib/util.php:326 lib/util.php:342 lib/action.php:570 +#: ../lib/util.php:326 lib/util.php:342 lib/action.php:570 lib/action.php:663 msgid "FAQ" msgstr "FAQ" #: ../actions/avatar.php:115 actions/profilesettings.php:352 -#: actions/avatarsettings.php:397 +#: actions/avatarsettings.php:397 actions/avatarsettings.php:349 msgid "Failed updating avatar." -msgstr "Uaktualnianie awatara nie powiodło się." +msgstr "Zaktualizowanie awatara nie powiodło się." #: ../actions/all.php:61 ../actions/allrss.php:64 actions/all.php:61 #: actions/allrss.php:64 actions/all.php:75 actions/allrss.php:107 +#: actions/allrss.php:110 #, php-format msgid "Feed for friends of %s" msgstr "Kanał dla znajomych użytkownika %s" #: ../actions/replies.php:65 ../actions/repliesrss.php:80 #: actions/replies.php:65 actions/repliesrss.php:66 actions/replies.php:134 -#: actions/repliesrss.php:71 +#: actions/repliesrss.php:71 actions/replies.php:136 #, php-format msgid "Feed for replies to %s" msgstr "Kanał dla odpowiedzi do użytkownika %s" #: ../actions/tag.php:55 actions/tag.php:55 actions/tag.php:61 +#: actions/tag.php:68 #, php-format msgid "Feed for tag %s" -msgstr "" +msgstr "Kanał dla znaczników %s" #: ../lib/searchaction.php:105 lib/searchaction.php:105 #: lib/searchgroupnav.php:83 msgid "Find content of notices" -msgstr "" +msgstr "Przeszukaj zawartość wpisów" #: ../lib/searchaction.php:101 lib/searchaction.php:101 #: lib/searchgroupnav.php:81 msgid "Find people on this site" -msgstr "" +msgstr "Znajdź osoby na tej stronie" -#: ../actions/login.php:122 +#: ../actions/login.php:122 actions/login.php:247 msgid "" "For security reasons, please re-enter your user name and password before " "changing your settings." msgstr "" -"Z powodów bezpieczeństwa wprowadź proszę ponownie nazwę użytkownika i hasło " -"przed zmianą swoich ustawień." +"Z powodów bezpieczeństwa ponownie podaj nazwę użytkownika i hasło przed " +"zmienianiem ustawień." #: ../actions/profilesettings.php:44 ../actions/register.php:164 #: actions/profilesettings.php:77 actions/register.php:178 #: actions/profilesettings.php:103 actions/register.php:391 #: actions/showgroup.php:235 actions/showstream.php:262 #: actions/tagother.php:105 lib/groupeditform.php:142 +#: actions/showgroup.php:237 actions/showstream.php:255 +#: actions/tagother.php:104 msgid "Full name" -msgstr "Pełna nazwa" +msgstr "Imię i nazwisko" #: ../actions/profilesettings.php:98 ../actions/register.php:79 #: ../actions/updateprofile.php:93 actions/profilesettings.php:213 #: actions/register.php:86 actions/updateprofile.php:94 #: actions/editgroup.php:195 actions/newgroup.php:146 #: actions/profilesettings.php:202 actions/register.php:171 -#: actions/updateprofile.php:97 +#: actions/updateprofile.php:97 actions/updateprofile.php:99 msgid "Full name is too long (max 255 chars)." -msgstr "Pełna nazwa jest zbyt długa (max. 255 znaków)." +msgstr "Imię i nazwisko jest za długie (maksymalnie 255 znaków)." #: ../lib/util.php:322 lib/util.php:338 lib/action.php:344 lib/action.php:566 +#: lib/action.php:421 lib/action.php:659 msgid "Help" msgstr "Pomoc" #: ../lib/util.php:298 lib/util.php:314 lib/action.php:322 -#: lib/facebookaction.php:200 +#: lib/facebookaction.php:200 lib/action.php:393 lib/facebookaction.php:213 msgid "Home" -msgstr "Początek" +msgstr "Strona główna" #: ../actions/profilesettings.php:46 ../actions/register.php:167 #: actions/profilesettings.php:79 actions/register.php:181 @@ -954,17 +1035,17 @@ msgstr "Strona domowa" #: actions/editgroup.php:192 actions/newgroup.php:143 #: actions/profilesettings.php:199 actions/register.php:168 msgid "Homepage is not a valid URL." -msgstr "Adres strony domowej nie jest poprawnym URL-em." +msgstr "Strona domowa nie jest prawidłowym adresem URL." #: ../actions/emailsettings.php:91 actions/emailsettings.php:98 -#: actions/emailsettings.php:173 +#: actions/emailsettings.php:173 actions/emailsettings.php:178 msgid "I want to post notices by email." -msgstr "" +msgstr "Chcę wysyłać wpisy przez e-mail." #: ../lib/settingsaction.php:102 lib/settingsaction.php:96 #: lib/connectsettingsaction.php:104 msgid "IM" -msgstr "" +msgstr "Komunikator" #: ../actions/imsettings.php:60 actions/imsettings.php:61 #: actions/imsettings.php:118 @@ -982,146 +1063,149 @@ msgid "" "If you already have an account, login with your username and password to " "connect it to your OpenID." msgstr "" -"Jeśli już masz konto, zaloguj się używając nazwy użytkownika i hasła, aby " +"Jeśli już masz konto, zaloguj się za pomocą nazwy użytkownika i hasła, aby " "połączyć je ze swoim identyfikatorem OpenID." -#: ../actions/openidsettings.php:45 +#: ../actions/openidsettings.php:45 actions/openidsettings.php:96 msgid "" "If you want to add an OpenID to your account, enter it in the box below and " "click \"Add\"." msgstr "" -"Jeśli chcesz skojarzyć konto OpenID ze swoim lokalnym kontem, wprowadź " -"identyfikator w poniższe pole i kliknij \"Dodaj\"." +"Jeśli chcesz dodać identyfikator OpenID do swojego konta, podaj go w " +"poniższym polu i naciśnij \"Dodaj\"." -#: ../actions/recoverpassword.php:137 +#: ../actions/recoverpassword.php:137 actions/recoverpassword.php:152 msgid "" "If you've forgotten or lost your password, you can get a new one sent to the " "email address you have stored in your account." msgstr "" +"Jeśli zapomniałeś lub zgubiłeś swoje hasło, możesz dostać nowe na adres e-" +"mail, który podałeś." #: ../actions/emailsettings.php:67 ../actions/smssettings.php:76 #: actions/emailsettings.php:68 actions/smssettings.php:76 #: actions/emailsettings.php:127 actions/smssettings.php:140 msgid "Incoming email" -msgstr "" +msgstr "Wiadomości przychodzące" #: ../actions/emailsettings.php:283 actions/emailsettings.php:301 -#: actions/emailsettings.php:443 +#: actions/emailsettings.php:443 actions/emailsettings.php:450 +#: actions/smssettings.php:518 msgid "Incoming email address removed." -msgstr "" +msgstr "Usunięto przychodzący adres e-mail." #: ../actions/password.php:69 actions/profilesettings.php:388 -#: actions/passwordsettings.php:153 +#: actions/passwordsettings.php:153 actions/passwordsettings.php:158 msgid "Incorrect old password" -msgstr "Stare hasło jest niepoprawne" +msgstr "Niepoprawne stare hasło" #: ../actions/login.php:67 actions/login.php:67 actions/facebookhome.php:131 -#: actions/login.php:132 +#: actions/login.php:132 actions/facebookhome.php:130 actions/login.php:114 msgid "Incorrect username or password." -msgstr "Błędna nazwa użytkownika lub hasło." +msgstr "Niepoprawna nazwa użytkownika lub hasło." -#: ../actions/recoverpassword.php:265 +#: ../actions/recoverpassword.php:265 actions/recoverpassword.php:304 msgid "" "Instructions for recovering your password have been sent to the email " "address registered to your account." msgstr "" -"Instrukcje dotyczące przywrócenia hasła zostały wysłane na adres e-mailowy " -"skojarzony z Twoim kontem." +"Instrukcje przywracania hasła zostały wysłane na adres e-mail zarejestrowany " +"z Twoim kontem." #: ../actions/updateprofile.php:114 actions/updateprofile.php:115 -#: actions/updateprofile.php:118 +#: actions/updateprofile.php:118 actions/updateprofile.php:120 #, php-format msgid "Invalid avatar URL '%s'" -msgstr "Błędny URL awatara '%s'" +msgstr "Nieprawidłowy adres URL awatara \"%s\"" #: ../actions/invite.php:55 actions/invite.php:62 actions/invite.php:70 #, php-format msgid "Invalid email address: %s" -msgstr "" +msgstr "Nieprawidłowy adres e-mail: %s" #: ../actions/updateprofile.php:98 actions/updateprofile.php:99 -#: actions/updateprofile.php:102 +#: actions/updateprofile.php:102 actions/updateprofile.php:104 #, php-format msgid "Invalid homepage '%s'" -msgstr "Błędna strona domowa '%s'" +msgstr "Nieprawidłowa strona domowa \"%s\"" #: ../actions/updateprofile.php:82 actions/updateprofile.php:83 -#: actions/updateprofile.php:86 +#: actions/updateprofile.php:86 actions/updateprofile.php:88 #, php-format msgid "Invalid license URL '%s'" -msgstr "Błędny URL licencji '%s'" +msgstr "Nieprawidłowy adres URL licencji \"%s\"" #: ../actions/postnotice.php:61 actions/postnotice.php:62 #: actions/postnotice.php:66 msgid "Invalid notice content" -msgstr "Błędna zawartość wpisu" +msgstr "Nieprawidłowa zawartość wpisu" #: ../actions/postnotice.php:67 actions/postnotice.php:68 #: actions/postnotice.php:72 msgid "Invalid notice uri" -msgstr "Błędny URI wpisu" +msgstr "Nieprawidłowy adres URI wpisu" #: ../actions/postnotice.php:72 actions/postnotice.php:73 #: actions/postnotice.php:77 msgid "Invalid notice url" -msgstr "Błędny URL wpisu" +msgstr "Nieprawidłowy adres URL wpisu" #: ../actions/updateprofile.php:87 actions/updateprofile.php:88 -#: actions/updateprofile.php:91 +#: actions/updateprofile.php:91 actions/updateprofile.php:93 #, php-format msgid "Invalid profile URL '%s'." -msgstr "Błędny URL profilu '%s'." +msgstr "Nieprawidłowy adres URL profilu \"%s\"." #: ../actions/remotesubscribe.php:96 actions/remotesubscribe.php:105 #: actions/remotesubscribe.php:135 msgid "Invalid profile URL (bad format)" -msgstr "Błędny URL profilu (zły format)" +msgstr "Nieprawidłowy adres URL profilu (błędny format)" #: ../actions/finishremotesubscribe.php:77 #: actions/finishremotesubscribe.php:79 actions/finishremotesubscribe.php:80 msgid "Invalid profile URL returned by server." -msgstr "Błędny URL profilu zwrócony przez serwer." +msgstr "Nieprawidłowy adres URL profilu zwrócony przez serwer." #: ../actions/avatarbynickname.php:37 actions/avatarbynickname.php:37 #: actions/avatarbynickname.php:69 msgid "Invalid size." -msgstr "Niepoprawny rozmiar." +msgstr "Nieprawidłowy rozmiar." #: ../actions/finishopenidlogin.php:235 ../actions/register.php:93 #: ../actions/register.php:111 actions/finishopenidlogin.php:241 #: actions/register.php:103 actions/register.php:121 #: actions/finishopenidlogin.php:279 actions/register.php:193 -#: actions/register.php:211 +#: actions/register.php:211 actions/finishopenidlogin.php:284 msgid "Invalid username or password." -msgstr "Błędna nazwa użytkownika lub hasło." +msgstr "Nieprawidłowa nazwa użytkownika lub hasło." #: ../actions/invite.php:79 actions/invite.php:86 actions/invite.php:102 msgid "Invitation(s) sent" -msgstr "" +msgstr "Wysłano zaproszenia" #: ../actions/invite.php:97 actions/invite.php:104 actions/invite.php:136 msgid "Invitation(s) sent to the following people:" -msgstr "" +msgstr "Wysłano zaproszenia do następujących osób:" #: ../lib/util.php:306 lib/util.php:322 lib/facebookaction.php:207 -#: lib/subgroupnav.php:103 +#: lib/subgroupnav.php:103 lib/facebookaction.php:220 msgid "Invite" -msgstr "" +msgstr "Zaproś" #: ../actions/invite.php:123 actions/invite.php:130 actions/invite.php:104 msgid "Invite new users" -msgstr "" +msgstr "Zaproś nowych użytkowników" -#: ../lib/util.php:261 lib/util.php:277 lib/action.php:609 +#: ../lib/util.php:261 lib/util.php:277 lib/action.php:609 lib/action.php:706 #, php-format msgid "" "It runs the [Laconica](http://laconi.ca/) microblogging software, version %" "s, available under the [GNU Affero General Public License](http://www.fsf." "org/licensing/licenses/agpl-3.0.html)." msgstr "" -"Działa pod kontrolą oprogramowania [Laconica](http://laconi.ca/) służącego " -"do prowadzenia mikroblogów, w wersji %s, dostępnego na licencji [GNU Affero " -"General Public License](http://www.fsf.org/licensing/licenses/agpl-3.0.html)." +"Działa pod kontrolą oprogramowania do mikroblogowania [Laconica](http://" +"laconi.ca/) w wersji %s, dostępnego na [Powszechnej Licencji Publicznej GNU " +"Affero](http://www.fsf.org/licensing/licenses/agpl-3.0.html)." #: ../actions/imsettings.php:173 actions/imsettings.php:181 #: actions/imsettings.php:296 @@ -1129,132 +1213,143 @@ msgid "Jabber ID already belongs to another user." msgstr "Identyfikator Jabbera należy już do innego użytkownika." #: ../actions/imsettings.php:62 actions/imsettings.php:63 +#: actions/imsettings.php:120 #, php-format msgid "" "Jabber or GTalk address, like \"UserName@example.org\". First, make sure to " "add %s to your buddy list in your IM client or on GTalk." msgstr "" -"Adres Jabbera lub GTalka w postaci \"Użytkownik@przykladowadomena.org\". Nie " -"zapomnij dodać %s do listy znajomych w swoim komunikatorze lub panelu GTalka." +"Adres Jabbera lub GTalk, taki jak \"NazwaUżytkownika@przykład.org\". " +"Najpierw upewnij się, że dodałeś %s do listy znajomych w komunikatorze lub " +"na GTalk." #: ../actions/profilesettings.php:57 actions/profilesettings.php:90 #: actions/profilesettings.php:128 msgid "Language" -msgstr "" +msgstr "Język" #: ../actions/profilesettings.php:113 actions/profilesettings.php:228 #: actions/profilesettings.php:217 msgid "Language is too long (max 50 chars)." -msgstr "" +msgstr "Język jest za długi (maksymalnie 50 znaków)." #: ../actions/profilesettings.php:52 ../actions/register.php:173 #: actions/profilesettings.php:85 actions/register.php:187 #: actions/profilesettings.php:117 actions/register.php:408 #: actions/showgroup.php:244 actions/showstream.php:271 #: actions/tagother.php:113 lib/groupeditform.php:156 lib/grouplist.php:126 -#: lib/profilelist.php:125 +#: lib/profilelist.php:125 actions/showgroup.php:246 +#: actions/showstream.php:264 actions/tagother.php:112 lib/profilelist.php:123 msgid "Location" -msgstr "Lokalizacja" +msgstr "Położenie" #: ../actions/profilesettings.php:104 ../actions/register.php:85 #: ../actions/updateprofile.php:108 actions/profilesettings.php:219 #: actions/register.php:92 actions/updateprofile.php:109 #: actions/editgroup.php:201 actions/newgroup.php:152 #: actions/profilesettings.php:208 actions/register.php:177 -#: actions/updateprofile.php:112 +#: actions/updateprofile.php:112 actions/updateprofile.php:114 msgid "Location is too long (max 255 chars)." -msgstr "Lokalizacja jest za długa (max. 255 znaków)." +msgstr "Położenie jest za długie (maksymalnie 255 znaków)." #: ../actions/login.php:97 ../actions/login.php:106 #: ../actions/openidlogin.php:68 ../lib/util.php:310 actions/login.php:97 #: actions/login.php:106 actions/openidlogin.php:77 lib/util.php:326 #: actions/facebooklogin.php:93 actions/login.php:186 actions/login.php:239 #: actions/openidlogin.php:112 lib/action.php:335 lib/facebookaction.php:288 -#: lib/facebookaction.php:315 lib/logingroupnav.php:75 +#: lib/facebookaction.php:315 lib/logingroupnav.php:75 actions/login.php:169 +#: actions/login.php:222 actions/openidlogin.php:121 lib/action.php:412 +#: lib/facebookaction.php:293 lib/facebookaction.php:319 #, php-format msgid "Login" -msgstr "Login" +msgstr "Zaloguj się" #: ../actions/openidlogin.php:44 actions/openidlogin.php:52 -#: actions/openidlogin.php:62 +#: actions/openidlogin.php:62 actions/openidlogin.php:70 #, php-format msgid "Login with an [OpenID](%%doc.openid%%) account." -msgstr "Zaloguj się używając konta [OpenID](%%doc.openid%%)." +msgstr "Zaloguj się za pomocą konta [OpenID](%%doc.openid%%)." -#: ../actions/login.php:126 +#: ../actions/login.php:126 actions/login.php:251 #, php-format msgid "" "Login with your username and password. Don't have a username yet? [Register]" "(%%action.register%%) a new account, or try [OpenID](%%action.openidlogin%" "%). " msgstr "" -"Zaloguj się używając nazwy użytkownika i hasła. Nie masz ich jeszcze? " -"[Zarejestruj się](%%action.register%%) i utwórz konto, albo użyj swojego " -"[OpenID](%%action.openidlogin%%)." +"Zaloguj się za pomocą nazwy użytkownika i hasła. Nie masz ich jeszcze? " +"[Zarejestruj](%%action.register%%) nowe konto lub wypróbuj [OpenID](%%action." +"openidlogin%%). " -#: ../lib/util.php:308 lib/util.php:324 lib/action.php:332 +#: ../lib/util.php:308 lib/util.php:324 lib/action.php:332 lib/action.php:409 msgid "Logout" -msgstr "Wyloguj" +msgstr "Wyloguj się" #: ../actions/register.php:166 actions/register.php:180 #: actions/register.php:393 msgid "Longer name, preferably your \"real\" name" -msgstr "" +msgstr "Dłuższa nazwa, najlepiej twoje \"prawdziwe\" nazwisko" #: ../actions/login.php:110 actions/login.php:110 actions/login.php:245 -#: lib/facebookaction.php:320 +#: lib/facebookaction.php:320 actions/login.php:228 lib/facebookaction.php:325 msgid "Lost or forgotten password?" -msgstr "Zgubione hasło?" +msgstr "Zgubione lub zapomniane hasło?" #: ../actions/emailsettings.php:80 ../actions/smssettings.php:89 #: actions/emailsettings.php:81 actions/smssettings.php:89 +#: actions/emailsettings.php:139 actions/smssettings.php:150 msgid "Make a new email address for posting to; cancels the old one." -msgstr "" +msgstr "Używaj nowego adresu e-mail do wysyłania; anuluj stary." #: ../actions/emailsettings.php:27 actions/emailsettings.php:27 #: actions/emailsettings.php:71 #, php-format msgid "Manage how you get email from %%site.name%%." -msgstr "" +msgstr "Zarządzaj, jak otrzymywać wiadomości e-mail od %%site.name%%." #: ../actions/showstream.php:300 actions/showstream.php:315 #: actions/showstream.php:480 msgid "Member since" -msgstr "W serwisie od" +msgstr "Członek od" #: ../actions/userrss.php:70 actions/userrss.php:67 actions/userrss.php:72 #, php-format msgid "Microblog by %s" -msgstr "%s – mikroblog" +msgstr "Mikroblog użytkownika %s" -#: ../actions/smssettings.php:304 +#: ../actions/smssettings.php:304 actions/smssettings.php:464 #, php-format msgid "" "Mobile carrier for your phone. If you know a carrier that accepts SMS over " "email but isn't listed here, send email to let us know at %s." msgstr "" +"Operator komórkowy Twojego telefonu. Jeśli znasz operatora, który akceptuje " +"wiadomości SMS przez e-mail, a nie znajduje się na liście, wyślij wiadomość " +"e-mail na %s (w języku angielskim), aby nam o tym powiedzieć." #: ../actions/finishopenidlogin.php:79 ../actions/register.php:188 #: actions/finishopenidlogin.php:85 actions/register.php:202 #: actions/finishopenidlogin.php:107 actions/register.php:429 +#: actions/register.php:430 msgid "My text and files are available under " -msgstr "Moje teksty i pliki są widoczne pod" +msgstr "Moje teksty i pliki są dostępne na " #: ../actions/emailsettings.php:82 ../actions/smssettings.php:91 #: actions/emailsettings.php:83 actions/smssettings.php:91 #: actions/emailsettings.php:142 actions/smssettings.php:152 msgid "New" -msgstr "" +msgstr "Nowe" #: ../lib/mail.php:144 lib/mail.php:144 lib/mail.php:286 #, php-format msgid "New email address for posting to %s" -msgstr "" +msgstr "Nowy adres e-mail do wysyłania do %s" #: ../actions/emailsettings.php:297 actions/emailsettings.php:315 -#: actions/emailsettings.php:465 +#: actions/emailsettings.php:465 actions/emailsettings.php:472 +#: actions/smssettings.php:542 msgid "New incoming email address added." -msgstr "" +msgstr "Dodano nowy przychodzący adres e-mail." #: ../actions/finishopenidlogin.php:71 actions/finishopenidlogin.php:77 #: actions/finishopenidlogin.php:99 @@ -1272,9 +1367,9 @@ msgstr "Nowy wpis" msgid "New password" msgstr "Nowe hasło" -#: ../actions/recoverpassword.php:314 +#: ../actions/recoverpassword.php:314 actions/recoverpassword.php:361 msgid "New password successfully saved. You are now logged in." -msgstr "Nowe hasło zapisano pomyślnie. Możesz się zalogować." +msgstr "Pomyślnie zapisano nowe hasło. Jesteś teraz zalogowany." #: ../actions/login.php:101 ../actions/profilesettings.php:41 #: ../actions/register.php:151 actions/login.php:101 @@ -1282,7 +1377,9 @@ msgstr "Nowe hasło zapisano pomyślnie. Możesz się zalogować." #: actions/login.php:228 actions/profilesettings.php:98 #: actions/register.php:367 actions/showgroup.php:224 #: actions/showstream.php:251 actions/tagother.php:95 -#: lib/facebookaction.php:308 lib/groupeditform.php:137 +#: lib/facebookaction.php:308 lib/groupeditform.php:137 actions/login.php:211 +#: actions/showgroup.php:226 actions/showstream.php:244 +#: actions/tagother.php:94 lib/facebookaction.php:312 msgid "Nickname" msgstr "Pseudonim" @@ -1293,21 +1390,23 @@ msgstr "Pseudonim" #: actions/newgroup.php:134 actions/profilesettings.php:214 #: actions/register.php:159 msgid "Nickname already in use. Try another one." -msgstr "Ten pseudonim jest już w użyciu. Wybierz inny." +msgstr "Pseudonim jest już używany. Spróbuj innego." #: ../actions/finishopenidlogin.php:165 ../actions/profilesettings.php:88 #: ../actions/register.php:67 ../actions/updateprofile.php:77 #: actions/finishopenidlogin.php:171 actions/profilesettings.php:203 #: actions/register.php:74 actions/updateprofile.php:78 #: actions/finishopenidlogin.php:205 actions/profilesettings.php:192 -#: actions/updateprofile.php:81 +#: actions/updateprofile.php:81 actions/editgroup.php:179 +#: actions/newgroup.php:130 actions/register.php:156 +#: actions/updateprofile.php:83 msgid "Nickname must have only lowercase letters and numbers and no spaces." -msgstr "Pseudonim musi zawierać tylko małe litery i cyfry, bez znaków spacji." +msgstr "Pseudonim może zawierać tylko małe litery i cyfry, bez spacji." #: ../actions/finishopenidlogin.php:170 actions/finishopenidlogin.php:176 #: actions/finishopenidlogin.php:210 msgid "Nickname not allowed." -msgstr "Pseudonim niedozwolony." +msgstr "Niedozwolony pseudonim." #: ../actions/remotesubscribe.php:72 actions/remotesubscribe.php:81 #: actions/remotesubscribe.php:106 @@ -1317,12 +1416,13 @@ msgstr "Pseudonim użytkownika którego chcesz obserwować" #: ../actions/recoverpassword.php:162 actions/recoverpassword.php:167 #: actions/recoverpassword.php:186 msgid "Nickname or email" -msgstr "Pseudonim lub e-mail" +msgstr "Pseudonim lub adres e-mail" #: ../actions/deletenotice.php:59 actions/deletenotice.php:60 #: actions/block.php:147 actions/deletenotice.php:118 +#: actions/deletenotice.php:116 msgid "No" -msgstr "" +msgstr "Nie" #: ../actions/imsettings.php:156 actions/imsettings.php:164 #: actions/imsettings.php:279 @@ -1332,17 +1432,17 @@ msgstr "Brak identyfikatora Jabbera." #: ../actions/userauthorization.php:129 actions/userauthorization.php:136 #: actions/userauthorization.php:153 msgid "No authorization request!" -msgstr "Brak żądania autoryzacji!" +msgstr "Brak żądania upoważnienia!" #: ../actions/smssettings.php:181 actions/smssettings.php:189 #: actions/smssettings.php:299 msgid "No carrier selected." -msgstr "" +msgstr "Nie wybrano operatora." #: ../actions/smssettings.php:316 actions/smssettings.php:324 #: actions/smssettings.php:486 msgid "No code entered" -msgstr "" +msgstr "Nie podano kodu" #: ../actions/confirmaddress.php:33 actions/confirmaddress.php:33 #: actions/confirmaddress.php:75 @@ -1352,27 +1452,29 @@ msgstr "Brak kodu potwierdzającego." #: ../actions/newnotice.php:44 actions/newmessage.php:53 #: actions/newnotice.php:44 classes/Command.php:197 actions/newmessage.php:109 #: actions/newnotice.php:126 classes/Command.php:223 +#: actions/newmessage.php:142 actions/newnotice.php:131 lib/command.php:223 msgid "No content!" msgstr "Brak zawartości!" #: ../actions/emailsettings.php:174 actions/emailsettings.php:192 -#: actions/emailsettings.php:304 +#: actions/emailsettings.php:304 actions/emailsettings.php:311 msgid "No email address." -msgstr "" +msgstr "Brak adresu e-mail." #: ../actions/userbyid.php:32 actions/userbyid.php:32 actions/userbyid.php:70 msgid "No id." msgstr "Brak identyfikatora." #: ../actions/emailsettings.php:271 actions/emailsettings.php:289 -#: actions/emailsettings.php:430 +#: actions/emailsettings.php:430 actions/emailsettings.php:437 +#: actions/smssettings.php:505 msgid "No incoming email address." -msgstr "" +msgstr "Brak przychodzącego adresu e-mail." #: ../actions/finishremotesubscribe.php:65 #: actions/finishremotesubscribe.php:67 actions/finishremotesubscribe.php:68 msgid "No nickname provided by remote server." -msgstr "Zdalny serwer nie wysłał pseudonimu." +msgstr "Zdalny serwer nie dostarczył pseudonimu." #: ../actions/avatarbynickname.php:27 actions/avatarbynickname.php:27 #: actions/avatarbynickname.php:59 actions/leavegroup.php:81 @@ -1383,24 +1485,24 @@ msgstr "Brak pseudonimu." #: ../actions/smssettings.php:229 actions/emailsettings.php:240 #: actions/imsettings.php:214 actions/smssettings.php:237 #: actions/emailsettings.php:363 actions/imsettings.php:345 -#: actions/smssettings.php:358 +#: actions/smssettings.php:358 actions/emailsettings.php:370 msgid "No pending confirmation to cancel." msgstr "Brak oczekujących potwierdzeń do anulowania." #: ../actions/smssettings.php:176 actions/smssettings.php:184 #: actions/smssettings.php:294 msgid "No phone number." -msgstr "" +msgstr "Brak numeru telefonu." #: ../actions/finishremotesubscribe.php:72 #: actions/finishremotesubscribe.php:74 actions/finishremotesubscribe.php:75 msgid "No profile URL returned by server." -msgstr "Serwer nie zwrócił żadnego URL-a." +msgstr "Serwer nie zwrócił adresu URL profilu." #: ../actions/recoverpassword.php:226 actions/recoverpassword.php:232 #: actions/recoverpassword.php:266 msgid "No registered email address for that user." -msgstr "Brak zarejestrowanych adresów e-mailowych dla tego użytkownika." +msgstr "Brak zarejestrowanych adresów e-mail dla tego użytkownika." #: ../actions/userauthorization.php:49 actions/userauthorization.php:55 #: actions/userauthorization.php:57 @@ -1410,51 +1512,52 @@ msgstr "Nie znaleziono żądania!" #: ../actions/noticesearch.php:64 ../actions/peoplesearch.php:64 #: actions/noticesearch.php:69 actions/peoplesearch.php:69 #: actions/groupsearch.php:81 actions/noticesearch.php:104 -#: actions/peoplesearch.php:85 +#: actions/peoplesearch.php:85 actions/noticesearch.php:117 msgid "No results" msgstr "Brak wyników" #: ../actions/avatarbynickname.php:32 actions/avatarbynickname.php:32 #: actions/avatarbynickname.php:64 msgid "No size." -msgstr "Zerowy rozmiar." +msgstr "Brak rozmiaru." #: ../actions/twitapistatuses.php:595 actions/twitapifavorites.php:136 #: actions/twitapistatuses.php:520 actions/twitapifavorites.php:112 -#: actions/twitapistatuses.php:446 +#: actions/twitapistatuses.php:446 actions/twitapifavorites.php:118 +#: actions/twitapistatuses.php:470 msgid "No status found with that ID." -msgstr "" +msgstr "Nie znaleziono statusów z tym identyfikatorem." #: ../actions/twitapistatuses.php:555 actions/twitapistatuses.php:478 -#: actions/twitapistatuses.php:418 +#: actions/twitapistatuses.php:418 actions/twitapistatuses.php:442 msgid "No status with that ID found." -msgstr "" +msgstr "Nie znaleziono statusów z tym identyfikatorem." #: ../actions/openidsettings.php:135 actions/openidsettings.php:144 #: actions/openidsettings.php:222 msgid "No such OpenID." -msgstr "Brak takiego identyfikatora OpenID." +msgstr "Nie ma takiego identyfikatora OpenID." #: ../actions/doc.php:29 actions/doc.php:29 actions/doc.php:64 msgid "No such document." -msgstr "Brak takiego dokumentu." +msgstr "Nie ma takiego dokumentu." #: ../actions/shownotice.php:32 ../actions/shownotice.php:83 #: ../lib/deleteaction.php:30 actions/shownotice.php:32 #: actions/shownotice.php:83 lib/deleteaction.php:30 actions/shownotice.php:87 #: lib/deleteaction.php:51 msgid "No such notice." -msgstr "Brak takiego wpisu." +msgstr "Nie ma takiego wpisu." #: ../actions/recoverpassword.php:56 actions/recoverpassword.php:56 #: actions/recoverpassword.php:62 msgid "No such recovery code." -msgstr "Brak takiego kodu przywracania." +msgstr "Nie ma takiego kodu przywracania." #: ../actions/postnotice.php:56 actions/postnotice.php:57 #: actions/postnotice.php:60 msgid "No such subscription" -msgstr "Nie ma takiej obserwacji" +msgstr "Nie ma takiej subskrypcji" #: ../actions/all.php:34 ../actions/allrss.php:35 #: ../actions/avatarbynickname.php:43 ../actions/foaf.php:40 @@ -1480,14 +1583,16 @@ msgstr "Nie ma takiej obserwacji" #: actions/usergroups.php:92 actions/userrss.php:38 actions/xrds.php:73 #: classes/Command.php:140 classes/Command.php:185 classes/Command.php:234 #: classes/Command.php:271 lib/galleryaction.php:60 lib/mailbox.php:82 -#: lib/subs.php:34 lib/subs.php:109 +#: lib/subs.php:34 lib/subs.php:109 actions/all.php:56 actions/allrss.php:68 +#: actions/favoritesrss.php:74 lib/command.php:140 lib/command.php:185 +#: lib/command.php:234 lib/command.php:271 lib/mailbox.php:84 msgid "No such user." msgstr "Brak takiego użytkownika." #: ../actions/recoverpassword.php:211 actions/recoverpassword.php:217 #: actions/recoverpassword.php:251 msgid "No user with that email address or username." -msgstr "" +msgstr "Brak użytkownika z tym adresem e-mail lub nazwą użytkownika." #: ../lib/gallery.php:80 lib/gallery.php:85 msgid "Nobody to show!" @@ -1501,64 +1606,66 @@ msgstr "To nie jest kod przywracania." #: ../scripts/maildaemon.php:50 scripts/maildaemon.php:50 #: scripts/maildaemon.php:53 msgid "Not a registered user." -msgstr "" +msgstr "To nie jest zarejestrowany użytkownik." #: ../lib/twitterapi.php:226 ../lib/twitterapi.php:247 #: ../lib/twitterapi.php:332 lib/twitterapi.php:391 lib/twitterapi.php:418 #: lib/twitterapi.php:502 lib/twitterapi.php:448 lib/twitterapi.php:476 -#: lib/twitterapi.php:566 +#: lib/twitterapi.php:566 lib/twitterapi.php:483 lib/twitterapi.php:511 +#: lib/twitterapi.php:601 msgid "Not a supported data format." -msgstr "" +msgstr "To nie jest obsługiwany format danych." #: ../actions/imsettings.php:167 actions/imsettings.php:175 #: actions/imsettings.php:290 msgid "Not a valid Jabber ID" -msgstr "Niepoprawny identyfikator Jabbera" +msgstr "To nie jest prawidłowy identyfikator Jabbera" #: ../lib/openid.php:131 lib/openid.php:131 lib/openid.php:140 +#: lib/openid.php:143 msgid "Not a valid OpenID." -msgstr "Niepoprawny identyfikator OpenID." +msgstr "To nie jest prawidłowy identyfikator OpenID." #: ../actions/emailsettings.php:185 actions/emailsettings.php:203 -#: actions/emailsettings.php:315 +#: actions/emailsettings.php:315 actions/emailsettings.php:322 msgid "Not a valid email address" -msgstr "" +msgstr "To nie jest prawidłowy adres e-mail" #: ../actions/register.php:63 actions/register.php:70 actions/register.php:152 msgid "Not a valid email address." -msgstr "Niewłaściwy adres e-mailowy." +msgstr "To nie jest prawidłowy adres e-mail." #: ../actions/profilesettings.php:91 ../actions/register.php:71 #: actions/profilesettings.php:206 actions/register.php:78 #: actions/editgroup.php:186 actions/newgroup.php:137 #: actions/profilesettings.php:195 actions/register.php:161 msgid "Not a valid nickname." -msgstr "Niewłaściwy pseudonim." +msgstr "To nie jest prawidłowy pseudonim." #: ../actions/remotesubscribe.php:120 actions/remotesubscribe.php:129 #: actions/remotesubscribe.php:159 msgid "Not a valid profile URL (incorrect services)." -msgstr "Błędny URL profilu (niepoprawne usługi)" +msgstr "To nie jest prawidłowy adres URL profilu (niepoprawne usługi)." #: ../actions/remotesubscribe.php:113 actions/remotesubscribe.php:122 #: actions/remotesubscribe.php:152 msgid "Not a valid profile URL (no XRDS defined)." -msgstr "Błędny URL profilu (nie zdefiniowany XRDS)" +msgstr "To nie jest prawidłowy adres URL profilu (nie podano XRDS)." #: ../actions/remotesubscribe.php:104 actions/remotesubscribe.php:113 #: actions/remotesubscribe.php:143 msgid "Not a valid profile URL (no YADIS document)." -msgstr "Błędny URL profilu (brak dokumentu YADIS)" +msgstr "To nie jest prawidłowy adres URL profilu (brak dokumentu YADIS)." #: ../actions/avatar.php:95 actions/profilesettings.php:332 -#: lib/imagefile.php:87 +#: lib/imagefile.php:87 lib/imagefile.php:90 msgid "Not an image or corrupt file." -msgstr "Brak obrazka lub plik uszkodzony." +msgstr "To nie jest obraz lub lub plik jest uszkodzony." #: ../actions/finishremotesubscribe.php:51 #: actions/finishremotesubscribe.php:53 actions/finishremotesubscribe.php:54 msgid "Not authorized." -msgstr "Brak autoryzacji." +msgstr "Brak upoważnienia." #: ../actions/finishremotesubscribe.php:38 #: actions/finishremotesubscribe.php:38 actions/finishremotesubscribe.php:40 @@ -1566,9 +1673,9 @@ msgid "Not expecting this response!" msgstr "Nieoczekiwana odpowiedź!" #: ../actions/twitapistatuses.php:422 actions/twitapistatuses.php:361 -#: actions/twitapistatuses.php:309 +#: actions/twitapistatuses.php:309 actions/twitapistatuses.php:327 msgid "Not found" -msgstr "" +msgstr "Nie znaleziono" #: ../actions/finishaddopenid.php:29 ../actions/logout.php:33 #: ../actions/newnotice.php:29 ../actions/subscribe.php:28 @@ -1582,18 +1689,18 @@ msgstr "" #: actions/newmessage.php:83 actions/newnotice.php:90 actions/nudge.php:63 #: actions/subedit.php:31 actions/subscribe.php:30 actions/unblock.php:60 #: actions/unsubscribe.php:27 lib/deleteaction.php:66 -#: lib/settingsaction.php:72 +#: lib/settingsaction.php:72 actions/newmessage.php:87 msgid "Not logged in." msgstr "Niezalogowany." #: ../lib/subs.php:91 lib/subs.php:104 lib/subs.php:122 msgid "Not subscribed!." -msgstr "Nie obserwujesz!." +msgstr "Nie zasubskrybowane!" #: ../actions/opensearch.php:35 actions/opensearch.php:35 #: actions/opensearch.php:67 msgid "Notice Search" -msgstr "" +msgstr "Wyszukiwanie wpisów" #: ../actions/showstream.php:82 actions/showstream.php:82 #: actions/showstream.php:180 actions/showstream.php:187 @@ -1605,19 +1712,19 @@ msgstr "Kanał wpisów dla %s" #: ../actions/shownotice.php:39 actions/shownotice.php:39 #: actions/shownotice.php:94 msgid "Notice has no profile" -msgstr "Wpis nie ma przypisanego profilu" +msgstr "Wpis nie posiada profilu" #: ../actions/showstream.php:316 actions/showstream.php:331 #: actions/showstream.php:504 lib/facebookaction.php:477 lib/mailbox.php:116 -#: lib/noticelist.php:87 +#: lib/noticelist.php:87 lib/facebookaction.php:581 lib/mailbox.php:118 msgid "Notices" msgstr "Wpisy" #: ../actions/tag.php:35 ../actions/tag.php:81 actions/tag.php:35 -#: actions/tag.php:81 actions/tag.php:41 +#: actions/tag.php:81 actions/tag.php:41 actions/tag.php:49 #, php-format msgid "Notices tagged with %s" -msgstr "" +msgstr "Wpisy ze znacznikiem %s" #: ../actions/password.php:39 actions/profilesettings.php:178 #: actions/passwordsettings.php:97 @@ -1626,7 +1733,7 @@ msgstr "Stare hasło" #: ../lib/settingsaction.php:96 ../lib/util.php:314 lib/settingsaction.php:90 #: lib/util.php:330 lib/accountsettingsaction.php:116 lib/action.php:341 -#: lib/logingroupnav.php:81 +#: lib/logingroupnav.php:81 lib/action.php:418 msgid "OpenID" msgstr "OpenID" @@ -1636,39 +1743,43 @@ msgid "OpenID Account Setup" msgstr "Ustawienia konta OpenID" #: ../lib/openid.php:180 lib/openid.php:180 lib/openid.php:266 +#: lib/openid.php:269 msgid "OpenID Auto-Submit" -msgstr "Automatyczne zatwierdzanie OpenID" +msgstr "Automatyczne wysłanie OpenID" #: ../actions/finishaddopenid.php:99 ../actions/finishopenidlogin.php:140 #: ../actions/openidlogin.php:60 actions/finishaddopenid.php:99 #: actions/finishopenidlogin.php:146 actions/openidlogin.php:68 #: actions/finishaddopenid.php:170 actions/openidlogin.php:80 +#: actions/openidlogin.php:89 msgid "OpenID Login" -msgstr "Użytkownik OpenID" +msgstr "Login OpenID" #: ../actions/openidlogin.php:65 ../actions/openidsettings.php:49 #: actions/openidlogin.php:74 actions/openidsettings.php:50 #: actions/openidlogin.php:102 actions/openidsettings.php:101 +#: actions/openidlogin.php:111 msgid "OpenID URL" -msgstr "URL usługi OpenID" +msgstr "Adres URL identyfikatora OpenID" #: ../actions/finishaddopenid.php:42 ../actions/finishopenidlogin.php:103 #: actions/finishaddopenid.php:42 actions/finishopenidlogin.php:109 #: actions/finishaddopenid.php:88 actions/finishopenidlogin.php:130 msgid "OpenID authentication cancelled." -msgstr "Uwiarygadnianie OpenID przerwane." +msgstr "Anulowano uwierzytelnienie OpenID." #: ../actions/finishaddopenid.php:46 ../actions/finishopenidlogin.php:107 #: actions/finishaddopenid.php:46 actions/finishopenidlogin.php:113 #: actions/finishaddopenid.php:92 actions/finishopenidlogin.php:134 #, php-format msgid "OpenID authentication failed: %s" -msgstr "Uwiarygadnianie OpenID nie powiodło się: %s" +msgstr "Uwierzytelnienie OpenID nie powiodło się: %s" #: ../lib/openid.php:133 lib/openid.php:133 lib/openid.php:142 +#: lib/openid.php:145 #, php-format msgid "OpenID failure: %s" -msgstr "Awaria OpenID: %s" +msgstr "Niepowodzenie OpenID: %s" #: ../actions/openidsettings.php:144 actions/openidsettings.php:153 #: actions/openidsettings.php:231 @@ -1681,13 +1792,14 @@ msgid "OpenID settings" msgstr "Ustawienia OpenID" #: ../actions/invite.php:135 actions/invite.php:143 actions/invite.php:180 +#: actions/invite.php:186 msgid "Optionally add a personal message to the invitation." -msgstr "" +msgstr "Opcjonalnie dodaj osobistą wiadomość do zaproszenia." #: ../actions/avatar.php:84 actions/profilesettings.php:321 -#: lib/imagefile.php:75 +#: lib/imagefile.php:75 lib/imagefile.php:79 msgid "Partial upload." -msgstr "Częściowa wysyłka." +msgstr "Częściowo wysłano." #: ../actions/finishopenidlogin.php:90 ../actions/login.php:102 #: ../actions/register.php:153 ../lib/settingsaction.php:93 @@ -1695,63 +1807,68 @@ msgstr "Częściowa wysyłka." #: actions/register.php:167 actions/finishopenidlogin.php:118 #: actions/login.php:231 actions/register.php:372 #: lib/accountsettingsaction.php:110 lib/facebookaction.php:311 +#: actions/login.php:214 lib/facebookaction.php:315 msgid "Password" msgstr "Hasło" #: ../actions/recoverpassword.php:288 actions/recoverpassword.php:301 #: actions/recoverpassword.php:335 msgid "Password and confirmation do not match." -msgstr "Hasło i jego potwierdzenie nie pasują do siebie." +msgstr "Hasło i potwierdzenie nie pasują do siebie." #: ../actions/recoverpassword.php:284 actions/recoverpassword.php:297 #: actions/recoverpassword.php:331 msgid "Password must be 6 chars or more." -msgstr "Hasło musi mieć 6 lub więcej znaków." +msgstr "Hasło musi mieć sześć lub więcej znaków." #: ../actions/recoverpassword.php:261 ../actions/recoverpassword.php:263 #: actions/recoverpassword.php:267 actions/recoverpassword.php:269 #: actions/recoverpassword.php:199 actions/recoverpassword.php:301 msgid "Password recovery requested" -msgstr "Zażądano odzyskania hasła" +msgstr "Zażądano przywracania hasła" #: ../actions/password.php:89 ../actions/recoverpassword.php:313 #: actions/profilesettings.php:408 actions/recoverpassword.php:326 #: actions/passwordsettings.php:173 actions/recoverpassword.php:200 +#: actions/passwordsettings.php:178 msgid "Password saved." -msgstr "Hasło zostało zapisane." +msgstr "Zapisano hasło." #: ../actions/password.php:61 ../actions/register.php:88 #: actions/profilesettings.php:380 actions/register.php:98 #: actions/passwordsettings.php:145 actions/register.php:183 +#: actions/passwordsettings.php:150 msgid "Passwords don't match." -msgstr "Podane hasła nie pasują do siebie." +msgstr "Hasła nie pasują do siebie." #: ../lib/searchaction.php:100 lib/searchaction.php:100 #: lib/searchgroupnav.php:80 msgid "People" -msgstr "" +msgstr "Osoby" #: ../actions/opensearch.php:33 actions/opensearch.php:33 #: actions/opensearch.php:64 msgid "People Search" -msgstr "" +msgstr "Wyszukiwanie osób" #: ../actions/peoplesearch.php:33 actions/peoplesearch.php:33 #: actions/peoplesearch.php:58 msgid "People search" -msgstr "Szukaj ludzi" +msgstr "Wyszukiwanie osób" #: ../lib/stream.php:50 lib/personal.php:50 lib/personalgroupnav.php:98 msgid "Personal" msgstr "Osobiste" #: ../actions/invite.php:133 actions/invite.php:141 actions/invite.php:178 +#: actions/invite.php:184 msgid "Personal message" -msgstr "" +msgstr "Osobista wiadomość" #: ../actions/smssettings.php:69 actions/smssettings.php:69 +#: actions/smssettings.php:128 msgid "Phone number, no punctuation or spaces, with area code" -msgstr "" +msgstr "Numer telefonu, bez znaków przestankowych i spacji, z kodem państwa" #: ../actions/userauthorization.php:78 msgid "" @@ -1759,21 +1876,20 @@ msgid "" "user's notices. If you didn't just ask to subscribe to someone's notices, " "click \"Cancel\"." msgstr "" -"Sprawdź proszę poniższe informacje, aby upewnić się czy na pewno chcesz " -"obserwować wpisy tego użytkownika. Jeżeli to pomyłka lub chodziło o kogoś " -"innego kliknij \"Anuluj\"." +"Sprawdź te szczegóły, aby upewnić się, czy chcesz subskrybować wpisy tego " +"użytkownika. Jeśli nie chcesz, po prostu naciśnij \"Anuluj\"." #: ../actions/imsettings.php:73 actions/imsettings.php:74 #: actions/imsettings.php:142 msgid "Post a notice when my Jabber/GTalk status changes." -msgstr "Utwórz wpis kiedy zmieni się status na komunikatorze." +msgstr "Wyślij wpis, kiedy zmieni się mój status na Jabberze/GTalk." #: ../actions/emailsettings.php:85 ../actions/imsettings.php:67 #: ../actions/smssettings.php:94 actions/emailsettings.php:86 #: actions/imsettings.php:68 actions/smssettings.php:94 #: actions/twittersettings.php:70 actions/emailsettings.php:147 #: actions/imsettings.php:133 actions/smssettings.php:157 -#: actions/twittersettings.php:134 +#: actions/twittersettings.php:134 actions/twittersettings.php:137 msgid "Preferences" msgstr "Preferencje" @@ -1782,22 +1898,24 @@ msgstr "Preferencje" #: actions/imsettings.php:152 actions/smssettings.php:171 #: actions/emailsettings.php:286 actions/imsettings.php:258 #: actions/othersettings.php:168 actions/smssettings.php:272 +#: actions/emailsettings.php:293 msgid "Preferences saved." -msgstr "Preferencje zostały zapisane." +msgstr "Zapisano preferencje." #: ../actions/profilesettings.php:57 actions/profilesettings.php:90 #: actions/profilesettings.php:129 msgid "Preferred language" -msgstr "" +msgstr "Preferowany język" -#: ../lib/util.php:328 lib/util.php:344 lib/action.php:572 +#: ../lib/util.php:328 lib/util.php:344 lib/action.php:572 lib/action.php:665 msgid "Privacy" msgstr "Prywatność" #: ../classes/Notice.php:95 ../classes/Notice.php:106 classes/Notice.php:109 #: classes/Notice.php:119 classes/Notice.php:145 classes/Notice.php:155 +#: classes/Notice.php:178 classes/Notice.php:188 msgid "Problem saving notice." -msgstr "Problem z zachowywaniem wpisu." +msgstr "Problem podczas zapisywania wpisu." #: ../lib/settingsaction.php:84 ../lib/stream.php:60 lib/personal.php:60 #: lib/settingsaction.php:84 lib/accountsettingsaction.php:104 @@ -1808,7 +1926,7 @@ msgstr "Profil" #: ../actions/remotesubscribe.php:73 actions/remotesubscribe.php:82 #: actions/remotesubscribe.php:109 msgid "Profile URL" -msgstr "URL profilu" +msgstr "Adres URL profilu" #: ../actions/profilesettings.php:34 actions/profilesettings.php:32 #: actions/profilesettings.php:58 @@ -1818,32 +1936,33 @@ msgstr "Ustawienia profilu" #: ../actions/postnotice.php:51 ../actions/updateprofile.php:52 #: actions/postnotice.php:52 actions/updateprofile.php:53 #: actions/postnotice.php:55 actions/updateprofile.php:56 +#: actions/updateprofile.php:58 msgid "Profile unknown" msgstr "Nieznany profil" #: ../actions/public.php:54 actions/public.php:54 actions/public.php:124 msgid "Public Stream Feed" -msgstr "Publiczny Kanał Strumieni" +msgstr "Kanał publicznego strumienia" #: ../actions/public.php:33 actions/public.php:33 actions/public.php:109 -#: lib/publicgroupnav.php:77 +#: lib/publicgroupnav.php:77 actions/public.php:112 lib/publicgroupnav.php:79 msgid "Public timeline" msgstr "Publiczna oś czasu" #: ../actions/imsettings.php:79 actions/imsettings.php:80 #: actions/imsettings.php:153 msgid "Publish a MicroID for my Jabber/GTalk address." -msgstr "" +msgstr "Opublikuj MicroID adresu Jabbera/GTalk." #: ../actions/emailsettings.php:94 actions/emailsettings.php:101 -#: actions/emailsettings.php:178 +#: actions/emailsettings.php:178 actions/emailsettings.php:183 msgid "Publish a MicroID for my email address." -msgstr "" +msgstr "Opublikuj MicroID adresu e-mail." #: ../actions/tag.php:75 ../actions/tag.php:76 actions/tag.php:75 #: actions/tag.php:76 msgid "Recent Tags" -msgstr "" +msgstr "Ostatnie znaczniki" #: ../actions/recoverpassword.php:166 actions/recoverpassword.php:171 #: actions/recoverpassword.php:190 @@ -1853,29 +1972,30 @@ msgstr "Przywróć" #: ../actions/recoverpassword.php:156 actions/recoverpassword.php:161 #: actions/recoverpassword.php:198 msgid "Recover password" -msgstr "Odzyskiwanie hasła" +msgstr "Przywróć hasło" #: ../actions/recoverpassword.php:67 actions/recoverpassword.php:67 #: actions/recoverpassword.php:73 msgid "Recovery code for unknown user." -msgstr "Kod przywracający dla nieznanego użytkownika." +msgstr "Kod przywracania dla nieznanego użytkownika." #: ../actions/register.php:142 ../actions/register.php:193 ../lib/util.php:312 #: actions/register.php:152 actions/register.php:207 lib/util.php:328 #: actions/register.php:69 actions/register.php:436 lib/action.php:338 #: lib/facebookaction.php:277 lib/logingroupnav.php:78 +#: actions/register.php:438 lib/action.php:415 lib/facebookaction.php:279 msgid "Register" -msgstr "Zarejestruj" +msgstr "Zarejestruj się" #: ../actions/register.php:28 actions/register.php:28 #: actions/finishopenidlogin.php:196 actions/register.php:90 msgid "Registration not allowed." -msgstr "" +msgstr "Rejestracja nie jest dozwolona." #: ../actions/register.php:200 actions/register.php:214 #: actions/register.php:67 msgid "Registration successful" -msgstr "" +msgstr "Rejestracja powiodła się" #: ../actions/userauthorization.php:120 actions/userauthorization.php:127 #: actions/userauthorization.php:144 @@ -1884,19 +2004,19 @@ msgstr "Odrzuć" #: ../actions/login.php:103 ../actions/register.php:176 actions/login.php:103 #: actions/register.php:190 actions/login.php:234 actions/openidlogin.php:107 -#: actions/register.php:414 +#: actions/register.php:414 actions/login.php:217 actions/openidlogin.php:116 msgid "Remember me" -msgstr "Pamiętaj mnie" +msgstr "Zapamiętaj mnie" #: ../actions/updateprofile.php:70 actions/updateprofile.php:71 -#: actions/updateprofile.php:74 +#: actions/updateprofile.php:74 actions/updateprofile.php:76 msgid "Remote profile with no matching profile" -msgstr "Zdalny profil bez odpowiadającego profilu lokalnego" +msgstr "Zdalny profil bez odpowiadającego profilu" #: ../actions/remotesubscribe.php:65 actions/remotesubscribe.php:73 #: actions/remotesubscribe.php:88 msgid "Remote subscribe" -msgstr "Zdalna subskrypcja" +msgstr "Zasubskrybuj zdalnie" #: ../actions/emailsettings.php:47 ../actions/emailsettings.php:75 #: ../actions/imsettings.php:48 ../actions/openidsettings.php:106 @@ -1908,21 +2028,22 @@ msgstr "Zdalna subskrypcja" #: actions/emailsettings.php:134 actions/imsettings.php:102 #: actions/openidsettings.php:166 actions/smssettings.php:103 #: actions/smssettings.php:146 actions/twittersettings.php:115 +#: actions/twittersettings.php:118 msgid "Remove" msgstr "Usuń" #: ../actions/openidsettings.php:68 actions/openidsettings.php:69 #: actions/openidsettings.php:123 msgid "Remove OpenID" -msgstr "Usuń konto OpenID" +msgstr "Usuń identyfikator OpenID" -#: ../actions/openidsettings.php:73 +#: ../actions/openidsettings.php:73 actions/openidsettings.php:128 msgid "" "Removing your only OpenID would make it impossible to log in! If you need to " "remove it, add another OpenID first." msgstr "" -"Usunięcie jedynego konta OpenID uniemożliwi dalsze logowanie! Jeśli musisz " -"je usunąć dodaj wcześniej jakieś inne." +"Usunięcie jedynego identyfikatora OpenID uniemożliwi zalogowanie się! Jeśli " +"musisz je usunąć, dodaj najpierw inne." #: ../lib/stream.php:55 lib/personal.php:55 lib/personalgroupnav.php:103 msgid "Replies" @@ -1931,7 +2052,7 @@ msgstr "Odpowiedzi" #: ../actions/replies.php:47 ../actions/repliesrss.php:76 ../lib/stream.php:56 #: actions/replies.php:47 actions/repliesrss.php:62 lib/personal.php:56 #: actions/replies.php:116 actions/repliesrss.php:67 -#: lib/personalgroupnav.php:104 +#: lib/personalgroupnav.php:104 actions/replies.php:118 #, php-format msgid "Replies to %s" msgstr "Odpowiedzi na %s" @@ -1939,41 +2060,42 @@ msgstr "Odpowiedzi na %s" #: ../actions/recoverpassword.php:183 actions/recoverpassword.php:189 #: actions/recoverpassword.php:223 msgid "Reset" -msgstr "Wyzeruj" +msgstr "Przywróć" #: ../actions/recoverpassword.php:173 actions/recoverpassword.php:178 #: actions/recoverpassword.php:197 msgid "Reset password" -msgstr "Ustaw ponownie hasło" +msgstr "Przywróć hasło" #: ../lib/settingsaction.php:99 lib/settingsaction.php:93 #: actions/subscriptions.php:123 lib/connectsettingsaction.php:107 +#: actions/subscriptions.php:125 msgid "SMS" -msgstr "" +msgstr "SMS" #: ../actions/smssettings.php:67 actions/smssettings.php:67 #: actions/smssettings.php:126 msgid "SMS Phone number" -msgstr "" +msgstr "Numer telefonu SMS" #: ../actions/smssettings.php:33 actions/smssettings.php:33 #: actions/smssettings.php:58 msgid "SMS Settings" -msgstr "" +msgstr "Ustawienia SMS" -#: ../lib/mail.php:219 lib/mail.php:225 lib/mail.php:437 +#: ../lib/mail.php:219 lib/mail.php:225 lib/mail.php:437 lib/mail.php:438 msgid "SMS confirmation" -msgstr "" +msgstr "Potwierdzenie SMS" #: ../actions/recoverpassword.php:182 actions/recoverpassword.php:188 #: actions/recoverpassword.php:222 msgid "Same as password above" -msgstr "Takie samo jak hasło wprowadzone powyżej" +msgstr "Takie samo jak powyższe hasło" #: ../actions/register.php:156 actions/register.php:170 #: actions/register.php:377 msgid "Same as password above. Required." -msgstr "" +msgstr "Takie samo jak powyższe hasło. Wymagane." #: ../actions/emailsettings.php:97 ../actions/imsettings.php:81 #: ../actions/profilesettings.php:67 ../actions/smssettings.php:100 @@ -1984,48 +2106,51 @@ msgstr "" #: actions/othersettings.php:117 actions/profilesettings.php:150 #: actions/smssettings.php:169 actions/subscriptions.php:124 #: actions/tagother.php:152 actions/twittersettings.php:161 -#: lib/groupeditform.php:171 +#: lib/groupeditform.php:171 actions/emailsettings.php:187 +#: actions/subscriptions.php:126 actions/tagother.php:154 +#: actions/twittersettings.php:164 msgid "Save" msgstr "Zapisz" #: ../lib/searchaction.php:84 ../lib/util.php:300 lib/searchaction.php:84 -#: lib/util.php:316 lib/action.php:325 +#: lib/util.php:316 lib/action.php:325 lib/action.php:396 msgid "Search" -msgstr "Szukaj" +msgstr "Znajdź" #: ../actions/noticesearch.php:80 actions/noticesearch.php:85 #: actions/noticesearch.php:127 msgid "Search Stream Feed" -msgstr "Szukaj Kanału Strumieni" +msgstr "Znajdź kanał strumienia" #: ../actions/noticesearch.php:30 actions/noticesearch.php:30 -#: actions/noticesearch.php:57 +#: actions/noticesearch.php:57 actions/noticesearch.php:68 #, php-format msgid "" "Search for notices on %%site.name%% by their contents. Separate search terms " "by spaces; they must be 3 characters or more." msgstr "" -"Wyszukiwanie w treści wpisów w serwisie %%site.name%%. Użyj spacji aby " -"oddzielić elementy wyszukiwania. Słowa muszą mieć minimum 3 znaki." +"Znajdź wpisy na %%site.name%% według ich zawartości. Oddziel wyszukiwane " +"terminy spacjami. Terminy muszą mieć trzy znaki lub więcej." -#: ../actions/peoplesearch.php:28 +#: ../actions/peoplesearch.php:28 actions/peoplesearch.php:52 #, php-format msgid "" "Search for people on %%site.name%% by their name, location, or interests. " "Separate the terms by spaces; they must be 3 characters or more." msgstr "" -"Szukaj ludzi w serwisie %%site.name%%. Kryteriami mogą być imiona i " -"nazwiska, miejscowości lub zainteresowania. Użyj spacji aby oddzielić " -"elementy wyszukiwania. Słowa muszą mieć minimum 3 znaki." +"Znajdź osoby na %%site.name%% według ich nazwiska, położenia lub " +"zainteresowań. Oddziel wyszukiwane terminy spacjami. Terminy muszą mieć trzy " +"znaki lub więcej." #: ../actions/smssettings.php:296 actions/smssettings.php:304 #: actions/smssettings.php:457 msgid "Select a carrier" -msgstr "" +msgstr "Wybierz operatora" #: ../actions/invite.php:137 ../lib/util.php:1172 actions/invite.php:145 #: lib/util.php:1306 lib/util.php:1731 actions/invite.php:182 -#: lib/messageform.php:167 lib/noticeform.php:177 +#: lib/messageform.php:167 lib/noticeform.php:177 actions/invite.php:189 +#: lib/messageform.php:165 msgid "Send" msgstr "Wyślij" @@ -2033,45 +2158,51 @@ msgstr "Wyślij" #: actions/emailsettings.php:74 actions/smssettings.php:82 #: actions/emailsettings.php:132 actions/smssettings.php:145 msgid "Send email to this address to post new notices." -msgstr "" +msgstr "Wyślij wiadomość e-mail na ten adres, aby wysyłać nowe wpisy." #: ../actions/emailsettings.php:88 actions/emailsettings.php:89 #: actions/emailsettings.php:152 msgid "Send me notices of new subscriptions through email." -msgstr "" +msgstr "Wyślij mi wpisy nowych subskrypcji przez e-mail." #: ../actions/imsettings.php:70 actions/imsettings.php:71 #: actions/imsettings.php:137 msgid "Send me notices through Jabber/GTalk." -msgstr "Wysyłaj mi wpisy przez Jabbera/GTalka" +msgstr "Wyślij mi wpisy przez Jabbera/GTalk." #: ../actions/smssettings.php:97 actions/smssettings.php:97 +#: actions/smssettings.php:162 msgid "" "Send me notices through SMS; I understand I may incur exorbitant charges " "from my carrier." msgstr "" +"Wyślij mi wpisy przez SMS. Rozumiem, że mogę otrzymywać większe rachunki od " +"swojego operatora." #: ../actions/imsettings.php:76 actions/imsettings.php:77 +#: actions/imsettings.php:147 msgid "Send me replies through Jabber/GTalk from people I'm not subscribed to." msgstr "" +"Wyślij mi odpowiedzi przez Jabbera/GTalk od osób, których nie subskrybuję." #: ../lib/util.php:304 lib/util.php:320 lib/facebookaction.php:215 +#: lib/facebookaction.php:228 msgid "Settings" msgstr "Ustawienia" #: ../actions/profilesettings.php:192 actions/profilesettings.php:307 #: actions/profilesettings.php:319 msgid "Settings saved." -msgstr "Ustawienia zostały zapisane." +msgstr "Zapisano ustawienia." #: ../actions/tag.php:60 actions/tag.php:60 msgid "Showing most popular tags from the last week" -msgstr "" +msgstr "Wyświetlanie najpopularniejszych znaczników od ostatniego tygodnia" #: ../actions/finishaddopenid.php:66 actions/finishaddopenid.php:66 #: actions/finishaddopenid.php:114 msgid "Someone else already has this OpenID." -msgstr "Ktoś inny posługuje się już tym identyfikatorem OpenID." +msgstr "Ktoś inny już posiada ten identyfikator OpenID." #: ../actions/finishopenidlogin.php:42 ../actions/openidsettings.php:126 #: actions/finishopenidlogin.php:47 actions/openidsettings.php:135 @@ -2082,27 +2213,28 @@ msgstr "Stało się coś dziwnego." #: ../scripts/maildaemon.php:58 scripts/maildaemon.php:58 #: scripts/maildaemon.php:61 msgid "Sorry, no incoming email allowed." -msgstr "" +msgstr "Przepraszamy, przychodzący e-mail nie jest dozwolony." #: ../scripts/maildaemon.php:54 scripts/maildaemon.php:54 #: scripts/maildaemon.php:57 msgid "Sorry, that is not your incoming email address." -msgstr "" +msgstr "Przepraszamy, to nie jest twój przychodzący adres e-mail." -#: ../lib/util.php:330 lib/util.php:346 lib/action.php:574 +#: ../lib/util.php:330 lib/util.php:346 lib/action.php:574 lib/action.php:667 msgid "Source" msgstr "Kod źródłowy" #: ../actions/showstream.php:296 actions/showstream.php:311 -#: actions/showstream.php:476 +#: actions/showstream.php:476 actions/showgroup.php:375 msgid "Statistics" msgstr "Statystyki" #: ../actions/finishopenidlogin.php:182 ../actions/finishopenidlogin.php:246 #: actions/finishopenidlogin.php:188 actions/finishopenidlogin.php:252 #: actions/finishopenidlogin.php:222 actions/finishopenidlogin.php:290 +#: actions/finishopenidlogin.php:295 msgid "Stored OpenID not found." -msgstr "Nie znaleziono zapisanego konta OpenID." +msgstr "Nie znaleziono przechowywanego identyfikatora OpenID." #: ../actions/remotesubscribe.php:75 ../actions/showstream.php:188 #: ../actions/showstream.php:197 actions/remotesubscribe.php:84 @@ -2110,7 +2242,7 @@ msgstr "Nie znaleziono zapisanego konta OpenID." #: actions/remotesubscribe.php:113 actions/showstream.php:376 #: lib/subscribeform.php:139 msgid "Subscribe" -msgstr "Subskrybuj" +msgstr "Zasubskrybuj" #: ../actions/showstream.php:313 ../actions/subscribers.php:27 #: actions/showstream.php:328 actions/subscribers.php:27 @@ -2120,14 +2252,14 @@ msgid "Subscribers" msgstr "Subskrybenci" #: ../actions/userauthorization.php:310 actions/userauthorization.php:322 -#: actions/userauthorization.php:338 +#: actions/userauthorization.php:338 actions/userauthorization.php:344 msgid "Subscription authorized" -msgstr "Subskrypcja uwierzytelniona" +msgstr "Upoważniono subskrypcję" #: ../actions/userauthorization.php:320 actions/userauthorization.php:332 -#: actions/userauthorization.php:349 +#: actions/userauthorization.php:349 actions/userauthorization.php:355 msgid "Subscription rejected" -msgstr "Subskrypcja odrzucona" +msgstr "Odrzucono subskrypcję" #: ../actions/showstream.php:230 ../actions/showstream.php:307 #: ../actions/subscriptions.php:27 actions/showstream.php:240 @@ -2138,25 +2270,26 @@ msgid "Subscriptions" msgstr "Subskrypcje" #: ../actions/avatar.php:87 actions/profilesettings.php:324 -#: lib/imagefile.php:78 +#: lib/imagefile.php:78 lib/imagefile.php:82 msgid "System error uploading file." -msgstr "Błąd systemowy podczas wysyłania pliku." +msgstr "Błąd systemu podczas wysyłania pliku." #: ../actions/tag.php:41 ../lib/util.php:301 actions/tag.php:41 #: lib/util.php:317 actions/profilesettings.php:122 actions/showstream.php:297 #: actions/tagother.php:147 actions/tagother.php:207 lib/profilelist.php:162 -#: lib/profilelist.php:164 +#: lib/profilelist.php:164 actions/showstream.php:290 actions/tagother.php:149 +#: actions/tagother.php:209 lib/profilelist.php:160 msgid "Tags" -msgstr "" +msgstr "Znaczniki" #: ../lib/searchaction.php:104 lib/searchaction.php:104 msgid "Text" -msgstr "" +msgstr "Tekst" #: ../actions/noticesearch.php:34 actions/noticesearch.php:34 -#: actions/noticesearch.php:67 +#: actions/noticesearch.php:67 actions/noticesearch.php:78 msgid "Text search" -msgstr "Szukaj tekstu" +msgstr "Znajdź tekst" #: ../actions/openidsettings.php:140 actions/openidsettings.php:149 #: actions/openidsettings.php:227 @@ -2166,7 +2299,7 @@ msgstr "Ten identyfikator OpenID nie należy do Ciebie." #: ../actions/confirmaddress.php:52 actions/confirmaddress.php:52 #: actions/confirmaddress.php:94 msgid "That address has already been confirmed." -msgstr "Ten adres został już potwierdzony" +msgstr "Ten adres został już potwierdzony." #: ../actions/confirmaddress.php:43 actions/confirmaddress.php:43 #: actions/confirmaddress.php:85 @@ -2174,8 +2307,9 @@ msgid "That confirmation code is not for you!" msgstr "Ten kod potwierdzający nie jest przeznaczony dla Ciebie!" #: ../actions/emailsettings.php:191 actions/emailsettings.php:209 +#: actions/emailsettings.php:328 msgid "That email address already belongs to another user." -msgstr "" +msgstr "Ten adres e-mail należy już do innego użytkownika." #: ../actions/avatar.php:80 actions/profilesettings.php:317 #: lib/imagefile.php:71 @@ -2185,17 +2319,17 @@ msgstr "Ten plik jest za duży." #: ../actions/imsettings.php:170 actions/imsettings.php:178 #: actions/imsettings.php:293 msgid "That is already your Jabber ID." -msgstr "Ten identyfikator Jabbera jest już do Ciebie przypisany." +msgstr "Ten identyfikator Jabbera jest już Twój." #: ../actions/emailsettings.php:188 actions/emailsettings.php:206 -#: actions/emailsettings.php:318 +#: actions/emailsettings.php:318 actions/emailsettings.php:325 msgid "That is already your email address." -msgstr "" +msgstr "Ten adres e-mail jest już Twój." #: ../actions/smssettings.php:188 actions/smssettings.php:196 #: actions/smssettings.php:306 msgid "That is already your phone number." -msgstr "" +msgstr "Ten numer telefonu jest już Twój." #: ../actions/imsettings.php:233 actions/imsettings.php:241 #: actions/imsettings.php:381 @@ -2203,109 +2337,117 @@ msgid "That is not your Jabber ID." msgstr "To nie jest Twój identyfikator Jabbera." #: ../actions/emailsettings.php:249 actions/emailsettings.php:267 -#: actions/emailsettings.php:397 +#: actions/emailsettings.php:397 actions/emailsettings.php:404 msgid "That is not your email address." -msgstr "" +msgstr "To nie jest Twój adres e-mail." #: ../actions/smssettings.php:257 actions/smssettings.php:265 #: actions/smssettings.php:393 msgid "That is not your phone number." -msgstr "" +msgstr "To nie jest Twój numer telefonu." #: ../actions/emailsettings.php:226 ../actions/imsettings.php:210 #: actions/emailsettings.php:244 actions/imsettings.php:218 #: actions/emailsettings.php:367 actions/imsettings.php:349 +#: actions/emailsettings.php:374 msgid "That is the wrong IM address." msgstr "To jest błędny adres komunikatora." #: ../actions/smssettings.php:233 actions/smssettings.php:241 #: actions/smssettings.php:362 msgid "That is the wrong confirmation number." -msgstr "" +msgstr "To jest błędny numer potwierdzenia." #: ../actions/smssettings.php:191 actions/smssettings.php:199 #: actions/smssettings.php:309 msgid "That phone number already belongs to another user." -msgstr "" +msgstr "Ten numer telefonu należy już do innego użytkownika." #: ../actions/newnotice.php:49 ../actions/twitapistatuses.php:408 #: actions/newnotice.php:49 actions/twitapistatuses.php:330 #: actions/facebookhome.php:243 actions/twitapistatuses.php:276 +#: actions/newnotice.php:136 actions/twitapistatuses.php:294 +#: lib/facebookaction.php:485 msgid "That's too long. Max notice size is 140 chars." -msgstr "Wpis za długi. Maksymalna długość to 140 znaków." +msgstr "Wpis jest za długi. Maksymalna długość to 140 znaków." #: ../actions/twitapiaccount.php:74 actions/twitapiaccount.php:72 -#: actions/twitapiaccount.php:62 +#: actions/twitapiaccount.php:62 actions/twitapiaccount.php:63 msgid "That's too long. Max notice size is 255 chars." -msgstr "" +msgstr "Wpis jest za długi. Maksymalna długość to 255 znaków." #: ../actions/confirmaddress.php:92 actions/confirmaddress.php:92 +#: actions/confirmaddress.php:159 #, php-format msgid "The address \"%s\" has been confirmed for your account." -msgstr "Skojarzony z Twoim kontem adres \"%s\" został potwierdzony." +msgstr "Adres \"%s\" został potwierdzony dla Twojego konta." #: ../actions/emailsettings.php:264 ../actions/imsettings.php:250 #: ../actions/smssettings.php:274 actions/emailsettings.php:282 #: actions/imsettings.php:258 actions/smssettings.php:282 #: actions/emailsettings.php:416 actions/imsettings.php:402 -#: actions/smssettings.php:413 +#: actions/smssettings.php:413 actions/emailsettings.php:423 msgid "The address was removed." msgstr "Adres został usunięty." -#: ../actions/userauthorization.php:312 +#: ../actions/userauthorization.php:312 actions/userauthorization.php:346 msgid "" "The subscription has been authorized, but no callback URL was passed. Check " "with the site's instructions for details on how to authorize the " "subscription. Your subscription token is:" msgstr "" -"Twoje żądanie obserwacji zostało odrzucone, ale nie przekazano żadnego URL-a " -"do zwrotnego komunikatu. Sprawdź w instrukcjach serwisu w jaki sposób " -"dokładnie odbywa się odrzucanie subskrypcji. Twój token subskrypcji to:" +"Subskrypcja została upoważniona, ale nie przekazano zwrotnego adresu URL. " +"Sprawdź w instrukcjach strony, jak upoważnić subskrypcję. Token subskrypcji:" -#: ../actions/userauthorization.php:322 +#: ../actions/userauthorization.php:322 actions/userauthorization.php:357 msgid "" "The subscription has been rejected, but no callback URL was passed. Check " "with the site's instructions for details on how to fully reject the " "subscription." msgstr "" -"Twoje żądanie obserwacji zostało odrzucone, ale nie przekazano żadnego URL-a " -"do zwrotnego komunikatu. Sprawdź w instrukcjach serwisu w jaki sposób " -"dokładnie odbywa się odrzucanie subskrypcji." +"Subskrypcja została odrzucona, ale nie przekazano zwrotnego adresu URL. " +"Sprawdź w instrukcjach strony, jak w pełni odrzucić subskrypcję." #: ../actions/subscribers.php:35 actions/subscribers.php:35 +#: actions/subscribers.php:67 #, php-format msgid "These are the people who listen to %s's notices." -msgstr "Ludzie obserwujący wpisy użytkownika %s." +msgstr "Osoby obserwujące wpisy użytkownika %s." #: ../actions/subscribers.php:33 actions/subscribers.php:33 +#: actions/subscribers.php:63 msgid "These are the people who listen to your notices." -msgstr "Ludzie obserwujący Twoje wpisy." +msgstr "Osoby obserwujący Twoje wpisy." #: ../actions/subscriptions.php:35 actions/subscriptions.php:35 +#: actions/subscriptions.php:69 #, php-format msgid "These are the people whose notices %s listens to." -msgstr "Ludzie, których wpisy obserwuje użytkownik %s." +msgstr "Osoby, których wpisy obserwuje użytkownik %s." #: ../actions/subscriptions.php:33 actions/subscriptions.php:33 +#: actions/subscriptions.php:65 msgid "These are the people whose notices you listen to." -msgstr "Ludzie których wpisy obserwujesz." +msgstr "Osoby, których wpisy obserwujesz." #: ../actions/invite.php:89 actions/invite.php:96 actions/invite.php:128 msgid "" "These people are already users and you were automatically subscribed to them:" msgstr "" +"Te osoby są już użytkownikami i zostałeś do nich automatycznie " +"zasubskrybowany:" -#: ../actions/recoverpassword.php:88 +#: ../actions/recoverpassword.php:88 actions/recoverpassword.php:97 msgid "This confirmation code is too old. Please start again." -msgstr "Kod potwierdzający jest przeterminowany. Zacznij jeszcze raz." +msgstr "Kod potwierdzający jest za stary. Rozpocznij ponownie." -#: ../lib/openid.php:195 +#: ../lib/openid.php:195 lib/openid.php:206 msgid "" "This form should automatically submit itself. If not, click the submit " "button to go to your OpenID provider." msgstr "" -"Ten formularz powinien wysłać się automatycznie. Jeśli tak się nie stanie " -"kliknij Wyślij, aby przejść do Twojego dostawcy OpenID." +"Ten formularz powinien wysłać się automatycznie. Jeśli tak się nie stanie, " +"naciśnij przycisk Wyślij, aby przejść do dostawcy OpenID." #: ../actions/finishopenidlogin.php:56 actions/finishopenidlogin.php:61 #: actions/finishopenidlogin.php:67 @@ -2315,66 +2457,69 @@ msgid "" "to a local account. You can either create a new account, or connect with " "your existing account, if you have one." msgstr "" -"Jeżeli logujesz się po raz pierwszy do %s to twoje konto OpenID musi zostać " -"skojarzone z kontem lokalnym. Możesz więc albo utworzyć nowe konto, albo " -"połączyć je z posiadanym istniejącym." +"Jeżeli logujesz się do %s po raz pierwszy, musimy połączyć identyfikator " +"OpenID z lokalnym kontem. Można utworzyć nowe konto lub połączyć z " +"istniejącym, jeśli je posiadasz." #: ../actions/twitapifriendships.php:108 ../actions/twitapistatuses.php:586 #: actions/twitapifavorites.php:127 actions/twitapifriendships.php:108 #: actions/twitapistatuses.php:511 actions/twitapifavorites.php:97 #: actions/twitapifriendships.php:85 actions/twitapistatuses.php:436 +#: actions/twitapifavorites.php:103 actions/twitapistatuses.php:460 msgid "This method requires a POST or DELETE." -msgstr "" +msgstr "Ta metoda wymaga POST lub DELETE." #: ../actions/twitapiaccount.php:65 ../actions/twitapifriendships.php:44 #: ../actions/twitapistatuses.php:381 actions/twitapiaccount.php:63 #: actions/twitapidirect_messages.php:114 actions/twitapifriendships.php:44 #: actions/twitapistatuses.php:303 actions/twitapiaccount.php:53 #: actions/twitapidirect_messages.php:122 actions/twitapifriendships.php:32 -#: actions/twitapistatuses.php:244 +#: actions/twitapistatuses.php:244 actions/twitapiaccount.php:54 +#: actions/twitapidirect_messages.php:131 actions/twitapistatuses.php:262 msgid "This method requires a POST." -msgstr "" +msgstr "Ta metoda wymaga POST." -#: ../lib/util.php:164 lib/util.php:246 +#: ../lib/util.php:164 lib/util.php:246 lib/htmloutputter.php:104 msgid "This page is not available in a media type you accept" -msgstr "Ta strona nie jest dostępna dla medium, którego typ akceptujesz" +msgstr "Ta strona jest niedostępna dla akceptowanego typu medium" #: ../actions/profilesettings.php:63 actions/profilesettings.php:96 #: actions/profilesettings.php:138 msgid "Timezone" -msgstr "" +msgstr "Strefa czasowa" #: ../actions/profilesettings.php:107 actions/profilesettings.php:222 #: actions/profilesettings.php:211 msgid "Timezone not selected." -msgstr "" +msgstr "Nie wybrano strefy czasowej." -#: ../actions/remotesubscribe.php:43 +#: ../actions/remotesubscribe.php:43 actions/remotesubscribe.php:74 #, php-format msgid "" "To subscribe, you can [login](%%action.login%%), or [register](%%action." "register%%) a new account. If you already have an account on a [compatible " "microblogging site](%%doc.openmublog%%), enter your profile URL below." msgstr "" -"Aby się zapisać możesz się [zalogować](%%action.login%%) lub [zarejestrować]" -"(%%action.register%%). Jeśli już posiadasz konto w [kompatybilnym serwisie](%" -"%doc.openmublog%%) wprowadź poniżej identyfikator URL." +"Aby zasubskrybować, można [zalogować się](%%action.login%%) lub " +"[zarejestrować](%%action.register%%) nowe konto. Jeśli już posiadasz konto " +"na [zgodnej stronie mikroblogowania](%%doc.openmublog%%), podaj poniżej " +"adres URL profilu." #: ../actions/twitapifriendships.php:163 actions/twitapifriendships.php:167 #: actions/twitapifriendships.php:132 msgid "Two user ids or screen_names must be supplied." -msgstr "" +msgstr "Należy dostarczyć dwa identyfikatory lub nazwy użytkowników." #: ../actions/profilesettings.php:48 ../actions/register.php:169 #: actions/profilesettings.php:81 actions/register.php:183 -#: actions/profilesettings.php:109 +#: actions/profilesettings.php:109 actions/register.php:398 msgid "URL of your homepage, blog, or profile on another site" -msgstr "URL Twojej strony domowej, bloga, lub profilu na innej stronie" +msgstr "Adres URL strony domowej, bloga lub profilu na innej stronie" #: ../actions/remotesubscribe.php:74 actions/remotesubscribe.php:83 #: actions/remotesubscribe.php:110 msgid "URL of your profile on another compatible microblogging service" -msgstr "URL Twojego profilu na kompatybilnym serwisie do mikroblogów" +msgstr "Adres URL profilu na innej, zgodnej usłudze mikroblogowania" #: ../actions/emailsettings.php:130 ../actions/imsettings.php:110 #: ../actions/recoverpassword.php:39 ../actions/smssettings.php:135 @@ -2384,17 +2529,19 @@ msgstr "URL Twojego profilu na kompatybilnym serwisie do mikroblogów" #: actions/emailsettings.php:242 actions/grouplogo.php:317 #: actions/imsettings.php:214 actions/recoverpassword.php:44 #: actions/smssettings.php:236 actions/twittersettings.php:302 +#: actions/avatarsettings.php:263 actions/emailsettings.php:247 +#: actions/grouplogo.php:324 actions/twittersettings.php:306 msgid "Unexpected form submission." -msgstr "Nieoczekiwane przesłanie formularza." +msgstr "Nieoczekiwane wysłanie formularza." #: ../actions/recoverpassword.php:276 actions/recoverpassword.php:289 #: actions/recoverpassword.php:323 msgid "Unexpected password reset." -msgstr "Nieoczekiwane wyzerowanie hasła." +msgstr "Nieoczekiwane przywrócenie hasła." #: ../index.php:57 index.php:57 actions/recoverpassword.php:202 msgid "Unknown action" -msgstr "" +msgstr "Nieznane działanie" #: ../actions/finishremotesubscribe.php:58 #: actions/finishremotesubscribe.php:60 actions/finishremotesubscribe.php:61 @@ -2406,8 +2553,8 @@ msgid "" "Unless otherwise specified, contents of this site are copyright by the " "contributors and available under the " msgstr "" -"Prawo do kopiowania zawartości tej strony, chyba że zaznaczono inaczej, " -"należy do tworzących jej treści i uwarunkowane zasadami" +"Jeśli nie podano inaczej, prawa autorskie do zawartości tej strony należy do " +"współtwórców i jest dostępna na warunkach licencji " #: ../actions/confirmaddress.php:48 actions/confirmaddress.php:48 #: actions/confirmaddress.php:90 @@ -2423,38 +2570,40 @@ msgstr "Zrezygnuj z subskrypcji" #: ../actions/postnotice.php:44 ../actions/updateprofile.php:45 #: actions/postnotice.php:45 actions/updateprofile.php:46 #: actions/postnotice.php:48 actions/updateprofile.php:49 +#: actions/updateprofile.php:51 msgid "Unsupported OMB version" msgstr "Nieobsługiwana wersja OMB" #: ../actions/avatar.php:105 actions/profilesettings.php:342 -#: lib/imagefile.php:102 +#: lib/imagefile.php:102 lib/imagefile.php:99 msgid "Unsupported image file format." msgstr "Nieobsługiwany format pliku obrazu." #: ../lib/settingsaction.php:100 lib/settingsaction.php:94 #: lib/connectsettingsaction.php:108 msgid "Updates by SMS" -msgstr "" +msgstr "Aktualizacje przez wiadomości SMS" #: ../lib/settingsaction.php:103 lib/settingsaction.php:97 #: lib/connectsettingsaction.php:105 msgid "Updates by instant messenger (IM)" -msgstr "" +msgstr "Aktualizacje przez komunikator" #: ../actions/twitapistatuses.php:241 actions/twitapistatuses.php:158 -#: actions/twitapistatuses.php:129 +#: actions/twitapistatuses.php:129 actions/twitapistatuses.php:134 #, php-format msgid "Updates from %1$s and friends on %2$s!" -msgstr "" +msgstr "Aktualizacje od %1$s i przyjaciół na %2$s!" #: ../actions/twitapistatuses.php:341 actions/twitapistatuses.php:268 -#: actions/twitapistatuses.php:202 +#: actions/twitapistatuses.php:202 actions/twitapistatuses.php:213 #, php-format msgid "Updates from %1$s on %2$s!" -msgstr "" +msgstr "Aktualizacje od %1$s na %2$s!" #: ../actions/avatar.php:68 actions/profilesettings.php:161 #: actions/avatarsettings.php:162 actions/grouplogo.php:232 +#: actions/avatarsettings.php:165 actions/grouplogo.php:238 msgid "Upload" msgstr "Wyślij" @@ -2465,23 +2614,25 @@ msgid "" "site license, also. Use a picture that belongs to you and that you want to " "share." msgstr "" -"Tu możesz wysłać nowego \"awatara\" (wizerunek użytkownika). Nie da się " -"edytować obrazu po jego umieszczeniu w serwisie, więc upewnij się, że jest w " -"miarę kwadratowy. Wysyłając go zgadzasz się na jego publikację na warunkach " -"podanych w licencji strony. Użyj grafiki, która należy do Ciebie i którą " -"możesz dzielić się z innymi." +"Tu można wysłać nowego \"awatara\" (obraz użytkownika). Nie można " +"modyfikować obrazu po jego wysłaniu, więc upewnij się, że jest w miarę " +"kwadratowy. Musi być także na licencji strony. Użyj obrazu, który należy do " +"Ciebie, i którym chcesz się dzielić." #: ../lib/settingsaction.php:91 msgid "Upload a new profile image" -msgstr "" +msgstr "Wyślij nowy obraz profilu" #: ../actions/invite.php:114 actions/invite.php:121 actions/invite.php:154 msgid "" "Use this form to invite your friends and colleagues to use this service." msgstr "" +"Użyj tego formularza, aby zaprosić przyjaciół i kolegów do używania tej " +"usługi." #: ../actions/register.php:159 ../actions/register.php:162 -#: actions/register.php:173 actions/register.php:176 +#: actions/register.php:173 actions/register.php:176 actions/register.php:382 +#: actions/register.php:386 msgid "Used only for updates, announcements, and password recovery" msgstr "Używane tylko do aktualizacji, ogłoszeń i przywracania hasła" @@ -2505,8 +2656,10 @@ msgstr "Obserwowany użytkownik nie istnieje." #: actions/twitapifavorites.php:42 actions/twitapistatuses.php:167 #: actions/twitapistatuses.php:503 actions/twitapiusers.php:55 #: actions/usergroups.php:99 lib/galleryaction.php:67 lib/twitterapi.php:626 +#: actions/twitapiaccount.php:71 actions/twitapistatuses.php:179 +#: actions/twitapistatuses.php:535 actions/twitapiusers.php:59 msgid "User has no profile." -msgstr "Użytkownik nie ma profilu." +msgstr "Użytkownik nie posiada profilu." #: ../actions/remotesubscribe.php:71 actions/remotesubscribe.php:80 #: actions/remotesubscribe.php:105 @@ -2515,12 +2668,12 @@ msgstr "Pseudonim użytkownika" #: ../actions/twitapiusers.php:75 actions/twitapiusers.php:80 msgid "User not found." -msgstr "" +msgstr "Nie znaleziono użytkownika." #: ../actions/profilesettings.php:63 actions/profilesettings.php:96 #: actions/profilesettings.php:139 msgid "What timezone are you normally in?" -msgstr "" +msgstr "W jakiej strefie czasowej zwykle się znajdujesz?" #: ../lib/util.php:1159 lib/util.php:1293 lib/noticeform.php:141 #, php-format @@ -2529,111 +2682,115 @@ msgstr "Co słychać, %s?" #: ../actions/profilesettings.php:54 ../actions/register.php:175 #: actions/profilesettings.php:87 actions/register.php:189 -#: actions/profilesettings.php:119 +#: actions/profilesettings.php:119 actions/register.php:410 msgid "Where you are, like \"City, State (or Region), Country\"" -msgstr "Gdzie jesteś? (np. \"miasto, region, kraj\")" +msgstr "Gdzie jesteś, np. \"miasto, województwo (lub region), kraj\"" #: ../actions/updateprofile.php:128 actions/updateprofile.php:129 -#: actions/updateprofile.php:132 +#: actions/updateprofile.php:132 actions/updateprofile.php:134 #, php-format msgid "Wrong image type for '%s'" -msgstr "Nieprawidłowy typ obrazu dla '%s'" +msgstr "Błędny typ obrazu dla \"%s\"" #: ../actions/updateprofile.php:123 actions/updateprofile.php:124 -#: actions/updateprofile.php:127 +#: actions/updateprofile.php:127 actions/updateprofile.php:129 #, php-format msgid "Wrong size image at '%s'" -msgstr "Nieprawidłowy rozmiar obrazu dla '%s'" +msgstr "Błędny rozmiar obrazu \"%s\"" #: ../actions/deletenotice.php:63 ../actions/deletenotice.php:72 #: actions/deletenotice.php:64 actions/deletenotice.php:79 #: actions/block.php:148 actions/deletenotice.php:122 -#: actions/deletenotice.php:141 +#: actions/deletenotice.php:141 actions/deletenotice.php:115 msgid "Yes" -msgstr "" +msgstr "Tak" #: ../actions/finishaddopenid.php:64 actions/finishaddopenid.php:64 #: actions/finishaddopenid.php:112 msgid "You already have this OpenID!" -msgstr "Już masz ten identyfikator OpenID!" +msgstr "Już posiadasz ten identyfikator OpenID!" #: ../actions/deletenotice.php:37 actions/deletenotice.php:37 msgid "" "You are about to permanently delete a notice. Once this is done, it cannot " "be undone." msgstr "" +"Wpis zostanie za chwilę trwale usunięty. Kiedy to się stanie, to już się nie " +"odstanie." #: ../actions/recoverpassword.php:31 actions/recoverpassword.php:31 #: actions/recoverpassword.php:36 msgid "You are already logged in!" -msgstr "Nie musisz ponownie się logować!" +msgstr "Jesteś już zalogowany!" #: ../actions/invite.php:81 actions/invite.php:88 actions/invite.php:120 msgid "You are already subscribed to these users:" -msgstr "" +msgstr "Jesteś już zasubskrybowany do tych użytkowników:" #: ../actions/twitapifriendships.php:128 actions/twitapifriendships.php:128 #: actions/twitapifriendships.php:105 msgid "You are not friends with the specified user." -msgstr "" +msgstr "Nie jesteś przyjacielem podanego użytkownika." #: ../actions/password.php:27 msgid "You can change your password here. Choose a good one!" -msgstr "Tu możesz zmienić hasło. Wybierz porządne!" +msgstr "Tutaj można zmienić hasło. Wybierz dobre!" #: ../actions/register.php:135 actions/register.php:145 msgid "You can create a new account to start posting notices." -msgstr "Możesz utworzyć nowe konto, aby rozpocząć wysyłanie wpisów." +msgstr "Można utworzyć nowe konto, aby rozpocząć wysyłanie wpisów." #: ../actions/smssettings.php:28 actions/smssettings.php:28 #: actions/smssettings.php:69 #, php-format msgid "You can receive SMS messages through email from %%site.name%%." -msgstr "" +msgstr "Można otrzymywać wiadomości SMS przez e-mail od %%site.name%%." -#: ../actions/openidsettings.php:86 +#: ../actions/openidsettings.php:86 actions/openidsettings.php:143 msgid "" "You can remove an OpenID from your account by clicking the button marked " "\"Remove\"." msgstr "" -"Możesz usunąć łączność z serwerem OpenID ze swojego konta klikając \"Usuń\"." +"Można usunąć identyfikator OpenID ze swojego konta naciskając przycisk \"Usuń" +"\"." #: ../actions/imsettings.php:28 actions/imsettings.php:28 +#: actions/imsettings.php:70 #, php-format msgid "" "You can send and receive notices through Jabber/GTalk [instant messages](%%" "doc.im%%). Configure your address and settings below." msgstr "" -"Możesz wysyłać i odbierać wpisy przez komunikator Jabber/GTalk (%%doc.im%%). " -"Poniżej możesz skonfigurować swój adres i ustawienia IM." +"Można wysyłać i odbierać wpisy przez [komunikator](%%doc.im%%) Jabber/GTalk. " +"Skonfiguruj adres i ustawienia poniżej." -#: ../actions/profilesettings.php:27 +#: ../actions/profilesettings.php:27 actions/profilesettings.php:69 msgid "" "You can update your personal profile info here so people know more about you." msgstr "" -"W tym miejscu możesz zaktualizować informacje zawarte w Twoim osobistym " -"profilu, aby inni mogli lepiej Cię poznać." +"Tutaj można zaktualizować osobiste informacje w profilu, aby inni mogli " +"lepiej Cię poznać." #: ../actions/finishremotesubscribe.php:31 ../actions/remotesubscribe.php:31 #: actions/finishremotesubscribe.php:31 actions/remotesubscribe.php:31 #: actions/finishremotesubscribe.php:33 actions/finishremotesubscribe.php:85 #: actions/finishremotesubscribe.php:101 actions/remotesubscribe.php:35 msgid "You can use the local subscription!" -msgstr "Możesz skorzystać z lokalnej subskrypcji!" +msgstr "Można używać lokalnej subskrypcji!" #: ../actions/finishopenidlogin.php:33 ../actions/register.php:61 #: actions/finishopenidlogin.php:38 actions/register.php:68 -#: actions/finishopenidlogin.php:43 +#: actions/finishopenidlogin.php:43 actions/register.php:149 msgid "You can't register if you don't agree to the license." msgstr "" "Nie możesz się zarejestrować, jeśli nie zgadzasz się z warunkami licencji." #: ../actions/updateprofile.php:63 actions/updateprofile.php:64 -#: actions/updateprofile.php:67 +#: actions/updateprofile.php:67 actions/updateprofile.php:69 msgid "You did not send us that profile" -msgstr "Ten profil nie był wysłany przez Ciebie" +msgstr "Nie wysłałeś nam tego profilu" -#: ../lib/mail.php:147 +#: ../lib/mail.php:147 lib/mail.php:289 #, php-format msgid "" "You have a new posting address on %1$s.\n" @@ -2645,122 +2802,132 @@ msgid "" "Faithfully yours,\n" "%4$s" msgstr "" +"Posiadasz nowy adres wysyłania na %1$s.\n" +"\n" +"Wyślij wiadomość e-mail na %2$s, aby wysłać nowe wpisy.\n" +"\n" +"Więcej instrukcji dotyczących poczty e-mail można znaleźć na %3$s.\n" +"\n" +"Z poważaniem,\n" +"%4$s" #: ../actions/twitapistatuses.php:612 actions/twitapistatuses.php:537 -#: actions/twitapistatuses.php:463 +#: actions/twitapistatuses.php:463 actions/twitapistatuses.php:486 msgid "You may not delete another user's status." -msgstr "" +msgstr "Nie można usuwać statusów innych użytkowników." #: ../actions/invite.php:31 actions/invite.php:31 actions/invite.php:39 #, php-format msgid "You must be logged in to invite other users to use %s" msgstr "" +"Należy być zalogowanym, aby zapraszać innych użytkowników do używania %s" #: ../actions/invite.php:103 actions/invite.php:110 actions/invite.php:142 msgid "" "You will be notified when your invitees accept the invitation and register " "on the site. Thanks for growing the community!" msgstr "" +"Zostaniesz powiadomiony, kiedy ktoś zaakceptuje zaproszenie i zarejestruje " +"się na stronie. Dziękujemy za pomoc w zwiększaniu społeczności!" -#: ../actions/recoverpassword.php:149 +#: ../actions/recoverpassword.php:149 actions/recoverpassword.php:158 msgid "You've been identified. Enter a new password below. " -msgstr "Identyfikacja pomyślna. Wprowadź poniżej nowe hasło." +msgstr "Zostałeś zidentyfikowany. Podaj poniżej nowe hasło. " #: ../actions/openidlogin.php:67 actions/openidlogin.php:76 -#: actions/openidlogin.php:104 +#: actions/openidlogin.php:104 actions/openidlogin.php:113 msgid "Your OpenID URL" -msgstr "URL Twojej usługi OpenID" +msgstr "Twój adres URL OpenID" -#: ../actions/recoverpassword.php:164 +#: ../actions/recoverpassword.php:164 actions/recoverpassword.php:188 msgid "Your nickname on this server, or your registered email address." -msgstr "" -"Twój pseudonim na tym serwerze lub adres e-mailowy użyty podczas rejestracji." +msgstr "Twój pseudonim na tym serwerze lub zarejestrowany adres e-mail." -#: ../actions/openidsettings.php:28 +#: ../actions/openidsettings.php:28 actions/openidsettings.php:70 #, php-format msgid "" "[OpenID](%%doc.openid%%) lets you log into many sites with the same user " "account. Manage your associated OpenIDs from here." msgstr "" -"[OpenID](%%doc.openid%%) pozwala logować Ci się do wielu serwisów z " -"wykorzystaniem jednego konta użytkownika. Tu możesz zarządzać swoimi " +"[OpenID](%%doc.openid%%) umożliwia logowanie się do wielu stron za pomocą " +"tego samego konta użytkownika. Tu można zarządzać powiązanymi " "identyfikatorami OpenID." -#: ../lib/util.php:943 lib/util.php:992 lib/util.php:945 +#: ../lib/util.php:943 lib/util.php:992 lib/util.php:945 lib/util.php:756 msgid "a few seconds ago" msgstr "kilka sekund temu" -#: ../lib/util.php:955 lib/util.php:1004 lib/util.php:957 +#: ../lib/util.php:955 lib/util.php:1004 lib/util.php:957 lib/util.php:768 #, php-format msgid "about %d days ago" msgstr "około %d dni temu" -#: ../lib/util.php:951 lib/util.php:1000 lib/util.php:953 +#: ../lib/util.php:951 lib/util.php:1000 lib/util.php:953 lib/util.php:764 #, php-format msgid "about %d hours ago" msgstr "około %d godzin temu" -#: ../lib/util.php:947 lib/util.php:996 lib/util.php:949 +#: ../lib/util.php:947 lib/util.php:996 lib/util.php:949 lib/util.php:760 #, php-format msgid "about %d minutes ago" msgstr "około %d minut temu" -#: ../lib/util.php:959 lib/util.php:1008 lib/util.php:961 +#: ../lib/util.php:959 lib/util.php:1008 lib/util.php:961 lib/util.php:772 #, php-format msgid "about %d months ago" msgstr "około %d miesięcy temu" -#: ../lib/util.php:953 lib/util.php:1002 lib/util.php:955 +#: ../lib/util.php:953 lib/util.php:1002 lib/util.php:955 lib/util.php:766 msgid "about a day ago" msgstr "blisko dzień temu" -#: ../lib/util.php:945 lib/util.php:994 lib/util.php:947 +#: ../lib/util.php:945 lib/util.php:994 lib/util.php:947 lib/util.php:758 msgid "about a minute ago" -msgstr "blisko minutę temu" +msgstr "około minutę temu" -#: ../lib/util.php:957 lib/util.php:1006 lib/util.php:959 +#: ../lib/util.php:957 lib/util.php:1006 lib/util.php:959 lib/util.php:770 msgid "about a month ago" -msgstr "blisko miesiąc temu" +msgstr "około miesiąc temu" -#: ../lib/util.php:961 lib/util.php:1010 lib/util.php:963 +#: ../lib/util.php:961 lib/util.php:1010 lib/util.php:963 lib/util.php:774 msgid "about a year ago" -msgstr "blisko rok temu" +msgstr "około rok temu" -#: ../lib/util.php:949 lib/util.php:998 lib/util.php:951 +#: ../lib/util.php:949 lib/util.php:998 lib/util.php:951 lib/util.php:762 msgid "about an hour ago" -msgstr "blisko godzinę temu" +msgstr "około godzinę temu" #: ../actions/showstream.php:423 ../lib/stream.php:132 #: actions/showstream.php:441 lib/stream.php:99 msgid "delete" -msgstr "" +msgstr "usuń" #: ../actions/noticesearch.php:130 ../actions/showstream.php:408 #: ../lib/stream.php:117 actions/noticesearch.php:136 #: actions/showstream.php:426 lib/stream.php:84 actions/noticesearch.php:187 msgid "in reply to..." -msgstr "w odpowiedzi na…" +msgstr "w odpowiedzi na..." #: ../actions/noticesearch.php:137 ../actions/showstream.php:415 #: ../lib/stream.php:124 actions/noticesearch.php:143 #: actions/showstream.php:433 lib/stream.php:91 actions/noticesearch.php:194 msgid "reply" -msgstr "odpowiedź" +msgstr "odpowiedz" #: ../actions/password.php:44 actions/profilesettings.php:183 #: actions/passwordsettings.php:106 msgid "same as password above" -msgstr "takie samo hasło jak powyżej" +msgstr "takie samo jak hasło powyżej" #: ../actions/twitapistatuses.php:755 actions/twitapistatuses.php:678 -#: actions/twitapistatuses.php:555 +#: actions/twitapistatuses.php:555 actions/twitapistatuses.php:596 +#: actions/twitapistatuses.php:618 msgid "unsupported file type" -msgstr "" +msgstr "nieobsługiwany typ pliku" #: ../lib/util.php:1309 lib/util.php:1443 -#, fuzzy msgid "« After" -msgstr "« następne" +msgstr "« Następne" #: actions/deletenotice.php:74 actions/disfavor.php:43 #: actions/emailsettings.php:127 actions/favor.php:45 @@ -2775,68 +2942,80 @@ msgstr "« następne" #: actions/finishopenidlogin.php:38 actions/invite.php:54 actions/nudge.php:80 #: actions/openidlogin.php:37 actions/recoverpassword.php:316 #: actions/subscribe.php:46 actions/unblock.php:65 actions/unsubscribe.php:43 +#: actions/avatarsettings.php:251 actions/emailsettings.php:229 +#: actions/grouplogo.php:314 actions/imsettings.php:200 actions/login.php:103 +#: actions/newmessage.php:133 actions/newnotice.php:96 +#: actions/openidsettings.php:188 actions/othersettings.php:136 +#: actions/passwordsettings.php:131 actions/profilesettings.php:172 +#: actions/register.php:113 actions/remotesubscribe.php:53 +#: actions/smssettings.php:216 actions/subedit.php:38 actions/tagother.php:166 +#: actions/twittersettings.php:294 actions/userauthorization.php:39 msgid "There was a problem with your session token. Try again, please." -msgstr "" +msgstr "Wystąpił problem z tokenem sesji. Spróbuj ponownie." #: actions/disfavor.php:55 actions/disfavor.php:81 msgid "This notice is not a favorite!" -msgstr "" +msgstr "Ten wpis nie jest ulubiony!" #: actions/disfavor.php:63 actions/disfavor.php:87 msgid "Could not delete favorite." -msgstr "" +msgstr "Nie można usunąć ulubionego wpisu." #: actions/disfavor.php:72 lib/favorform.php:140 msgid "Favor" -msgstr "" +msgstr "Dodaj do ulubionych" -#: actions/emailsettings.php:92 +#: actions/emailsettings.php:92 actions/emailsettings.php:157 msgid "Send me email when someone adds my notice as a favorite." -msgstr "" +msgstr "Wyślij mi wiadomość e-mail, kiedy ktoś doda mój wpis jako ulubiony." #: actions/emailsettings.php:95 actions/emailsettings.php:163 msgid "Send me email when someone sends me a private message." -msgstr "" +msgstr "Wyślij mi wiadomość e-mail, kiedy ktoś wyśle mi prywatną wiadomość." #: actions/favor.php:53 actions/twitapifavorites.php:142 actions/favor.php:81 -#: actions/twitapifavorites.php:118 +#: actions/twitapifavorites.php:118 actions/twitapifavorites.php:124 msgid "This notice is already a favorite!" -msgstr "" +msgstr "Ten wpis jest już ulubiony!" #: actions/favor.php:60 actions/twitapifavorites.php:151 #: classes/Command.php:132 actions/favor.php:86 #: actions/twitapifavorites.php:125 classes/Command.php:152 +#: actions/twitapifavorites.php:131 lib/command.php:152 msgid "Could not create favorite." -msgstr "" +msgstr "Nie można utworzyć ulubionego wpisu." #: actions/favor.php:70 msgid "Disfavor" -msgstr "" +msgstr "Usuń wpis z ulubionych" #: actions/favoritesrss.php:60 actions/showfavorites.php:47 #: actions/favoritesrss.php:100 actions/showfavorites.php:77 +#: actions/favoritesrss.php:110 #, php-format msgid "%s favorite notices" -msgstr "" +msgstr "Ulubione wpisy użytkownika %s" #: actions/favoritesrss.php:64 actions/favoritesrss.php:104 +#: actions/favoritesrss.php:114 #, php-format msgid "Feed of favorite notices of %s" -msgstr "" +msgstr "Kanał ulubionych wpisów użytkownika %s" #: actions/inbox.php:28 actions/inbox.php:59 #, php-format msgid "Inbox for %s - page %d" -msgstr "" +msgstr "Odebrane wiadomości użytkownika %s - strona %d" #: actions/inbox.php:30 actions/inbox.php:62 #, php-format msgid "Inbox for %s" -msgstr "" +msgstr "Odebrane wiadomości użytkownika %s" #: actions/inbox.php:53 actions/inbox.php:115 msgid "This is your inbox, which lists your incoming private messages." msgstr "" +"To jest skrzynka odbiorcza, która wyświetla przychodzące wiadomości prywatne." #: actions/invite.php:178 actions/invite.php:213 #, php-format @@ -2844,234 +3023,260 @@ msgid "" "%1$s has invited you to join them on %2$s (%3$s).\n" "\n" msgstr "" +"%1$s zaprosił się do dołączenia do %2$s (%3$s).\n" +"\n" #: actions/login.php:104 actions/login.php:235 actions/openidlogin.php:108 #: actions/register.php:416 msgid "Automatically login in the future; " -msgstr "" +msgstr "Automatyczne logowanie; " #: actions/login.php:122 actions/login.php:264 msgid "For security reasons, please re-enter your " -msgstr "" +msgstr "Z powodów bezpieczeństwa ponownie podaj " #: actions/login.php:126 actions/login.php:268 msgid "Login with your username and password. " -msgstr "" +msgstr "Zaloguj się za pomocą nazwy użytkownika i hasła. " #: actions/newmessage.php:58 actions/twitapidirect_messages.php:130 -#: actions/twitapidirect_messages.php:141 +#: actions/twitapidirect_messages.php:141 actions/newmessage.php:148 +#: actions/twitapidirect_messages.php:150 msgid "That's too long. Max message size is 140 chars." -msgstr "" +msgstr "Wiadomość jest za długa. Maksymalna długość to 140 znaków." #: actions/newmessage.php:65 actions/newmessage.php:128 +#: actions/newmessage.php:155 msgid "No recipient specified." -msgstr "" +msgstr "Nie podano odbiorcy." #: actions/newmessage.php:68 actions/newmessage.php:113 #: classes/Command.php:206 actions/newmessage.php:131 #: actions/newmessage.php:168 classes/Command.php:237 +#: actions/newmessage.php:119 actions/newmessage.php:158 lib/command.php:237 msgid "You can't send a message to this user." -msgstr "" +msgstr "Nie można wysłać wiadomości do tego użytkownika." #: actions/newmessage.php:71 actions/twitapidirect_messages.php:146 #: classes/Command.php:209 actions/twitapidirect_messages.php:158 -#: classes/Command.php:240 +#: classes/Command.php:240 actions/newmessage.php:161 +#: actions/twitapidirect_messages.php:167 lib/command.php:240 msgid "" "Don't send a message to yourself; just say it to yourself quietly instead." -msgstr "" +msgstr "Nie wysyłaj wiadomości do siebie, po prostu powiedz to sobie po cichu." #: actions/newmessage.php:108 actions/microsummary.php:62 -#: actions/newmessage.php:163 +#: actions/newmessage.php:163 actions/newmessage.php:114 msgid "No such user" -msgstr "" +msgstr "Nie ma takiego użytkownika" #: actions/newmessage.php:117 actions/newmessage.php:67 +#: actions/newmessage.php:71 msgid "New message" -msgstr "" +msgstr "Nowa wiadomość" #: actions/noticesearch.php:95 actions/noticesearch.php:146 msgid "Notice without matching profile" -msgstr "" +msgstr "Wpis bez odpowiadającego profilu" #: actions/openidsettings.php:28 actions/openidsettings.php:70 #, php-format msgid "[OpenID](%%doc.openid%%) lets you log into many sites " -msgstr "" +msgstr "[OpenID](%%doc.openid%%) umożliwia logowanie się na wiele stron " #: actions/openidsettings.php:46 actions/openidsettings.php:96 msgid "If you want to add an OpenID to your account, " -msgstr "" +msgstr "Jeśli chcesz dodać identyfikator OpenID do konta, " #: actions/openidsettings.php:74 msgid "Removing your only OpenID would make it impossible to log in! " -msgstr "" +msgstr "Usunięcie jedynego identyfikatora OpenID uniemożliwi zalogowanie się! " #: actions/openidsettings.php:87 actions/openidsettings.php:143 msgid "You can remove an OpenID from your account " -msgstr "" +msgstr "Można usunąć identyfikator OpenID z konta " #: actions/outbox.php:28 actions/outbox.php:58 #, php-format msgid "Outbox for %s - page %d" -msgstr "" +msgstr "Wysłane wiadomości użytkownika %s - strona %d" #: actions/outbox.php:30 actions/outbox.php:61 #, php-format msgid "Outbox for %s" -msgstr "" +msgstr "Wysłane wiadomości użytkownika %s" #: actions/outbox.php:53 actions/outbox.php:116 msgid "This is your outbox, which lists private messages you have sent." -msgstr "" +msgstr "To są wiadomości wysłane, czyli prywatne wiadomości, które wysłałeś." #: actions/peoplesearch.php:28 actions/peoplesearch.php:52 #, php-format msgid "" "Search for people on %%site.name%% by their name, location, or interests. " msgstr "" +"Znajdź osoby na %%site.name%% według ich nazwiska, położenia lub " +"zainteresowań. " #: actions/profilesettings.php:27 actions/profilesettings.php:69 msgid "You can update your personal profile info here " -msgstr "" +msgstr "Można tutaj zaktualizować osobiste informacje profilu " #: actions/profilesettings.php:115 actions/remotesubscribe.php:320 #: actions/userauthorization.php:159 actions/userrss.php:76 #: actions/avatarsettings.php:104 actions/avatarsettings.php:179 #: actions/grouplogo.php:177 actions/remotesubscribe.php:367 #: actions/userauthorization.php:176 actions/userrss.php:82 +#: actions/avatarsettings.php:106 actions/avatarsettings.php:182 +#: actions/grouplogo.php:183 actions/remotesubscribe.php:366 msgid "User without matching profile" -msgstr "" +msgstr "Użytkownik bez odpowiadającego profilu" #: actions/recoverpassword.php:91 actions/recoverpassword.php:97 msgid "This confirmation code is too old. " -msgstr "" +msgstr "Ten kod potwierdzający jest za stary. " #: actions/recoverpassword.php:141 actions/recoverpassword.php:152 msgid "If you've forgotten or lost your" -msgstr "" +msgstr "Jeśli zapomniałeś lub zgubiłeś" #: actions/recoverpassword.php:154 actions/recoverpassword.php:158 msgid "You've been identified. Enter a " -msgstr "" +msgstr "Zostałeś zidentyfikowany. Podaj " #: actions/recoverpassword.php:169 actions/recoverpassword.php:188 msgid "Your nickname on this server, " -msgstr "" +msgstr "Pseudonim na tym serwerze, " #: actions/recoverpassword.php:271 actions/recoverpassword.php:304 msgid "Instructions for recovering your password " -msgstr "" +msgstr "Instrukcje przywracania hasła " #: actions/recoverpassword.php:327 actions/recoverpassword.php:361 msgid "New password successfully saved. " -msgstr "" +msgstr "Pomyślnie zapisano nowe hasło. " #: actions/register.php:95 actions/register.php:180 +#: actions/passwordsettings.php:147 msgid "Password must be 6 or more characters." -msgstr "" +msgstr "Hasło musi mieć sześć lub więcej znaków." #: actions/register.php:216 #, php-format msgid "" "Congratulations, %s! And welcome to %%%%site.name%%%%. From here, you may " "want to..." -msgstr "" +msgstr "Gratulacje, %s! Witaj na %%%%site.name%%%%. Stąd możesz chcieć..." #: actions/register.php:227 msgid "(You should receive a message by email momentarily, with " -msgstr "" +msgstr "(Powinieneś właśnie otrzymać wiadomość przez e-mail z " #: actions/remotesubscribe.php:51 actions/remotesubscribe.php:74 #, php-format msgid "To subscribe, you can [login](%%action.login%%)," -msgstr "" +msgstr "Aby zasubskrybować, można [zalogować się](%%action.login%%)," #: actions/showfavorites.php:61 actions/showfavorites.php:145 +#: actions/showfavorites.php:147 #, php-format msgid "Feed for favorites of %s" -msgstr "" +msgstr "Kanał ulubionych wpisów użytkownika %s" #: actions/showfavorites.php:84 actions/twitapifavorites.php:85 #: actions/showfavorites.php:202 actions/twitapifavorites.php:59 +#: actions/showfavorites.php:179 msgid "Could not retrieve favorite notices." -msgstr "" +msgstr "Nie można odebrać ulubionych wpisów." #: actions/showmessage.php:33 actions/showmessage.php:81 msgid "No such message." -msgstr "" +msgstr "Nie ma takiej wiadomości." -#: actions/showmessage.php:42 +#: actions/showmessage.php:42 actions/showmessage.php:98 msgid "Only the sender and recipient may read this message." -msgstr "" +msgstr "Tylko nadawca i odbiorca mogą przeczytać tę wiadomość." #: actions/showmessage.php:61 actions/showmessage.php:108 #, php-format msgid "Message to %1$s on %2$s" -msgstr "" +msgstr "Wiadomość do użytkownika %1$s na %2$s" #: actions/showmessage.php:66 actions/showmessage.php:113 #, php-format msgid "Message from %1$s on %2$s" -msgstr "" +msgstr "Wiadomość od użytkownika %1$s na %2$s" #: actions/showstream.php:154 msgid "Send a message" -msgstr "" +msgstr "Wyślij wiadomość" #: actions/smssettings.php:312 actions/smssettings.php:464 #, php-format msgid "Mobile carrier for your phone. " -msgstr "" +msgstr "Operator komórkowy Twojego telefonu. " #: actions/twitapidirect_messages.php:76 actions/twitapidirect_messages.php:68 +#: actions/twitapidirect_messages.php:67 #, php-format msgid "Direct messages to %s" -msgstr "" +msgstr "Bezpośrednia wiadomość do użytkownika %s" #: actions/twitapidirect_messages.php:77 actions/twitapidirect_messages.php:69 +#: actions/twitapidirect_messages.php:68 #, php-format msgid "All the direct messages sent to %s" -msgstr "" +msgstr "Wszystkie bezpośrednie wiadomości wysłane do użytkownika %s" #: actions/twitapidirect_messages.php:81 actions/twitapidirect_messages.php:73 +#: actions/twitapidirect_messages.php:72 msgid "Direct Messages You've Sent" -msgstr "" +msgstr "Wysłane bezpośrednie wiadomości" #: actions/twitapidirect_messages.php:82 actions/twitapidirect_messages.php:74 +#: actions/twitapidirect_messages.php:73 #, php-format msgid "All the direct messages sent from %s" -msgstr "" +msgstr "Wszystkie bezpośrednie wiadomości wysłane od użytkownika %s" #: actions/twitapidirect_messages.php:128 #: actions/twitapidirect_messages.php:137 +#: actions/twitapidirect_messages.php:146 msgid "No message text!" -msgstr "" +msgstr "Brak tekstu wiadomości!" #: actions/twitapidirect_messages.php:138 #: actions/twitapidirect_messages.php:150 +#: actions/twitapidirect_messages.php:159 msgid "Recipient user not found." -msgstr "" +msgstr "Nie znaleziono odbiorcy." #: actions/twitapidirect_messages.php:141 #: actions/twitapidirect_messages.php:153 +#: actions/twitapidirect_messages.php:162 msgid "Can't send direct messages to users who aren't your friend." msgstr "" +"Nie można wysłać bezpośredniej wiadomości do użytkowników, którzy nie są " +"Twoimi przyjaciółmi." #: actions/twitapifavorites.php:92 actions/twitapifavorites.php:66 +#: actions/twitapifavorites.php:64 #, php-format msgid "%s / Favorites from %s" -msgstr "" +msgstr "%s/ulubione wpisy od %s" #: actions/twitapifavorites.php:95 actions/twitapifavorites.php:69 +#: actions/twitapifavorites.php:68 #, php-format msgid "%s updates favorited by %s / %s." -msgstr "" +msgstr "Użytkownik %s aktualizuje ulubione według %s/%s." #: actions/twitapifavorites.php:187 lib/mail.php:275 #: actions/twitapifavorites.php:164 lib/mail.php:553 +#: actions/twitapifavorites.php:170 lib/mail.php:554 #, php-format msgid "%s added your notice as a favorite" -msgstr "" +msgstr "Użytkownik %s dodał Twój wpis jako ulubiony" #: actions/twitapifavorites.php:188 lib/mail.php:276 #: actions/twitapifavorites.php:165 @@ -3080,230 +3285,251 @@ msgid "" "%1$s just added your notice from %2$s as one of their favorites.\n" "\n" msgstr "" +"Użytkownik %1$s właśnie dodał Twój wpis od %2$s jako jeden z jego " +"ulubionych.\n" +"\n" #: actions/twittersettings.php:27 msgid "" "Add your Twitter account to automatically send your notices to Twitter, " msgstr "" +"Dodaj swoje konto Twittera, aby automatycznie wysyłać wpisy na Twittera, " #: actions/twittersettings.php:41 actions/twittersettings.php:60 +#: actions/twittersettings.php:61 msgid "Twitter settings" -msgstr "" +msgstr "Ustawienia Twittera" #: actions/twittersettings.php:48 actions/twittersettings.php:105 +#: actions/twittersettings.php:106 msgid "Twitter Account" -msgstr "" +msgstr "Konto Twittera" #: actions/twittersettings.php:56 actions/twittersettings.php:113 +#: actions/twittersettings.php:114 msgid "Current verified Twitter account." -msgstr "" +msgstr "Obecnie sprawdzone konto Twittera." #: actions/twittersettings.php:63 msgid "Twitter Username" -msgstr "" +msgstr "Nazwa użytkownika Twitter" #: actions/twittersettings.php:65 actions/twittersettings.php:123 +#: actions/twittersettings.php:126 msgid "No spaces, please." -msgstr "" +msgstr "Bez spacji." #: actions/twittersettings.php:67 msgid "Twitter Password" -msgstr "" +msgstr "Hasło Twittera" #: actions/twittersettings.php:72 actions/twittersettings.php:139 +#: actions/twittersettings.php:142 msgid "Automatically send my notices to Twitter." -msgstr "" +msgstr "Automatycznie wyślij moje wpisy na Twittera." #: actions/twittersettings.php:75 actions/twittersettings.php:146 +#: actions/twittersettings.php:149 msgid "Send local \"@\" replies to Twitter." -msgstr "" +msgstr "Wyślij lokalne odpowiedzi \"@\" na Twittera." #: actions/twittersettings.php:78 actions/twittersettings.php:153 +#: actions/twittersettings.php:156 msgid "Subscribe to my Twitter friends here." -msgstr "" +msgstr "Zasubskrybuj tutaj moich przyjaciół z Twittera." -#: actions/twittersettings.php:122 +#: actions/twittersettings.php:122 actions/twittersettings.php:331 msgid "" "Username must have only numbers, upper- and lowercase letters, and " "underscore (_). 15 chars max." msgstr "" +"Nazwa użytkownika może zawierać tylko liczby, małe i wielkie litery oraz " +"podkreślnik (_). Maksymalnie 15 znaków." #: actions/twittersettings.php:128 actions/twittersettings.php:334 +#: actions/twittersettings.php:338 msgid "Could not verify your Twitter credentials!" -msgstr "" +msgstr "Nie można sprawdzić danych uwierzytelniających Twittera!" #: actions/twittersettings.php:137 #, php-format msgid "Unable to retrieve account information for \"%s\" from Twitter." -msgstr "" +msgstr "Nie można pobrać informacji o koncie \"%s\" z Twittera." #: actions/twittersettings.php:151 actions/twittersettings.php:170 #: actions/twittersettings.php:348 actions/twittersettings.php:368 +#: actions/twittersettings.php:352 actions/twittersettings.php:372 msgid "Unable to save your Twitter settings!" -msgstr "" +msgstr "Nie można zapisać ustawień Twittera!" #: actions/twittersettings.php:174 actions/twittersettings.php:376 +#: actions/twittersettings.php:380 msgid "Twitter settings saved." -msgstr "" +msgstr "Zapisano ustawienia Twittera." #: actions/twittersettings.php:192 actions/twittersettings.php:395 +#: actions/twittersettings.php:399 msgid "That is not your Twitter account." -msgstr "" +msgstr "To nie jest Twoje konto Twittera." #: actions/twittersettings.php:200 actions/twittersettings.php:208 -#: actions/twittersettings.php:403 +#: actions/twittersettings.php:403 actions/twittersettings.php:407 msgid "Couldn't remove Twitter user." -msgstr "" +msgstr "Nie można usunąć użytkownika Twittera." #: actions/twittersettings.php:212 actions/twittersettings.php:407 +#: actions/twittersettings.php:411 msgid "Twitter account removed." -msgstr "" +msgstr "Usunięto użytkownika Twittera." #: actions/twittersettings.php:225 actions/twittersettings.php:239 #: actions/twittersettings.php:428 actions/twittersettings.php:439 -#: actions/twittersettings.php:453 +#: actions/twittersettings.php:453 actions/twittersettings.php:432 +#: actions/twittersettings.php:443 actions/twittersettings.php:457 msgid "Couldn't save Twitter preferences." -msgstr "" +msgstr "Nie można zapisać preferencji Twittera." #: actions/twittersettings.php:245 actions/twittersettings.php:461 +#: actions/twittersettings.php:465 msgid "Twitter preferences saved." -msgstr "" +msgstr "Zapisano preferencje Twittera." #: actions/userauthorization.php:84 actions/userauthorization.php:86 msgid "Please check these details to make sure " -msgstr "" +msgstr "Sprawdź te szczegóły, aby upewnić się " #: actions/userauthorization.php:324 actions/userauthorization.php:340 msgid "The subscription has been authorized, but no " -msgstr "" +msgstr "Subskrypcja została upoważniona, ale nie " #: actions/userauthorization.php:334 actions/userauthorization.php:351 msgid "The subscription has been rejected, but no " -msgstr "" +msgstr "Subskrypcja została odrzucona, ale nie " #: classes/Channel.php:113 classes/Channel.php:132 classes/Channel.php:151 +#: lib/channel.php:138 lib/channel.php:158 msgid "Command results" -msgstr "" +msgstr "Wyniki polecenia" -#: classes/Channel.php:148 classes/Channel.php:204 +#: classes/Channel.php:148 classes/Channel.php:204 lib/channel.php:210 msgid "Command complete" -msgstr "" +msgstr "Zakończono polecenie" -#: classes/Channel.php:158 classes/Channel.php:215 +#: classes/Channel.php:158 classes/Channel.php:215 lib/channel.php:221 msgid "Command failed" -msgstr "" +msgstr "Polecenie nie powiodło się" -#: classes/Command.php:39 classes/Command.php:44 +#: classes/Command.php:39 classes/Command.php:44 lib/command.php:44 msgid "Sorry, this command is not yet implemented." -msgstr "" +msgstr "Przepraszamy, te polecenie nie zostało jeszcze zaimplementowane." #: classes/Command.php:96 classes/Command.php:113 #, php-format msgid "Subscriptions: %1$s\n" -msgstr "" +msgstr "Subskrypcje: %1$s\n" #: classes/Command.php:125 classes/Command.php:242 classes/Command.php:145 -#: classes/Command.php:276 +#: classes/Command.php:276 lib/command.php:145 lib/command.php:276 msgid "User has no last notice" -msgstr "" +msgstr "Użytkownik nie posiada ostatniego wpisu" -#: classes/Command.php:146 classes/Command.php:166 +#: classes/Command.php:146 classes/Command.php:166 lib/command.php:166 msgid "Notice marked as fave." -msgstr "" +msgstr "Zaznaczono wpis jako ulubiony." -#: classes/Command.php:166 classes/Command.php:189 +#: classes/Command.php:166 classes/Command.php:189 lib/command.php:189 #, php-format msgid "%1$s (%2$s)" -msgstr "" +msgstr "%1$s (%2$s)" -#: classes/Command.php:169 classes/Command.php:192 +#: classes/Command.php:169 classes/Command.php:192 lib/command.php:192 #, php-format msgid "Fullname: %s" -msgstr "" +msgstr "Imię i nazwisko: %s" -#: classes/Command.php:172 classes/Command.php:195 +#: classes/Command.php:172 classes/Command.php:195 lib/command.php:195 #, php-format msgid "Location: %s" -msgstr "" +msgstr "Położenie: %s" -#: classes/Command.php:175 classes/Command.php:198 +#: classes/Command.php:175 classes/Command.php:198 lib/command.php:198 #, php-format msgid "Homepage: %s" -msgstr "" +msgstr "Strona domowa: %s" -#: classes/Command.php:178 classes/Command.php:201 +#: classes/Command.php:178 classes/Command.php:201 lib/command.php:201 #, php-format msgid "About: %s" -msgstr "" +msgstr "O mnie: %s" -#: classes/Command.php:200 classes/Command.php:228 +#: classes/Command.php:200 classes/Command.php:228 lib/command.php:228 #, php-format msgid "Message too long - maximum is 140 characters, you sent %d" -msgstr "" +msgstr "Wiadomość jest za długa - maksymalnie 140 znaków, wysłano %d" -#: classes/Command.php:214 classes/Command.php:245 +#: classes/Command.php:214 classes/Command.php:245 lib/command.php:245 #, php-format msgid "Direct message to %s sent" -msgstr "" +msgstr "Wysłano bezpośrednią wiadomość do użytkownika %s" -#: classes/Command.php:216 classes/Command.php:247 +#: classes/Command.php:216 classes/Command.php:247 lib/command.php:247 msgid "Error sending direct message." -msgstr "" +msgstr "Błąd podczas wysyłania bezpośredniej wiadomości." -#: classes/Command.php:263 classes/Command.php:300 +#: classes/Command.php:263 classes/Command.php:300 lib/command.php:300 msgid "Specify the name of the user to subscribe to" -msgstr "" +msgstr "Podaj nazwę użytkownika do zasubskrybowania" -#: classes/Command.php:270 classes/Command.php:307 +#: classes/Command.php:270 classes/Command.php:307 lib/command.php:307 #, php-format msgid "Subscribed to %s" -msgstr "" +msgstr "Zasubskrybowano użytkownika %s" -#: classes/Command.php:288 classes/Command.php:328 +#: classes/Command.php:288 classes/Command.php:328 lib/command.php:328 msgid "Specify the name of the user to unsubscribe from" -msgstr "" +msgstr "Podaj nazwę użytkownika do usunięcia subskrypcji" -#: classes/Command.php:295 classes/Command.php:335 +#: classes/Command.php:295 classes/Command.php:335 lib/command.php:335 #, php-format msgid "Unsubscribed from %s" -msgstr "" +msgstr "Usunięto subskrypcję użytkownika %s" #: classes/Command.php:310 classes/Command.php:330 classes/Command.php:353 -#: classes/Command.php:376 +#: classes/Command.php:376 lib/command.php:353 lib/command.php:376 msgid "Command not yet implemented." -msgstr "" +msgstr "Nie zaimplementowano polecenia." -#: classes/Command.php:313 classes/Command.php:356 +#: classes/Command.php:313 classes/Command.php:356 lib/command.php:356 msgid "Notification off." -msgstr "" +msgstr "Wyłączono powiadomienia." -#: classes/Command.php:315 classes/Command.php:358 +#: classes/Command.php:315 classes/Command.php:358 lib/command.php:358 msgid "Can't turn off notification." -msgstr "" +msgstr "Nie można wyłączyć powiadomień." -#: classes/Command.php:333 classes/Command.php:379 +#: classes/Command.php:333 classes/Command.php:379 lib/command.php:379 msgid "Notification on." -msgstr "" +msgstr "Włączono powiadomienia." -#: classes/Command.php:335 classes/Command.php:381 +#: classes/Command.php:335 classes/Command.php:381 lib/command.php:381 msgid "Can't turn on notification." -msgstr "" +msgstr "Nie można włączyć powiadomień." #: classes/Command.php:344 classes/Command.php:392 msgid "Commands:\n" -msgstr "" +msgstr "Polecenia:\n" #: classes/Message.php:53 classes/Message.php:56 msgid "Could not insert message." -msgstr "" +msgstr "Nie można wprowadzić wiadomości." #: classes/Message.php:63 classes/Message.php:66 msgid "Could not update message with new URI." -msgstr "" +msgstr "Nie można zaktualizować wiadomości za pomocą nowego adresu URL." #: lib/gallery.php:46 msgid "User without matching profile in system." -msgstr "" +msgstr "Użytkownik bez odpowiadającego profilu w systemie." #: lib/mail.php:147 lib/mail.php:289 #, php-format @@ -3311,11 +3537,13 @@ msgid "" "You have a new posting address on %1$s.\n" "\n" msgstr "" +"Posiadasz nowy adres wysyłania na %1$s.\n" +"\n" -#: lib/mail.php:249 lib/mail.php:508 +#: lib/mail.php:249 lib/mail.php:508 lib/mail.php:509 #, php-format msgid "New private message from %s" -msgstr "" +msgstr "Nowa prywatna wiadomość od użytkownika %s" #: lib/mail.php:253 lib/mail.php:512 #, php-format @@ -3323,88 +3551,97 @@ msgid "" "%1$s (%2$s) sent you a private message:\n" "\n" msgstr "" +"Użytkownik %1$s (%2$s) wysłał Ci prywatną wiadomość:\n" +"\n" -#: lib/mailbox.php:43 lib/mailbox.php:89 +#: lib/mailbox.php:43 lib/mailbox.php:89 lib/mailbox.php:91 msgid "Only the user can read their own mailboxes." -msgstr "" +msgstr "Tylko użytkownik może czytać swoje skrzynki pocztowe." #: lib/openid.php:195 lib/openid.php:203 msgid "This form should automatically submit itself. " -msgstr "" +msgstr "Ten formularz powinien automatycznie się wysłać. " #: lib/personal.php:65 lib/personalgroupnav.php:113 msgid "Favorites" -msgstr "" +msgstr "Ulubione" #: lib/personal.php:66 lib/personalgroupnav.php:114 #, php-format msgid "%s's favorite notices" -msgstr "" +msgstr "Ulubione wpisy użytkownika %s" #: lib/personal.php:66 lib/personalgroupnav.php:114 msgid "User" -msgstr "" +msgstr "Użytkownik" #: lib/personal.php:75 lib/personalgroupnav.php:123 msgid "Inbox" -msgstr "" +msgstr "Odebrane" #: lib/personal.php:76 lib/personalgroupnav.php:124 msgid "Your incoming messages" -msgstr "" +msgstr "Wiadomości przychodzące" #: lib/personal.php:80 lib/personalgroupnav.php:128 msgid "Outbox" -msgstr "" +msgstr "Wysłane" #: lib/personal.php:81 lib/personalgroupnav.php:129 msgid "Your sent messages" -msgstr "" +msgstr "Wysłane wiadomości" #: lib/settingsaction.php:99 lib/connectsettingsaction.php:110 msgid "Twitter" -msgstr "" +msgstr "Twitter" #: lib/settingsaction.php:100 lib/connectsettingsaction.php:111 msgid "Twitter integration options" -msgstr "" +msgstr "Opcje integracji z Twitterem" #: lib/util.php:1718 lib/messageform.php:139 lib/noticelist.php:422 +#: lib/messageform.php:137 lib/noticelist.php:425 msgid "To" -msgstr "" +msgstr "Do" #: scripts/maildaemon.php:45 scripts/maildaemon.php:48 msgid "Could not parse message." -msgstr "" +msgstr "Nie można przeanalizować wiadomości." -#: actions/all.php:63 actions/facebookhome.php:162 -#, fuzzy, php-format +#: actions/all.php:63 actions/facebookhome.php:162 actions/all.php:66 +#: actions/facebookhome.php:161 +#, php-format msgid "%s and friends, page %d" -msgstr "%s i przyjaciele" +msgstr "Użytkownik %s i przyjaciele, strona %d" #: actions/avatarsettings.php:76 msgid "You can upload your personal avatar." -msgstr "" +msgstr "Można wysłać osobisty awatar." #: actions/avatarsettings.php:117 actions/avatarsettings.php:191 -#: actions/grouplogo.php:250 -#, fuzzy +#: actions/grouplogo.php:250 actions/avatarsettings.php:119 +#: actions/avatarsettings.php:194 actions/grouplogo.php:256 msgid "Avatar settings" -msgstr "Ustawienia" +msgstr "Ustawienia awatara" #: actions/avatarsettings.php:124 actions/avatarsettings.php:199 #: actions/grouplogo.php:198 actions/grouplogo.php:258 +#: actions/avatarsettings.php:126 actions/avatarsettings.php:202 +#: actions/grouplogo.php:204 actions/grouplogo.php:264 msgid "Original" -msgstr "" +msgstr "Oryginał" #: actions/avatarsettings.php:139 actions/avatarsettings.php:211 #: actions/grouplogo.php:209 actions/grouplogo.php:270 +#: actions/avatarsettings.php:141 actions/avatarsettings.php:214 +#: actions/grouplogo.php:215 actions/grouplogo.php:276 msgid "Preview" -msgstr "" +msgstr "Podgląd" #: actions/avatarsettings.php:225 actions/grouplogo.php:284 +#: actions/avatarsettings.php:228 actions/grouplogo.php:291 msgid "Crop" -msgstr "" +msgstr "Przytnij" #: actions/avatarsettings.php:248 actions/deletenotice.php:133 #: actions/emailsettings.php:224 actions/grouplogo.php:307 @@ -3416,594 +3653,567 @@ msgstr "" #: actions/subedit.php:38 actions/twittersettings.php:290 #: actions/userauthorization.php:39 msgid "There was a problem with your session token. " -msgstr "" +msgstr "Wystąpił problem z tokenem sesji. " #: actions/avatarsettings.php:303 actions/grouplogo.php:360 +#: actions/avatarsettings.php:308 msgid "Pick a square area of the image to be your avatar" -msgstr "" +msgstr "Wybierz kwadratowy obszar obrazu do awatara" #: actions/avatarsettings.php:327 actions/grouplogo.php:384 +#: actions/avatarsettings.php:323 actions/grouplogo.php:382 msgid "Lost our file data." -msgstr "" +msgstr "Utracono dane pliku." #: actions/avatarsettings.php:334 actions/grouplogo.php:391 -#: classes/User_group.php:112 -#, fuzzy +#: classes/User_group.php:112 lib/imagefile.php:112 msgid "Lost our file." -msgstr "Brak takiego wpisu." +msgstr "Utracono plik." #: actions/avatarsettings.php:349 actions/avatarsettings.php:383 #: actions/grouplogo.php:406 actions/grouplogo.php:440 -#: classes/User_group.php:129 classes/User_group.php:161 +#: classes/User_group.php:129 classes/User_group.php:161 lib/imagefile.php:144 +#: lib/imagefile.php:191 msgid "Unknown file type" -msgstr "" +msgstr "Nieznany typ pliku" #: actions/block.php:69 actions/subedit.php:46 actions/unblock.php:70 msgid "No profile specified." -msgstr "" +msgstr "Nie podano profilu." #: actions/block.php:74 actions/subedit.php:53 actions/tagother.php:46 #: actions/unblock.php:75 msgid "No profile with that ID." -msgstr "" +msgstr "Brak profilu o tym identyfikatorze." #: actions/block.php:111 -#, fuzzy msgid "Block user" -msgstr "Brak takiego użytkownika." +msgstr "Zablokuj użytkownika" #: actions/block.php:129 msgid "Are you sure you want to block this user? " -msgstr "" +msgstr "Na pewno chcesz zablokować tego użytkownika? " #: actions/block.php:162 -#, fuzzy msgid "You have already blocked this user." -msgstr "Nie musisz ponownie się logować!" +msgstr "Ten użytkownik został już zablokowany." #: actions/block.php:167 msgid "Failed to save block information." -msgstr "" +msgstr "Zapisanie informacji o blokadzie nie powiodło się." #: actions/confirmaddress.php:159 -#, fuzzy, php-format +#, php-format msgid "The address \"%s\" has been " -msgstr "Adres został usunięty." +msgstr "Adres \"%s\" został " #: actions/deletenotice.php:73 msgid "You are about to permanently delete a notice. " -msgstr "" +msgstr "Za chwilę wpis zostanie trwale usunięty. " #: actions/disfavor.php:94 msgid "Add to favorites" -msgstr "" +msgstr "Dodaj do ulubionych" #: actions/editgroup.php:54 #, php-format msgid "Edit %s group" -msgstr "" +msgstr "Edytuj grupę %s" #: actions/editgroup.php:66 actions/groupbyid.php:72 actions/grouplogo.php:66 #: actions/joingroup.php:60 actions/newgroup.php:65 actions/showgroup.php:100 +#: actions/grouplogo.php:70 actions/grouprss.php:80 msgid "Inboxes must be enabled for groups to work" -msgstr "" +msgstr "Skrzynki odbiorcze grup muszą być włączone, aby działały" #: actions/editgroup.php:71 actions/grouplogo.php:71 actions/newgroup.php:70 +#: actions/grouplogo.php:75 msgid "You must be logged in to create a group." -msgstr "" +msgstr "Musisz być zalogowany, aby utworzyć grupę." #: actions/editgroup.php:87 actions/grouplogo.php:87 #: actions/groupmembers.php:76 actions/joingroup.php:81 -#: actions/showgroup.php:121 -#, fuzzy +#: actions/showgroup.php:121 actions/grouplogo.php:91 actions/grouprss.php:96 msgid "No nickname" -msgstr "Brak pseudonimu." +msgstr "Brak pseudonimu" #: actions/editgroup.php:99 actions/groupbyid.php:88 actions/grouplogo.php:100 #: actions/groupmembers.php:83 actions/joingroup.php:88 -#: actions/showgroup.php:128 -#, fuzzy +#: actions/showgroup.php:128 actions/grouplogo.php:104 +#: actions/grouprss.php:103 msgid "No such group" -msgstr "Brak takiego wpisu." +msgstr "Nie ma takiej grupy" #: actions/editgroup.php:106 actions/editgroup.php:165 -#: actions/grouplogo.php:107 +#: actions/grouplogo.php:107 actions/grouplogo.php:111 msgid "You must be an admin to edit the group" -msgstr "" +msgstr "Musisz być administratorem, aby zmodyfikować grupę" #: actions/editgroup.php:157 msgid "Use this form to edit the group." -msgstr "" +msgstr "Użyj tego formularza, aby zmodyfikować grupę." #: actions/editgroup.php:179 actions/newgroup.php:130 actions/register.php:156 -#, fuzzy msgid "Nickname must have only lowercase letters " -msgstr "Pseudonim musi zawierać tylko małe litery i cyfry, bez znaków spacji." +msgstr "Pseudonim może zawierać tylko małe litery " #: actions/editgroup.php:198 actions/newgroup.php:149 -#, fuzzy msgid "description is too long (max 140 chars)." -msgstr "Wpis \"O mnie\" jest za długi (maks. 140 znaków)" +msgstr "opis jest za długi (maksymalnie 140 znaków)." #: actions/editgroup.php:218 -#, fuzzy msgid "Could not update group." -msgstr "Nie można zaktualizować użytkownika." +msgstr "Nie można zaktualizować grupy." #: actions/editgroup.php:226 -#, fuzzy msgid "Options saved." -msgstr "Ustawienia zostały zapisane." +msgstr "Zapisano opcje." #: actions/emailsettings.php:107 actions/imsettings.php:108 -#, fuzzy, php-format +#, php-format msgid "Awaiting confirmation on this address. " -msgstr "Błąd kodu potwierdzającego." +msgstr "Oczekiwanie na potwierdzenie tego adresu. " #: actions/emailsettings.php:139 actions/smssettings.php:150 msgid "Make a new email address for posting to; " -msgstr "" +msgstr "Utwórz nowy adres e-mail do wysyłania; " #: actions/emailsettings.php:157 msgid "Send me email when someone " -msgstr "" +msgstr "Wyślij mi wiadomość e-mail, kiedy ktoś " -#: actions/emailsettings.php:168 +#: actions/emailsettings.php:168 actions/emailsettings.php:173 msgid "Allow friends to nudge me and send me an email." -msgstr "" +msgstr "Pozwól przyjaciołom na szturchanie mnie i wyślij mi wiadomość e-mail." #: actions/emailsettings.php:321 -#, fuzzy msgid "That email address already belongs " -msgstr "Taki e-mail już istnieje" +msgstr "Ten adres e-mail już należy " #: actions/emailsettings.php:343 -#, fuzzy msgid "A confirmation code was sent to the email address you added. " -msgstr "" -"Na Twój adres komunikatora został wysłany kod potwierdzający. Musisz " -"zaakceptować otrzymywanie wiadomości od %s." +msgstr "Kod potwierdzający został wysłany na dodany adres e-mail. " #: actions/facebookhome.php:110 msgid "Server error - couldn't get user!" -msgstr "" +msgstr "Błąd serwera - nie można uzyskać użytkownika!" #: actions/facebookhome.php:196 #, php-format msgid "If you would like the %s app to automatically update " -msgstr "" +msgstr "Jeśli chcesz, aby aplikacja %s automatycznie aktualizowała " #: actions/facebookhome.php:213 actions/facebooksettings.php:137 #, php-format msgid "Allow %s to update my Facebook status" -msgstr "" +msgstr "Pozwól %s na aktualizowanie mojego statusu na Facebook" -#: actions/facebookhome.php:218 +#: actions/facebookhome.php:218 actions/facebookhome.php:223 msgid "Skip" -msgstr "" +msgstr "Pomiń" -#: actions/facebookhome.php:235 -#, fuzzy +#: actions/facebookhome.php:235 lib/facebookaction.php:479 msgid "No notice content!" -msgstr "Brak zawartości!" +msgstr "Brak zawartości wpisu!" #: actions/facebookhome.php:295 lib/action.php:870 lib/facebookaction.php:399 +#: actions/facebookhome.php:253 lib/action.php:973 lib/facebookaction.php:433 msgid "Pagination" -msgstr "" +msgstr "Paginacja" #: actions/facebookhome.php:304 lib/action.php:879 lib/facebookaction.php:408 -#, fuzzy +#: actions/facebookhome.php:262 lib/action.php:982 lib/facebookaction.php:442 msgid "After" -msgstr "« następne" +msgstr "Następne" #: actions/facebookhome.php:312 lib/action.php:887 lib/facebookaction.php:416 -#, fuzzy +#: actions/facebookhome.php:270 lib/action.php:990 lib/facebookaction.php:450 msgid "Before" -msgstr "Wcześniej »" +msgstr "Wcześniej" #: actions/facebookinvite.php:70 #, php-format msgid "Thanks for inviting your friends to use %s" -msgstr "" +msgstr "Dziękujemy za zaproszenie przyjaciół do używania %s" #: actions/facebookinvite.php:72 msgid "Invitations have been sent to the following users:" -msgstr "" +msgstr "Zaproszenia zostały wysłane do następujących użytkowników:" -#: actions/facebookinvite.php:96 +#: actions/facebookinvite.php:96 actions/facebookinvite.php:102 #, php-format msgid "You have been invited to %s" -msgstr "" +msgstr "Zostałeś zaproszony do %s" -#: actions/facebookinvite.php:105 -#, fuzzy, php-format +#: actions/facebookinvite.php:105 actions/facebookinvite.php:111 +#, php-format msgid "Invite your friends to use %s" -msgstr "Kanał dla znajomych użytkownika %s" +msgstr "Zaproś przyjaciół do używania %s" -#: actions/facebookinvite.php:113 +#: actions/facebookinvite.php:113 actions/facebookinvite.php:126 #, php-format msgid "Friends already using %s:" -msgstr "" +msgstr "Przyjaciele już używający %s:" -#: actions/facebookinvite.php:130 +#: actions/facebookinvite.php:130 actions/facebookinvite.php:143 #, php-format msgid "Send invitations" -msgstr "" +msgstr "Wyślij zaproszenia" #: actions/facebookremove.php:56 -#, fuzzy msgid "Couldn't remove Facebook user." -msgstr "Nie można zaktualizować użytkownika." +msgstr "Nie można usunąć użytkownika Facebook." #: actions/facebooksettings.php:65 msgid "There was a problem saving your sync preferences!" -msgstr "" +msgstr "Wystąpił problem podczas zapisywania preferencji synchronizacji!" #: actions/facebooksettings.php:67 -#, fuzzy msgid "Sync preferences saved." -msgstr "Preferencje zostały zapisane." +msgstr "Zapisano preferencje synchronizacji." #: actions/facebooksettings.php:90 msgid "Automatically update my Facebook status with my notices." -msgstr "" +msgstr "Automatycznie aktualizuj status na Facebook moimi wpisami." #: actions/facebooksettings.php:97 msgid "Send \"@\" replies to Facebook." -msgstr "" +msgstr "Wyślij odpowiedzi \"@\" do Facebook." #: actions/facebooksettings.php:106 -#, fuzzy msgid "Prefix" -msgstr "Profil" +msgstr "Przedrostek" #: actions/facebooksettings.php:108 msgid "A string to prefix notices with." -msgstr "" +msgstr "Tekst do poprzedzenia wpisów." #: actions/facebooksettings.php:124 #, php-format msgid "If you would like %s to automatically update " -msgstr "" +msgstr "Jeśli chcesz, aby %s automatycznie aktualizowało " #: actions/facebooksettings.php:147 -#, fuzzy msgid "Sync preferences" -msgstr "Preferencje" +msgstr "Zsynchronizuj preferencje" #: actions/favor.php:94 lib/disfavorform.php:140 msgid "Disfavor favorite" -msgstr "" +msgstr "Usuń wpis z ulubionych" #: actions/favorited.php:65 lib/popularnoticesection.php:76 -#: lib/publicgroupnav.php:91 -#, fuzzy +#: lib/publicgroupnav.php:91 lib/popularnoticesection.php:82 +#: lib/publicgroupnav.php:93 msgid "Popular notices" -msgstr "Brak takiego wpisu." +msgstr "Popularne wpisy" #: actions/favorited.php:67 -#, fuzzy, php-format +#, php-format msgid "Popular notices, page %d" -msgstr "Brak takiego wpisu." +msgstr "Popularne wpisy, strona %d" #: actions/favorited.php:79 msgid "The most popular notices on the site right now." -msgstr "" +msgstr "Najpopularniejsze wpisy na stronie w te chwili." #: actions/featured.php:69 lib/featureduserssection.php:82 -#: lib/publicgroupnav.php:87 +#: lib/publicgroupnav.php:87 lib/publicgroupnav.php:89 msgid "Featured users" -msgstr "" +msgstr "Znani użytkownicy" #: actions/featured.php:71 #, php-format msgid "Featured users, page %d" -msgstr "" +msgstr "Znani użytkownicy, strona %d" #: actions/featured.php:99 #, php-format msgid "A selection of some of the great users on %s" -msgstr "" +msgstr "Wybór znanych użytkowników na %s" #: actions/finishremotesubscribe.php:188 msgid "That user has blocked you from subscribing." -msgstr "" +msgstr "Ten użytkownik zablokował Cię z subskrypcji." #: actions/groupbyid.php:79 msgid "No ID" -msgstr "" +msgstr "Brak identyfikatora" #: actions/grouplogo.php:138 actions/grouplogo.php:191 +#: actions/grouplogo.php:144 actions/grouplogo.php:197 msgid "Group logo" -msgstr "" +msgstr "Logo grupy" #: actions/grouplogo.php:149 msgid "You can upload a logo image for your group." -msgstr "" +msgstr "Można wysłać obraz logo dla grupy." -#: actions/grouplogo.php:448 -#, fuzzy +#: actions/grouplogo.php:448 actions/grouplogo.php:401 msgid "Logo updated." -msgstr "Awatar załadowany." +msgstr "Zaktualizowano logo." -#: actions/grouplogo.php:450 -#, fuzzy +#: actions/grouplogo.php:450 actions/grouplogo.php:403 msgid "Failed updating logo." -msgstr "Uaktualnianie awatara nie powiodło się." +msgstr "Zaktualizowanie logo nie powiodło się." #: actions/groupmembers.php:93 lib/groupnav.php:91 #, php-format msgid "%s group members" -msgstr "" +msgstr "Członkowie grupy %s" #: actions/groupmembers.php:96 #, php-format msgid "%s group members, page %d" -msgstr "" +msgstr "Członkowie grupy %s, strona %d" #: actions/groupmembers.php:111 msgid "A list of the users in this group." -msgstr "" +msgstr "Lista użytkowników znajdujących się w tej grupie." #: actions/groups.php:62 actions/showstream.php:518 lib/publicgroupnav.php:79 -#: lib/subgroupnav.php:96 +#: lib/subgroupnav.php:96 lib/publicgroupnav.php:81 msgid "Groups" -msgstr "" +msgstr "Grupy" #: actions/groups.php:64 #, php-format msgid "Groups, page %d" -msgstr "" +msgstr "Grupy, strona %d" #: actions/groups.php:90 #, php-format msgid "%%%%site.name%%%% groups let you find and talk with " -msgstr "" +msgstr "Grupy %%%%site.name%%%% pozwalają na szukanie i rozmawianie z " #: actions/groups.php:106 actions/usergroups.php:124 lib/groupeditform.php:123 -#, fuzzy +#: actions/usergroups.php:125 msgid "Create a new group" -msgstr "Załóż nowe konto" +msgstr "Utwórz nową grupę" #: actions/groupsearch.php:57 -#, fuzzy, php-format +#, php-format msgid "" "Search for groups on %%site.name%% by their name, location, or description. " -msgstr "" -"Szukaj ludzi w serwisie %%site.name%%. Kryteriami mogą być imiona i " -"nazwiska, miejscowości lub zainteresowania. Użyj spacji aby oddzielić " -"elementy wyszukiwania. Słowa muszą mieć minimum 3 znaki." +msgstr "Znajdź grupy na %%site.name%% według ich nazw, położenia lub opisu. " #: actions/groupsearch.php:63 -#, fuzzy msgid "Group search" -msgstr "Szukaj ludzi" +msgstr "Znajdź grupę" #: actions/imsettings.php:70 msgid "You can send and receive notices through " -msgstr "" +msgstr "Można wysyłać i otrzymywać wpisy przez " #: actions/imsettings.php:120 #, php-format msgid "Jabber or GTalk address, " -msgstr "" +msgstr "adres Jabbera lub GTalk, " #: actions/imsettings.php:147 -#, fuzzy msgid "Send me replies through Jabber/GTalk " -msgstr "Wysyłaj mi wpisy przez Jabbera/GTalka" +msgstr "Wyślij mi odpowiedzi przez Jabbera/GTalk " #: actions/imsettings.php:321 -#, fuzzy, php-format +#, php-format msgid "A confirmation code was sent " -msgstr "Brak kodu potwierdzającego." +msgstr "Kod potwierdzający został wysłany " #: actions/joingroup.php:65 msgid "You must be logged in to join a group." -msgstr "" +msgstr "Musisz być zalogowany, aby dołączyć do grupy." #: actions/joingroup.php:95 -#, fuzzy msgid "You are already a member of that group" -msgstr "Nie musisz ponownie się logować!" +msgstr "Jesteś już członkiem tej grupy" #: actions/joingroup.php:128 -#, fuzzy, php-format +#, php-format msgid "Could not join user %s to group %s" -msgstr "Nie można przekierować do serwera: %s" +msgstr "Nie można dołączyć użytkownika %s do grupy %s" #: actions/joingroup.php:135 #, php-format msgid "%s joined group %s" -msgstr "" +msgstr "Użytkownik %s dołączył do grupy %s" #: actions/leavegroup.php:60 msgid "Inboxes must be enabled for groups to work." -msgstr "" +msgstr "Skrzynki odbiorcze dla grup muszą być włączone, aby działały." #: actions/leavegroup.php:65 msgid "You must be logged in to leave a group." -msgstr "" +msgstr "Musisz być zalogowany, aby opuścić grupę." #: actions/leavegroup.php:88 -#, fuzzy msgid "No such group." -msgstr "Brak takiego wpisu." +msgstr "Nie ma takiej grupy." #: actions/leavegroup.php:95 -#, fuzzy msgid "You are not a member of that group." -msgstr "Ten profil nie był wysłany przez Ciebie" +msgstr "Nie jesteś członkiem tej grupy." #: actions/leavegroup.php:100 msgid "You may not leave a group while you are its administrator." -msgstr "" +msgstr "Nie możesz opuścić grupy, kiedy jesteś jej administratorem." -#: actions/leavegroup.php:130 +#: actions/leavegroup.php:130 actions/leavegroup.php:124 msgid "Could not find membership record." -msgstr "" +msgstr "Nie można znaleźć wpisu członkostwa." -#: actions/leavegroup.php:138 -#, fuzzy, php-format +#: actions/leavegroup.php:138 actions/leavegroup.php:132 +#, php-format msgid "Could not remove user %s to group %s" -msgstr "Nie można utworzyć formularza OpenID: %s" +msgstr "Nie można usunąć użytkownika %s z grupy %s" -#: actions/leavegroup.php:145 +#: actions/leavegroup.php:145 actions/leavegroup.php:139 #, php-format msgid "%s left group %s" -msgstr "" +msgstr "Użytkownik %s opuścił grupę %s" -#: actions/login.php:225 lib/facebookaction.php:304 +#: actions/login.php:225 lib/facebookaction.php:304 actions/login.php:208 msgid "Login to site" -msgstr "" +msgstr "Zaloguj się na stronie" #: actions/microsummary.php:69 msgid "No current status" -msgstr "" +msgstr "Brak obecnego statusu" #: actions/newgroup.php:53 msgid "New group" -msgstr "" +msgstr "Nowa grupa" #: actions/newgroup.php:115 msgid "Use this form to create a new group." -msgstr "" +msgstr "Użyj tego formularza, aby utworzyć nową grupę." #: actions/newgroup.php:177 -#, fuzzy msgid "Could not create group." -msgstr "Nie można zapisać informacji o awatarze" +msgstr "Nie można utworzyć grupy." #: actions/newgroup.php:191 -#, fuzzy msgid "Could not set group membership." -msgstr "Nie można obserwować." +msgstr "Nie można ustawić członkostwa w grupie." #: actions/newmessage.php:119 actions/newnotice.php:132 -#, fuzzy msgid "That's too long. " -msgstr "Ten plik jest za duży." +msgstr "Wiadomość jest za długa. " #: actions/newmessage.php:134 msgid "Don't send a message to yourself; " -msgstr "" +msgstr "Nie wysyłaj wiadomości do siebie; " -#: actions/newnotice.php:166 -#, fuzzy +#: actions/newnotice.php:166 actions/newnotice.php:174 msgid "Notice posted" -msgstr "Wpisy" +msgstr "Wysłano wpis" -#: actions/newnotice.php:200 classes/Channel.php:163 +#: actions/newnotice.php:200 classes/Channel.php:163 actions/newnotice.php:208 +#: lib/channel.php:170 msgid "Ajax Error" -msgstr "" +msgstr "Błąd AJAX" #: actions/nudge.php:85 msgid "" "This user doesn't allow nudges or hasn't confirmed or set his email yet." msgstr "" +"Ten użytkownik nie pozwala na szturchnięcia lub nie potwierdził lub nie " +"ustawił jeszcze swojego adresu e-mail." #: actions/nudge.php:94 msgid "Nudge sent" -msgstr "" +msgstr "Wysłano szturchnięcie" #: actions/nudge.php:97 msgid "Nudge sent!" -msgstr "" +msgstr "Wysłano szturchnięcie!" -#: actions/openidlogin.php:97 -#, fuzzy +#: actions/openidlogin.php:97 actions/openidlogin.php:106 msgid "OpenID login" -msgstr "Użytkownik OpenID" +msgstr "Login OpenID" #: actions/openidsettings.php:128 -#, fuzzy msgid "Removing your only OpenID " -msgstr "Usuń konto OpenID" +msgstr "Usuwanie jedynego identyfikatora OpenID " #: actions/othersettings.php:60 -#, fuzzy msgid "Other Settings" -msgstr "Ustawienia" +msgstr "Inne ustawienia" #: actions/othersettings.php:71 msgid "Manage various other options." -msgstr "" +msgstr "Zarządzaj różnymi innymi opcjami." #: actions/othersettings.php:93 msgid "URL Auto-shortening" -msgstr "" +msgstr "Automatyczne skracanie adresów URL" #: actions/othersettings.php:112 -#, fuzzy msgid "Service" -msgstr "Szukaj" +msgstr "Usługa" #: actions/othersettings.php:113 msgid "Automatic shortening service to use." -msgstr "" +msgstr "Używana automatyczna usługa skracania." #: actions/othersettings.php:144 -#, fuzzy msgid "URL shortening service is too long (max 50 chars)." -msgstr "Lokalizacja jest za długa (max. 255 znaków)." +msgstr "Adres URL usługi skracania jest za długi (maksymalnie 50 znaków)." #: actions/passwordsettings.php:69 -#, fuzzy msgid "Change your password." -msgstr "Zmień hasło" +msgstr "Zmień hasło." #: actions/passwordsettings.php:89 -#, fuzzy msgid "Password change" -msgstr "Hasło zostało zapisane." +msgstr "Zmiana hasła" -#: actions/peopletag.php:35 -#, fuzzy, php-format +#: actions/peopletag.php:35 actions/peopletag.php:70 +#, php-format msgid "Not a valid people tag: %s" -msgstr "Niewłaściwy adres e-mailowy." +msgstr "Nieprawidłowy znacznik osób: %s" -#: actions/peopletag.php:47 +#: actions/peopletag.php:47 actions/peopletag.php:144 #, php-format msgid "Users self-tagged with %s - page %d" -msgstr "" +msgstr "Użytkownicy używający znacznika %s - strona %d" #: actions/peopletag.php:91 #, php-format msgid "These are users who have tagged themselves \"%s\" " -msgstr "" +msgstr "To są użytkownicy którzy nadali sobie znacznik \"%s\" " #: actions/profilesettings.php:91 -#, fuzzy msgid "Profile information" -msgstr "Nieznany profil" +msgstr "Informacje o profilu" #: actions/profilesettings.php:124 msgid "" "Tags for yourself (letters, numbers, -, ., and _), comma- or space- separated" msgstr "" +"Znaczniki dla siebie (litery, liczby, -, . i _), oddzielone przecinkami lub " +"spacjami" #: actions/profilesettings.php:144 msgid "Automatically subscribe to whoever " -msgstr "" +msgstr "Automatycznie zasubskrybuj do każdego " #: actions/profilesettings.php:229 actions/tagother.php:176 -#, fuzzy, php-format +#: actions/tagother.php:178 +#, php-format msgid "Invalid tag: \"%s\"" -msgstr "Błędna strona domowa '%s'" +msgstr "Nieprawidłowy znacznik: \"%s\"" #: actions/profilesettings.php:311 -#, fuzzy msgid "Couldn't save tags." -msgstr "Nie można zapisać profilu." +msgstr "Nie można zapisać znaczników." -#: actions/public.php:107 -#, fuzzy, php-format +#: actions/public.php:107 actions/public.php:110 +#, php-format msgid "Public timeline, page %d" -msgstr "Publiczna oś czasu" +msgstr "Publiczna oś czasu, strona %d" -#: actions/public.php:173 +#: actions/public.php:173 actions/public.php:184 msgid "Could not retrieve public stream." -msgstr "" +msgstr "Nie można pobrać publicznego strumienia." #: actions/public.php:220 #, php-format @@ -4011,139 +4221,132 @@ msgid "" "This is %%site.name%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-" "blogging) service " msgstr "" +"To jest %%site.name%%, usługa [mikroblogowania](http://en.wikipedia.org/wiki/" +"Micro-blogging) " #: actions/publictagcloud.php:57 -#, fuzzy msgid "Public tag cloud" -msgstr "Publiczny Kanał Strumieni" +msgstr "Publiczna chmura znaczników" #: actions/publictagcloud.php:63 #, php-format msgid "These are most popular recent tags on %s " -msgstr "" +msgstr "To są najpopularniejsze ostatnie znaczniki na %s " #: actions/publictagcloud.php:119 msgid "Tag cloud" -msgstr "" +msgstr "Chmura znaczników" #: actions/register.php:139 actions/register.php:349 msgid "Sorry, only invited people can register." -msgstr "" +msgstr "Przepraszamy, tylko zaproszone osoby mogą się rejestrować." #: actions/register.php:149 -#, fuzzy msgid "You can't register if you don't " -msgstr "" -"Nie możesz się zarejestrować, jeśli nie zgadzasz się z warunkami licencji." +msgstr "Nie możesz się zarejestrować, jeśli nie " #: actions/register.php:286 msgid "With this form you can create " -msgstr "" +msgstr "Za pomocą tego formularza można utworzyć " #: actions/register.php:368 -#, fuzzy msgid "1-64 lowercase letters or numbers, " -msgstr "Max. 64 znaki alfanumeryczne, bez spacji i znaków przestankowych" +msgstr "1-64 małe litery lub liczby, " #: actions/register.php:382 actions/register.php:386 -#, fuzzy msgid "Used only for updates, announcements, " -msgstr "Używane tylko do aktualizacji, ogłoszeń i przywracania hasła" +msgstr "Używane tylko do aktualizacji, ogłoszeń, " #: actions/register.php:398 -#, fuzzy msgid "URL of your homepage, blog, " -msgstr "URL Twojej strony domowej, bloga, lub profilu na innej stronie" +msgstr "Adres URL strony domowej, bloga, " #: actions/register.php:404 -#, fuzzy msgid "Describe yourself and your " -msgstr "Opisz się w 140 znakach" +msgstr "Opisz się i swoje " #: actions/register.php:410 -#, fuzzy msgid "Where you are, like \"City, " -msgstr "Gdzie jesteś? (np. \"miasto, region, kraj\")" +msgstr "Gdzie jesteś, np. \"miasto, " #: actions/register.php:432 -#, fuzzy msgid " except this private data: password, " -msgstr "" -"z wyłączeniem tych prywatnych danych: e-maila, identyfikatora IM, numeru " -"telefonu." +msgstr " poza tymi prywatnymi danymi: hasło, " #: actions/register.php:471 #, php-format msgid "Congratulations, %s! And welcome to %%%%site.name%%%%. " -msgstr "" +msgstr "Gratulacje, %s! Witaj na %%%%site.name%%%%. " #: actions/register.php:495 msgid "(You should receive a message by email " -msgstr "" +msgstr "(Powinieneś otrzymać wiadomość przez e-mail " #: actions/remotesubscribe.php:166 actions/remotesubscribe.php:171 msgid "That's a local profile! Login to subscribe." -msgstr "" +msgstr "To jest profil lokalny! Zaloguj się, aby zasubskrybować." -#: actions/replies.php:118 -#, fuzzy, php-format +#: actions/replies.php:118 actions/replies.php:120 +#, php-format msgid "Replies to %s, page %d" -msgstr "Odpowiedzi na %s" +msgstr "Odpowiedzi na %s, strona %d" #: actions/showfavorites.php:79 #, php-format msgid "%s favorite notices, page %d" -msgstr "" +msgstr "Ulubione wpisy użytkownika %s, strona %d" #: actions/showgroup.php:77 lib/groupnav.php:85 #, php-format msgid "%s group" -msgstr "" +msgstr "Grupa %s" #: actions/showgroup.php:79 #, php-format msgid "%s group, page %d" -msgstr "" +msgstr "Grupa %s, strona %d" -#: actions/showgroup.php:206 -#, fuzzy +#: actions/showgroup.php:206 actions/showgroup.php:208 msgid "Group profile" -msgstr "Brak takiego wpisu." +msgstr "Profil grupy" #: actions/showgroup.php:251 actions/showstream.php:278 #: actions/tagother.php:119 lib/grouplist.php:134 lib/profilelist.php:133 +#: actions/showgroup.php:253 actions/showstream.php:271 +#: actions/tagother.php:118 lib/profilelist.php:131 msgid "URL" -msgstr "" +msgstr "Adres URL" #: actions/showgroup.php:262 actions/showstream.php:289 #: actions/tagother.php:129 lib/grouplist.php:145 lib/profilelist.php:144 -#, fuzzy +#: actions/showgroup.php:264 actions/showstream.php:282 +#: actions/tagother.php:128 lib/profilelist.php:142 msgid "Note" -msgstr "Wpisy" +msgstr "Wpis" -#: actions/showgroup.php:270 +#: actions/showgroup.php:270 actions/showgroup.php:272 msgid "Group actions" -msgstr "" +msgstr "Działania grupy" -#: actions/showgroup.php:323 -#, fuzzy, php-format +#: actions/showgroup.php:323 actions/showgroup.php:304 +#, php-format msgid "Notice feed for %s group" -msgstr "Kanał wpisów dla %s" +msgstr "Kanał wpisów dla grupy %s" -#: actions/showgroup.php:357 lib/groupnav.php:90 -#, fuzzy +#: actions/showgroup.php:357 lib/groupnav.php:90 actions/showgroup.php:339 +#: actions/showgroup.php:384 msgid "Members" -msgstr "W serwisie od" +msgstr "Członkowie" #: actions/showgroup.php:363 actions/showstream.php:413 #: actions/showstream.php:442 actions/showstream.php:524 lib/section.php:95 -#: lib/tagcloudsection.php:71 +#: lib/tagcloudsection.php:71 actions/showgroup.php:344 msgid "(None)" -msgstr "" +msgstr "(Brak)" -#: actions/showgroup.php:370 +#: actions/showgroup.php:370 actions/showgroup.php:350 msgid "All members" -msgstr "" +msgstr "Wszyscy członkowie" #: actions/showgroup.php:378 #, php-format @@ -4151,50 +4354,51 @@ msgid "" "**%s** is a user group on %%%%site.name%%%%, a [micro-blogging](http://en." "wikipedia.org/wiki/Micro-blogging) service " msgstr "" +"**%s** jest grupą użytkowników na %%%%site.name%%%%, usłudze " +"[mikroblogowania](http://en.wikipedia.org/wiki/Micro-blogging) " #: actions/showmessage.php:98 msgid "Only the sender and recipient " -msgstr "" +msgstr "Tylko nadawca i odbiorca " #: actions/showstream.php:73 #, php-format msgid "%s, page %d" -msgstr "" +msgstr "%s, strona %d" #: actions/showstream.php:143 -#, fuzzy msgid "'s profile" -msgstr "Profil" +msgstr " - profil" #: actions/showstream.php:236 actions/tagother.php:77 -#, fuzzy +#: actions/showstream.php:220 msgid "User profile" -msgstr "Użytkownik nie ma profilu." +msgstr "Profil użytkownika" #: actions/showstream.php:240 actions/tagother.php:81 +#: actions/showstream.php:224 msgid "Photo" -msgstr "" +msgstr "Zdjęcie" -#: actions/showstream.php:317 +#: actions/showstream.php:317 actions/showstream.php:309 msgid "User actions" -msgstr "" +msgstr "Działania użytkownika" #: actions/showstream.php:342 msgid "Send a direct message to this user" -msgstr "" +msgstr "Wyślij bezpośrednią wiadomość do tego użytkownika" #: actions/showstream.php:343 msgid "Message" -msgstr "" +msgstr "Wiadomość" #: actions/showstream.php:451 -#, fuzzy msgid "All subscribers" -msgstr "Subskrybenci" +msgstr "Wszyscy subskrybenci" #: actions/showstream.php:533 msgid "All groups" -msgstr "" +msgstr "Wszystkie grupy" #: actions/showstream.php:542 #, php-format @@ -4202,480 +4406,449 @@ msgid "" "**%s** has an account on %%%%site.name%%%%, a [micro-blogging](http://en." "wikipedia.org/wiki/Micro-blogging) service " msgstr "" +"**%s** posiada konto na %%%%site.name%%%%, usłudze [mikroblogowania](http://" +"en.wikipedia.org/wiki/Micro-blogging) " #: actions/smssettings.php:128 -#, fuzzy msgid "Phone number, no punctuation or spaces, " -msgstr "Max. 64 znaki alfanumeryczne, bez spacji i znaków przestankowych" +msgstr "Numer telefonu, bez znaków przestankowych i spacji, " #: actions/smssettings.php:162 -#, fuzzy msgid "Send me notices through SMS; " -msgstr "Wysyłaj mi wpisy przez Jabbera/GTalka" +msgstr "Wyślij mi wpisy przez SMS; " #: actions/smssettings.php:335 -#, fuzzy msgid "A confirmation code was sent to the phone number you added. " -msgstr "Ten kod potwierdzający nie jest przeznaczony dla Ciebie!" +msgstr "Kod potwierdzający został wysłany na dodany numer telefonu. " #: actions/smssettings.php:453 msgid "Mobile carrier" -msgstr "" +msgstr "Operator komórkowy" #: actions/subedit.php:70 -#, fuzzy msgid "You are not subscribed to that profile." -msgstr "Ten profil nie był wysłany przez Ciebie" +msgstr "Nie jesteś zasubskrybowany do tego profilu." #: actions/subedit.php:83 -#, fuzzy msgid "Could not save subscription." -msgstr "Nie można obserwować." +msgstr "Nie można zapisać subskrypcji." #: actions/subscribe.php:55 -#, fuzzy msgid "Not a local user." -msgstr "Brak takiego użytkownika." +msgstr "Nie jest lokalnym użytkownikiem." #: actions/subscribe.php:69 -#, fuzzy msgid "Subscribed" -msgstr "Subskrybuj" +msgstr "Zasubskrybowano" #: actions/subscribers.php:50 -#, fuzzy, php-format +#, php-format msgid "%s subscribers" -msgstr "Subskrybenci" +msgstr "Subskrybenci %s" #: actions/subscribers.php:52 #, php-format msgid "%s subscribers, page %d" -msgstr "" +msgstr "Subskrybenci %s, strona %d" #: actions/subscribers.php:63 -#, fuzzy msgid "These are the people who listen to " -msgstr "Ludzie obserwujący wpisy użytkownika %s." +msgstr "Osoby obserwujące " #: actions/subscribers.php:67 -#, fuzzy, php-format +#, php-format msgid "These are the people who " -msgstr "Ludzie obserwujący wpisy użytkownika %s." +msgstr "Osoby, które " #: actions/subscriptions.php:52 -#, fuzzy, php-format +#, php-format msgid "%s subscriptions" -msgstr "Wszyscy obserwowani" +msgstr "Subskrypcje %s" #: actions/subscriptions.php:54 -#, fuzzy, php-format +#, php-format msgid "%s subscriptions, page %d" -msgstr "Wszyscy obserwowani" +msgstr "Subskrypcje %s, strona %d" #: actions/subscriptions.php:65 -#, fuzzy msgid "These are the people whose notices " -msgstr "Ludzie, których wpisy obserwuje użytkownik %s." +msgstr "Osoby, których wpisy " #: actions/subscriptions.php:69 -#, fuzzy, php-format +#, php-format msgid "These are the people whose " -msgstr "Ludzie obserwujący wpisy użytkownika %s." +msgstr "Osoby, których " -#: actions/subscriptions.php:122 -#, fuzzy +#: actions/subscriptions.php:122 actions/subscriptions.php:124 msgid "Jabber" -msgstr "Brak identyfikatora Jabbera." +msgstr "Jabber" -#: actions/tag.php:43 -#, fuzzy, php-format +#: actions/tag.php:43 actions/tag.php:51 +#, php-format msgid "Notices tagged with %s, page %d" -msgstr "%s – mikroblog" +msgstr "Wpisy ze znacznikiem %s, strona %d" -#: actions/tag.php:66 +#: actions/tag.php:66 actions/tag.php:73 #, php-format msgid "Messages tagged \"%s\", most recent first" -msgstr "" +msgstr "Wiadomości ze znacznikiem \"%s\", najpierw najnowsze" #: actions/tagother.php:33 -#, fuzzy msgid "Not logged in" -msgstr "Niezalogowany." +msgstr "Nie zalogowano" #: actions/tagother.php:39 -#, fuzzy msgid "No id argument." -msgstr "Brak takiego dokumentu." +msgstr "Brak parametru identyfikatora." #: actions/tagother.php:65 #, php-format msgid "Tag %s" -msgstr "" +msgstr "Znacznik %s" #: actions/tagother.php:141 msgid "Tag user" -msgstr "" +msgstr "Znacznik użytkownika" -#: actions/tagother.php:149 +#: actions/tagother.php:149 actions/tagother.php:151 msgid "" "Tags for this user (letters, numbers, -, ., and _), comma- or space- " "separated" msgstr "" +"Znaczniki dla tego użytkownika (litery, liczby, -, . i _), oddzielone " +"przecinkami lub spacjami" #: actions/tagother.php:164 msgid "There was a problem with your session token." -msgstr "" +msgstr "Wystąpił problem z tokenem sesji." -#: actions/tagother.php:191 +#: actions/tagother.php:191 actions/tagother.php:193 msgid "" "You can only tag people you are subscribed to or who are subscribed to you." msgstr "" +"Można nadawać znaczniki tylko osobom, których subskrybujesz lub którzy " +"subskrybują Ciebie." -#: actions/tagother.php:198 -#, fuzzy +#: actions/tagother.php:198 actions/tagother.php:200 msgid "Could not save tags." -msgstr "Nie można zapisać informacji o awatarze" +msgstr "Nie można zapisać znaczników." -#: actions/tagother.php:233 +#: actions/tagother.php:233 actions/tagother.php:235 msgid "Use this form to add tags to your subscribers or subscriptions." msgstr "" +"Użyj tego formularza, aby dodać znaczniki subskrybentom lub subskrypcjom." #: actions/tagrss.php:35 -#, fuzzy msgid "No such tag." -msgstr "Brak takiego wpisu." +msgstr "Nie ma takiego znacznika." -#: actions/tagrss.php:66 -#, fuzzy, php-format +#: actions/tagrss.php:66 actions/tagrss.php:64 +#, php-format msgid "Microblog tagged with %s" -msgstr "%s – mikroblog" +msgstr "Mikroblogi ze znacznikiem %s" #: actions/twitapiblocks.php:47 msgid "Block user failed." -msgstr "" +msgstr "Zablokowanie użytkownika nie powiodło się." #: actions/twitapiblocks.php:69 msgid "Unblock user failed." -msgstr "" +msgstr "Odblokowanie użytkownika nie powiodło się." -#: actions/twitapiusers.php:48 -#, fuzzy +#: actions/twitapiusers.php:48 actions/twitapiusers.php:52 msgid "Not found." -msgstr "Nie znaleziono żądania!" +msgstr "Nie znaleziono." #: actions/twittersettings.php:71 msgid "Add your Twitter account to automatically send " -msgstr "" +msgstr "Dodaj konto Twittera, aby automatycznie wysyłać " -#: actions/twittersettings.php:119 +#: actions/twittersettings.php:119 actions/twittersettings.php:122 msgid "Twitter user name" -msgstr "" +msgstr "Nazwa użytkownika Twittera" -#: actions/twittersettings.php:126 -#, fuzzy +#: actions/twittersettings.php:126 actions/twittersettings.php:129 msgid "Twitter password" -msgstr "Nowe hasło" +msgstr "Hasło Twittera" -#: actions/twittersettings.php:228 +#: actions/twittersettings.php:228 actions/twittersettings.php:232 msgid "Twitter Friends" -msgstr "" +msgstr "Przyjaciele z Twittera" #: actions/twittersettings.php:327 msgid "Username must have only numbers, " -msgstr "" +msgstr "Nazwa użytkownika może zawierać tylko liczby, " #: actions/twittersettings.php:341 -#, fuzzy, php-format +#, php-format msgid "Unable to retrieve account information " -msgstr "Nie można skasować potwierdzenia adresu e-mail." +msgstr "Nie można pobrać informacji o koncie " #: actions/unblock.php:108 -#, fuzzy msgid "Error removing the block." -msgstr "Błąd w zapisie użytkownika." +msgstr "Błąd podczas usuwania blokady." #: actions/unsubscribe.php:50 -#, fuzzy msgid "No profile id in request." -msgstr "Serwer nie zwrócił żadnego URL-a." +msgstr "Brak identyfikatora profilu w żądaniu." #: actions/unsubscribe.php:57 -#, fuzzy msgid "No profile with that id." -msgstr "Zdalny profil bez odpowiadającego profilu lokalnego" +msgstr "Brak profilu z tym identyfikatorem." #: actions/unsubscribe.php:71 -#, fuzzy msgid "Unsubscribed" -msgstr "Zrezygnuj z subskrypcji" +msgstr "Zrezygnowano z subskrypcji" #: actions/usergroups.php:63 #, php-format msgid "%s groups" -msgstr "" +msgstr "Grupy %s" #: actions/usergroups.php:65 #, php-format msgid "%s groups, page %d" -msgstr "" +msgstr "Grupy %s, strona %d" -#: classes/Notice.php:104 -#, fuzzy +#: classes/Notice.php:104 classes/Notice.php:128 msgid "Problem saving notice. Unknown user." -msgstr "Problem z zachowywaniem wpisu." +msgstr "Problem podczas zapisywania wpisu. Nieznany użytkownik." -#: classes/Notice.php:109 +#: classes/Notice.php:109 classes/Notice.php:133 msgid "" "Too many notices too fast; take a breather and post again in a few minutes." msgstr "" +"Za dużo wpisów w za krótkim czasie, weź głęboki oddech i wyślij ponownie za " +"kilka minut." -#: classes/Notice.php:116 +#: classes/Notice.php:116 classes/Notice.php:145 msgid "You are banned from posting notices on this site." -msgstr "" +msgstr "Zabroniono Ci wysyłania wpisów na tej stronie." #: lib/accountsettingsaction.php:108 -#, fuzzy msgid "Upload an avatar" -msgstr "Uaktualnianie awatara nie powiodło się." +msgstr "Wyślij awatar" #: lib/accountsettingsaction.php:119 msgid "Other" -msgstr "" +msgstr "Inne" #: lib/accountsettingsaction.php:120 msgid "Other options" -msgstr "" +msgstr "Inne opcje" -#: lib/action.php:130 +#: lib/action.php:130 lib/action.php:132 #, php-format msgid "%s - %s" -msgstr "" +msgstr "%s - %s" -#: lib/action.php:145 +#: lib/action.php:145 lib/action.php:147 msgid "Untitled page" -msgstr "" +msgstr "Strona bez nazwy" -#: lib/action.php:316 +#: lib/action.php:316 lib/action.php:387 msgid "Primary site navigation" -msgstr "" +msgstr "Główna nawigacja strony" -#: lib/action.php:322 +#: lib/action.php:322 lib/action.php:393 msgid "Personal profile and friends timeline" -msgstr "" +msgstr "Profil osobisty i oś czasu przyjaciół" -#: lib/action.php:325 +#: lib/action.php:325 lib/action.php:396 msgid "Search for people or text" -msgstr "" +msgstr "Znajdź osoby lub tekst" -#: lib/action.php:328 -#, fuzzy +#: lib/action.php:328 lib/action.php:399 msgid "Account" -msgstr "O serwisie" +msgstr "Konto" -#: lib/action.php:328 +#: lib/action.php:328 lib/action.php:399 msgid "Change your email, avatar, password, profile" -msgstr "" +msgstr "Zmień adres e-mail, awatar, hasło, profil" -#: lib/action.php:330 +#: lib/action.php:330 lib/action.php:403 msgid "Connect to IM, SMS, Twitter" -msgstr "" +msgstr "Połącz z komunikatorem, SMS, Twitterem" -#: lib/action.php:332 +#: lib/action.php:332 lib/action.php:409 msgid "Logout from the site" -msgstr "" +msgstr "Wyloguj się ze strony" -#: lib/action.php:335 +#: lib/action.php:335 lib/action.php:412 msgid "Login to the site" -msgstr "" +msgstr "Zaloguj się na stronę" -#: lib/action.php:338 -#, fuzzy +#: lib/action.php:338 lib/action.php:415 msgid "Create an account" -msgstr "Załóż nowe konto" +msgstr "Utwórz konto" -#: lib/action.php:341 -#, fuzzy +#: lib/action.php:341 lib/action.php:418 msgid "Login with OpenID" -msgstr "Brak takiego identyfikatora OpenID." +msgstr "Zaloguj się za pomocą OpenID" -#: lib/action.php:344 -#, fuzzy +#: lib/action.php:344 lib/action.php:421 msgid "Help me!" -msgstr "Pomoc" +msgstr "Pomóż mi!" -#: lib/action.php:362 -#, fuzzy +#: lib/action.php:362 lib/action.php:441 msgid "Site notice" -msgstr "Nowy wpis" +msgstr "Wpis strony" -#: lib/action.php:417 +#: lib/action.php:417 lib/action.php:504 msgid "Local views" -msgstr "" +msgstr "Lokalne widoki" -#: lib/action.php:472 -#, fuzzy +#: lib/action.php:472 lib/action.php:559 msgid "Page notice" -msgstr "Nowy wpis" +msgstr "Wpis strony" -#: lib/action.php:562 -#, fuzzy +#: lib/action.php:562 lib/action.php:654 msgid "Secondary site navigation" -msgstr "Subskrypcje" +msgstr "Druga nawigacja strony" -#: lib/action.php:602 lib/action.php:623 +#: lib/action.php:602 lib/action.php:623 lib/action.php:699 lib/action.php:720 msgid "Laconica software license" -msgstr "" +msgstr "Licencja oprogramowania Laconica" -#: lib/action.php:630 +#: lib/action.php:630 lib/action.php:727 msgid "All " -msgstr "" +msgstr "Wszystko " -#: lib/action.php:635 +#: lib/action.php:635 lib/action.php:732 msgid "license." -msgstr "" +msgstr "licencja." #: lib/blockform.php:123 lib/blockform.php:153 -#, fuzzy msgid "Block this user" -msgstr "Brak takiego użytkownika." +msgstr "Zablokuj tego użytkownika" #: lib/blockform.php:153 msgid "Block" -msgstr "" +msgstr "Zablokuj" #: lib/disfavorform.php:114 lib/disfavorform.php:140 msgid "Disfavor this notice" -msgstr "" +msgstr "Usuń ten wpis z ulubionych" #: lib/facebookaction.php:268 #, php-format msgid "To use the %s Facebook Application you need to login " -msgstr "" +msgstr "Aby używać aplikacji Facebook %s, musisz się zalogować " -#: lib/facebookaction.php:271 -#, fuzzy +#: lib/facebookaction.php:271 lib/facebookaction.php:273 msgid " a new account." -msgstr "Załóż nowe konto" +msgstr " nowe konto." #: lib/facebookaction.php:557 lib/mailbox.php:214 lib/noticelist.php:354 -#, fuzzy +#: lib/facebookaction.php:675 lib/mailbox.php:216 lib/noticelist.php:357 msgid "Published" -msgstr "Publiczny" +msgstr "Opublikowano" #: lib/favorform.php:114 lib/favorform.php:140 -#, fuzzy msgid "Favor this notice" -msgstr "Brak takiego wpisu." +msgstr "Dodaj ten wpis do ulubionych" #: lib/feedlist.php:64 msgid "Export data" -msgstr "" +msgstr "Wyeksportuj dane" #: lib/galleryaction.php:121 msgid "Filter tags" -msgstr "" +msgstr "Filtruj znaczniki" #: lib/galleryaction.php:131 msgid "All" -msgstr "" +msgstr "Wszystko" #: lib/galleryaction.php:137 msgid "Tag" -msgstr "" +msgstr "Znacznik" #: lib/galleryaction.php:138 msgid "Choose a tag to narrow list" -msgstr "" +msgstr "Wybierz znacznik do ograniczonej listy" #: lib/galleryaction.php:139 msgid "Go" -msgstr "" +msgstr "Przejdź" #: lib/groupeditform.php:148 -#, fuzzy msgid "URL of the homepage or blog of the group or topic" -msgstr "URL Twojej strony domowej, bloga, lub profilu na innej stronie" +msgstr "Adres URL strony domowej lub bloga grupy, albo temat" #: lib/groupeditform.php:151 -#, fuzzy msgid "Description" -msgstr "Subskrypcje" +msgstr "Opis" #: lib/groupeditform.php:153 -#, fuzzy msgid "Describe the group or topic in 140 chars" -msgstr "Opisz się w 140 znakach" +msgstr "Opisz grupę lub temat w 140 znakach" #: lib/groupeditform.php:158 -#, fuzzy msgid "" "Location for the group, if any, like \"City, State (or Region), Country\"" -msgstr "Gdzie jesteś? (np. \"miasto, region, kraj\")" +msgstr "" +"Położenie grupy, jeśli istnieje, np. \"miasto, województwo (lub region), kraj" +"\"" #: lib/groupnav.php:84 lib/searchgroupnav.php:84 msgid "Group" -msgstr "" +msgstr "Grupa" #: lib/groupnav.php:100 msgid "Admin" -msgstr "" +msgstr "Administrator" #: lib/groupnav.php:101 #, php-format msgid "Edit %s group properties" -msgstr "" +msgstr "Edytuj właściwości grupy %s" #: lib/groupnav.php:106 -#, fuzzy msgid "Logo" -msgstr "Wyloguj" +msgstr "Logo" #: lib/groupnav.php:107 #, php-format msgid "Add or edit %s logo" -msgstr "" +msgstr "Dodaj lub edytuj logo grupy %s" #: lib/groupsbymemberssection.php:71 msgid "Groups with most members" -msgstr "" +msgstr "Grupy z największą liczbą członków" #: lib/groupsbypostssection.php:71 msgid "Groups with most posts" -msgstr "" +msgstr "Grupy z największą ilością wpisów" #: lib/grouptagcloudsection.php:56 #, php-format msgid "Tags in %s group's notices" -msgstr "" +msgstr "Znaczniki we wpisach grupy %s" #: lib/htmloutputter.php:104 -#, fuzzy msgid "This page is not available in a " -msgstr "Ta strona nie jest dostępna dla medium, którego typ akceptujesz" +msgstr "Ta strona nie jest dostępna w " #: lib/joinform.php:114 -#, fuzzy msgid "Join" -msgstr "Login" +msgstr "Dołącz" #: lib/leaveform.php:114 -#, fuzzy msgid "Leave" -msgstr "Zapisz" +msgstr "Opuść" #: lib/logingroupnav.php:76 -#, fuzzy msgid "Login with a username and password" -msgstr "Błędna nazwa użytkownika lub hasło." +msgstr "Zaloguj się za pomocą nazwy użytkownika i hasła" #: lib/logingroupnav.php:79 -#, fuzzy msgid "Sign up for a new account" msgstr "Załóż nowe konto" #: lib/logingroupnav.php:82 msgid "Login or register with OpenID" -msgstr "" +msgstr "Zaloguj się lub zarejestruj za pomocą OpenID" #: lib/mail.php:175 #, php-format @@ -4683,21 +4856,23 @@ msgid "" "Hey, %s.\n" "\n" msgstr "" +"Cześć, %s.\n" +"\n" #: lib/mail.php:236 -#, fuzzy, php-format +#, php-format msgid "%1$s is now listening to " -msgstr "%1$s obserwuje teraz Twoje wpisy na %2$s." +msgstr "%1$s obserwuje teraz " #: lib/mail.php:254 -#, fuzzy, php-format +#, php-format msgid "Location: %s\n" -msgstr "Lokalizacja" +msgstr "Położenie: %s\n" #: lib/mail.php:256 -#, fuzzy, php-format +#, php-format msgid "Homepage: %s\n" -msgstr "Strona domowa" +msgstr "Strona domowa: %s\n" #: lib/mail.php:258 #, php-format @@ -4705,185 +4880,783 @@ msgid "" "Bio: %s\n" "\n" msgstr "" +"O mnie: %s\n" +"\n" -#: lib/mail.php:461 +#: lib/mail.php:461 lib/mail.php:462 #, php-format msgid "You've been nudged by %s" -msgstr "" +msgstr "Zostałeś szturchnięty przez %s" #: lib/mail.php:465 #, php-format msgid "%1$s (%2$s) is wondering what you are up to " -msgstr "" +msgstr "%1$s (%2$s) zastanawia się, co zamierzasz " #: lib/mail.php:555 -#, fuzzy, php-format +#, php-format msgid "%1$s just added your notice from %2$s" -msgstr "%1$s obserwuje teraz Twoje wpisy na %2$s." +msgstr "%1$s właśnie dodał Twój wpis z %2$s" -#: lib/mailbox.php:229 lib/noticelist.php:380 +#: lib/mailbox.php:229 lib/noticelist.php:380 lib/mailbox.php:231 +#: lib/noticelist.php:383 msgid "From" -msgstr "" +msgstr "Od" -#: lib/messageform.php:110 +#: lib/messageform.php:110 lib/messageform.php:109 msgid "Send a direct notice" -msgstr "" +msgstr "Wyślij bezpośredni wpis" #: lib/noticeform.php:125 -#, fuzzy msgid "Send a notice" -msgstr "Nowy wpis" +msgstr "Wyślij wpis" #: lib/noticeform.php:152 -#, fuzzy msgid "Available characters" -msgstr "6 lub więcej znaków" +msgstr "Dostępne znaki" -#: lib/noticelist.php:426 -#, fuzzy +#: lib/noticelist.php:426 lib/noticelist.php:429 msgid "in reply to" -msgstr "w odpowiedzi na…" +msgstr "w odpowiedzi na" -#: lib/noticelist.php:447 lib/noticelist.php:450 +#: lib/noticelist.php:447 lib/noticelist.php:450 lib/noticelist.php:451 +#: lib/noticelist.php:454 msgid "Reply to this notice" -msgstr "" +msgstr "Odpowiedz na ten wpis" -#: lib/noticelist.php:451 -#, fuzzy +#: lib/noticelist.php:451 lib/noticelist.php:455 msgid "Reply" -msgstr "odpowiedź" +msgstr "Odpowiedz" -#: lib/noticelist.php:471 lib/noticelist.php:474 +#: lib/noticelist.php:471 lib/noticelist.php:474 lib/noticelist.php:476 +#: lib/noticelist.php:479 msgid "Delete this notice" -msgstr "" +msgstr "Usuń ten wpis" -#: lib/noticelist.php:474 +#: lib/noticelist.php:474 actions/avatarsettings.php:148 +#: lib/noticelist.php:479 msgid "Delete" -msgstr "" +msgstr "Usuń" #: lib/nudgeform.php:116 msgid "Nudge this user" -msgstr "" +msgstr "Szturchnij tego użytkownika" #: lib/nudgeform.php:128 msgid "Nudge" -msgstr "" +msgstr "Szturchnij" #: lib/nudgeform.php:128 msgid "Send a nudge to this user" -msgstr "" +msgstr "Wyślij szturchnięcie do tego użytkownika" #: lib/personaltagcloudsection.php:56 #, php-format msgid "Tags in %s's notices" -msgstr "" +msgstr "Znaczniki we wpisach użytkownika %s" -#: lib/profilelist.php:182 +#: lib/profilelist.php:182 lib/profilelist.php:180 msgid "(none)" -msgstr "" +msgstr "(brak)" -#: lib/publicgroupnav.php:76 +#: lib/publicgroupnav.php:76 lib/publicgroupnav.php:78 msgid "Public" msgstr "Publiczny" -#: lib/publicgroupnav.php:80 +#: lib/publicgroupnav.php:80 lib/publicgroupnav.php:82 msgid "User groups" -msgstr "" +msgstr "Grupy użytkowników" #: lib/publicgroupnav.php:82 lib/publicgroupnav.php:83 +#: lib/publicgroupnav.php:84 lib/publicgroupnav.php:85 msgid "Recent tags" -msgstr "" +msgstr "Ostatnie znaczniki" -#: lib/publicgroupnav.php:86 +#: lib/publicgroupnav.php:86 lib/publicgroupnav.php:88 msgid "Featured" -msgstr "" +msgstr "Znane" -#: lib/publicgroupnav.php:90 -#, fuzzy +#: lib/publicgroupnav.php:90 lib/publicgroupnav.php:92 msgid "Popular" -msgstr "Szukaj ludzi" +msgstr "Popularne" #: lib/searchgroupnav.php:82 -#, fuzzy msgid "Notice" -msgstr "Wpisy" +msgstr "Wpis" #: lib/searchgroupnav.php:85 msgid "Find groups on this site" -msgstr "" +msgstr "Znajdź grupy na tej stronie" #: lib/section.php:89 msgid "Untitled section" -msgstr "" +msgstr "Sekcja bez nazwy" #: lib/subgroupnav.php:81 -#, fuzzy, php-format +#, php-format msgid "People %s subscribes to" -msgstr "Zdalna subskrypcja" +msgstr "Osoby %s zasubskrybowane do" #: lib/subgroupnav.php:89 -#, fuzzy, php-format +#, php-format msgid "People subscribed to %s" -msgstr "Zdalna subskrypcja" +msgstr "Osoby zasubskrybowane do %s" #: lib/subgroupnav.php:97 #, php-format msgid "Groups %s is a member of" -msgstr "" +msgstr "Grupy %s są członkiem" #: lib/subgroupnav.php:104 #, php-format msgid "Invite friends and colleagues to join you on %s" -msgstr "" +msgstr "Zaproś przyjaciół i kolegów do dołączenia do Ciebie na %s" #: lib/subs.php:53 -#, fuzzy msgid "User has blocked you." -msgstr "Użytkownik nie ma profilu." +msgstr "Użytkownik zablokował Cię." #: lib/subscribeform.php:115 lib/subscribeform.php:139 -#, fuzzy msgid "Subscribe to this user" -msgstr "Subskrypcja uwierzytelniona" +msgstr "Zasubskrybuj tego użytkownika" #: lib/tagcloudsection.php:56 msgid "None" -msgstr "" +msgstr "Brak" #: lib/topposterssection.php:74 msgid "Top posters" -msgstr "" +msgstr "Najczęściej wysyłający wpisy" #: lib/unblockform.php:120 lib/unblockform.php:150 -#, fuzzy msgid "Unblock this user" -msgstr "Brak takiego użytkownika." +msgstr "Odblokuj tego użytkownika" #: lib/unblockform.php:150 msgid "Unblock" -msgstr "" +msgstr "Odblokuj" #: lib/unsubscribeform.php:113 lib/unsubscribeform.php:137 msgid "Unsubscribe from this user" +msgstr "Zrezygnuj z subskrypcji tego użytkownika" + +#: actions/all.php:77 +#, php-format +msgid "Feed for friends of %s (RSS 1.0)" +msgstr "Kanał dla znajomych użytkownika %s (RSS 1.0)" + +#: actions/all.php:82 +#, php-format +msgid "Feed for friends of %s (RSS 2.0)" +msgstr "Kanał dla znajomych użytkownika %s (RSS 2.0)" + +#: actions/all.php:87 +#, php-format +msgid "Feed for friends of %s (Atom)" +msgstr "Kanał dla znajomych użytkownika %s (Atom)" + +#: actions/all.php:112 +msgid "You and friends" +msgstr "Ty i przyjaciele" + +#: actions/avatarsettings.php:78 +#, php-format +msgid "You can upload your personal avatar. The maximum file size is %s." +msgstr "Można wysłać swój osobisty awatar. Maksymalny rozmiar pliku to %s." + +#: actions/avatarsettings.php:373 +msgid "Avatar deleted." +msgstr "Usunięto awatar." + +#: actions/block.php:129 +msgid "" +"Are you sure you want to block this user? Afterwards, they will be " +"unsubscribed from you, unable to subscribe to you in the future, and you " +"will not be notified of any @-replies from them." +msgstr "" +"Jesteś pewny, że chcesz zablokować tego użytkownika. Po tym jego subskrypcja " +"do Ciebie zostanie usunięta, nie będzie mógł Cię zasubskrybować w " +"przyszłości i nie będziesz powiadamiany o żadnych odpowiedziach @ od niego." + +#: actions/deletenotice.php:73 +msgid "" +"You are about to permanently delete a notice. Once this is done, it cannot " +"be undone." +msgstr "" +"Za chwilę wpis zostanie trwale usunięty. Kiedy to się stanie, to już się nie " +"odstanie." + +#: actions/deletenotice.php:127 +msgid "There was a problem with your session token. Try again, please." +msgstr "Wystąpił problem z tokenem sesji. Spróbuj ponownie." + +#: actions/emailsettings.php:168 +msgid "Send me email when someone sends me an \"@-reply\"." +msgstr "Wyślij mi wiadomość e-mail, kiedy ktoś wyśle mi odpowiedź \"@\"." + +#: actions/facebookhome.php:193 +#, php-format +msgid "" +"If you would like the %s app to automatically update your Facebook status " +"with your latest notice, you need to give it permission." +msgstr "" +"Jeśli chcesz, aby aplikacja %s automatycznie aktualizowała status na " +"Facebook najnowszym wpisem, musisz dać jej pozwolenie." + +#: actions/facebookhome.php:217 +#, php-format +msgid "Okay, do it!" +msgstr "OK, zrób to!" + +#: actions/facebooksettings.php:124 +#, php-format +msgid "" +"If you would like %s to automatically update your Facebook status with your " +"latest notice, you need to give it permission." +msgstr "" +"Jeśli chcesz, aby %s automatycznie aktualizowało status na Facebook " +"najnowszym wpisem, musisz dać mu pozwolenie." + +#: actions/grouplogo.php:155 +#, php-format +msgid "" +"You can upload a logo image for your group. The maximum file size is %s." +msgstr "Można wysłać obraz logo grupy. Maksymalny rozmiar pliku to %s." + +#: actions/grouplogo.php:367 +msgid "Pick a square area of the image to be the logo." +msgstr "Wybierz kwadratowy obszar obrazu, który będzie logo." + +#: actions/grouprss.php:136 +#, php-format +msgid "Microblog by %s group" +msgstr "Mikroblog grupy %s" + +#: actions/groupsearch.php:57 +#, php-format +msgid "" +"Search for groups on %%site.name%% by their name, location, or description. " +"Separate the terms by spaces; they must be 3 characters or more." +msgstr "" +"Znajdź grupy na %%site.name%% według ich nazwy, położenia lub opisu. Oddziel " +"terminy spacjami; muszą mieć trzy znaki lub więcej." + +#: actions/groups.php:90 +#, php-format +msgid "" +"%%%%site.name%%%% groups let you find and talk with people of similar " +"interests. After you join a group you can send messages to all other members " +"using the syntax \"!groupname\". Don't see a group you like? Try [searching " +"for one](%%%%action.groupsearch%%%%) or [start your own!](%%%%action.newgroup" +"%%%%)" +msgstr "" +"Grupy %%%%site.name%%%% umożliwiają znalezienie i rozmawianie z osobami o " +"podobnych zainteresowaniach. Po dołączeniu do grupy można wysyłać wiadomości " +"do wszystkich członków używając składni \"!nazwagrupy\". Nie widzisz grupy, " +"która Cię interesuje? Spróbuj ją [znaleźć](%%%%action.groupsearch%%%%) lub " +"[założyć własną!](%%%%action.newgroup%%%%)" + +#: actions/newmessage.php:102 +msgid "Only logged-in users can send direct messages." +msgstr "Tylko zalogowani użytkownicy mogą wysyłać bezpośrednie wiadomości." + +#: actions/noticesearch.php:91 +#, php-format +msgid "Search results for \"%s\" on %s" +msgstr "Wyniki wyszukiwania dla \"%s\" na %s" + +#: actions/openidlogin.php:66 +#, php-format +msgid "" +"For security reasons, please re-login with your [OpenID](%%doc.openid%%) " +"before changing your settings." +msgstr "" +"Z powodów bezpieczeństwa przed zmienianiem ustawień zaloguj się ponownie za " +"pomocą identyfikatora [OpenID](%%doc.openid%%)." + +#: actions/public.php:125 +msgid "Public Stream Feed (RSS 1.0)" +msgstr "Kanał publicznego strumienia (RSS 1.0)" + +#: actions/public.php:130 +msgid "Public Stream Feed (RSS 2.0)" +msgstr "Kanał publicznego strumienia (RSS 2.0)" + +#: actions/public.php:135 +msgid "Public Stream Feed (Atom)" +msgstr "Kanał publicznego strumienia (Atom)" + +#: actions/public.php:210 +#, php-format +msgid "" +"This is %%site.name%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-" +"blogging) service based on the Free Software [Laconica](http://laconi.ca/) " +"tool. [Join now](%%action.register%%) to share notices about yourself with " +"friends, family, and colleagues! ([Read more](%%doc.help%%))" +msgstr "" +"To jest %%site.name%%, usługa [mikroblogowania](http://en.wikipedia.org/wiki/" +"Micro-blogging) oparta na wolnym narzędziu [Laconica](http://laconi.ca/). " +"[Dołącz teraz](%%action.register%%), aby dzielić się wpisami o sobie z " +"przyjaciółmi, rodziną i kolegami! ([Przeczytaj więcej](%%doc.help%%))" + +#: actions/register.php:286 +#, php-format +msgid "" +"With this form you can create a new account. You can then post notices and " +"link up to friends and colleagues. (Have an [OpenID](http://openid.net/)? " +"Try our [OpenID registration](%%action.openidlogin%%)!)" +msgstr "" +"Za pomocą tego formularza można utworzyć nowe konto. Można wtedy wysyłać " +"wpisy i połączyć się z przyjaciółmi i kolegami. (Posiadasz identyfikator " +"[OpenID](http://openid.net/)? Wypróbuj [rejestracji OpenID](%%action." +"openidlogin%%)!)" + +#: actions/register.php:432 +msgid "Creative Commons Attribution 3.0" +msgstr "Creative Commons Uznanie Autorstwa 3.0" + +#: actions/register.php:433 +msgid "" +" except this private data: password, email address, IM address, and phone " +"number." +msgstr "" +" poza tymi prywatnymi danymi: hasło, adres e-mail, adres komunikatora i " +"numer telefonu." + +#: actions/showgroup.php:378 +msgid "Created" +msgstr "Utworzono" + +#: actions/showgroup.php:393 +#, php-format +msgid "" +"**%s** is a user group on %%%%site.name%%%%, a [micro-blogging](http://en." +"wikipedia.org/wiki/Micro-blogging) service based on the Free Software " +"[Laconica](http://laconi.ca/) tool. Its members share short messages about " +"their life and interests. [Join now](%%%%action.register%%%%) to become part " +"of this group and many more! ([Read more](%%%%doc.help%%%%))" +msgstr "" +"**%s** jest grupą użytkowników na %%%%site.name%%%%, usłudze " +"[mikroblogowania](http://en.wikipedia.org/wiki/Micro-blogging) opartej na " +"wolnym narzędziu [Laconica](http://laconi.ca/). Jej członkowie dzielą się " +"krótkimi wiadomościami o swoim życiu i zainteresowaniach. [Dołącz teraz](%%%%" +"action.register%%%%), aby stać się częścią tej grupy i wiele więcej! " +"([Przeczytaj więcej](%%%%doc.help%%%%))" + +#: actions/showstream.php:147 +msgid "Your profile" +msgstr "Twój profil" + +#: actions/showstream.php:149 +#, php-format +msgid "%s's profile" +msgstr "Profil użytkownika %s" + +#: actions/showstream.php:163 +#, php-format +msgid "Notice feed for %s (RSS 1.0)" +msgstr "Kanał wpisów dla %s (RSS 1.0)" + +#: actions/showstream.php:170 +#, php-format +msgid "Notice feed for %s (RSS 2.0)" +msgstr "Kanał wpisów dla %s (RSS 2.0)" + +#: actions/showstream.php:177 +#, php-format +msgid "Notice feed for %s (Atom)" +msgstr "Kanał wpisów dla %s (Atom)" + +#: actions/showstream.php:182 +#, php-format +msgid "FOAF for %s" +msgstr "FOAF dla %s" + +#: actions/showstream.php:237 +msgid "Edit Avatar" +msgstr "Edytuj awatar" + +#: actions/showstream.php:316 +msgid "Edit profile settings" +msgstr "Edytuj ustawienia profilu" + +#: actions/showstream.php:317 +msgid "Edit" +msgstr "Edytuj" + +#: actions/showstream.php:542 +#, php-format +msgid "" +"**%s** has an account on %%%%site.name%%%%, a [micro-blogging](http://en." +"wikipedia.org/wiki/Micro-blogging) service based on the Free Software " +"[Laconica](http://laconi.ca/) tool. [Join now](%%%%action.register%%%%) to " +"follow **%s**'s notices and many more! ([Read more](%%%%doc.help%%%%))" +msgstr "" +"**%s** posiada konto na %%%%site.name%%%%, usłudze [mikroblogowania](http://" +"en.wikipedia.org/wiki/Micro-blogging) opartej na wolnym narzędziu [Laconica]" +"(http://laconi.ca/). [Dołącz teraz](%%%%action.register%%%%), aby obserwować " +"wpisy użytkownika **%s** i wiele więcej! ([Przeczytaj więcej](%%%%doc.help%%%" +"%))" + +#: actions/smssettings.php:335 +msgid "" +"A confirmation code was sent to the phone number you added. Check your phone " +"for the code and instructions on how to use it." +msgstr "" +"Kod potwierdzający został wysłany na dodany numer telefonu. Sprawdź telefon, " +"czy otrzymałeś kod i instrukcje jak go użyć." + +#: actions/twitapifavorites.php:171 lib/mail.php:556 +#, php-format +msgid "" +"%1$s just added your notice from %2$s as one of their favorites.\n" +"\n" +"In case you forgot, you can see the text of your notice here:\n" +"\n" +"%3$s\n" +"\n" +"You can see the list of %1$s's favorites here:\n" +"\n" +"%4$s\n" +"\n" +"Faithfully yours,\n" +"%5$s\n" +msgstr "" +"%1$s właśnie dodał Twój wpis z %2$s jako jeden ze swoich ulubionych.\n" +"\n" +"Jeśli go zapomniałeś, tutaj możesz zobaczyć tekst wpisu:\n" +"\n" +"%3$s\n" +"\n" +"Tutaj możesz zobaczyć listę ulubionych wpisów użytkownika %1$s:\n" +"\n" +"%4$s\n" +"\n" +"Z poważaniem,\n" +"%5$s\n" + +#: actions/twitapistatuses.php:124 +msgid "No such user!" +msgstr "Nie ma takiego użytkownika!" + +#: actions/twittersettings.php:72 +msgid "" +"Add your Twitter account to automatically send your notices to Twitter, and " +"subscribe to Twitter friends already here." +msgstr "" +"Dodaj konto Twittera, aby automatycznie wysyłać wpisy do Twittera i " +"zasubskrybować przyjaciół z Twittera, którzy już tu są." + +#: actions/twittersettings.php:345 +#, php-format +msgid "Unable to retrieve account information For \"%s\" from Twitter." +msgstr "Nie można pobrać informacji o koncie dla \"%s\" z Twittera." + +#: actions/userauthorization.php:86 +msgid "" +"Please check these details to make sure that you want to subscribe to this " +"user's notices. If you didn't just ask to subscribe to someone's notices, " +"click \"Reject\"." +msgstr "" +"Sprawdź te szczegóły, aby upewnić się, czy na pewno chcesz zasubskrybować " +"wpisy tego użytkownika. Jeżeli nie prosiłeś o subskrypcję czyichś wpisów, " +"naciśnij \"Odrzuć\"." + +#: actions/usergroups.php:131 +msgid "Search for more groups" +msgstr "Znajdź więcej grup" + +#: classes/Notice.php:138 +msgid "" +"Too many duplicate messages too quickly; take a breather and post again in a " +"few minutes." +msgstr "" +"Za dużo takich samych wiadomości w za krótkim czasie, weź głęboki oddech i " +"wyślij ponownie za kilka minut." + +#: lib/action.php:406 +msgid "Connect to SMS, Twitter" +msgstr "Połącz z SMS, Twitterem" + +#: lib/action.php:671 +msgid "Badge" +msgstr "Odznaka" + +#: lib/command.php:113 +#, php-format +msgid "" +"Subscriptions: %1$s\n" +"Subscribers: %2$s\n" +"Notices: %3$s" msgstr "" +"Subskrypcje: %1$s\n" +"Subskrybenci: %2$s\n" +"Wpisy: %3$s" -#, fuzzy -#~ msgid "Delete my account" -#~ msgstr "Załóż nowe konto" +#: lib/command.php:392 +msgid "" +"Commands:\n" +"on - turn on notifications\n" +"off - turn off notifications\n" +"help - show this help\n" +"follow - subscribe to user\n" +"leave - unsubscribe from user\n" +"d - direct message to user\n" +"get - get last notice from user\n" +"whois - get profile info on user\n" +"fav - add user's last notice as a 'fave'\n" +"stats - get your stats\n" +"stop - same as 'off'\n" +"quit - same as 'off'\n" +"sub - same as 'follow'\n" +"unsub - same as 'leave'\n" +"last - same as 'get'\n" +"on - not yet implemented.\n" +"off - not yet implemented.\n" +"nudge - not yet implemented.\n" +"invite - not yet implemented.\n" +"track - not yet implemented.\n" +"untrack - not yet implemented.\n" +"track off - not yet implemented.\n" +"untrack all - not yet implemented.\n" +"tracks - not yet implemented.\n" +"tracking - not yet implemented.\n" +msgstr "" +"Polecenia:\n" +"on - włącza powiadomienia\n" +"off - wyłącza powiadomienia\n" +"help - wyświetla tę pomoc\n" +"follow - subskrybuje użytkownika\n" +"leave - rezygnuje z subskrypcji użytkownika\n" +"d - bezpośrednia wiadomość do użytkownika\n" +"get - uzyskuje ostatni wpis użytkownika\n" +"whois - uzyskuje informacje o profilu użytkownika\n" +"fav - dodaje ostatni wpis użytkownika jako \"ulubiony\"\n" +"stats - uzyskuje Twoje statystyki\n" +"stop - to samo co \"off\"\n" +"quit - to samo co \"off\"\n" +"sub - to samo co \"follow\"\n" +"unsub - to samo co \"leave\"\n" +"last - to samo co \"get\"\n" +"on - jeszcze nie zaimplementowano.\n" +"off - jeszcze nie zaimplementowano.\n" +"nudge - jeszcze nie zaimplementowano.\n" +"invite - jeszcze nie zaimplementowano.\n" +"track - jeszcze nie zaimplementowano.\n" +"untrack - jeszcze nie zaimplementowano.\n" +"track off - jeszcze nie zaimplementowano.\n" +"untrack all - jeszcze nie zaimplementowano.\n" +"tracks - jeszcze nie zaimplementowano.\n" +"tracking - jeszcze nie zaimplementowano.\n" + +#: lib/dberroraction.php:60 +msgid "Database error" +msgstr "Błąd bazy danych" -#~ msgid "Couldn't confirm email." -#~ msgstr "Nie można potwierdzić e-maila." +#: lib/facebookaction.php:271 +#, php-format +msgid "" +"To use the %s Facebook Application you need to login with your username and " +"password. Don't have a username yet? " +msgstr "" +"Aby użyć aplikacji Facebook %s, musisz się zalogować za pomocą nazwy " +"użytkownika i hasła. Nie masz jeszcze nazwy użytkownika? " -#~ msgid "Email address" -#~ msgstr "Adres e-mailowy" +#: lib/feed.php:85 +msgid "RSS 1.0" +msgstr "RSS 1.0" + +#: lib/feed.php:87 +msgid "RSS 2.0" +msgstr "RSS 2.0" + +#: lib/feed.php:89 +msgid "Atom" +msgstr "Atom" + +#: lib/feed.php:91 +msgid "FOAF" +msgstr "FOAF" + +#: lib/imagefile.php:75 +#, php-format +msgid "That file is too big. The maximum file size is %d." +msgstr "Ten plik jest za duży. Maksymalny rozmiar pliku to %d." + +#: lib/mail.php:175 +#, php-format +msgid "" +"Hey, %s.\n" +"\n" +"Someone just entered this email address on %s.\n" +"\n" +"If it was you, and you want to confirm your entry, use the URL below:\n" +"\n" +"\t%s\n" +"\n" +"If not, just ignore this message.\n" +"\n" +"Thanks for your time, \n" +"%s\n" +msgstr "" +"Cześć, %s.\n" +"\n" +"Ktoś właśnie podał ten adres e-mail na %s.\n" +"\n" +"Jeśli to byłeś Ty, i chcesz potwierdzić swoje wejście, użyj poniższego " +"adresu URL:\n" +"\n" +"\t%s\n" +"\n" +"Jeśli to nie ty, po prostu zignoruj tę wiadomość.\n" +"\n" +"Dziękujemy za Twój czas, \n" +"%s\n" + +#: lib/mail.php:241 +#, php-format +msgid "" +"%1$s is now listening to your notices on %2$s.\n" +"\n" +"\t%3$s\n" +"\n" +"%4$s%5$s%6$s\n" +"Faithfully yours,\n" +"%7$s.\n" +"\n" +"----\n" +"Change your email address or notification options at %8$s\n" +msgstr "" +"Użytkownik %1$s obserwuje teraz Twoje wpisy na %2$s.\n" +"\n" +"\t%3$s\n" +"\n" +"%4$s%5$s%6$s\n" +"Z poważaniem,\n" +"%7$s.\n" +"\n" +"----\n" +"Zmień adres e-mail lub opcje powiadamiania na %8$s\n" + +#: lib/mail.php:466 +#, php-format +msgid "" +"%1$s (%2$s) is wondering what you are up to these days and is inviting you " +"to post some news.\n" +"\n" +"So let's hear from you :)\n" +"\n" +"%3$s\n" +"\n" +"Don't reply to this email; it won't get to them.\n" +"\n" +"With kind regards,\n" +"%4$s\n" +msgstr "" +"Użytkownik %1$s (%2$s) zastanawia się, co się z Tobą dzieje w ostatnich " +"dniach i zaprasza Cię do wysłania jakichś aktualności.\n" +"\n" +"Tak więc do usłyszenia. :)\n" +"\n" +"%3$s\n" +"\n" +"Nie odpowiadaj na tę wiadomość e-mail, nie dotrze ona do nich.\n" +"\n" +"Z poważaniem,\n" +"%4$s\n" + +#: lib/mail.php:513 +#, php-format +msgid "" +"%1$s (%2$s) sent you a private message:\n" +"\n" +"------------------------------------------------------\n" +"%3$s\n" +"------------------------------------------------------\n" +"\n" +"You can reply to their message here:\n" +"\n" +"%4$s\n" +"\n" +"Don't reply to this email; it won't get to them.\n" +"\n" +"With kind regards,\n" +"%5$s\n" +msgstr "" +"Użytkownik %1$s (%2$s) wysłał Ci prywatną wiadomość:\n" +"\n" +"------------------------------------------------------\n" +"%3$s\n" +"------------------------------------------------------\n" +"\n" +"Tutaj możesz na nią odpowiedzieć:\n" +"\n" +"%4$s\n" +"\n" +"Nie odpowiadaj na tę wiadomość e-mail, nie dotrze ona do nich.\n" +"\n" +"Z poważaniem,\n" +"%5$s\n" + +#: lib/mail.php:598 +#, php-format +msgid "%s sent a notice to your attention" +msgstr "Użytkownik %s wysłał wpis wymagający Twojej uwagi" + +#: lib/mail.php:600 +#, php-format +msgid "" +"%1$s just sent a notice to your attention (an '@-reply') on %2$s.\n" +"\n" +"The notice is here:\n" +"\n" +"\t%3$s\n" +"\n" +"It reads:\n" +"\n" +"\t%4$s\n" +"\n" +"You can reply back here:\n" +"\n" +"\t%5$s\n" +"\n" +"The list of all @-replies for you here:\n" +"\n" +"%6$s\n" +"\n" +"Faithfully yours,\n" +"%2$s\n" +"\n" +"P.S. You can turn off these email notifications here: %7$s\n" +msgstr "" +"Użytkownik %1$s właśnie wysłał wpis wymagający Twojej uwagi (odpowiedź \"@" +"\") na %2$s.\n" +"\n" +"Twój wpis znajduje się tutaj:\n" +"\n" +"\t%3$s\n" +"\n" +"Zawiera tekst:\n" +"\n" +"\t%4$s\n" +"\n" +"Tutaj możesz odpowiedzieć:\n" +"\n" +"\t%5$s\n" +"\n" +"Lista wszystkich odpowiedzi \"@\" do Ciebie znajduje się tutaj:\n" +"\n" +"%6$s\n" +"\n" +"Z poważaniem,\n" +"%2$s\n" +"\n" +"PS Tutaj możesz wyłączyć te powiadomienia przez e-mail: %7$s\n" -#~ msgid "Error inserting notice" -#~ msgstr "Błąd przy wprowadzaniu wpisu" +#: lib/searchaction.php:122 +msgid "Search site" +msgstr "Znajdź stronę" -#~ msgid "" -#~ "If you've forgotten or lost your password, you can get a new one sent " -#~ "the email address you have stored in your account." -#~ msgstr "" -#~ "Jeśli Twoje hasło gdzieś się zapodziało lub zostało zapomniane to możesz " -#~ "wygenerować nowe. Zostanie ono wysłane na adres e-mailowy skojarzony z " -#~ "Twoim kontem." +#: lib/section.php:106 +msgid "More..." +msgstr "Więcej..." -- cgit v1.2.3 From f934cf2ac0cab8be26e5108c51fe0dcbef5b8517 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 12 Apr 2009 15:34:38 -0400 Subject: Update XML generation and list of actions in public XRDS Updated the XML generation calls and list of actions in the public XRDS document. --- actions/publicxrds.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/actions/publicxrds.php b/actions/publicxrds.php index aad59d779..2c52f1246 100644 --- a/actions/publicxrds.php +++ b/actions/publicxrds.php @@ -51,7 +51,7 @@ class PublicxrdsAction extends Action { /** * Is read only? - * + * * @return boolean true */ function isReadOnly() @@ -61,7 +61,7 @@ class PublicxrdsAction extends Action /** * Class handler. - * + * * @param array $args array of arguments * * @return nothing @@ -70,24 +70,24 @@ class PublicxrdsAction extends Action { parent::handle($args); header('Content-Type: application/xrds+xml'); - common_start_xml(); + $this->startXML(); $this->elementStart('XRDS', array('xmlns' => 'xri://$xrds')); $this->elementStart('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)', 'xmlns:simple' => 'http://xrds-simple.net/core/1.0', 'version' => '2.0')); $this->element('Type', null, 'xri://$xrds*simple'); - foreach (array('finishopenidlogin', 'finishaddopenid', 'finishimmediate') as $finish) { + foreach (array('finishopenidlogin', 'finishaddopenid') as $finish) { $this->showService(Auth_OpenID_RP_RETURN_TO_URL_TYPE, common_local_url($finish)); } $this->elementEnd('XRD'); $this->elementEnd('XRDS'); - common_end_xml(); + $this->endXML(); } /** * Show service. - * + * * @param string $type XRDS type * @param string $uri URI * @param array $params type parameters, null by default -- cgit v1.2.3 From e9e7671d5fbb6e3e66c8629ac78246cd9a47ceda Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Sun, 12 Apr 2009 21:40:29 +0000 Subject: Updated markup for entity_profile on Authorize subscription page. --- actions/userauthorization.php | 87 ++++++++++++++++++++++++++++++++----------- 1 file changed, 65 insertions(+), 22 deletions(-) diff --git a/actions/userauthorization.php b/actions/userauthorization.php index 8723848c7..c8c679dcd 100644 --- a/actions/userauthorization.php +++ b/actions/userauthorization.php @@ -97,47 +97,90 @@ class UserauthorizationAction extends Action $location = $params['omb_listenee_location']; $avatar = $params['omb_listenee_avatar']; - $this->elementStart('div', 'profile'); + $this->elementStart('div', array('class' => 'profile')); + $this->elementStart('div', 'entity_profile vcard'); + $this->elementStart('a', array('href' => $profile, + 'class' => 'url')); if ($avatar) { $this->element('img', array('src' => $avatar, - 'class' => 'avatar', + 'class' => 'photo avatar', 'width' => AVATAR_PROFILE_SIZE, 'height' => AVATAR_PROFILE_SIZE, 'alt' => $nickname)); } - $this->element('a', array('href' => $profile, - 'class' => 'external profile nickname'), - $nickname); + $hasFN = ($fullname !== '') ? 'nickname' : 'fn nickname'; + $this->elementStart('span', $hasFN); + $this->raw($nickname); + $this->elementEnd('span'); + $this->elementEnd('a'); + if (!is_null($fullname)) { - $this->elementStart('div', 'fullname'); - if (!is_null($homepage)) { - $this->element('a', array('href' => $homepage), - $fullname); - } else { - $this->text($fullname); - } - $this->elementEnd('div'); + $this->elementStart('dl', 'entity_fn'); + $this->elementStart('dd'); + $this->elementStart('span', 'fn'); + $this->raw($fullname); + $this->elementEnd('span'); + $this->elementEnd('dd'); + $this->elementEnd('dl'); } if (!is_null($location)) { - $this->element('div', 'location', $location); + $this->elementStart('dl', 'entity_location'); + $this->element('dt', null, _('Location')); + $this->elementStart('dd', 'label'); + $this->raw($location); + $this->elementEnd('dd'); + $this->elementEnd('dl'); + } + + if (!is_null($homepage)) { + $this->elementStart('dl', 'entity_url'); + $this->element('dt', null, _('URL')); + $this->elementStart('dd'); + $this->elementStart('a', array('href' => $homepage, + 'class' => 'url')); + $this->raw($homepage); + $this->elementEnd('a'); + $this->elementEnd('dd'); + $this->elementEnd('dl'); } + if (!is_null($bio)) { - $this->element('div', 'bio', $bio); + $this->elementStart('dl', 'entity_note'); + $this->element('dt', null, _('Note')); + $this->elementStart('dd', 'note'); + $this->raw($bio); + $this->elementEnd('dd'); + $this->elementEnd('dl'); + } + + if (!is_null($license)) { + $this->elementStart('dl', 'entity_license'); + $this->element('dt', null, _('License')); + $this->elementStart('dd', 'license'); + $this->element('a', array('href' => $license, + 'class' => 'license'), + $license); + $this->elementEnd('dd'); + $this->elementEnd('dl'); } - $this->elementStart('div', 'license'); - $this->element('a', array('href' => $license, - 'class' => 'license'), - $license); - $this->elementEnd('div'); $this->elementEnd('div'); + + $this->elementStart('div', 'entity_actions'); + $this->elementStart('ul'); + $this->elementStart('li', 'entity_subscribe'); $this->elementStart('form', array('method' => 'post', 'id' => 'userauthorization', 'name' => 'userauthorization', 'action' => common_local_url('userauthorization'))); $this->hidden('token', common_session_token()); - $this->submit('accept', _('Accept')); - $this->submit('reject', _('Reject')); + + $this->submit('accept', _('Accept'), 'submit accept', null, _('Subscribe to this user')); + $this->submit('reject', _('Reject'), 'submit reject', null, _('Reject this subscription')); $this->elementEnd('form'); + $this->elementEnd('li'); + $this->elementEnd('ul'); + $this->elementEnd('div'); + $this->elementEnd('div'); } function sendAuthorization() -- cgit v1.2.3 From 7a00dc749da9bcc003aad5f90b0346ba164680df Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Sun, 12 Apr 2009 21:50:14 +0000 Subject: Updated styles for the Authrization subscription form inputs --- actions/userauthorization.php | 1 + theme/base/css/display.css | 6 ++++-- theme/default/css/display.css | 3 ++- theme/identica/css/display.css | 3 ++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/actions/userauthorization.php b/actions/userauthorization.php index c8c679dcd..168019149 100644 --- a/actions/userauthorization.php +++ b/actions/userauthorization.php @@ -170,6 +170,7 @@ class UserauthorizationAction extends Action $this->elementStart('li', 'entity_subscribe'); $this->elementStart('form', array('method' => 'post', 'id' => 'userauthorization', + 'class' => 'form_user_authorization', 'name' => 'userauthorization', 'action' => common_local_url('userauthorization'))); $this->hidden('token', common_session_token()); diff --git a/theme/base/css/display.css b/theme/base/css/display.css index 3b4a2a4b3..9c0980ec6 100644 --- a/theme/base/css/display.css +++ b/theme/base/css/display.css @@ -607,7 +607,9 @@ border-radius:4px; -moz-border-radius:4px; -webkit-border-radius:4px; } - +.entity_actions .accept { +margin-bottom:18px; +} .entity_tags ul { list-style-type:none; @@ -1158,4 +1160,4 @@ display:none; } .guide { clear:both; -} \ No newline at end of file +} diff --git a/theme/default/css/display.css b/theme/default/css/display.css index 42e29374f..5523a331e 100644 --- a/theme/default/css/display.css +++ b/theme/default/css/display.css @@ -164,7 +164,8 @@ background-color:#A9BF4F; color:#fff; } .form_user_unsubscribe input.submit, -.form_group_leave input.submit { +.form_group_leave input.submit, +.form_user_authorization input.reject { background-color:#97BFD1; } diff --git a/theme/identica/css/display.css b/theme/identica/css/display.css index 8edb005a6..e4f582b6c 100644 --- a/theme/identica/css/display.css +++ b/theme/identica/css/display.css @@ -164,7 +164,8 @@ background-color:#9BB43E; color:#fff; } .form_user_unsubscribe input.submit, -.form_group_leave input.submit { +.form_group_leave input.submit, +.form_user_authorization input.reject { background-color:#87B4C8; } -- cgit v1.2.3 From d62f69e5928e94e1ca15a469ba31cdfef6a80016 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Mon, 13 Apr 2009 03:05:00 +0000 Subject: Removing h1 from display in Profile page due to duplicate visibility of fn and nickname. --- theme/base/css/display.css | 1 + 1 file changed, 1 insertion(+) diff --git a/theme/base/css/display.css b/theme/base/css/display.css index 9c0980ec6..00f7c0e8f 100644 --- a/theme/base/css/display.css +++ b/theme/base/css/display.css @@ -29,6 +29,7 @@ h1 { font-size:1.4em; margin-bottom:18px; } +#showstream h1 { display:none; } h2 { font-size:1.3em; } h3 { font-size:1.2em; } h4 { font-size:1.1em; } -- cgit v1.2.3 From ffa00073509a275df2605ca39d110c0c3fcf2dee Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Mon, 13 Apr 2009 16:40:51 +0000 Subject: Ticket 1419. Added config option to set site to private. --- config.php.sample | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config.php.sample b/config.php.sample index 0a01552fe..e70d9ab46 100644 --- a/config.php.sample +++ b/config.php.sample @@ -30,6 +30,8 @@ $config['site']['path'] = 'laconica'; #$config['site']['closed'] = true; #Only allow registration for people invited by another user #$config['site']['inviteonly'] = true; +#Make the site invisible to non-logged-in users +#$config['site']['private'] = true; # If you want logging sent to a file instead of syslog #$config['site']['logfile'] = '/tmp/laconica.log'; -- cgit v1.2.3 From d4f9f2c69bb9cba7aa2ff67a2b75d106f1bd1607 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Mon, 13 Apr 2009 17:26:12 +0000 Subject: Moved layout styles to base stylesheet. --- theme/base/css/display.css | 4 ++++ theme/default/css/display.css | 4 ---- theme/identica/css/display.css | 4 ---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/theme/base/css/display.css b/theme/base/css/display.css index 00f7c0e8f..2fb1c007f 100644 --- a/theme/base/css/display.css +++ b/theme/base/css/display.css @@ -921,6 +921,10 @@ padding:0; } +#usergroups #new_group { +float: left; +margin-right: 2em; +} #new_group, #group_search { margin-bottom:18px; } diff --git a/theme/default/css/display.css b/theme/default/css/display.css index 5523a331e..c5d694610 100644 --- a/theme/default/css/display.css +++ b/theme/default/css/display.css @@ -232,10 +232,6 @@ background-color:#fcfcfc; #new_group a { background:transparent url(../images/icons/twotone/green/news.gif) no-repeat 0 45%; } -#usergroups #new_group { -float: left; -margin-right: 2em; -} .pagination .nav_prev a, .pagination .nav_next a { diff --git a/theme/identica/css/display.css b/theme/identica/css/display.css index e4f582b6c..c32b6269d 100644 --- a/theme/identica/css/display.css +++ b/theme/identica/css/display.css @@ -232,10 +232,6 @@ background-color:#fcfcfc; #new_group a { background:transparent url(../images/icons/twotone/green/news.gif) no-repeat 0 45%; } -#usergroups #new_group { -float: left; -margin-right: 2em; -} .pagination .nav_prev a, .pagination .nav_next a { -- cgit v1.2.3 From e9e75fc9d5f44b2ffe10602a3bd183cccb7da4ec Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 13 Apr 2009 15:49:26 -0400 Subject: isReadOnly() now takes arguments Add an array of arguments to isReadOnly() method of actions, to let them change their results depending on what actions are called. Primarily used by the 'api' action. Ideally in the future that will be multiple actions. But this might still be useful. --- actions/all.php | 2 +- actions/api.php | 13 ++++++------- actions/avatarbynickname.php | 2 +- actions/doc.php | 2 +- actions/favorited.php | 2 +- actions/featured.php | 2 +- actions/foaf.php | 2 +- actions/groupbyid.php | 2 +- actions/groupmembers.php | 2 +- actions/grouprss.php | 2 +- actions/groups.php | 2 +- actions/invite.php | 2 +- actions/login.php | 2 +- actions/logout.php | 2 +- actions/microsummary.php | 2 +- actions/noticesearchrss.php | 2 +- actions/nudge.php | 2 +- actions/opensearch.php | 2 +- actions/public.php | 2 +- actions/publicrss.php | 2 +- actions/publictagcloud.php | 2 +- actions/publicxrds.php | 2 +- actions/replies.php | 2 +- actions/repliesrss.php | 2 +- actions/requesttoken.php | 2 +- actions/showfavorites.php | 2 +- actions/showgroup.php | 2 +- actions/showmessage.php | 2 +- actions/shownotice.php | 2 +- actions/showstream.php | 2 +- actions/subscribers.php | 2 +- actions/sup.php | 2 +- actions/tag.php | 2 +- actions/tagrss.php | 2 +- actions/twitapisearchjson.php | 2 +- actions/userbyid.php | 2 +- actions/usergroups.php | 2 +- actions/userrss.php | 2 +- actions/xrds.php | 2 +- index.php | 2 +- lib/action.php | 5 ++++- lib/error.php | 2 +- lib/galleryaction.php | 2 +- lib/peoplesearchresults.php | 2 +- lib/personal.php | 2 +- lib/searchaction.php | 2 +- 46 files changed, 54 insertions(+), 52 deletions(-) diff --git a/actions/all.php b/actions/all.php index f5bbfe2e3..69890a70c 100644 --- a/actions/all.php +++ b/actions/all.php @@ -25,7 +25,7 @@ require_once INSTALLDIR.'/lib/feedlist.php'; class AllAction extends ProfileAction { - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/actions/api.php b/actions/api.php index c18d551b6..e40a18798 100644 --- a/actions/api.php +++ b/actions/api.php @@ -134,8 +134,8 @@ class ApiAction extends Action 'favorites/favorites'); $fullname = "$this->api_action/$this->api_method"; - - // If the site is "private", all API methods except laconica/config + + // If the site is "private", all API methods except laconica/config // need authentication if (common_config('site', 'private')) { return $fullname != 'laconica/config' || false; @@ -180,11 +180,11 @@ class ApiAction extends Action } } - function isReadOnly() + function isReadOnly($args)($args) { - # NOTE: before handle(), can't use $this->arg - $apiaction = $_REQUEST['apiaction']; - $method = $_REQUEST['method']; + $apiaction = $args['apiaction']; + $method = $args['method']; + list($cmdtext, $fmt) = explode('.', $method); static $write_methods = array( @@ -207,5 +207,4 @@ class ApiAction extends Action return false; } - } diff --git a/actions/avatarbynickname.php b/actions/avatarbynickname.php index ca58c9653..e92a99372 100644 --- a/actions/avatarbynickname.php +++ b/actions/avatarbynickname.php @@ -98,7 +98,7 @@ class AvatarbynicknameAction extends Action common_redirect($url, 302); } - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/actions/doc.php b/actions/doc.php index ebffb7c15..e6508030b 100644 --- a/actions/doc.php +++ b/actions/doc.php @@ -108,7 +108,7 @@ class DocAction extends Action return ucfirst($this->title); } - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/actions/favorited.php b/actions/favorited.php index 09ab1216a..c902d80f5 100644 --- a/actions/favorited.php +++ b/actions/favorited.php @@ -85,7 +85,7 @@ class FavoritedAction extends Action * @return boolean true */ - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/actions/featured.php b/actions/featured.php index 86fd3f374..79eba2aa6 100644 --- a/actions/featured.php +++ b/actions/featured.php @@ -50,7 +50,7 @@ class FeaturedAction extends Action { var $page = null; - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/actions/foaf.php b/actions/foaf.php index 416935b1b..2d5b78d12 100644 --- a/actions/foaf.php +++ b/actions/foaf.php @@ -25,7 +25,7 @@ define('BOTH', 0); class FoafAction extends Action { - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/actions/groupbyid.php b/actions/groupbyid.php index 678119a94..7d327d56c 100644 --- a/actions/groupbyid.php +++ b/actions/groupbyid.php @@ -59,7 +59,7 @@ class GroupbyidAction extends Action * @return boolean true */ - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/actions/groupmembers.php b/actions/groupmembers.php index 00f43a9f5..a90108e4d 100644 --- a/actions/groupmembers.php +++ b/actions/groupmembers.php @@ -48,7 +48,7 @@ class GroupmembersAction extends Action { var $page = null; - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/actions/grouprss.php b/actions/grouprss.php index de76a5960..a9a2eef87 100644 --- a/actions/grouprss.php +++ b/actions/grouprss.php @@ -57,7 +57,7 @@ class groupRssAction extends Rss10Action * @return boolean true */ - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/actions/groups.php b/actions/groups.php index 39dc2232b..26b52a5fc 100644 --- a/actions/groups.php +++ b/actions/groups.php @@ -51,7 +51,7 @@ class GroupsAction extends Action var $page = null; var $profile = null; - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/actions/invite.php b/actions/invite.php index df6e3b714..7e52cdbcc 100644 --- a/actions/invite.php +++ b/actions/invite.php @@ -27,7 +27,7 @@ class InviteAction extends Action var $subbed = null; var $sent = null; - function isReadOnly() + function isReadOnly($args) { return false; } diff --git a/actions/login.php b/actions/login.php index 59c6b4874..50de83f6f 100644 --- a/actions/login.php +++ b/actions/login.php @@ -55,7 +55,7 @@ class LoginAction extends Action * @return boolean false */ - function isReadOnly() + function isReadOnly($args) { return false; } diff --git a/actions/logout.php b/actions/logout.php index b7681be38..9f3bfe247 100644 --- a/actions/logout.php +++ b/actions/logout.php @@ -52,7 +52,7 @@ class LogoutAction extends Action * * @return boolean true */ - function isReadOnly() + function isReadOnly($args) { return false; } diff --git a/actions/microsummary.php b/actions/microsummary.php index 065a2e0eb..0b408ec95 100644 --- a/actions/microsummary.php +++ b/actions/microsummary.php @@ -74,7 +74,7 @@ class MicrosummaryAction extends Action print $user->nickname . ': ' . $notice->content; } - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/actions/noticesearchrss.php b/actions/noticesearchrss.php index ba5276d06..f6da969ee 100644 --- a/actions/noticesearchrss.php +++ b/actions/noticesearchrss.php @@ -92,7 +92,7 @@ class NoticesearchrssAction extends Rss10Action return null; } - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/actions/nudge.php b/actions/nudge.php index b4e5e01dd..c23d3e643 100644 --- a/actions/nudge.php +++ b/actions/nudge.php @@ -124,7 +124,7 @@ class NudgeAction extends Action } } - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/actions/opensearch.php b/actions/opensearch.php index 2eb818306..d1f4895ce 100644 --- a/actions/opensearch.php +++ b/actions/opensearch.php @@ -84,7 +84,7 @@ class OpensearchAction extends Action $this->endXML(); } - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/actions/public.php b/actions/public.php index 5a380de9a..27153f131 100644 --- a/actions/public.php +++ b/actions/public.php @@ -56,7 +56,7 @@ class PublicAction extends Action var $page = null; - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/actions/publicrss.php b/actions/publicrss.php index 77e26e0f4..bc52f2952 100644 --- a/actions/publicrss.php +++ b/actions/publicrss.php @@ -102,7 +102,7 @@ class PublicrssAction extends Rss10Action // nop } - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/actions/publictagcloud.php b/actions/publictagcloud.php index 855cfed9b..e9f33d58b 100644 --- a/actions/publictagcloud.php +++ b/actions/publictagcloud.php @@ -47,7 +47,7 @@ define('TAGS_PER_PAGE', 100); class PublictagcloudAction extends Action { - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/actions/publicxrds.php b/actions/publicxrds.php index 2c52f1246..283a932ca 100644 --- a/actions/publicxrds.php +++ b/actions/publicxrds.php @@ -54,7 +54,7 @@ class PublicxrdsAction extends Action * * @return boolean true */ - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/actions/replies.php b/actions/replies.php index 2769cb422..eac4d0a3a 100644 --- a/actions/replies.php +++ b/actions/replies.php @@ -196,7 +196,7 @@ class RepliesAction extends Action $this->elementEnd('div'); } - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/actions/repliesrss.php b/actions/repliesrss.php index 985318bf1..2017c4309 100644 --- a/actions/repliesrss.php +++ b/actions/repliesrss.php @@ -83,7 +83,7 @@ class RepliesrssAction extends Rss10Action return ($avatar) ? $avatar->url : null; } - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/actions/requesttoken.php b/actions/requesttoken.php index ca253b97a..fb577fdd5 100644 --- a/actions/requesttoken.php +++ b/actions/requesttoken.php @@ -52,7 +52,7 @@ class RequesttokenAction extends Action * * @return boolean false */ - function isReadOnly() + function isReadOnly($args) { return false; } diff --git a/actions/showfavorites.php b/actions/showfavorites.php index 4d4349505..e8cf1cb01 100644 --- a/actions/showfavorites.php +++ b/actions/showfavorites.php @@ -58,7 +58,7 @@ class ShowfavoritesAction extends Action * @return boolean true */ - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/actions/showgroup.php b/actions/showgroup.php index 79445851f..7e86a79f1 100644 --- a/actions/showgroup.php +++ b/actions/showgroup.php @@ -60,7 +60,7 @@ class ShowgroupAction extends Action * @return boolean true */ - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/actions/showmessage.php b/actions/showmessage.php index 572a71739..4fcaadbe8 100644 --- a/actions/showmessage.php +++ b/actions/showmessage.php @@ -177,7 +177,7 @@ class ShowmessageAction extends MailboxAction return ''; } - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/actions/shownotice.php b/actions/shownotice.php index ccae49bb3..2c469c9de 100644 --- a/actions/shownotice.php +++ b/actions/shownotice.php @@ -106,7 +106,7 @@ class ShownoticeAction extends Action * @return boolean true */ - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/actions/showstream.php b/actions/showstream.php index ce237dae2..c1a2c337a 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -56,7 +56,7 @@ require_once INSTALLDIR.'/lib/feedlist.php'; class ShowstreamAction extends ProfileAction { - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/actions/subscribers.php b/actions/subscribers.php index 7ebb54d33..d91a7d4fd 100644 --- a/actions/subscribers.php +++ b/actions/subscribers.php @@ -130,7 +130,7 @@ class SubscribersList extends ProfileList $bf->show(); } - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/actions/sup.php b/actions/sup.php index 246b3299d..691153d6a 100644 --- a/actions/sup.php +++ b/actions/sup.php @@ -79,7 +79,7 @@ class SupAction extends Action return $updates; } - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/actions/tag.php b/actions/tag.php index c413bf8c3..7f82c2a58 100644 --- a/actions/tag.php +++ b/actions/tag.php @@ -87,7 +87,7 @@ class TagAction extends Action $this->page, 'tag', array('tag' => $this->tag)); } - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/actions/tagrss.php b/actions/tagrss.php index a77fa12c9..83cf3afe2 100644 --- a/actions/tagrss.php +++ b/actions/tagrss.php @@ -65,7 +65,7 @@ class TagrssAction extends Rss10Action return $c; } - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/actions/twitapisearchjson.php b/actions/twitapisearchjson.php index 0f9f523a1..b0e3be687 100644 --- a/actions/twitapisearchjson.php +++ b/actions/twitapisearchjson.php @@ -142,7 +142,7 @@ class TwitapisearchjsonAction extends TwitterapiAction * @return boolean true */ - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/actions/userbyid.php b/actions/userbyid.php index 1e30d1aac..4a985fcd7 100644 --- a/actions/userbyid.php +++ b/actions/userbyid.php @@ -50,7 +50,7 @@ class UserbyidAction extends Action * * @return boolean true */ - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/actions/usergroups.php b/actions/usergroups.php index 06b2334bf..e3088dcbd 100644 --- a/actions/usergroups.php +++ b/actions/usergroups.php @@ -52,7 +52,7 @@ class UsergroupsAction extends Action var $page = null; var $profile = null; - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/actions/userrss.php b/actions/userrss.php index d3bf352d8..5861d9ee3 100644 --- a/actions/userrss.php +++ b/actions/userrss.php @@ -96,7 +96,7 @@ class UserrssAction extends Rss10Action parent::initRss($limit); } - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/actions/xrds.php b/actions/xrds.php index 075831803..1335b6b80 100644 --- a/actions/xrds.php +++ b/actions/xrds.php @@ -52,7 +52,7 @@ class XrdsAction extends Action * * @return boolean true */ - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/index.php b/index.php index e83d08c13..e24bde917 100644 --- a/index.php +++ b/index.php @@ -128,7 +128,7 @@ function main() // XXX: find somewhere for this little block to live - if (common_config('db', 'mirror') && $action_obj->isReadOnly()) { + if (common_config('db', 'mirror') && $action_obj->isReadOnly($args)) { if (is_array(common_config('db', 'mirror'))) { // "load balancing", ha ha $arr = common_config('db', 'mirror'); diff --git a/lib/action.php b/lib/action.php index cc98d4445..673549246 100644 --- a/lib/action.php +++ b/lib/action.php @@ -791,9 +791,12 @@ class Action extends HTMLOutputter // lawsuit * * MAY override * + * @param array $args other arguments + * * @return boolean is read only action? */ - function isReadOnly() + + function isReadOnly($args)($args) { return false; } diff --git a/lib/error.php b/lib/error.php index 526d9f81b..282682133 100644 --- a/lib/error.php +++ b/lib/error.php @@ -93,7 +93,7 @@ class ErrorAction extends Action return $this->message; } - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/lib/galleryaction.php b/lib/galleryaction.php index 8e21d7393..0484918ce 100644 --- a/lib/galleryaction.php +++ b/lib/galleryaction.php @@ -76,7 +76,7 @@ class GalleryAction extends Action return true; } - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/lib/peoplesearchresults.php b/lib/peoplesearchresults.php index f8ab7cf3b..d3f840852 100644 --- a/lib/peoplesearchresults.php +++ b/lib/peoplesearchresults.php @@ -67,7 +67,7 @@ class PeopleSearchResults extends ProfileList return preg_replace($this->pattern, '\\1', htmlspecialchars($text)); } - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/lib/personal.php b/lib/personal.php index e46350c63..f92732375 100644 --- a/lib/personal.php +++ b/lib/personal.php @@ -47,7 +47,7 @@ class PersonalAction extends Action var $user = null; - function isReadOnly() + function isReadOnly($args) { return true; } diff --git a/lib/searchaction.php b/lib/searchaction.php index e7ad4affd..e74450e11 100644 --- a/lib/searchaction.php +++ b/lib/searchaction.php @@ -51,7 +51,7 @@ class SearchAction extends Action * * @return boolean true */ - function isReadOnly() + function isReadOnly($args) { return true; } -- cgit v1.2.3 From 4c9be4d566c4d4b6e846935cbabd951f5d59259d Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 13 Apr 2009 15:52:15 -0400 Subject: typo in api.php --- actions/api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/api.php b/actions/api.php index e40a18798..d2f0a2eff 100644 --- a/actions/api.php +++ b/actions/api.php @@ -180,7 +180,7 @@ class ApiAction extends Action } } - function isReadOnly($args)($args) + function isReadOnly($args) { $apiaction = $args['apiaction']; $method = $args['method']; -- cgit v1.2.3 From 4684d34713a8057387750bc52802d0c0475ec926 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 13 Apr 2009 15:54:16 -0400 Subject: typo in lib action --- lib/action.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/action.php b/lib/action.php index 673549246..1ba062812 100644 --- a/lib/action.php +++ b/lib/action.php @@ -796,7 +796,7 @@ class Action extends HTMLOutputter // lawsuit * @return boolean is read only action? */ - function isReadOnly($args)($args) + function isReadOnly($args) { return false; } -- cgit v1.2.3 From 01695dc3465c8198123c254816f9a93a35b6c773 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Mon, 13 Apr 2009 15:03:34 -0700 Subject: Fix bad dates in API's JSON search results --- lib/jsonsearchresultslist.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jsonsearchresultslist.php b/lib/jsonsearchresultslist.php index 0cdcf0c51..f786c20a8 100644 --- a/lib/jsonsearchresultslist.php +++ b/lib/jsonsearchresultslist.php @@ -232,7 +232,7 @@ class ResultItem $this->profile_image_url = ($avatar) ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_STREAM_SIZE); - $this->created_at = date('r', $this->notice->created); + $this->created_at = common_date_rfc2822($this->notice->created); } /** -- cgit v1.2.3 From 9f2e2e4b2c1b428a1892c57c7194fbc5ede5b125 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Tue, 14 Apr 2009 11:50:59 -0700 Subject: Notice sources: Fixed Nambu, added Tricklepost and sorted the list. --- db/notice_source.sql | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/db/notice_source.sql b/db/notice_source.sql index ac23f14aa..d5124e223 100644 --- a/db/notice_source.sql +++ b/db/notice_source.sql @@ -1,29 +1,28 @@ INSERT INTO notice_source (code, name, url, created) VALUES - ('Do','Gnome Do','http://do.davebsd.com/wiki/index.php?title=Microblog_Plugin', now()), - ('Facebook','Facebook','http://apps.facebook.com/identica/', now()), - ('Gwibber','Gwibber','http://launchpad.net/gwibber', now()), - ('HelloTxt','HelloTxt','http://hellotxt.com/', now()), - ('IdentiFox','IdentiFox','http://www.bitbucket.org/uncryptic/identifox/', now()), - ('LaTwit','LaTwit','http://latwit.mac65.com/', now()), - ('Nambu','Nambu','http://www.nambu.com/', now()), - ('Pikchur','Pikchur','http://www.pikchur.com/', now()), - ('Ping.fm','Ping.fm','http://ping.fm/', now()), - ('Twidge','Twidge','http://software.complete.org/twidge', now()), - ('Updating.Me','Updating.Me','http://updating.me/', now()), + ('adium', 'Adium', 'http://www.adiumx.com/', now()), ('betwittered','BeTwittered','http://www.32hours.com/betwitteredinfo/', now()), ('bti','bti','http://gregkh.github.com/bti/', now()), ('cliqset', 'Cliqset', 'http://www.cliqset.com/', now()), ('deskbar','Deskbar-Applet','http://www.gnome.org/projects/deskbar-applet/', now()), + ('Do','Gnome Do','http://do.davebsd.com/wiki/index.php?title=Microblog_Plugin', now()), + ('Facebook','Facebook','http://apps.facebook.com/identica/', now()), + ('Gwibber','Gwibber','http://launchpad.net/gwibber', now()), + ('HelloTxt','HelloTxt','http://hellotxt.com/', now()), ('identicatools','Laconica Tools','http://bitbucketlabs.net/laconica-tools/', now()), ('identichat','identichat','http://identichat.prosody.im/', now()), + ('IdentiFox','IdentiFox','http://www.bitbucket.org/uncryptic/identifox/', now()), ('identitwitch','IdentiTwitch','http://richfish.org/identitwitch/', now()), + ('LaTwit','LaTwit','http://latwit.mac65.com/', now()), ('maisha', 'Maisha', 'http://maisha.grango.org/', now()), ('mbpidgin','mbpidgin','http://code.google.com/p/microblog-purple/', now()), ('Mobidentica', 'Mobidentica', 'http://www.substanceofcode.com/software/mobidentica/', now()), ('moconica','Moconica','http://moconica.com/', now()), + ('nambu','Nambu','http://www.nambu.com/', now()), ('peoplebrowsr', 'PeopleBrowsr', 'http://www.peoplebrowsr.com/', now()), + ('Pikchur','Pikchur','http://www.pikchur.com/', now()), + ('Ping.fm','Ping.fm','http://ping.fm/', now()), ('pocketwit','PockeTwit','http://code.google.com/p/pocketwit/', now()), ('posty','Posty','http://spreadingfunkyness.com/posty/', now()), ('royalewithcheese','Royale With Cheese','http://p.hellyeah.org/', now()), @@ -35,9 +34,11 @@ VALUES ('tarpipe','tarpipe','http://tarpipe.com/', now()), ('tjunar','Tjunar','http://nederflash.nl/boek/titels/tjunar-air', now()), ('tr.im','tr.im','http://tr.im/', now()), + ('triklepost', 'Tricklepost', 'http://github.com/zcopley/tricklepost/tree/master', now()), ('tweenky','Tweenky','http://beta.tweenky.com/', now()), ('twhirl','Twhirl','http://www.twhirl.org/', now()), ('twibble','twibble','http://www.twibble.de/', now()), + ('Twidge','Twidge','http://software.complete.org/twidge', now()), ('twidge','Twidge','http://software.complete.org/twidge', now()), ('twidroid','twidroid','http://www.twidroid.com/', now()), ('twittelator','Twittelator','http://www.stone.com/iPhone/Twittelator/', now()), @@ -47,6 +48,6 @@ VALUES ('twittertools','Twitter Tools','http://wordpress.org/extend/plugins/twitter-tools/', now()), ('twitux','Twitux','http://live.gnome.org/DanielMorales/Twitux', now()), ('twitvim','TwitVim','http://vim.sourceforge.net/scripts/script.php?script_id=2204', now()), + ('Updating.Me','Updating.Me','http://updating.me/', now()), ('urfastr','urfastr','http://urfastr.net/', now()), - ('adium', 'Adium', 'http://www.adiumx.com/', now()), ('yatca','Yatca','http://www.yatca.com/', now()); -- cgit v1.2.3 From b1940bcb7b028b993b26cd3c36f4fdbbc79c96e6 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 14 Apr 2009 16:01:02 -0400 Subject: escape slash in regexp --- plugins/LinkbackPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/LinkbackPlugin.php b/plugins/LinkbackPlugin.php index 56a26176b..881ead99e 100644 --- a/plugins/LinkbackPlugin.php +++ b/plugins/LinkbackPlugin.php @@ -99,7 +99,7 @@ class LinkbackPlugin extends Plugin if (array_key_exists('X-Pingback', $result->headers)) { $pb = $result->headers['X-Pingback']; - } else if (preg_match('//', + } else if (preg_match('//', $result->body, $match)) { $pb = $match[1]; -- cgit v1.2.3 From b142c260108f43636b69adb90d5a27ffa44f0f74 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 14 Apr 2009 16:02:09 -0400 Subject: Make stuff work with no base --- lib/action.php | 4 ---- theme/default/css/display.css | 10 ++-------- theme/identica/css/display.css | 10 ++-------- theme/iphone/display.css | 16 +++++++--------- 4 files changed, 11 insertions(+), 29 deletions(-) diff --git a/lib/action.php b/lib/action.php index 1ba062812..b02f525f0 100644 --- a/lib/action.php +++ b/lib/action.php @@ -192,10 +192,6 @@ class Action extends HTMLOutputter // lawsuit { if (Event::handle('StartShowStyles', array($this))) { if (Event::handle('StartShowLaconicaStyles', array($this))) { - $this->element('link', array('rel' => 'stylesheet', - 'type' => 'text/css', - 'href' => theme_path('css/display.css', 'base') . '?version=' . LACONICA_VERSION, - 'media' => 'screen, projection, tv')); $this->element('link', array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => theme_path('css/display.css', null) . '?version=' . LACONICA_VERSION, diff --git a/theme/default/css/display.css b/theme/default/css/display.css index c5d694610..69a600cc2 100644 --- a/theme/default/css/display.css +++ b/theme/default/css/display.css @@ -7,6 +7,8 @@ * @link http://laconi.ca/ */ +@import url(../../base/css/display.css); + html, body, a:active { @@ -70,7 +72,6 @@ border-top-color:#D1D9E4; border-top-color:#97BFD1; } - #content .notice p.entry-content a:visited { background-color:#fcfcfc; } @@ -82,7 +83,6 @@ background-color:#fcfffc; background-color:#CEE1E9; } - #notice_text-count { color:#333; } @@ -112,7 +112,6 @@ background-color:rgba(255, 255, 255, 0.2); background-color:rgba(255, 255, 255, 0.7); } - .error { background-color:#F7E8E8; } @@ -120,7 +119,6 @@ background-color:#F7E8E8; background-color:#EFF3DC; } - #anon_notice { background-color:#97BFD1; color:#fff; @@ -131,7 +129,6 @@ border-color:#fff; background-color:#A9BF4F; } - #export_data li a { background-repeat:no-repeat; background-position:0 45%; @@ -184,8 +181,6 @@ background-image:url(../images/icons/twotone/green/mail.gif); background-image:url(../images/icons/twotone/green/shield.gif); } - - /* NOTICES */ .notices li.over { background-color:#fcfcfc; @@ -228,7 +223,6 @@ background-color:#fcfcfc; } /*END: NOTICES */ - #new_group a { background:transparent url(../images/icons/twotone/green/news.gif) no-repeat 0 45%; } diff --git a/theme/identica/css/display.css b/theme/identica/css/display.css index c32b6269d..d05578d43 100644 --- a/theme/identica/css/display.css +++ b/theme/identica/css/display.css @@ -7,6 +7,8 @@ * @link http://laconi.ca/ */ +@import url(../../base/css/display.css); + html, body, a:active { @@ -70,7 +72,6 @@ border-top-color:#CEE1E9; border-top-color:#87B4C8; } - #content .notice p.entry-content a:visited { background-color:#fcfcfc; } @@ -82,7 +83,6 @@ background-color:#fcfffc; background-color:#CEE1E9; } - #notice_text-count { color:#333; } @@ -112,7 +112,6 @@ background-color:rgba(135, 180, 200, 0.3); background-color:rgba(255, 255, 255, 0.7); } - .error { background-color:#F7E8E8; } @@ -120,7 +119,6 @@ background-color:#F7E8E8; background-color:#EFF3DC; } - #anon_notice { background-color:#87B4C8; color:#fff; @@ -131,7 +129,6 @@ border-color:#fff; background-color:#9BB43E; } - #export_data li a { background-repeat:no-repeat; background-position:0 45%; @@ -184,8 +181,6 @@ background-image:url(../images/icons/twotone/green/mail.gif); background-image:url(../images/icons/twotone/green/shield.gif); } - - /* NOTICES */ .notices li.over { background-color:#fcfcfc; @@ -228,7 +223,6 @@ background-color:#fcfcfc; } /*END: NOTICES */ - #new_group a { background:transparent url(../images/icons/twotone/green/news.gif) no-repeat 0 45%; } diff --git a/theme/iphone/display.css b/theme/iphone/display.css index 6ac471c1e..1838a8e86 100644 --- a/theme/iphone/display.css +++ b/theme/iphone/display.css @@ -2,6 +2,8 @@ /* Design & CSS by Marie-Claude Doyon http://www.marieclaudedoyon.com */ /* Simplified for mobile by Ken Sheppardson http://identi.ca/kshep */ +@import url(../../base/css/display.css); + html {} body { width: 100%; @@ -28,7 +30,6 @@ h1 { font-size: 1.2em; } - #wrap { margin: 0; } @@ -196,7 +197,7 @@ p#branding a { } .instructions a:hover, .success a:hover, .error a:hover { color: #FCFFF5; -} +} .success { clear: both; float: left; @@ -210,7 +211,6 @@ p#branding a { background-color: #ce3728; } - /* ----- Stream -----*/ #notices { @@ -273,7 +273,7 @@ p.time { p.time a { color: #91AA9D; } - + /* ----- Profile -----*/ #profile { clear: both; @@ -356,7 +356,7 @@ dl.statistics { clear: left; float: left; width: 200px; -} +} .statistics dd { float: left; } @@ -402,8 +402,6 @@ ul.subscriptions li, ul.subscribers li { } /* ----- End Subscriptions & Subscribers -----*/ - - #pagination { margin: 18px auto; } @@ -488,7 +486,7 @@ input#submit:hover, input.submit:hover { input.checkbox { width: auto; border: 0; -} +} textarea, input { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 1em; @@ -629,7 +627,7 @@ input#openid_url { #profiles a:hover { text-decoration: underline; } - + .profile_single { clear: both; display: block; -- cgit v1.2.3 From 20394664957a202cc86cc48ee2d115032e82c58a Mon Sep 17 00:00:00 2001 From: Robin Millette Date: Tue, 14 Apr 2009 23:03:19 +0000 Subject: trac#1223 Show most popular notices per tag in the tag page sidebar. --- actions/tag.php | 7 +++++++ lib/popularnoticesection.php | 25 +++++++++++++++++-------- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/actions/tag.php b/actions/tag.php index d15f64498..cb6572b96 100644 --- a/actions/tag.php +++ b/actions/tag.php @@ -45,6 +45,13 @@ class TagAction extends Action return true; } + function showSections() + { + $pop = new PopularNoticeSection($this); + $pop->show(); + } + + function title() { if ($this->page == 1) { diff --git a/lib/popularnoticesection.php b/lib/popularnoticesection.php index 0505f0fa9..a8d47ef54 100644 --- a/lib/popularnoticesection.php +++ b/lib/popularnoticesection.php @@ -50,17 +50,26 @@ class PopularNoticeSection extends NoticeSection { if (common_config('db', 'type') == 'pgsql') { $weightexpr='sum(exp(-extract(epoch from (now() - fave.modified)) / %s))'; + if (!empty($this->out->tag)) { + $tag = pg_escape_string($this->tag); + } } else { $weightexpr='sum(exp(-(now() - fave.modified) / %s))'; + if (!empty($this->out->tag)) { + $tag = mysql_escape_string($this->out->tag); + } } - - $qry = 'SELECT notice.*, '. - $weightexpr . ' as weight ' . - 'FROM notice JOIN fave ON notice.id = fave.notice_id ' . - 'GROUP BY notice.id,notice.profile_id,notice.content,notice.uri,' . - 'notice.rendered,notice.url,notice.created,notice.modified,' . - 'notice.reply_to,notice.is_local,notice.source ' . - 'ORDER BY weight DESC'; + $qry = "SELECT notice.*, $weightexpr as weight "; + if(isset($tag)) { + $qry .= 'FROM notice_tag, notice JOIN fave ON notice.id = fave.notice_id ' . + "WHERE notice.id = notice_tag.notice_id and '$tag' = notice_tag.tag"; + } else { + $qry .= 'FROM notice JOIN fave ON notice.id = fave.notice_id'; + } + $qry .= ' GROUP BY notice.id,notice.profile_id,notice.content,notice.uri,' . + 'notice.rendered,notice.url,notice.created,notice.modified,' . + 'notice.reply_to,notice.is_local,notice.source ' . + 'ORDER BY weight DESC'; $offset = 0; $limit = NOTICES_PER_SECTION + 1; -- cgit v1.2.3 From e876b74e8ba7e80edcb9a13bff15deff4aa6ff15 Mon Sep 17 00:00:00 2001 From: Adrian Lang Date: Wed, 15 Apr 2009 08:38:05 +0200 Subject: Add license notice to install.php, replace short and asp style tags by more portable long tag form. --- install.php | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/install.php b/install.php index 0240349bb..87a99a650 100644 --- a/install.php +++ b/install.php @@ -1,4 +1,22 @@ -. + */ + define('INSTALLDIR', dirname(__FILE__)); function main() @@ -19,12 +37,12 @@ function checkPrereqs() { if (file_exists(INSTALLDIR.'/config.php')) { ?>

Config file "config.php" already exists.

-

Require PHP version 5 or greater.

Require PHP version 5 or greater.

Cannot load required extension "".

Cannot load required extension "".

Cannot write config file to "".

+ ?>

Cannot write config file to "".

On your server, try this command:

-
chmod a+w
- chmod a+w +

Cannot write avatar directory "/avatar/".

+ ?>

Cannot write avatar directory "/avatar/".

On your server, try this command:

-
chmod a+w /avatar/
+
chmod a+w /avatar/

Install Laconica

- +
- \ No newline at end of file + -- cgit v1.2.3 From e8fc34e75c4c9684b8c7e03d471a905e08446618 Mon Sep 17 00:00:00 2001 From: Fil Date: Wed, 15 Apr 2009 10:35:15 +0200 Subject: Use preg_quote to fix http://laconi.ca/trac/ticket/1342 --- actions/noticesearch.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/actions/noticesearch.php b/actions/noticesearch.php index 095d0a454..0828e47d7 100644 --- a/actions/noticesearch.php +++ b/actions/noticesearch.php @@ -184,11 +184,11 @@ class SearchNoticeListItem extends NoticeListItem { function highlight($text, $terms) { /* Highligh search terms */ - $pattern = '/('.implode('|', array_map('htmlspecialchars', $terms)).')/i'; + $pattern = '/('.implode('|', array_map('preg_quote', array_map('htmlspecialchars', $terms))).')/i'; $result = preg_replace($pattern, '\\1', $text); /* Remove highlighting from inside links, loop incase multiple highlights in links */ - $pattern = '/(href="[^"]*)('.implode('|', array_map('htmlspecialchars', $terms)).')<\/strong>([^"]*")/iU'; + $pattern = '/(href="[^"]*)('.implode('|', array_map('preg_quote', array_map('htmlspecialchars', $terms))).')<\/strong>([^"]*")/iU'; do { $result = preg_replace($pattern, '\\1\\2\\3', $result, -1, $count); } while ($count); -- cgit v1.2.3 From 8439477201cd59a6c0dba84ddf48eb86a6154199 Mon Sep 17 00:00:00 2001 From: Adrian Lang Date: Wed, 15 Apr 2009 13:29:52 +0200 Subject: Add escaping of /. --- actions/noticesearch.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/actions/noticesearch.php b/actions/noticesearch.php index 0828e47d7..d996998fc 100644 --- a/actions/noticesearch.php +++ b/actions/noticesearch.php @@ -184,11 +184,13 @@ class SearchNoticeListItem extends NoticeListItem { function highlight($text, $terms) { /* Highligh search terms */ - $pattern = '/('.implode('|', array_map('preg_quote', array_map('htmlspecialchars', $terms))).')/i'; + $options = implode('|', array_map('preg_quote', array_map('htmlspecialchars', $terms), + array_fill(0, sizeof($terms), '/'))); + $pattern = "/($options)/i"; $result = preg_replace($pattern, '\\1', $text); /* Remove highlighting from inside links, loop incase multiple highlights in links */ - $pattern = '/(href="[^"]*)('.implode('|', array_map('preg_quote', array_map('htmlspecialchars', $terms))).')<\/strong>([^"]*")/iU'; + $pattern = '/(href="[^"]*)('.$options.')<\/strong>([^"]*")/iU'; do { $result = preg_replace($pattern, '\\1\\2\\3', $result, -1, $count); } while ($count); -- cgit v1.2.3 From 8da76e0810342a90ac006f67cfd73500972f883a Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 15 Apr 2009 10:05:16 -0400 Subject: add user id to statistics --- lib/profileaction.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/profileaction.php b/lib/profileaction.php index c81924e31..1f2e30994 100644 --- a/lib/profileaction.php +++ b/lib/profileaction.php @@ -179,6 +179,11 @@ class ProfileAction extends Action $this->element('h2', null, _('Statistics')); // Other stats...? + $this->elementStart('dl', 'entity_user-id'); + $this->element('dt', null, _('User ID')); + $this->element('dd', null, $this->profile->id); + $this->elementEnd('dl'); + $this->elementStart('dl', 'entity_member-since'); $this->element('dt', null, _('Member since')); $this->element('dd', null, date('j M Y', -- cgit v1.2.3 From 7ba3f8aeb3277bec52eee896f0c6807c7121104c Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 15 Apr 2009 11:30:33 -0400 Subject: script to trim very old notices from inboxes --- scripts/triminboxes.php | 83 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 scripts/triminboxes.php diff --git a/scripts/triminboxes.php b/scripts/triminboxes.php new file mode 100644 index 000000000..0d2eaeaf0 --- /dev/null +++ b/scripts/triminboxes.php @@ -0,0 +1,83 @@ +#!/usr/bin/env php +. + */ + +# Abort if called from a web server +if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) { + print "This script must be run from the command line\n"; + exit(1); +} + +ini_set("max_execution_time", "0"); +ini_set("max_input_time", "0"); +set_time_limit(0); +mb_internal_encoding('UTF-8'); + +define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); +define('LACONICA', true); + +require_once(INSTALLDIR . '/lib/common.php'); + +$user = new User(); +if ($argc > 1) { + $user->whereAdd('id > ' . $argv[1]); +} +$cnt = $user->find(); + +while ($user->fetch()) { + + $inbox_entry = new Notice_inbox(); + $inbox_entry->user_id = $user->id; + $inbox_entry->orderBy('created DESC'); + $inbox_entry->limit(1000, 1); + + $id = null; + + if ($inbox_entry->find(true)) { + $id = $inbox_entry->notice_id; + } + + $inbox_entry->free(); + unset($inbox_entry); + + if (is_null($id)) { + continue; + } + + $start = microtime(true); + + $old_inbox = new Notice_inbox(); + $cnt = $old_inbox->query('DELETE from notice_inbox WHERE user_id = ' . $user->id . ' AND notice_id < ' . $id); + $old_inbox->free(); + unset($old_inbox); + + print "Deleted $cnt notices for $user->nickname ($user->id).\n"; + + $finish = microtime(true); + + $delay = 3.0 * ($finish - $start); + + print "Delaying $delay seconds..."; + + // Wait to let slaves catch up + + usleep($delay * 1000000); + + print "DONE.\n"; +} -- cgit v1.2.3 From 3081b2e31708520e6ed83041ce3ba04329d3ec90 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 16 Apr 2009 08:44:48 -0400 Subject: start of querybyid --- classes/User.php | 43 ++++++++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/classes/User.php b/classes/User.php index 3b9b5cd83..098381f73 100644 --- a/classes/User.php +++ b/classes/User.php @@ -444,21 +444,42 @@ class User extends Memcached_DataObject 'SELECT notice.* ' . 'FROM notice JOIN subscription ON notice.profile_id = subscription.subscribed ' . 'WHERE subscription.subscriber = %d '; - $order = null; + return Notice::getStream(sprintf($qry, $this->id), + 'user:notices_with_friends:' . $this->id, + $offset, $limit, $since_id, $before_id, + $order, $since); } else if ($enabled === true || ($enabled == 'transitional' && $this->inboxed == 1)) { - $qry = - 'SELECT notice.* ' . - 'FROM notice JOIN notice_inbox ON notice.id = notice_inbox.notice_id ' . - 'WHERE notice_inbox.user_id = %d '; - // NOTE: we override ORDER - $order = null; + $cache = common_memcache(); + + if (!empty($cache)) { + + # Get the notices out of the cache + + $notices = $cache->get(common_cache_key($cachekey)); + + # On a cache hit, return a DB-object-like wrapper + + if ($notices !== false) { + $wrapper = new ArrayWrapper(array_slice($notices, $offset, $limit)); + return $wrapper; + } + } + + $inbox = Notice_inbox::stream($this->id, $offset, $limit, $since_id, $before_id, $since); + + $ids = array(); + + while ($inbox->fetch()) { + $ids[] = $inbox->notice_id; + } + + $inbox->free(); + unset($inbox); + + return Notice::getStreamByIds($ids, 'user:notices_with_friends:' . $this->id); } - return Notice::getStream(sprintf($qry, $this->id), - 'user:notices_with_friends:' . $this->id, - $offset, $limit, $since_id, $before_id, - $order, $since); } function blowFavesCache() -- cgit v1.2.3 From 3e3fec39ffd2d8e82c493809967ac22723e2365c Mon Sep 17 00:00:00 2001 From: CiaranG Date: Thu, 16 Apr 2009 17:21:06 +0100 Subject: Clarification in README regarding welcome/default users, as it has tripped a couple of people up --- README | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README b/README index 09d9d301c..7b2dcacc5 100644 --- a/README +++ b/README @@ -1129,6 +1129,9 @@ welcome: nickname of a user account that sends welcome messages to new busy servers it may be a good idea to keep that one just for 'urgent' messages. Default is null; no message. +If either of these special user accounts are specified, the users should +be created before the configuration is updated. + Troubleshooting =============== -- cgit v1.2.3 From 362cac0a96a48a0568454b6d60306ae10e2175e6 Mon Sep 17 00:00:00 2001 From: Robin Millette Date: Thu, 16 Apr 2009 17:34:19 +0000 Subject: Add a few events (hooks): RegistrationTry, RegistrationForData, ProfileFormData and ProfileSaveForm. --- actions/profilesettings.php | 343 ++++++++++++++++++++++---------------------- actions/register.php | 340 ++++++++++++++++++++++--------------------- 2 files changed, 346 insertions(+), 337 deletions(-) diff --git a/actions/profilesettings.php b/actions/profilesettings.php index 60f7c0796..fb847680b 100644 --- a/actions/profilesettings.php +++ b/actions/profilesettings.php @@ -91,67 +91,68 @@ class ProfilesettingsAction extends AccountSettingsAction $this->element('legend', null, _('Profile information')); $this->hidden('token', common_session_token()); - # too much common patterns here... abstractable? - + // too much common patterns here... abstractable? $this->elementStart('ul', 'form_data'); - $this->elementStart('li'); - $this->input('nickname', _('Nickname'), - ($this->arg('nickname')) ? $this->arg('nickname') : $profile->nickname, - _('1-64 lowercase letters or numbers, no punctuation or spaces')); - $this->elementEnd('li'); - $this->elementStart('li'); - $this->input('fullname', _('Full name'), - ($this->arg('fullname')) ? $this->arg('fullname') : $profile->fullname); - $this->elementEnd('li'); - $this->elementStart('li'); - $this->input('homepage', _('Homepage'), - ($this->arg('homepage')) ? $this->arg('homepage') : $profile->homepage, - _('URL of your homepage, blog, or profile on another site')); - $this->elementEnd('li'); - $this->elementStart('li'); - $this->textarea('bio', _('Bio'), - ($this->arg('bio')) ? $this->arg('bio') : $profile->bio, - _('Describe yourself and your interests in 140 chars')); - $this->elementEnd('li'); - $this->elementStart('li'); - $this->input('location', _('Location'), - ($this->arg('location')) ? $this->arg('location') : $profile->location, - _('Where you are, like "City, State (or Region), Country"')); - $this->elementEnd('li'); - $this->elementStart('li'); - $this->input('tags', _('Tags'), - ($this->arg('tags')) ? $this->arg('tags') : implode(' ', $user->getSelfTags()), - _('Tags for yourself (letters, numbers, -, ., and _), comma- or space- separated')); - $this->elementEnd('li'); - $this->elementStart('li'); - $language = common_language(); - $this->dropdown('language', _('Language'), - get_nice_language_list(), _('Preferred language'), - true, $language); - $this->elementEnd('li'); - $timezone = common_timezone(); - $timezones = array(); - foreach(DateTimeZone::listIdentifiers() as $k => $v) { - $timezones[$v] = $v; + if (Event::handle('StartProfileFormData', array($this))) { + $this->elementStart('li'); + $this->input('nickname', _('Nickname'), + ($this->arg('nickname')) ? $this->arg('nickname') : $profile->nickname, + _('1-64 lowercase letters or numbers, no punctuation or spaces')); + $this->elementEnd('li'); + $this->elementStart('li'); + $this->input('fullname', _('Full name'), + ($this->arg('fullname')) ? $this->arg('fullname') : $profile->fullname); + $this->elementEnd('li'); + $this->elementStart('li'); + $this->input('homepage', _('Homepage'), + ($this->arg('homepage')) ? $this->arg('homepage') : $profile->homepage, + _('URL of your homepage, blog, or profile on another site')); + $this->elementEnd('li'); + $this->elementStart('li'); + $this->textarea('bio', _('Bio'), + ($this->arg('bio')) ? $this->arg('bio') : $profile->bio, + _('Describe yourself and your interests in 140 chars')); + $this->elementEnd('li'); + $this->elementStart('li'); + $this->input('location', _('Location'), + ($this->arg('location')) ? $this->arg('location') : $profile->location, + _('Where you are, like "City, State (or Region), Country"')); + $this->elementEnd('li'); + Event::handle('EndProfileFormData', array($this)); + $this->elementStart('li'); + $this->input('tags', _('Tags'), + ($this->arg('tags')) ? $this->arg('tags') : implode(' ', $user->getSelfTags()), + _('Tags for yourself (letters, numbers, -, ., and _), comma- or space- separated')); + $this->elementEnd('li'); + $this->elementStart('li'); + $language = common_language(); + $this->dropdown('language', _('Language'), + get_nice_language_list(), _('Preferred language'), + false, $language); + $this->elementEnd('li'); + $timezone = common_timezone(); + $timezones = array(); + foreach(DateTimeZone::listIdentifiers() as $k => $v) { + $timezones[$v] = $v; + } + $this->elementStart('li'); + $this->dropdown('timezone', _('Timezone'), + $timezones, _('What timezone are you normally in?'), + true, $timezone); + $this->elementEnd('li'); + $this->elementStart('li'); + $this->checkbox('autosubscribe', + _('Automatically subscribe to whoever '. + 'subscribes to me (best for non-humans)'), + ($this->arg('autosubscribe')) ? + $this->boolean('autosubscribe') : $user->autosubscribe); + $this->elementEnd('li'); } - $this->elementStart('li'); - $this->dropdown('timezone', _('Timezone'), - $timezones, _('What timezone are you normally in?'), - true, $timezone); - $this->elementEnd('li'); - $this->elementStart('li'); - $this->checkbox('autosubscribe', - _('Automatically subscribe to whoever '. - 'subscribes to me (best for non-humans)'), - ($this->arg('autosubscribe')) ? - $this->boolean('autosubscribe') : $user->autosubscribe); - $this->elementEnd('li'); $this->elementEnd('ul'); $this->submit('save', _('Save')); $this->elementEnd('fieldset'); $this->elementEnd('form'); - } /** @@ -165,158 +166,158 @@ class ProfilesettingsAction extends AccountSettingsAction function handlePost() { - # CSRF protection - + // CSRF protection $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { $this->showForm(_('There was a problem with your session token. '. - 'Try again, please.')); + 'Try again, please.')); return; } - $nickname = $this->trimmed('nickname'); - $fullname = $this->trimmed('fullname'); - $homepage = $this->trimmed('homepage'); - $bio = $this->trimmed('bio'); - $location = $this->trimmed('location'); - $autosubscribe = $this->boolean('autosubscribe'); - $language = $this->trimmed('language'); - $timezone = $this->trimmed('timezone'); - $tagstring = $this->trimmed('tags'); - - # Some validation - - if (!Validate::string($nickname, array('min_length' => 1, - 'max_length' => 64, - 'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) { - $this->showForm(_('Nickname must have only lowercase letters and numbers and no spaces.')); - return; - } else if (!User::allowed_nickname($nickname)) { - $this->showForm(_('Not a valid nickname.')); - return; - } else if (!is_null($homepage) && (strlen($homepage) > 0) && - !Validate::uri($homepage, array('allowed_schemes' => array('http', 'https')))) { - $this->showForm(_('Homepage is not a valid URL.')); - return; - } else if (!is_null($fullname) && mb_strlen($fullname) > 255) { - $this->showForm(_('Full name is too long (max 255 chars).')); - return; - } else if (!is_null($bio) && mb_strlen($bio) > 140) { - $this->showForm(_('Bio is too long (max 140 chars).')); - return; - } else if (!is_null($location) && mb_strlen($location) > 255) { - $this->showForm(_('Location is too long (max 255 chars).')); - return; - } else if (is_null($timezone) || !in_array($timezone, DateTimeZone::listIdentifiers())) { - $this->showForm(_('Timezone not selected.')); - return; - } else if ($this->nicknameExists($nickname)) { - $this->showForm(_('Nickname already in use. Try another one.')); - return; - } else if (!is_null($language) && strlen($language) > 50) { - $this->showForm(_('Language is too long (max 50 chars).')); - return; - } + if (Event::handle('StartProfileSaveForm', array($this))) { + + $nickname = $this->trimmed('nickname'); + $fullname = $this->trimmed('fullname'); + $homepage = $this->trimmed('homepage'); + $bio = $this->trimmed('bio'); + $location = $this->trimmed('location'); + $autosubscribe = $this->boolean('autosubscribe'); + $language = $this->trimmed('language'); + $timezone = $this->trimmed('timezone'); + $tagstring = $this->trimmed('tags'); + + // Some validation + if (!Validate::string($nickname, array('min_length' => 1, + 'max_length' => 64, + 'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) { + $this->showForm(_('Nickname must have only lowercase letters and numbers and no spaces.')); + return; + } else if (!User::allowed_nickname($nickname)) { + $this->showForm(_('Not a valid nickname.')); + return; + } else if (!is_null($homepage) && (strlen($homepage) > 0) && + !Validate::uri($homepage, array('allowed_schemes' => array('http', 'https')))) { + $this->showForm(_('Homepage is not a valid URL.')); + return; + } else if (!is_null($fullname) && mb_strlen($fullname) > 255) { + $this->showForm(_('Full name is too long (max 255 chars).')); + return; + } else if (!is_null($bio) && mb_strlen($bio) > 140) { + $this->showForm(_('Bio is too long (max 140 chars).')); + return; + } else if (!is_null($location) && mb_strlen($location) > 255) { + $this->showForm(_('Location is too long (max 255 chars).')); + return; + } else if (is_null($timezone) || !in_array($timezone, DateTimeZone::listIdentifiers())) { + $this->showForm(_('Timezone not selected.')); + return; + } else if ($this->nicknameExists($nickname)) { + $this->showForm(_('Nickname already in use. Try another one.')); + return; + } else if (!is_null($language) && strlen($language) > 50) { + $this->showForm(_('Language is too long (max 50 chars).')); + return; + } - if ($tagstring) { - $tags = array_map('common_canonical_tag', preg_split('/[\s,]+/', $tagstring)); - } else { - $tags = array(); - } + if ($tagstring) { + $tags = array_map('common_canonical_tag', preg_split('/[\s,]+/', $tagstring)); + } else { + $tags = array(); + } - foreach ($tags as $tag) { - if (!common_valid_profile_tag($tag)) { - $this->showForm(sprintf(_('Invalid tag: "%s"'), $tag)); - return; + foreach ($tags as $tag) { + if (!common_valid_profile_tag($tag)) { + $this->showForm(sprintf(_('Invalid tag: "%s"'), $tag)); + return; + } } - } - $user = common_current_user(); + $user = common_current_user(); - $user->query('BEGIN'); + $user->query('BEGIN'); - if ($user->nickname != $nickname || - $user->language != $language || - $user->timezone != $timezone) { + if ($user->nickname != $nickname || + $user->language != $language || + $user->timezone != $timezone) { - common_debug('Updating user nickname from ' . $user->nickname . ' to ' . $nickname, - __FILE__); - common_debug('Updating user language from ' . $user->language . ' to ' . $language, - __FILE__); - common_debug('Updating user timezone from ' . $user->timezone . ' to ' . $timezone, - __FILE__); + common_debug('Updating user nickname from ' . $user->nickname . ' to ' . $nickname, + __FILE__); + common_debug('Updating user language from ' . $user->language . ' to ' . $language, + __FILE__); + common_debug('Updating user timezone from ' . $user->timezone . ' to ' . $timezone, + __FILE__); - $original = clone($user); + $original = clone($user); - $user->nickname = $nickname; - $user->language = $language; - $user->timezone = $timezone; + $user->nickname = $nickname; + $user->language = $language; + $user->timezone = $timezone; - $result = $user->updateKeys($original); + $result = $user->updateKeys($original); - if ($result === false) { - common_log_db_error($user, 'UPDATE', __FILE__); - $this->serverError(_('Couldn\'t update user.')); - return; - } else { - # Re-initialize language environment if it changed - common_init_language(); + if ($result === false) { + common_log_db_error($user, 'UPDATE', __FILE__); + $this->serverError(_('Couldn\'t update user.')); + return; + } else { + // Re-initialize language environment if it changed + common_init_language(); + } } - } - - # XXX: XOR - if ($user->autosubscribe ^ $autosubscribe) { +// XXX: XOR + if ($user->autosubscribe ^ $autosubscribe) { - $original = clone($user); + $original = clone($user); - $user->autosubscribe = $autosubscribe; + $user->autosubscribe = $autosubscribe; - $result = $user->update($original); + $result = $user->update($original); - if ($result === false) { - common_log_db_error($user, 'UPDATE', __FILE__); - $this->serverError(_('Couldn\'t update user for autosubscribe.')); - return; + if ($result === false) { + common_log_db_error($user, 'UPDATE', __FILE__); + $this->serverError(_('Couldn\'t update user for autosubscribe.')); + return; + } } - } - - $profile = $user->getProfile(); - $orig_profile = clone($profile); + $profile = $user->getProfile(); - $profile->nickname = $user->nickname; - $profile->fullname = $fullname; - $profile->homepage = $homepage; - $profile->bio = $bio; - $profile->location = $location; - $profile->profileurl = common_profile_url($nickname); + $orig_profile = clone($profile); - common_debug('Old profile: ' . common_log_objstring($orig_profile), __FILE__); - common_debug('New profile: ' . common_log_objstring($profile), __FILE__); + $profile->nickname = $user->nickname; + $profile->fullname = $fullname; + $profile->homepage = $homepage; + $profile->bio = $bio; + $profile->location = $location; + $profile->profileurl = common_profile_url($nickname); - $result = $profile->update($orig_profile); + common_debug('Old profile: ' . common_log_objstring($orig_profile), __FILE__); + common_debug('New profile: ' . common_log_objstring($profile), __FILE__); - if (!$result) { - common_log_db_error($profile, 'UPDATE', __FILE__); - $this->serverError(_('Couldn\'t save profile.')); - return; - } + $result = $profile->update($orig_profile); - # Set the user tags + if (!$result) { + common_log_db_error($profile, 'UPDATE', __FILE__); + $this->serverError(_('Couldn\'t save profile.')); + return; + } - $result = $user->setSelfTags($tags); + // Set the user tags + $result = $user->setSelfTags($tags); - if (!$result) { - $this->serverError(_('Couldn\'t save tags.')); - return; - } + if (!$result) { + $this->serverError(_('Couldn\'t save tags.')); + return; + } - $user->query('COMMIT'); + $user->query('COMMIT'); + Event::handle('EndProfileSaveForm', array($this)); + common_broadcast_profile($profile); - common_broadcast_profile($profile); + $this->showForm(_('Settings saved.'), true); - $this->showForm(_('Settings saved.'), true); + } } function nicknameExists($nickname) diff --git a/actions/register.php b/actions/register.php index 5d7a8ce69..ab49ad3fd 100644 --- a/actions/register.php +++ b/actions/register.php @@ -108,107 +108,109 @@ class RegisterAction extends Action function tryRegister() { - $token = $this->trimmed('token'); - if (!$token || $token != common_session_token()) { - $this->showForm(_('There was a problem with your session token. '. - 'Try again, please.')); - return; - } - - $nickname = $this->trimmed('nickname'); - $email = $this->trimmed('email'); - $fullname = $this->trimmed('fullname'); - $homepage = $this->trimmed('homepage'); - $bio = $this->trimmed('bio'); - $location = $this->trimmed('location'); - - // We don't trim these... whitespace is OK in a password! - - $password = $this->arg('password'); - $confirm = $this->arg('confirm'); + if (Event::handle('StartRegistrationTry', array($this))) { + $token = $this->trimmed('token'); + if (!$token || $token != common_session_token()) { + $this->showForm(_('There was a problem with your session token. '. + 'Try again, please.')); + return; + } - // invitation code, if any + $nickname = $this->trimmed('nickname'); + $email = $this->trimmed('email'); + $fullname = $this->trimmed('fullname'); + $homepage = $this->trimmed('homepage'); + $bio = $this->trimmed('bio'); + $location = $this->trimmed('location'); - $code = $this->trimmed('code'); + // We don't trim these... whitespace is OK in a password! + $password = $this->arg('password'); + $confirm = $this->arg('confirm'); - if ($code) { - $invite = Invitation::staticGet($code); - } + // invitation code, if any + $code = $this->trimmed('code'); - if (common_config('site', 'inviteonly') && !($code && $invite)) { - $this->clientError(_('Sorry, only invited people can register.')); - return; - } + if ($code) { + $invite = Invitation::staticGet($code); + } - // Input scrubbing - - $nickname = common_canonical_nickname($nickname); - $email = common_canonical_email($email); - - if (!$this->boolean('license')) { - $this->showForm(_('You can\'t register if you don\'t '. - 'agree to the license.')); - } else if ($email && !Validate::email($email, true)) { - $this->showForm(_('Not a valid email address.')); - } else if (!Validate::string($nickname, array('min_length' => 1, - 'max_length' => 64, - 'format' => NICKNAME_FMT))) { - $this->showForm(_('Nickname must have only lowercase letters '. - 'and numbers and no spaces.')); - } else if ($this->nicknameExists($nickname)) { - $this->showForm(_('Nickname already in use. Try another one.')); - } else if (!User::allowed_nickname($nickname)) { - $this->showForm(_('Not a valid nickname.')); - } else if ($this->emailExists($email)) { - $this->showForm(_('Email address already exists.')); - } else if (!is_null($homepage) && (strlen($homepage) > 0) && - !Validate::uri($homepage, - array('allowed_schemes' => - array('http', 'https')))) { - $this->showForm(_('Homepage is not a valid URL.')); - return; - } else if (!is_null($fullname) && mb_strlen($fullname) > 255) { - $this->showForm(_('Full name is too long (max 255 chars).')); - return; - } else if (!is_null($bio) && mb_strlen($bio) > 140) { - $this->showForm(_('Bio is too long (max 140 chars).')); - return; - } else if (!is_null($location) && mb_strlen($location) > 255) { - $this->showForm(_('Location is too long (max 255 chars).')); - return; - } else if (strlen($password) < 6) { - $this->showForm(_('Password must be 6 or more characters.')); - return; - } else if ($password != $confirm) { - $this->showForm(_('Passwords don\'t match.')); - } else if ($user = User::register(array('nickname' => $nickname, - 'password' => $password, - 'email' => $email, - 'fullname' => $fullname, - 'homepage' => $homepage, - 'bio' => $bio, - 'location' => $location, - 'code' => $code))) { - if (!$user) { - $this->showForm(_('Invalid username or password.')); + if (common_config('site', 'inviteonly') && !($code && $invite)) { + $this->clientError(_('Sorry, only invited people can register.')); return; } - // success! - if (!common_set_user($user)) { - $this->serverError(_('Error setting user.')); + + // Input scrubbing + $nickname = common_canonical_nickname($nickname); + $email = common_canonical_email($email); + + if (!$this->boolean('license')) { + $this->showForm(_('You can\'t register if you don\'t '. + 'agree to the license.')); + } else if ($email && !Validate::email($email, true)) { + $this->showForm(_('Not a valid email address.')); + } else if (!Validate::string($nickname, array('min_length' => 1, + 'max_length' => 64, + 'format' => NICKNAME_FMT))) { + $this->showForm(_('Nickname must have only lowercase letters '. + 'and numbers and no spaces.')); + } else if ($this->nicknameExists($nickname)) { + $this->showForm(_('Nickname already in use. Try another one.')); + } else if (!User::allowed_nickname($nickname)) { + $this->showForm(_('Not a valid nickname.')); + } else if ($this->emailExists($email)) { + $this->showForm(_('Email address already exists.')); + } else if (!is_null($homepage) && (strlen($homepage) > 0) && + !Validate::uri($homepage, + array('allowed_schemes' => + array('http', 'https')))) { + $this->showForm(_('Homepage is not a valid URL.')); return; + } else if (!is_null($fullname) && mb_strlen($fullname) > 255) { + $this->showForm(_('Full name is too long (max 255 chars).')); + return; + } else if (!is_null($bio) && mb_strlen($bio) > 140) { + $this->showForm(_('Bio is too long (max 140 chars).')); + return; + } else if (!is_null($location) && mb_strlen($location) > 255) { + $this->showForm(_('Location is too long (max 255 chars).')); + return; + } else if (strlen($password) < 6) { + $this->showForm(_('Password must be 6 or more characters.')); + return; + } else if ($password != $confirm) { + $this->showForm(_('Passwords don\'t match.')); + } else if ($user = User::register(array('nickname' => $nickname, + 'password' => $password, + 'email' => $email, + 'fullname' => $fullname, + 'homepage' => $homepage, + 'bio' => $bio, + 'location' => $location, + 'code' => $code))) { + if (!$user) { + $this->showForm(_('Invalid username or password.')); + return; + } + // success! + if (!common_set_user($user)) { + $this->serverError(_('Error setting user.')); + return; + } + // this is a real login + common_real_login(true); + if ($this->boolean('rememberme')) { + common_debug('Adding rememberme cookie for ' . $nickname); + common_rememberme($user); + } + + Event::handle('EndRegistrationTry', array($this)); + + // Re-init language env in case it changed (not yet, but soon) + common_init_language(); + $this->showSuccess(); + } else { + $this->showForm(_('Invalid username or password.')); } - // this is a real login - common_real_login(true); - if ($this->boolean('rememberme')) { - common_debug('Adding rememberme cookie for ' . $nickname); - common_rememberme($user); - } - // Re-init language env in case it changed (not yet, but soon) - common_init_language(); - $this->showSuccess(); - } else { - $this->showForm(_('Invalid username or password.')); } } @@ -250,7 +252,9 @@ class RegisterAction extends Action // overrrided to add entry-title class function showPageTitle() { - $this->element('h1', array('class' => 'entry-title'), $this->title()); + if (Event::handle('StartShowPageTitle', array($this))) { + $this->element('h1', array('class' => 'entry-title'), $this->title()); + } } // overrided to add hentry, and content-inner class @@ -351,9 +355,9 @@ class RegisterAction extends Action } $this->elementStart('form', array('method' => 'post', - 'id' => 'form_register', - 'class' => 'form_settings', - 'action' => common_local_url('register'))); + 'id' => 'form_register', + 'class' => 'form_settings', + 'action' => common_local_url('register'))); $this->elementStart('fieldset'); $this->element('legend', null, 'Account settings'); $this->hidden('token', common_session_token()); @@ -363,77 +367,80 @@ class RegisterAction extends Action } $this->elementStart('ul', 'form_data'); - $this->elementStart('li'); - $this->input('nickname', _('Nickname'), $this->trimmed('nickname'), - _('1-64 lowercase letters or numbers, '. - 'no punctuation or spaces. Required.')); - $this->elementEnd('li'); - $this->elementStart('li'); - $this->password('password', _('Password'), - _('6 or more characters. Required.')); - $this->elementEnd('li'); - $this->elementStart('li'); - $this->password('confirm', _('Confirm'), - _('Same as password above. Required.')); - $this->elementEnd('li'); - $this->elementStart('li'); - if ($invite && $invite->address_type == 'email') { - $this->input('email', _('Email'), $invite->address, - _('Used only for updates, announcements, '. - 'and password recovery')); - } else { - $this->input('email', _('Email'), $this->trimmed('email'), - _('Used only for updates, announcements, '. - 'and password recovery')); - } - $this->elementEnd('li'); - $this->elementStart('li'); - $this->input('fullname', _('Full name'), - $this->trimmed('fullname'), - _('Longer name, preferably your "real" name')); - $this->elementEnd('li'); - $this->elementStart('li'); - $this->input('homepage', _('Homepage'), - $this->trimmed('homepage'), - _('URL of your homepage, blog, '. - 'or profile on another site')); - $this->elementEnd('li'); - $this->elementStart('li'); - $this->textarea('bio', _('Bio'), - $this->trimmed('bio'), - _('Describe yourself and your '. - 'interests in 140 chars')); - $this->elementEnd('li'); - $this->elementStart('li'); - $this->input('location', _('Location'), - $this->trimmed('location'), - _('Where you are, like "City, '. - 'State (or Region), Country"')); - $this->elementEnd('li'); - $this->elementStart('li', array('id' => 'settings_rememberme')); - $this->checkbox('rememberme', _('Remember me'), - $this->boolean('rememberme'), - _('Automatically login in the future; '. - 'not for shared computers!')); - $this->elementEnd('li'); - $attrs = array('type' => 'checkbox', - 'id' => 'license', - 'class' => 'checkbox', - 'name' => 'license', - 'value' => 'true'); - if ($this->boolean('license')) { - $attrs['checked'] = 'checked'; + if (Event::handle('StartRegistrationFormData', array($this))) { + $this->elementStart('li'); + $this->input('nickname', _('Nickname'), $this->trimmed('nickname'), + _('1-64 lowercase letters or numbers, '. + 'no punctuation or spaces. Required.')); + $this->elementEnd('li'); + $this->elementStart('li'); + $this->password('password', _('Password'), + _('6 or more characters. Required.')); + $this->elementEnd('li'); + $this->elementStart('li'); + $this->password('confirm', _('Confirm'), + _('Same as password above. Required.')); + $this->elementEnd('li'); + $this->elementStart('li'); + if ($invite && $invite->address_type == 'email') { + $this->input('email', _('Email'), $invite->address, + _('Used only for updates, announcements, '. + 'and password recovery')); + } else { + $this->input('email', _('Email'), $this->trimmed('email'), + _('Used only for updates, announcements, '. + 'and password recovery')); + } + $this->elementEnd('li'); + $this->elementStart('li'); + $this->input('fullname', _('Full name'), + $this->trimmed('fullname'), + _('Longer name, preferably your "real" name')); + $this->elementEnd('li'); + $this->elementStart('li'); + $this->input('homepage', _('Homepage'), + $this->trimmed('homepage'), + _('URL of your homepage, blog, '. + 'or profile on another site')); + $this->elementEnd('li'); + $this->elementStart('li'); + $this->textarea('bio', _('Bio'), + $this->trimmed('bio'), + _('Describe yourself and your '. + 'interests in 140 chars')); + $this->elementEnd('li'); + $this->elementStart('li'); + $this->input('location', _('Location'), + $this->trimmed('location'), + _('Where you are, like "City, '. + 'State (or Region), Country"')); + $this->elementEnd('li'); + Event::handle('EndRegistrationFormData', array($this)); + $this->elementStart('li', array('id' => 'settings_rememberme')); + $this->checkbox('rememberme', _('Remember me'), + $this->boolean('rememberme'), + _('Automatically login in the future; '. + 'not for shared computers!')); + $this->elementEnd('li'); + $attrs = array('type' => 'checkbox', + 'id' => 'license', + 'class' => 'checkbox', + 'name' => 'license', + 'value' => 'true'); + if ($this->boolean('license')) { + $attrs['checked'] = 'checked'; + } + $this->elementStart('li'); + $this->element('input', $attrs); + $this->elementStart('label', array('class' => 'checkbox', 'for' => 'license')); + $this->text(_('My text and files are available under ')); + $this->element('a', array('href' => common_config('license', 'url')), + common_config('license', 'title'), _("Creative Commons Attribution 3.0")); + $this->text(_(' except this private data: password, '. + 'email address, IM address, and phone number.')); + $this->elementEnd('label'); + $this->elementEnd('li'); } - $this->elementStart('li'); - $this->element('input', $attrs); - $this->elementStart('label', array('class' => 'checkbox', 'for' => 'license')); - $this->text(_('My text and files are available under ')); - $this->element('a', array('href' => common_config('license', 'url')), - common_config('license', 'title'), _("Creative Commons Attribution 3.0")); - $this->text(_(' except this private data: password, '. - 'email address, IM address, and phone number.')); - $this->elementEnd('label'); - $this->elementEnd('li'); $this->elementEnd('ul'); $this->submit('submit', _('Register')); $this->elementEnd('fieldset'); @@ -515,3 +522,4 @@ class RegisterAction extends Action $nav->show(); } } + -- cgit v1.2.3 From ed0556971661de1b8748882f48c316afac20b8be Mon Sep 17 00:00:00 2001 From: Robin Millette Date: Thu, 16 Apr 2009 17:58:52 +0000 Subject: Add an even (hook): StartPersonalGroupNav. --- lib/personalgroupnav.php | 68 +++++++++++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/lib/personalgroupnav.php b/lib/personalgroupnav.php index 63e6138df..acc033667 100644 --- a/lib/personalgroupnav.php +++ b/lib/personalgroupnav.php @@ -93,43 +93,45 @@ class PersonalGroupNav extends Widget $this->out->elementStart('ul', array('class' => 'nav')); - $this->out->menuItem(common_local_url('all', array('nickname' => - $nickname)), - _('Personal'), - sprintf(_('%s and friends'), (($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname)), - $action == 'all', 'nav_timeline_personal'); - $this->out->menuItem(common_local_url('replies', array('nickname' => - $nickname)), - _('Replies'), - sprintf(_('Replies to %s'), (($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname)), - $action == 'replies', 'nav_timeline_replies'); - $this->out->menuItem(common_local_url('showstream', array('nickname' => - $nickname)), - _('Profile'), - ($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname, - $action == 'showstream', 'nav_profile'); - $this->out->menuItem(common_local_url('showfavorites', array('nickname' => - $nickname)), - _('Favorites'), - sprintf(_('%s\'s favorite notices'), ($user_profile) ? $user_profile->getBestName() : _('User')), - $action == 'showfavorites', 'nav_timeline_favorites'); + if (Event::handle('StartPersonalGroupNav', array($this))) { + $this->out->menuItem(common_local_url('all', array('nickname' => + $nickname)), + _('Personal'), + sprintf(_('%s and friends'), (($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname)), + $action == 'all', 'nav_timeline_personal'); + $this->out->menuItem(common_local_url('replies', array('nickname' => + $nickname)), + _('Replies'), + sprintf(_('Replies to %s'), (($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname)), + $action == 'replies', 'nav_timeline_replies'); + $this->out->menuItem(common_local_url('showstream', array('nickname' => + $nickname)), + _('Profile'), + ($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname, + $action == 'showstream', 'nav_profile'); + $this->out->menuItem(common_local_url('showfavorites', array('nickname' => + $nickname)), + _('Favorites'), + sprintf(_('%s\'s favorite notices'), ($user_profile) ? $user_profile->getBestName() : _('User')), + $action == 'showfavorites', 'nav_timeline_favorites'); - $cur = common_current_user(); + $cur = common_current_user(); - if ($cur && $cur->id == $user->id) { + if ($cur && $cur->id == $user->id) { - $this->out->menuItem(common_local_url('inbox', array('nickname' => - $nickname)), - _('Inbox'), - _('Your incoming messages'), - $action == 'inbox'); - $this->out->menuItem(common_local_url('outbox', array('nickname' => - $nickname)), - _('Outbox'), - _('Your sent messages'), - $action == 'outbox'); + $this->out->menuItem(common_local_url('inbox', array('nickname' => + $nickname)), + _('Inbox'), + _('Your incoming messages'), + $action == 'inbox'); + $this->out->menuItem(common_local_url('outbox', array('nickname' => + $nickname)), + _('Outbox'), + _('Your sent messages'), + $action == 'outbox'); + } + Event::handle('EndPersonalGroupNav', array($this)); } - $this->out->elementEnd('ul'); } } -- cgit v1.2.3 From bac3ee95c96db10ed51a907f6f9b602a7c887c0f Mon Sep 17 00:00:00 2001 From: CiaranG Date: Thu, 16 Apr 2009 21:07:59 +0100 Subject: Abort the xmpp-related daemons immediately if xmpp is disabled in the config, otherwise they chew up *lots* of CPU doing nothing --- scripts/jabberqueuehandler.php | 9 ++++++++- scripts/publicqueuehandler.php | 7 +++++++ scripts/xmppconfirmhandler.php | 7 +++++++ scripts/xmppdaemon.php | 7 +++++++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/scripts/jabberqueuehandler.php b/scripts/jabberqueuehandler.php index 924fc4545..8b6e974c0 100755 --- a/scripts/jabberqueuehandler.php +++ b/scripts/jabberqueuehandler.php @@ -54,6 +54,13 @@ class JabberQueueHandler extends XmppQueueHandler } } +// Abort immediately if xmpp is not enabled, otherwise the daemon chews up +// lots of CPU trying to connect to unconfigured servers +if (common_config('xmpp','enabled')==false) { + print "Aborting daemon - xmpp is disabled\n"; + exit(); +} + ini_set("max_execution_time", "0"); ini_set("max_input_time", "0"); set_time_limit(0); @@ -63,4 +70,4 @@ $resource = ($argc > 1) ? $argv[1] : (common_config('xmpp','resource') . '-queue $handler = new JabberQueueHandler($resource); -$handler->runOnce(); \ No newline at end of file +$handler->runOnce(); diff --git a/scripts/publicqueuehandler.php b/scripts/publicqueuehandler.php index 5075c12df..b0fa22d43 100755 --- a/scripts/publicqueuehandler.php +++ b/scripts/publicqueuehandler.php @@ -52,6 +52,13 @@ class PublicQueueHandler extends XmppQueueHandler } } +// Abort immediately if xmpp is not enabled, otherwise the daemon chews up +// lots of CPU trying to connect to unconfigured servers +if (common_config('xmpp','enabled')==false) { + print "Aborting daemon - xmpp is disabled\n"; + exit(); +} + ini_set("max_execution_time", "0"); ini_set("max_input_time", "0"); set_time_limit(0); diff --git a/scripts/xmppconfirmhandler.php b/scripts/xmppconfirmhandler.php index 2b8b085ce..7f39235fe 100755 --- a/scripts/xmppconfirmhandler.php +++ b/scripts/xmppconfirmhandler.php @@ -140,6 +140,13 @@ class XmppConfirmHandler extends XmppQueueHandler } } +// Abort immediately if xmpp is not enabled, otherwise the daemon chews up +// lots of CPU trying to connect to unconfigured servers +if (common_config('xmpp','enabled')==false) { + print "Aborting daemon - xmpp is disabled\n"; + exit(); +} + ini_set("max_execution_time", "0"); ini_set("max_input_time", "0"); set_time_limit(0); diff --git a/scripts/xmppdaemon.php b/scripts/xmppdaemon.php index ef3f8c63d..0ce2f2a28 100755 --- a/scripts/xmppdaemon.php +++ b/scripts/xmppdaemon.php @@ -321,6 +321,13 @@ class XMPPDaemon extends Daemon } } +// Abort immediately if xmpp is not enabled, otherwise the daemon chews up +// lots of CPU trying to connect to unconfigured servers +if (common_config('xmpp','enabled')==false) { + print "Aborting daemon - xmpp is disabled\n"; + exit(); +} + ini_set("max_execution_time", "0"); ini_set("max_input_time", "0"); set_time_limit(0); -- cgit v1.2.3 From 4d0e4f733bdfa281487f370b70f5f7440a7ef931 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Thu, 16 Apr 2009 14:40:57 -0700 Subject: Make API dates more compatible with Twitter - ticket 1432 --- lib/twitterapi.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/twitterapi.php b/lib/twitterapi.php index b8357c688..6a90b4e28 100644 --- a/lib/twitterapi.php +++ b/lib/twitterapi.php @@ -418,7 +418,7 @@ class TwitterapiAction extends Action function date_twitter($dt) { $t = strtotime($dt); - return date("D M d G:i:s O Y", $t); + return date("D M d H:i:s O Y", $t); } // XXX: Candidate for a general utility method somewhere? -- cgit v1.2.3 From c3a44d2ab982c42aaece2785316416a8ea780873 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Thu, 16 Apr 2009 21:57:42 +0000 Subject: form_notice textarea is cleared on successful direct message post. Disabled notice posting with XHR on Inbox and Outbox pages. This will be revisited in 0.8.x. --- js/util.js | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/js/util.js b/js/util.js index 81139744f..38d2a9a42 100644 --- a/js/util.js +++ b/js/util.js @@ -166,28 +166,36 @@ $(document).ready(function(){ $("#notice_action-submit").addClass("disabled"); return true; }, - success: function(xml) { if ($("#error", xml).length > 0 || $("#command_result", xml).length > 0) { + success: function(xml) { if ($("#error", xml).length > 0) { var result = document._importNode($("p", xml).get(0), true); result = result.textContent || result.innerHTML; alert(result); } else { - $("#notices_primary .notices").prepend(document._importNode($("li", xml).get(0), true)); + if ($("#command_result", xml).length > 0) { + var result = document._importNode($("p", xml).get(0), true); + result = result.textContent || result.innerHTML; + alert(result); + } + else { + $("#notices_primary .notices").prepend(document._importNode($("li", xml).get(0), true)); + counter(); + $("#notices_primary .notice:first").css({display:"none"}); + $("#notices_primary .notice:first").fadeIn(2500); + NoticeHover(); + NoticeReply(); + } $("#notice_data-text").val(""); - counter(); - $("#notices_primary .notice:first").css({display:"none"}); - $("#notices_primary .notice:first").fadeIn(2500); - NoticeHover(); - NoticeReply(); } $("#form_notice").removeClass("processing"); $("#notice_action-submit").removeAttr("disabled"); $("#notice_action-submit").removeClass("disabled"); } }; - $("#form_notice").ajaxForm(PostNotice); - $("#form_notice").each(addAjaxHidden); - + if (document.body.id != 'inbox' && document.body.id != 'outbox') { + $("#form_notice").ajaxForm(PostNotice); + $("#form_notice").each(addAjaxHidden); + } NoticeHover(); NoticeReply(); }); -- cgit v1.2.3 From 34d904b180e5caa17eb945292a8a64656424d5d0 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Fri, 17 Apr 2009 01:11:38 +0000 Subject: Ticket 1404. Showing the link to the members list page. --- actions/grouprss.php | 2 +- actions/showgroup.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/actions/grouprss.php b/actions/grouprss.php index a9a2eef87..0b7280a11 100644 --- a/actions/grouprss.php +++ b/actions/grouprss.php @@ -34,7 +34,7 @@ if (!defined('LACONICA')) { require_once INSTALLDIR.'/lib/rssaction.php'; -define('MEMBERS_PER_SECTION', 81); +define('MEMBERS_PER_SECTION', 27); /** * Group RSS feed diff --git a/actions/showgroup.php b/actions/showgroup.php index 025f8383a..a7df39727 100644 --- a/actions/showgroup.php +++ b/actions/showgroup.php @@ -35,7 +35,7 @@ if (!defined('LACONICA')) { require_once INSTALLDIR.'/lib/noticelist.php'; require_once INSTALLDIR.'/lib/feedlist.php'; -define('MEMBERS_PER_SECTION', 81); +define('MEMBERS_PER_SECTION', 27); /** * Group main page @@ -361,7 +361,7 @@ class ShowgroupAction extends Action $this->element('p', null, _('(None)')); } - if ($cnt == MEMBERS_PER_SECTION) { + if ($cnt > MEMBERS_PER_SECTION) { $this->element('a', array('href' => common_local_url('groupmembers', array('nickname' => $this->group->nickname))), _('All members')); -- cgit v1.2.3 From 21873b806d6c5cf3e55ea10e49959c944f708688 Mon Sep 17 00:00:00 2001 From: Robin Millette Date: Fri, 17 Apr 2009 16:46:49 +0000 Subject: cosmetic fixes. --- lib/searchaction.php | 2 +- lib/tagcloudsection.php | 124 ------------------------------------------------ lib/util.php | 3 +- 3 files changed, 3 insertions(+), 126 deletions(-) delete mode 100644 lib/tagcloudsection.php diff --git a/lib/searchaction.php b/lib/searchaction.php index e74450e11..e7ad4affd 100644 --- a/lib/searchaction.php +++ b/lib/searchaction.php @@ -51,7 +51,7 @@ class SearchAction extends Action * * @return boolean true */ - function isReadOnly($args) + function isReadOnly() { return true; } diff --git a/lib/tagcloudsection.php b/lib/tagcloudsection.php deleted file mode 100644 index ff2aca6d6..000000000 --- a/lib/tagcloudsection.php +++ /dev/null @@ -1,124 +0,0 @@ -. - * - * @category Widget - * @package Laconica - * @author Evan Prodromou - * @copyright 2009 Control Yourself, Inc. - * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ - */ - -if (!defined('LACONICA')) { - exit(1); -} - -define('TAGS_PER_SECTION', 20); - -/** - * Base class for sections - * - * These are the widgets that show interesting data about a person - * group, or site. - * - * @category Widget - * @package Laconica - * @author Evan Prodromou - * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ - */ - -class TagCloudSection extends Section -{ - function showContent() - { - $tags = $this->getTags(); - - if (!$tags) { - $this->out->element('p', null, _('None')); - return false; - } - - $cnt = 0; - - $tw = array(); - $sum = 0; - - while ($tags->fetch() && ++$cnt <= TAGS_PER_SECTION) { - $tw[$tags->tag] = $tags->weight; - $sum += $tags->weight; - } - - if ($cnt == 0) { - $this->out->element('p', null, _('(None)')); - return false; - } - - ksort($tw); - - $this->out->elementStart('ul', 'tags xoxo tag-cloud'); - foreach ($tw as $tag => $weight) { - $this->showTag($tag, $weight, ($sum == 0) ? 0 : $weight/$sum); - } - $this->out->elementEnd('ul'); - - return ($cnt > TAGS_PER_SECTION); - } - - function getTags() - { - return null; - } - - function showTag($tag, $weight, $relative) - { - if ($relative > 0.1) { - $rel = 'tag-cloud-7'; - } else if ($relative > 0.05) { - $rel = 'tag-cloud-6'; - } else if ($relative > 0.02) { - $rel = 'tag-cloud-5'; - } else if ($relative > 0.01) { - $rel = 'tag-cloud-4'; - } else if ($relative > 0.005) { - $rel = 'tag-cloud-3'; - } else if ($relative > 0.002) { - $rel = 'tag-cloud-2'; - } else { - $rel = 'tag-cloud-1'; - } - - $this->out->elementStart('li', $rel); - $this->out->element('a', array('href' => $this->tagUrl($tag)), - $tag); - $this->out->elementEnd('li'); - } - - function tagUrl($tag) - { - return common_local_url('tag', array('tag' => $tag)); - } - - function divId() - { - return 'tagcloud'; - } -} diff --git a/lib/util.php b/lib/util.php index 675ff51f0..5d16e39b5 100644 --- a/lib/util.php +++ b/lib/util.php @@ -1333,4 +1333,5 @@ function common_database_tablename($tablename) } //table prefixes could be added here later return $tablename; -} \ No newline at end of file +} + -- cgit v1.2.3 From 2e06d5a2cb0d05d944bd0f969dbf5a0b10a1d48e Mon Sep 17 00:00:00 2001 From: Robin Millette Date: Fri, 17 Apr 2009 17:24:41 +0000 Subject: file was removed by mistake. --- lib/tagcloudsection.php | 142 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 lib/tagcloudsection.php diff --git a/lib/tagcloudsection.php b/lib/tagcloudsection.php new file mode 100644 index 000000000..f5c305c65 --- /dev/null +++ b/lib/tagcloudsection.php @@ -0,0 +1,142 @@ +. + * + * @category Widget + * @package Laconica + * @author Evan Prodromou + * @copyright 2009 Control Yourself, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + */ + +if (!defined('LACONICA')) { + exit(1); +} + +define('TAGS_PER_SECTION', 20); + +/** + * Base class for sections + * + * These are the widgets that show interesting data about a person + * group, or site. + * + * @category Widget + * @package Laconica + * @author Evan Prodromou + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + */ + +class TagCloudSection extends Section +{ + function showContent() + { + $tags = $this->getAllTags(); + + if (!$tags) { + $this->out->element('p', null, _('None')); + return false; + } + + $cnt = count($tags); + + if ($cnt == 0) { + $this->out->element('p', null, _('(None)')); + return false; + } + + ksort($tags); + + $this->out->elementStart('ul', 'tags xoxo tag-cloud'); + foreach ($tags as $tag => $weight) { + $this->showTag($tag, $weight, ($sum == 0) ? 0 : $weight/$sum); + } + $this->out->elementEnd('ul'); + + return ($cnt > TAGS_PER_SECTION); + } + + function getTags($lst, $usr) + { + $profile_tag = new Profile_tag; + $profile_tag->selectAdd(); + $profile_tag->selectAdd('tag'); + $profile_tag->selectAdd('count(tag) as weight'); + $profile_tag->groupBy('tag'); + $profile_tag->orderBy('weight DESC'); + $cnt = $profile_tag->find(); + + $profile_tag->query(" +SELECT tag, count(tag) as weight from profile_tag, (SELECT subscriber, subscribed from subscription where subscriber=$usr and subscribed != subscriber) as t where tagger=subscriber and tagged=subscribed group by tag order by weight dest"); + + $tags = array(); + while ($profile_tag->fetch()) { +// var_dump($profile_tag); + $tags[$profile_tag->tag] = $profile_tag->weight; + } + $profile_tag->free(); + if (0) { + echo 'tags:
';
+            var_dump($tags);
+            echo '
'; + } + return $tags; + } + + function getAllTags() { + return null; + } + + function showTag($tag, $weight, $relative) + { + if ($relative > 0.1) { + $rel = 'tag-cloud-7'; + } else if ($relative > 0.05) { + $rel = 'tag-cloud-6'; + } else if ($relative > 0.02) { + $rel = 'tag-cloud-5'; + } else if ($relative > 0.01) { + $rel = 'tag-cloud-4'; + } else if ($relative > 0.005) { + $rel = 'tag-cloud-3'; + } else if ($relative > 0.002) { + $rel = 'tag-cloud-2'; + } else { + $rel = 'tag-cloud-1'; + } + + $this->out->elementStart('li', $rel); + $this->out->element('a', array('href' => $this->tagUrl($tag)), + $tag); + $this->out->elementEnd('li'); + } + + function tagUrl($tag) + { + return common_local_url('tag', array('tag' => $tag)); + } + + function divId() + { + return 'tagcloud'; + } +} -- cgit v1.2.3 From 2873940265611d6556eaee7a01dd53587d7ef446 Mon Sep 17 00:00:00 2001 From: Robin Millette Date: Fri, 17 Apr 2009 17:31:22 +0000 Subject: Fixed file that was removed by mistake. --- lib/tagcloudsection.php | 44 +++++++++++++------------------------------- 1 file changed, 13 insertions(+), 31 deletions(-) diff --git a/lib/tagcloudsection.php b/lib/tagcloudsection.php index f5c305c65..ff2aca6d6 100644 --- a/lib/tagcloudsection.php +++ b/lib/tagcloudsection.php @@ -50,24 +50,32 @@ class TagCloudSection extends Section { function showContent() { - $tags = $this->getAllTags(); + $tags = $this->getTags(); if (!$tags) { $this->out->element('p', null, _('None')); return false; } - $cnt = count($tags); + $cnt = 0; + + $tw = array(); + $sum = 0; + + while ($tags->fetch() && ++$cnt <= TAGS_PER_SECTION) { + $tw[$tags->tag] = $tags->weight; + $sum += $tags->weight; + } if ($cnt == 0) { $this->out->element('p', null, _('(None)')); return false; } - ksort($tags); + ksort($tw); $this->out->elementStart('ul', 'tags xoxo tag-cloud'); - foreach ($tags as $tag => $weight) { + foreach ($tw as $tag => $weight) { $this->showTag($tag, $weight, ($sum == 0) ? 0 : $weight/$sum); } $this->out->elementEnd('ul'); @@ -75,34 +83,8 @@ class TagCloudSection extends Section return ($cnt > TAGS_PER_SECTION); } - function getTags($lst, $usr) + function getTags() { - $profile_tag = new Profile_tag; - $profile_tag->selectAdd(); - $profile_tag->selectAdd('tag'); - $profile_tag->selectAdd('count(tag) as weight'); - $profile_tag->groupBy('tag'); - $profile_tag->orderBy('weight DESC'); - $cnt = $profile_tag->find(); - - $profile_tag->query(" -SELECT tag, count(tag) as weight from profile_tag, (SELECT subscriber, subscribed from subscription where subscriber=$usr and subscribed != subscriber) as t where tagger=subscriber and tagged=subscribed group by tag order by weight dest"); - - $tags = array(); - while ($profile_tag->fetch()) { -// var_dump($profile_tag); - $tags[$profile_tag->tag] = $profile_tag->weight; - } - $profile_tag->free(); - if (0) { - echo 'tags:
';
-            var_dump($tags);
-            echo '
'; - } - return $tags; - } - - function getAllTags() { return null; } -- cgit v1.2.3 From b22f446df2384c5bd3fa5cf428106ea0a62f1b7d Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Fri, 17 Apr 2009 19:51:20 +0000 Subject: Clear notice char counter for direct messages as well. --- js/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/util.js b/js/util.js index 38d2a9a42..3753bd989 100644 --- a/js/util.js +++ b/js/util.js @@ -179,12 +179,12 @@ $(document).ready(function(){ } else { $("#notices_primary .notices").prepend(document._importNode($("li", xml).get(0), true)); - counter(); $("#notices_primary .notice:first").css({display:"none"}); $("#notices_primary .notice:first").fadeIn(2500); NoticeHover(); NoticeReply(); } + counter(); $("#notice_data-text").val(""); } $("#form_notice").removeClass("processing"); -- cgit v1.2.3 From 231c61a7eb3bb79faed696945ccd6d831c80f0f2 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 17 Apr 2009 12:52:26 -0700 Subject: store invite code in session so openidfinish can find it --- actions/finishopenidlogin.php | 33 ++++++-- actions/register.php | 171 ++++++++++++++++++++++++------------------ 2 files changed, 127 insertions(+), 77 deletions(-) diff --git a/actions/finishopenidlogin.php b/actions/finishopenidlogin.php index 952185742..b08b96df6 100644 --- a/actions/finishopenidlogin.php +++ b/actions/finishopenidlogin.php @@ -191,11 +191,28 @@ class FinishopenidloginAction extends Action { # FIXME: save invite code before redirect, and check here - if (common_config('site', 'closed') || common_config('site', 'inviteonly')) { + if (common_config('site', 'closed')) { $this->clientError(_('Registration not allowed.')); return; } + $invite = null; + + if (common_config('site', 'inviteonly')) { + $code = $_SESSION['invitecode']; + if (empty($code)) { + $this->clientError(_('Registration not allowed.')); + return; + } + + $invite = Invitation::staticGet($code); + + if (empty($invite)) { + $this->clientError(_('Not a valid invitation code.')); + return; + } + } + $nickname = $this->trimmed('newname'); if (!Validate::string($nickname, array('min_length' => 1, @@ -257,10 +274,16 @@ class FinishopenidloginAction extends Action # XXX: add language # XXX: add timezone - $user = User::register(array('nickname' => $nickname, - 'email' => $email, - 'fullname' => $fullname, - 'location' => $location)); + $args = array('nickname' => $nickname, + 'email' => $email, + 'fullname' => $fullname, + 'location' => $location); + + if (!empty($invite)) { + $args['code'] = $invite->code; + } + + $user = User::register($args); $result = oid_link_user($user->id, $canonical, $display); diff --git a/actions/register.php b/actions/register.php index ab49ad3fd..4ac7c349d 100644 --- a/actions/register.php +++ b/actions/register.php @@ -55,6 +55,44 @@ class RegisterAction extends Action var $registered = false; + /** + * Prepare page to run + * + * + * @param $args + * @return string title + */ + + function prepare() + { + $this->code = $this->trimmed('code'); + + if (empty($this->code)) { + common_ensure_session(); + if (!empty($_SESSION['invitecode'])) { + $this->code = $_SESSION['invitecode']; + } + } + + if (common_config('site', 'inviteonly') && empty($this->code)) { + $this->clientError(_('Sorry, only invited people can register.')); + return false; + } + + if (!empty($this->code)) { + $this->invite = Invitation::staticGet($code); + if (empty($this->invite)) { + $this->clientError(_('Sorry, invalid invitation code.')); + return false; + } + // Store this in case we need it + common_ensure_session(); + $_SESSION['invitecode'] = $this->code; + } + + return true; + } + /** * Title of the page * @@ -112,7 +150,7 @@ class RegisterAction extends Action $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { $this->showForm(_('There was a problem with your session token. '. - 'Try again, please.')); + 'Try again, please.')); return; } @@ -145,14 +183,14 @@ class RegisterAction extends Action if (!$this->boolean('license')) { $this->showForm(_('You can\'t register if you don\'t '. - 'agree to the license.')); + 'agree to the license.')); } else if ($email && !Validate::email($email, true)) { $this->showForm(_('Not a valid email address.')); } else if (!Validate::string($nickname, array('min_length' => 1, - 'max_length' => 64, - 'format' => NICKNAME_FMT))) { + 'max_length' => 64, + 'format' => NICKNAME_FMT))) { $this->showForm(_('Nickname must have only lowercase letters '. - 'and numbers and no spaces.')); + 'and numbers and no spaces.')); } else if ($this->nicknameExists($nickname)) { $this->showForm(_('Nickname already in use. Try another one.')); } else if (!User::allowed_nickname($nickname)) { @@ -160,9 +198,9 @@ class RegisterAction extends Action } else if ($this->emailExists($email)) { $this->showForm(_('Email address already exists.')); } else if (!is_null($homepage) && (strlen($homepage) > 0) && - !Validate::uri($homepage, - array('allowed_schemes' => - array('http', 'https')))) { + !Validate::uri($homepage, + array('allowed_schemes' => + array('http', 'https')))) { $this->showForm(_('Homepage is not a valid URL.')); return; } else if (!is_null($fullname) && mb_strlen($fullname) > 255) { @@ -180,13 +218,13 @@ class RegisterAction extends Action } else if ($password != $confirm) { $this->showForm(_('Passwords don\'t match.')); } else if ($user = User::register(array('nickname' => $nickname, - 'password' => $password, - 'email' => $email, - 'fullname' => $fullname, - 'homepage' => $homepage, - 'bio' => $bio, - 'location' => $location, - 'code' => $code))) { + 'password' => $password, + 'email' => $email, + 'fullname' => $fullname, + 'homepage' => $homepage, + 'bio' => $bio, + 'location' => $location, + 'code' => $code))) { if (!$user) { $this->showForm(_('Invalid username or password.')); return; @@ -259,17 +297,17 @@ class RegisterAction extends Action // overrided to add hentry, and content-inner class function showContentBlock() - { - $this->elementStart('div', array('id' => 'content', 'class' => 'hentry')); - $this->showPageTitle(); - $this->showPageNoticeBlock(); - $this->elementStart('div', array('id' => 'content_inner', - 'class' => 'entry-content')); - // show the actual content (forms, lists, whatever) - $this->showContent(); - $this->elementEnd('div'); - $this->elementEnd('div'); - } + { + $this->elementStart('div', array('id' => 'content', 'class' => 'hentry')); + $this->showPageTitle(); + $this->showPageNoticeBlock(); + $this->elementStart('div', array('id' => 'content_inner', + 'class' => 'entry-content')); + // show the actual content (forms, lists, whatever) + $this->showContent(); + $this->elementEnd('div'); + $this->elementEnd('div'); + } /** * Instructions or a notice for the page @@ -343,90 +381,79 @@ class RegisterAction extends Action function showFormContent() { - $code = $this->trimmed('code'); - - if ($code) { - $invite = Invitation::staticGet($code); - } - - if (common_config('site', 'inviteonly') && !($code && $invite)) { - $this->clientError(_('Sorry, only invited people can register.')); - return; - } - $this->elementStart('form', array('method' => 'post', - 'id' => 'form_register', - 'class' => 'form_settings', - 'action' => common_local_url('register'))); + 'id' => 'form_register', + 'class' => 'form_settings', + 'action' => common_local_url('register'))); $this->elementStart('fieldset'); $this->element('legend', null, 'Account settings'); $this->hidden('token', common_session_token()); - if ($code) { - $this->hidden('code', $code); + if ($this->code) { + $this->hidden('code', $this->code); } $this->elementStart('ul', 'form_data'); if (Event::handle('StartRegistrationFormData', array($this))) { $this->elementStart('li'); $this->input('nickname', _('Nickname'), $this->trimmed('nickname'), - _('1-64 lowercase letters or numbers, '. - 'no punctuation or spaces. Required.')); + _('1-64 lowercase letters or numbers, '. + 'no punctuation or spaces. Required.')); $this->elementEnd('li'); $this->elementStart('li'); $this->password('password', _('Password'), - _('6 or more characters. Required.')); + _('6 or more characters. Required.')); $this->elementEnd('li'); $this->elementStart('li'); $this->password('confirm', _('Confirm'), - _('Same as password above. Required.')); + _('Same as password above. Required.')); $this->elementEnd('li'); $this->elementStart('li'); - if ($invite && $invite->address_type == 'email') { - $this->input('email', _('Email'), $invite->address, - _('Used only for updates, announcements, '. - 'and password recovery')); + if ($this->invite && $this->invite->address_type == 'email') { + $this->input('email', _('Email'), $this->invite->address, + _('Used only for updates, announcements, '. + 'and password recovery')); } else { $this->input('email', _('Email'), $this->trimmed('email'), - _('Used only for updates, announcements, '. - 'and password recovery')); + _('Used only for updates, announcements, '. + 'and password recovery')); } $this->elementEnd('li'); $this->elementStart('li'); $this->input('fullname', _('Full name'), - $this->trimmed('fullname'), - _('Longer name, preferably your "real" name')); + $this->trimmed('fullname'), + _('Longer name, preferably your "real" name')); $this->elementEnd('li'); $this->elementStart('li'); $this->input('homepage', _('Homepage'), - $this->trimmed('homepage'), - _('URL of your homepage, blog, '. - 'or profile on another site')); + $this->trimmed('homepage'), + _('URL of your homepage, blog, '. + 'or profile on another site')); $this->elementEnd('li'); $this->elementStart('li'); $this->textarea('bio', _('Bio'), - $this->trimmed('bio'), - _('Describe yourself and your '. - 'interests in 140 chars')); + $this->trimmed('bio'), + _('Describe yourself and your '. + 'interests in 140 chars')); $this->elementEnd('li'); $this->elementStart('li'); $this->input('location', _('Location'), - $this->trimmed('location'), - _('Where you are, like "City, '. - 'State (or Region), Country"')); + $this->trimmed('location'), + _('Where you are, like "City, '. + 'State (or Region), Country"')); $this->elementEnd('li'); Event::handle('EndRegistrationFormData', array($this)); $this->elementStart('li', array('id' => 'settings_rememberme')); $this->checkbox('rememberme', _('Remember me'), - $this->boolean('rememberme'), - _('Automatically login in the future; '. - 'not for shared computers!')); + $this->boolean('rememberme'), + _('Automatically login in the future; '. + 'not for shared computers!')); $this->elementEnd('li'); $attrs = array('type' => 'checkbox', - 'id' => 'license', - 'class' => 'checkbox', - 'name' => 'license', - 'value' => 'true'); + 'id' => 'license', + 'class' => 'checkbox', + 'name' => 'license', + 'value' => 'true'); if ($this->boolean('license')) { $attrs['checked'] = 'checked'; } @@ -435,9 +462,9 @@ class RegisterAction extends Action $this->elementStart('label', array('class' => 'checkbox', 'for' => 'license')); $this->text(_('My text and files are available under ')); $this->element('a', array('href' => common_config('license', 'url')), - common_config('license', 'title'), _("Creative Commons Attribution 3.0")); + common_config('license', 'title'), _("Creative Commons Attribution 3.0")); $this->text(_(' except this private data: password, '. - 'email address, IM address, and phone number.')); + 'email address, IM address, and phone number.')); $this->elementEnd('label'); $this->elementEnd('li'); } -- cgit v1.2.3 From e8382b1292192d4c393f13ad7cd8da1be19211a8 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 17 Apr 2009 13:03:33 -0700 Subject: incorrect variable access --- actions/register.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/actions/register.php b/actions/register.php index 4ac7c349d..033cf557f 100644 --- a/actions/register.php +++ b/actions/register.php @@ -63,13 +63,14 @@ class RegisterAction extends Action * @return string title */ - function prepare() + function prepare($args) { + parent::prepare($args); $this->code = $this->trimmed('code'); if (empty($this->code)) { common_ensure_session(); - if (!empty($_SESSION['invitecode'])) { + if (array_key_exists('invitecode', $_SESSION)) { $this->code = $_SESSION['invitecode']; } } @@ -80,7 +81,7 @@ class RegisterAction extends Action } if (!empty($this->code)) { - $this->invite = Invitation::staticGet($code); + $this->invite = Invitation::staticGet('code', $this->code); if (empty($this->invite)) { $this->clientError(_('Sorry, invalid invitation code.')); return false; -- cgit v1.2.3 From 81714c6c31569e35f6b068791870bdfec25d005c Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Fri, 17 Apr 2009 20:14:06 +0000 Subject: counter() after val() reset to avoid (weird) bug. --- js/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/util.js b/js/util.js index 3753bd989..53e6eb792 100644 --- a/js/util.js +++ b/js/util.js @@ -184,8 +184,8 @@ $(document).ready(function(){ NoticeHover(); NoticeReply(); } - counter(); $("#notice_data-text").val(""); + counter(); } $("#form_notice").removeClass("processing"); $("#notice_action-submit").removeAttr("disabled"); -- cgit v1.2.3 From 7196410bb0398c15fbab767a9b7cedc513e6520b Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Sat, 18 Apr 2009 19:00:20 +0200 Subject: shortening links in notices from XMPP This patch enables shortening of links, that where send from XMPP. The problem was, that in util.php common_current_user() is not finding the user account from which is posted, so the service to shorten is not known, so no shortening at all... This patch cleans up the xmppdaemon a little bit and hard codes ur1.ca as shortening service _if_ the user is not set. Ugly but working. --- lib/util.php | 20 ++++++-------------- scripts/xmppdaemon.php | 17 +++++------------ 2 files changed, 11 insertions(+), 26 deletions(-) diff --git a/lib/util.php b/lib/util.php index 675ff51f0..ab5e99593 100644 --- a/lib/util.php +++ b/lib/util.php @@ -519,11 +519,16 @@ function common_shorten_links($text) function common_shorten_link($url, $reverse = false) { + static $url_cache = array(); if ($reverse) return isset($url_cache[$url]) ? $url_cache[$url] : $url; $user = common_current_user(); - + if (!isset($user)) { + // common current user does not find a user when called from the XMPP daemon + // therefore we'll set one here fix, so that XMPP given URLs may be shortened + $user->urlshorteningservice = 'ur1.ca'; + } $curlh = curl_init(); curl_setopt($curlh, CURLOPT_CONNECTTIMEOUT, 20); // # seconds to wait curl_setopt($curlh, CURLOPT_USERAGENT, 'Laconica'); @@ -1321,16 +1326,3 @@ function common_compatible_license($from, $to) // XXX: better compatibility check needed here! return ($from == $to); } - -/** - * returns a quoted table name, if required according to config - */ -function common_database_tablename($tablename) -{ - - if(common_config('db','quote_identifiers')) { - $tablename = '"'. $tablename .'"'; - } - //table prefixes could be added here later - return $tablename; -} \ No newline at end of file diff --git a/scripts/xmppdaemon.php b/scripts/xmppdaemon.php index ef3f8c63d..5711f715d 100755 --- a/scripts/xmppdaemon.php +++ b/scripts/xmppdaemon.php @@ -152,11 +152,6 @@ class XMPPDaemon extends Daemon $body = preg_replace('/d[\ ]*('. $to .')[\ ]*/', '', $pl['body']); $this->add_direct($user, $body, $to, $from); } else { - $len = mb_strlen($pl['body']); - if($len > 140) { - $this->from_site($from, 'Message too long - maximum is 140 characters, you sent ' . $len); - return; - } $this->add_notice($user, $pl); } @@ -255,15 +250,13 @@ class XMPPDaemon extends Daemon function add_notice(&$user, &$pl) { $body = trim($pl['body']); - $content_shortened = common_shorten_link($body); + $content_shortened = common_shorten_links($body); if (mb_strlen($content_shortened) > 140) { - $content = trim(mb_substr($body, 0, 140)); - $content_shortened = common_shorten_link($content); - } - else { - $content = $body; + $from = jabber_normalize_jid($pl['from']); + $this->from_site($from, "Message too long - maximum is 140 characters, you sent ".mb_strlen($content_shortened)); + return; } - $notice = Notice::saveNew($user->id, $content, 'xmpp'); + $notice = Notice::saveNew($user->id, $content_shortened, 'xmpp'); if (is_string($notice)) { $this->log(LOG_ERR, $notice); return; -- cgit v1.2.3 From 4b54a418f3f26b44defdb42b8168ae43f4d1c66c Mon Sep 17 00:00:00 2001 From: Robin Millette Date: Sat, 18 Apr 2009 19:08:33 +0000 Subject: trac#1215, 1216, 1217 and 1219: subscribers/subscriptions people tagclouds --- actions/subscribers.php | 10 ++++ actions/subscriptions.php | 10 ++++ lib/subpeopletagcloudsection.php | 76 ++++++++++++++++++++++++++ lib/subscriberspeopleselftagcloudsection.php | 54 ++++++++++++++++++ lib/subscriberspeopletagcloudsection.php | 60 ++++++++++++++++++++ lib/subscriptionspeopleselftagcloudsection.php | 54 ++++++++++++++++++ lib/subscriptionspeopletagcloudsection.php | 59 ++++++++++++++++++++ 7 files changed, 323 insertions(+) create mode 100644 lib/subpeopletagcloudsection.php create mode 100644 lib/subscriberspeopleselftagcloudsection.php create mode 100644 lib/subscriberspeopletagcloudsection.php create mode 100644 lib/subscriptionspeopleselftagcloudsection.php create mode 100644 lib/subscriptionspeopletagcloudsection.php diff --git a/actions/subscribers.php b/actions/subscribers.php index d91a7d4fd..4482de9a7 100644 --- a/actions/subscribers.php +++ b/actions/subscribers.php @@ -118,6 +118,16 @@ class SubscribersAction extends GalleryAction $this->raw(common_markup_to_html($message)); $this->elementEnd('div'); } + + function showSections() + { + parent::showSections(); + $cloud = new SubscribersPeopleTagCloudSection($this); + $cloud->show(); + + $cloud2 = new SubscribersPeopleSelfTagCloudSection($this); + $cloud2->show(); + } } class SubscribersList extends ProfileList diff --git a/actions/subscriptions.php b/actions/subscriptions.php index e6f3c54db..095b18ad8 100644 --- a/actions/subscriptions.php +++ b/actions/subscriptions.php @@ -125,6 +125,16 @@ class SubscriptionsAction extends GalleryAction $this->raw(common_markup_to_html($message)); $this->elementEnd('div'); } + + function showSections() + { + parent::showSections(); + $cloud = new SubscriptionsPeopleTagCloudSection($this); + $cloud->show(); + + $cloud2 = new SubscriptionsPeopleSelfTagCloudSection($this); + $cloud2->show(); + } } class SubscriptionsList extends ProfileList diff --git a/lib/subpeopletagcloudsection.php b/lib/subpeopletagcloudsection.php new file mode 100644 index 000000000..d98f28afa --- /dev/null +++ b/lib/subpeopletagcloudsection.php @@ -0,0 +1,76 @@ +. + * + * @category Widget + * @package Laconica + * @author Evan Prodromou + * @copyright 2009 Control Yourself, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + */ + +if (!defined('LACONICA')) { + exit(1); +} + +/** + * Personal tag cloud section + * + * @category Widget + * @package Laconica + * @author Evan Prodromou + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + */ + +class SubPeopleTagCloudSection extends TagCloudSection +{ + function getTags() + { + $qry = $this->query(); + $limit = TAGS_PER_SECTION; + $offset = 0; + + if (common_config('db','type') == 'pgsql') { + $qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset; + } else { + $qry .= ' LIMIT ' . $offset . ', ' . $limit; + } + + $profile_tag = Memcached_DataObject::cachedQuery('Profile_tag', + sprintf($qry, + $this->out->user->id)); + return $profile_tag; + } + + function tagUrl($tag) { + return common_local_url('peopletag', array('tag' => $tag)); + } + + function showTag($tag, $weight, $relative) { + $rel = 'tag-cloud-'; + $rel .= 1+intval(7 * $relative * $weight - 0.01); + + $this->out->elementStart('li', $rel); + $this->out->element('a', array('href' => $this->tagUrl($tag)), $tag); + $this->out->elementEnd('li'); + } +} diff --git a/lib/subscriberspeopleselftagcloudsection.php b/lib/subscriberspeopleselftagcloudsection.php new file mode 100644 index 000000000..b5a39c6de --- /dev/null +++ b/lib/subscriberspeopleselftagcloudsection.php @@ -0,0 +1,54 @@ +. + * + * @category Widget + * @package Laconica + * @author Evan Prodromou + * @copyright 2009 Control Yourself, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + */ + +if (!defined('LACONICA')) { + exit(1); +} + +/** + * Personal tag cloud section + * + * @category Widget + * @package Laconica + * @author Evan Prodromou + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + */ + +class SubscribersPeopleSelfTagCloudSection extends SubPeopleTagCloudSection +{ + function title() + { + return _('People Tagcloud as self-tagged'); + } + + function query() { + return 'select tag, count(tag) as weight from subscription left join profile_tag on tagger = subscriber where subscribed=%d and subscribed != subscriber and tagger = tagged group by tag order by weight desc'; + } +} diff --git a/lib/subscriberspeopletagcloudsection.php b/lib/subscriberspeopletagcloudsection.php new file mode 100644 index 000000000..23011efdd --- /dev/null +++ b/lib/subscriberspeopletagcloudsection.php @@ -0,0 +1,60 @@ +. + * + * @category Widget + * @package Laconica + * @author Evan Prodromou + * @copyright 2009 Control Yourself, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + */ + +if (!defined('LACONICA')) { + exit(1); +} + +/** + * Personal tag cloud section + * + * @category Widget + * @package Laconica + * @author Evan Prodromou + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + */ + +class SubscribersPeopleTagCloudSection extends SubPeopleTagCloudSection +{ + function title() + { + return _('People Tagcloud as tagged'); + } + + function tagUrl($tag) { + $nickname = $this->out->profile->nickname; + return common_local_url('subscribers', array('nickname' => $nickname, 'tag' => $tag)); + } + + + function query() { + return 'select tag, count(tag) as weight from subscription left join profile_tag on subscriber=tagged and subscribed=tagger where subscribed=%d and subscriber != subscribed group by tag order by weight desc'; + } +} diff --git a/lib/subscriptionspeopleselftagcloudsection.php b/lib/subscriptionspeopleselftagcloudsection.php new file mode 100644 index 000000000..8ac65adb0 --- /dev/null +++ b/lib/subscriptionspeopleselftagcloudsection.php @@ -0,0 +1,54 @@ +. + * + * @category Widget + * @package Laconica + * @author Evan Prodromou + * @copyright 2009 Control Yourself, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + */ + +if (!defined('LACONICA')) { + exit(1); +} + +/** + * Personal tag cloud section + * + * @category Widget + * @package Laconica + * @author Evan Prodromou + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + */ + +class SubscriptionsPeopleSelfTagCloudSection extends SubPeopleTagCloudSection +{ + function title() + { + return _('People Tagcloud as self-tagged'); + } + + function query() { + return 'select tag, count(tag) as weight from subscription left join profile_tag on tagger = subscriber where subscribed=%d and subscriber != subscribed and tagger = tagged group by tag order by weight desc'; + } +} diff --git a/lib/subscriptionspeopletagcloudsection.php b/lib/subscriptionspeopletagcloudsection.php new file mode 100644 index 000000000..c3f7d1763 --- /dev/null +++ b/lib/subscriptionspeopletagcloudsection.php @@ -0,0 +1,59 @@ +. + * + * @category Widget + * @package Laconica + * @author Evan Prodromou + * @copyright 2009 Control Yourself, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + */ + +if (!defined('LACONICA')) { + exit(1); +} + +/** + * Personal tag cloud section + * + * @category Widget + * @package Laconica + * @author Evan Prodromou + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + */ + +class SubscriptionsPeopleTagCloudSection extends SubPeopleTagCloudSection +{ + function title() + { + return _('People Tagcloud as tagged'); + } + + function tagUrl($tag) { + $nickname = $this->out->profile->nickname; + return common_local_url('subscriptions', array('nickname' => $nickname, 'tag' => $tag)); + } + + function query() { + return 'select tag, count(tag) as weight from subscription left join profile_tag on subscriber=tagger and subscribed=tagged where subscriber=%d and subscriber != subscribed group by tag order by weight desc'; + } +} -- cgit v1.2.3 From 90fb7be99a74689de0d0e2409230d8bd515ac5c3 Mon Sep 17 00:00:00 2001 From: Dan Moore Date: Sat, 18 Apr 2009 15:33:36 -0400 Subject: Bringing the presentation of boolean variables (favorited, truncated, profile_background_tile) and the result from friendships/exist in JSON results from the Twitter Compatible API in line with what the real Twitter API does. Currently, laconica returns text strings enclosed in quotes instead of bare Javascript booleans. This change fixes that. See http://laconi.ca/trac/ticket/1326 for one open issue related to this. --- actions/twitapifriendships.php | 6 +----- actions/twitapiusers.php | 2 +- lib/twitterapi.php | 29 ++++++++++++++++++++++++----- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/actions/twitapifriendships.php b/actions/twitapifriendships.php index c50c5e84a..2f8250e0d 100644 --- a/actions/twitapifriendships.php +++ b/actions/twitapifriendships.php @@ -133,11 +133,7 @@ class TwitapifriendshipsAction extends TwitterapiAction return; } - if ($user_a->isSubscribed($user_b)) { - $result = 'true'; - } else { - $result = 'false'; - } + $result = $user_a->isSubscribed($user_b); switch ($apidata['content-type']) { case 'xml': diff --git a/actions/twitapiusers.php b/actions/twitapiusers.php index 2894b7486..41d0d955b 100644 --- a/actions/twitapiusers.php +++ b/actions/twitapiusers.php @@ -83,7 +83,7 @@ class TwitapiusersAction extends TwitterapiAction $twitter_user['profile_link_color'] = ''; $twitter_user['profile_sidebar_fill_color'] = ''; $twitter_user['profile_sidebar_border_color'] = ''; - $twitter_user['profile_background_tile'] = 'false'; + $twitter_user['profile_background_tile'] = false; $faves = DB_DataObject::factory('fave'); $faves->user_id = $user->id; diff --git a/lib/twitterapi.php b/lib/twitterapi.php index 6a90b4e28..caf8c0716 100644 --- a/lib/twitterapi.php +++ b/lib/twitterapi.php @@ -51,6 +51,26 @@ class TwitterapiAction extends Action parent::handle($args); } + /** + * Overrides XMLOutputter::element to write booleans as strings (true|false). + * See that method's documentation for more info. + * + * @param string $tag Element type or tagname + * @param array $attrs Array of element attributes, as + * key-value pairs + * @param string $content string content of the element + * + * @return void + */ + function element($tag, $attrs=null, $content=null) + { + if (is_bool($content)) { + $content = ($content ? 'true' : 'false'); + } + + return parent::element($tag, $attrs, $content); + } + function twitter_user_array($profile, $get_notice=false) { @@ -66,7 +86,7 @@ class TwitterapiAction extends Action $avatar = $profile->getAvatar(AVATAR_STREAM_SIZE); $twitter_user['profile_image_url'] = ($avatar) ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_STREAM_SIZE); - $twitter_user['protected'] = 'false'; # not supported by Laconica yet + $twitter_user['protected'] = false; # not supported by Laconica yet $twitter_user['url'] = ($profile->homepage) ? $profile->homepage : null; if ($get_notice) { @@ -86,7 +106,7 @@ class TwitterapiAction extends Action $twitter_status = array(); $twitter_status['text'] = $notice->content; - $twitter_status['truncated'] = 'false'; # Not possible on Laconica + $twitter_status['truncated'] = false; # Not possible on Laconica $twitter_status['created_at'] = $this->date_twitter($notice->created); $twitter_status['in_reply_to_status_id'] = ($notice->reply_to) ? intval($notice->reply_to) : null; @@ -108,10 +128,9 @@ class TwitterapiAction extends Action ($replier_profile) ? $replier_profile->nickname : null; if (isset($this->auth_user)) { - $twitter_status['favorited'] = - ($this->auth_user->hasFave($notice)) ? 'true' : 'false'; + $twitter_status['favorited'] = $this->auth_user->hasFave($notice); } else { - $twitter_status['favorited'] = 'false'; + $twitter_status['favorited'] = false; } if ($include_user) { -- cgit v1.2.3 From b764c3be78aef4305b75b14d7f3e8c9f1c552f9e Mon Sep 17 00:00:00 2001 From: Dan Moore Date: Sat, 18 Apr 2009 15:42:44 -0400 Subject: This should change the JSON representation of the booleans 'following' and 'notifications', but unlike the previous change, I was unable to test this. --- actions/twitapiusers.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/actions/twitapiusers.php b/actions/twitapiusers.php index 41d0d955b..92d67454c 100644 --- a/actions/twitapiusers.php +++ b/actions/twitapiusers.php @@ -103,22 +103,14 @@ class TwitapiusersAction extends TwitterapiAction if (isset($apidata['user'])) { - if ($apidata['user']->isSubscribed($profile)) { - $twitter_user['following'] = 'true'; - } else { - $twitter_user['following'] = 'false'; - } + $twitter_user['following'] = $apidata['user']->isSubscribed($profile); // Notifications on? $sub = Subscription::pkeyGet(array('subscriber' => $apidata['user']->id, 'subscribed' => $profile->id)); if ($sub) { - if ($sub->jabber || $sub->sms) { - $twitter_user['notifications'] = 'true'; - } else { - $twitter_user['notifications'] = 'false'; - } + $twitter_user['notifications'] = ($sub->jabber || $sub->sms); } } -- cgit v1.2.3 From 48846c38057b20bb51814c22456d6907cc2a99e8 Mon Sep 17 00:00:00 2001 From: Dan Moore Date: Sat, 18 Apr 2009 15:54:23 -0400 Subject: Fixing spaces/tabs. --- actions/twitapiusers.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/actions/twitapiusers.php b/actions/twitapiusers.php index 92d67454c..1542cfb33 100644 --- a/actions/twitapiusers.php +++ b/actions/twitapiusers.php @@ -82,8 +82,8 @@ class TwitapiusersAction extends TwitterapiAction $twitter_user['profile_text_color'] = ''; $twitter_user['profile_link_color'] = ''; $twitter_user['profile_sidebar_fill_color'] = ''; - $twitter_user['profile_sidebar_border_color'] = ''; - $twitter_user['profile_background_tile'] = false; + $twitter_user['profile_sidebar_border_color'] = ''; + $twitter_user['profile_background_tile'] = false; $faves = DB_DataObject::factory('fave'); $faves->user_id = $user->id; @@ -103,16 +103,16 @@ class TwitapiusersAction extends TwitterapiAction if (isset($apidata['user'])) { - $twitter_user['following'] = $apidata['user']->isSubscribed($profile); + $twitter_user['following'] = $apidata['user']->isSubscribed($profile); - // Notifications on? - $sub = Subscription::pkeyGet(array('subscriber' => - $apidata['user']->id, 'subscribed' => $profile->id)); + // Notifications on? + $sub = Subscription::pkeyGet(array('subscriber' => + $apidata['user']->id, 'subscribed' => $profile->id)); - if ($sub) { - $twitter_user['notifications'] = ($sub->jabber || $sub->sms); - } - } + if ($sub) { + $twitter_user['notifications'] = ($sub->jabber || $sub->sms); + } + } if ($apidata['content-type'] == 'xml') { $this->init_document('xml'); -- cgit v1.2.3 From e9213043a820095cceeb6cacbfacf08bba9d3142 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sat, 18 Apr 2009 19:36:25 -0700 Subject: add reply_to index to notice --- db/laconica.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/db/laconica.sql b/db/laconica.sql index a790a3fd2..5b57494d9 100644 --- a/db/laconica.sql +++ b/db/laconica.sql @@ -117,6 +117,7 @@ create table notice ( index notice_profile_id_idx (profile_id), index notice_created_idx (created), + index notice_replyto_idx (reply_to), FULLTEXT(content) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_general_ci; -- cgit v1.2.3 From 4cb0a929806869b09d4325c1464fc2ecb7b5a76e Mon Sep 17 00:00:00 2001 From: CiaranG Date: Tue, 21 Apr 2009 20:43:57 +0100 Subject: Add feed2omb to notice sources --- db/notice_source.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/db/notice_source.sql b/db/notice_source.sql index d5124e223..ce44f3235 100644 --- a/db/notice_source.sql +++ b/db/notice_source.sql @@ -8,6 +8,7 @@ VALUES ('deskbar','Deskbar-Applet','http://www.gnome.org/projects/deskbar-applet/', now()), ('Do','Gnome Do','http://do.davebsd.com/wiki/index.php?title=Microblog_Plugin', now()), ('Facebook','Facebook','http://apps.facebook.com/identica/', now()), + ('feed2omb','feed2omb','http://projects.ciarang.com/p/feed2omb/', now()), ('Gwibber','Gwibber','http://launchpad.net/gwibber', now()), ('HelloTxt','HelloTxt','http://hellotxt.com/', now()), ('identicatools','Laconica Tools','http://bitbucketlabs.net/laconica-tools/', now()), -- cgit v1.2.3 From ec5e06a542d6b06ea9b1d3de7cb309dd1088b4d4 Mon Sep 17 00:00:00 2001 From: CiaranG Date: Tue, 21 Apr 2009 23:36:15 +0100 Subject: Suppress errors when checking for the existence of files that might be restricted by open_basedir - should resolve issue #1310 --- lib/common.php | 2 +- lib/util.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/common.php b/lib/common.php index b3882d207..f983c4d16 100644 --- a/lib/common.php +++ b/lib/common.php @@ -192,7 +192,7 @@ $_config_files[] = INSTALLDIR.'/config.php'; $_have_a_config = false; foreach ($_config_files as $_config_file) { - if (file_exists($_config_file)) { + if (@file_exists($_config_file)) { include_once($_config_file); $_have_a_config = true; } diff --git a/lib/util.php b/lib/util.php index e0eda0114..e1dd238ba 100644 --- a/lib/util.php +++ b/lib/util.php @@ -966,7 +966,7 @@ function common_root_url($ssl=false) function common_good_rand($bytes) { // XXX: use random.org...? - if (file_exists('/dev/urandom')) { + if (@file_exists('/dev/urandom')) { return common_urandom($bytes); } else { // FIXME: this is probably not good enough return common_mtrand($bytes); -- cgit v1.2.3 From fe3241183e3559442003b9b70435d59126e11b7e Mon Sep 17 00:00:00 2001 From: Robin Millette Date: Thu, 23 Apr 2009 01:03:17 +0000 Subject: fix join a group link from user homepage when he hasn't posted anything yet --- actions/all.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/all.php b/actions/all.php index a92e55462..a53bbea07 100644 --- a/actions/all.php +++ b/actions/all.php @@ -93,7 +93,7 @@ class AllAction extends ProfileAction if (common_logged_in()) { $current_user = common_current_user(); if ($this->user->id === $current_user->id) { - $message .= _('Try subscribing to more people, [join a group](%%action.groups) or post something yourself.'); + $message .= _('Try subscribing to more people, [join a group](%%action.groups%%) or post something yourself.'); } else { $message .= sprintf(_('You can try to [nudge %s](../%s) from his profile or [post something to his or her attention](%%%%action.newnotice%%%%?status_textarea=%s).'), $this->user->nickname, $this->user->nickname, '@' . $this->user->nickname); } -- cgit v1.2.3 From c4941e904316ef98582290602f8cba1d220b873a Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Thu, 23 Apr 2009 02:17:58 +0000 Subject: Added ajax responses --- actions/newmessage.php | 45 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/actions/newmessage.php b/actions/newmessage.php index 82276ff34..52d4899ba 100644 --- a/actions/newmessage.php +++ b/actions/newmessage.php @@ -172,15 +172,54 @@ class NewmessageAction extends Action $this->notify($user, $this->other, $message); - $url = common_local_url('outbox', array('nickname' => $user->nickname)); + if ($this->boolean('ajax')) { + $this->startHTML('text/xml;charset=utf-8'); + $this->elementStart('head'); + $this->element('title', null, _('Message sent')); + $this->elementEnd('head'); + $this->elementStart('body'); + $this->element('p', array('id' => 'command_result'), + sprintf(_('Direct message to %s sent'), + $this->other->nickname)); + $this->elementEnd('body'); + $this->elementEnd('html'); + } else { + $url = common_local_url('outbox', + array('nickname' => $user->nickname)); + common_redirect($url, 303); + } + } - common_redirect($url, 303); + /** + * Show an Ajax-y error message + * + * Goes back to the browser, where it's shown in a popup. + * + * @param string $msg Message to show + * + * @return void + */ + + function ajaxErrorMsg($msg) + { + $this->startHTML('text/xml;charset=utf-8', true); + $this->elementStart('head'); + $this->element('title', null, _('Ajax Error')); + $this->elementEnd('head'); + $this->elementStart('body'); + $this->element('p', array('id' => 'error'), $msg); + $this->elementEnd('body'); + $this->elementEnd('html'); } function showForm($msg = null) { - $this->msg = $msg; + if ($msg && $this->boolean('ajax')) { + $this->ajaxErrorMsg($msg); + return; + } + $this->msg = $msg; $this->showPage(); } -- cgit v1.2.3 From 63c52784c7acc54b0b7b39ff3ca7763774e4ab9a Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Thu, 23 Apr 2009 02:22:00 +0000 Subject: Allowing XHR for Inbox/Outbox pages. --- js/util.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/js/util.js b/js/util.js index 53e6eb792..13036f7ca 100644 --- a/js/util.js +++ b/js/util.js @@ -192,10 +192,8 @@ $(document).ready(function(){ $("#notice_action-submit").removeClass("disabled"); } }; - if (document.body.id != 'inbox' && document.body.id != 'outbox') { - $("#form_notice").ajaxForm(PostNotice); - $("#form_notice").each(addAjaxHidden); - } + $("#form_notice").ajaxForm(PostNotice); + $("#form_notice").each(addAjaxHidden); NoticeHover(); NoticeReply(); }); -- cgit v1.2.3 From 640628de2d593933e810b4785dfe38923b979713 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 23 Apr 2009 05:03:19 -0400 Subject: A queuehandler for blowing caches offline We add a queuehandler for blowing the memcached caches off-line. This should speed up the processing of new notices. --- classes/Notice.php | 25 ++++++++++++++++- lib/util.php | 14 ++++++++-- scripts/memcachedqueuehandler.php | 58 +++++++++++++++++++++++++++++++++++++++ scripts/startdaemons.sh | 3 +- scripts/stopdaemons.sh | 2 +- 5 files changed, 97 insertions(+), 5 deletions(-) create mode 100644 scripts/memcachedqueuehandler.php diff --git a/classes/Notice.php b/classes/Notice.php index 5fa0d79a1..fbfeb9489 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -207,7 +207,11 @@ class Notice extends Memcached_DataObject # XXX: someone clever could prepend instead of clearing the cache if (common_config('memcached', 'enabled')) { - $notice->blowCaches(); + if (common_config('queues', 'enabled')) { + $notice->blowAuthorCaches(); + } else { + $notice->blowCaches(); + } } return $notice; @@ -271,6 +275,25 @@ class Notice extends Memcached_DataObject $this->blowGroupCache($blowLast); } + function blowAuthorCaches($blowLast=false) + { + // Clear the user's cache + $cache = common_memcache(); + if ($cache) { + $user = User::staticGet($this->profile_id); + if (!empty($user)) { + $cache->delete(common_cache_key('user:notices_with_friends:' . $user->id)); + if ($blowLast) { + $cache->delete(common_cache_key('user:notices_with_friends:' . $user->id . ';last')); + } + } + $user->free(); + unset($user); + } + $this->blowNoticeCache($blowLast); + $this->blowPublicCache($blowLast); + } + function blowGroupCache($blowLast=false) { $cache = common_memcache(); diff --git a/lib/util.php b/lib/util.php index e0eda0114..12797891c 100644 --- a/lib/util.php +++ b/lib/util.php @@ -879,7 +879,17 @@ function common_broadcast_notice($notice, $remote=false) function common_enqueue_notice($notice) { - foreach (array('jabber', 'omb', 'sms', 'public', 'twitter', 'facebook', 'ping') as $transport) { + $transports = array('omb', 'sms', 'twitter', 'facebook', 'ping'); + + if (common_config('xmpp', 'enabled')) { + $transports = array_merge($transports, array('jabber', 'public')); + } + + if (common_config('memcached', 'enabled')) { + $transports[] = 'memcached'; + } + + foreach ($transports as $transport) { $qi = new Queue_item(); $qi->notice_id = $notice->id; $qi->transport = $transport; @@ -1332,7 +1342,7 @@ function common_compatible_license($from, $to) */ function common_database_tablename($tablename) { - + if(common_config('db','quote_identifiers')) { $tablename = '"'. $tablename .'"'; } diff --git a/scripts/memcachedqueuehandler.php b/scripts/memcachedqueuehandler.php new file mode 100644 index 000000000..3fcebcfc3 --- /dev/null +++ b/scripts/memcachedqueuehandler.php @@ -0,0 +1,58 @@ +#!/usr/bin/env php +. + */ + +// Abort if called from a web server + +if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) { + print "This script must be run from the command line\n"; + exit(); +} + +define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); +define('LACONICA', true); + +require_once(INSTALLDIR . '/lib/common.php'); + +set_error_handler('common_error_handler'); + +class MemcachedQueueHandler extends QueueHandler +{ + function transport() + { + return 'memcached'; + } + + function handle_notice($notice) + { + // XXX: fork here + common_log(LOG_INFO, "Blowing memcached for $notice->id\n"; + $notice->blowCaches(); + return true; + } +} + +ini_set("max_execution_time", "0"); +ini_set("max_input_time", "0"); +set_time_limit(0); +mb_internal_encoding('UTF-8'); + +$handler = new MemcachedQueueHandler($resource); + +$handler->runOnce(); diff --git a/scripts/startdaemons.sh b/scripts/startdaemons.sh index c3729761d..08de6d954 100755 --- a/scripts/startdaemons.sh +++ b/scripts/startdaemons.sh @@ -24,7 +24,8 @@ DIR=`dirname $0` for f in xmppdaemon.php jabberqueuehandler.php publicqueuehandler.php \ xmppconfirmhandler.php smsqueuehandler.php ombqueuehandler.php \ - twitterqueuehandler.php facebookqueuehandler.php pingqueuehandler.php; do + twitterqueuehandler.php facebookqueuehandler.php pingqueuehandler.php \ + memcachedqueuehandler.php; do echo -n "Starting $f..."; php $DIR/$f diff --git a/scripts/stopdaemons.sh b/scripts/stopdaemons.sh index 2bb8f9ecb..e5a181cd1 100755 --- a/scripts/stopdaemons.sh +++ b/scripts/stopdaemons.sh @@ -24,7 +24,7 @@ SDIR=`dirname $0` DIR=`php $SDIR/getpiddir.php` for f in jabberhandler ombhandler publichandler smshandler pinghandler \ - xmppconfirmhandler xmppdaemon twitterhandler facebookhandler ; do + xmppconfirmhandler xmppdaemon twitterhandler facebookhandler memcachedhandler; do FILES="$DIR/$f.*.pid" for ff in "$FILES" ; do -- cgit v1.2.3 From aee45ea91dcec4736d8b9befe17e030b873d9226 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 23 Apr 2009 05:08:48 -0400 Subject: Add an inbox queue handler Handle distributing a notice to multiple inboxes in a queue handler rather than in the Web action. --- classes/Notice.php | 5 +++- lib/util.php | 4 +++ scripts/inboxqueuehandler.php | 57 +++++++++++++++++++++++++++++++++++++++++++ scripts/startdaemons.sh | 2 +- scripts/stopdaemons.sh | 3 ++- 5 files changed, 68 insertions(+), 3 deletions(-) create mode 100644 scripts/inboxqueuehandler.php diff --git a/classes/Notice.php b/classes/Notice.php index fbfeb9489..ff00f2a94 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -197,7 +197,10 @@ class Notice extends Memcached_DataObject $notice->saveTags(); $notice->saveGroups(); - $notice->addToInboxes(); + if (!common_config('queues', 'enabled')) { + $notice->addToInboxes(); + } + $notice->query('COMMIT'); Event::handle('EndNoticeSave', array($notice)); diff --git a/lib/util.php b/lib/util.php index 12797891c..9b6d2941a 100644 --- a/lib/util.php +++ b/lib/util.php @@ -889,6 +889,10 @@ function common_enqueue_notice($notice) $transports[] = 'memcached'; } + if (common_config('queues', 'enabled')) { + $transports[] = 'inbox'; + } + foreach ($transports as $transport) { $qi = new Queue_item(); $qi->notice_id = $notice->id; diff --git a/scripts/inboxqueuehandler.php b/scripts/inboxqueuehandler.php new file mode 100644 index 000000000..16e334b83 --- /dev/null +++ b/scripts/inboxqueuehandler.php @@ -0,0 +1,57 @@ +#!/usr/bin/env php +. + */ + +// Abort if called from a web server + +if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) { + print "This script must be run from the command line\n"; + exit(); +} + +define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); +define('LACONICA', true); + +require_once(INSTALLDIR . '/lib/common.php'); + +set_error_handler('common_error_handler'); + +class InboxQueueHandler extends QueueHandler +{ + function transport() + { + return 'inbox'; + } + + function handle_notice($notice) + { + common_log(LOG_INFO, "Distributing notice to inboxes for $notice->id"); + $notice->addToInboxes(); + return true; + } +} + +ini_set("max_execution_time", "0"); +ini_set("max_input_time", "0"); +set_time_limit(0); +mb_internal_encoding('UTF-8'); + +$handler = new InboxQueueHandler($resource); + +$handler->runOnce(); diff --git a/scripts/startdaemons.sh b/scripts/startdaemons.sh index 08de6d954..66f9ed4e0 100755 --- a/scripts/startdaemons.sh +++ b/scripts/startdaemons.sh @@ -25,7 +25,7 @@ DIR=`dirname $0` for f in xmppdaemon.php jabberqueuehandler.php publicqueuehandler.php \ xmppconfirmhandler.php smsqueuehandler.php ombqueuehandler.php \ twitterqueuehandler.php facebookqueuehandler.php pingqueuehandler.php \ - memcachedqueuehandler.php; do + memcachedqueuehandler.php inboxqueuehandler.php; do echo -n "Starting $f..."; php $DIR/$f diff --git a/scripts/stopdaemons.sh b/scripts/stopdaemons.sh index e5a181cd1..196991de0 100755 --- a/scripts/stopdaemons.sh +++ b/scripts/stopdaemons.sh @@ -24,7 +24,8 @@ SDIR=`dirname $0` DIR=`php $SDIR/getpiddir.php` for f in jabberhandler ombhandler publichandler smshandler pinghandler \ - xmppconfirmhandler xmppdaemon twitterhandler facebookhandler memcachedhandler; do + xmppconfirmhandler xmppdaemon twitterhandler facebookhandler \ + memcachedhandler inboxhandler; do FILES="$DIR/$f.*.pid" for ff in "$FILES" ; do -- cgit v1.2.3 From 2053bdabef929f4a095d91fbdd3fa62646e9f332 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 23 Apr 2009 05:23:59 -0400 Subject: fix parse error in memcachedqueuehandler --- scripts/memcachedqueuehandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/memcachedqueuehandler.php b/scripts/memcachedqueuehandler.php index 3fcebcfc3..43231fa2c 100644 --- a/scripts/memcachedqueuehandler.php +++ b/scripts/memcachedqueuehandler.php @@ -42,7 +42,7 @@ class MemcachedQueueHandler extends QueueHandler function handle_notice($notice) { // XXX: fork here - common_log(LOG_INFO, "Blowing memcached for $notice->id\n"; + common_log(LOG_INFO, "Blowing memcached for $notice->id"); $notice->blowCaches(); return true; } -- cgit v1.2.3 From 31b04220bd9fbadbfac01b60276a9c14896b6a45 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 23 Apr 2009 09:34:56 +0000 Subject: incorrect config setting for queues --- classes/Notice.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/Notice.php b/classes/Notice.php index ff00f2a94..ebed0b8af 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -197,7 +197,7 @@ class Notice extends Memcached_DataObject $notice->saveTags(); $notice->saveGroups(); - if (!common_config('queues', 'enabled')) { + if (!common_config('queue', 'enabled')) { $notice->addToInboxes(); } @@ -210,7 +210,7 @@ class Notice extends Memcached_DataObject # XXX: someone clever could prepend instead of clearing the cache if (common_config('memcached', 'enabled')) { - if (common_config('queues', 'enabled')) { + if (common_config('queue', 'enabled')) { $notice->blowAuthorCaches(); } else { $notice->blowCaches(); -- cgit v1.2.3 From ece70bf326fa680ec7acdef00751e2bb71bceee1 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 23 Apr 2009 09:35:10 +0000 Subject: incorrect config setting for inboxes --- lib/util.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/util.php b/lib/util.php index af4db4f02..d77039b74 100644 --- a/lib/util.php +++ b/lib/util.php @@ -889,7 +889,8 @@ function common_enqueue_notice($notice) $transports[] = 'memcached'; } - if (common_config('queues', 'enabled')) { + if (common_config('inboxes', 'enabled') === true || + common_config('inboxes', 'enabled') === 'transitional') { $transports[] = 'inbox'; } -- cgit v1.2.3 From a3e727823d01ed9fd5f440eeaf27449092309865 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 23 Apr 2009 09:52:21 +0000 Subject: some basic fixes for inbox and memcached queue handlers --- scripts/inboxqueuehandler.php | 15 +++++++++++++-- scripts/memcachedqueuehandler.php | 16 ++++++++++++++-- 2 files changed, 27 insertions(+), 4 deletions(-) mode change 100644 => 100755 scripts/inboxqueuehandler.php mode change 100644 => 100755 scripts/memcachedqueuehandler.php diff --git a/scripts/inboxqueuehandler.php b/scripts/inboxqueuehandler.php old mode 100644 new mode 100755 index 16e334b83..c76b80389 --- a/scripts/inboxqueuehandler.php +++ b/scripts/inboxqueuehandler.php @@ -29,6 +29,7 @@ define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); define('LACONICA', true); require_once(INSTALLDIR . '/lib/common.php'); +require_once(INSTALLDIR . '/lib/queuehandler.php'); set_error_handler('common_error_handler'); @@ -39,12 +40,20 @@ class InboxQueueHandler extends QueueHandler return 'inbox'; } + function start() { + $this->log(LOG_INFO, "INITIALIZE"); + return true; + } + function handle_notice($notice) { - common_log(LOG_INFO, "Distributing notice to inboxes for $notice->id"); + $this->log(LOG_INFO, "Distributing notice to inboxes for $notice->id"); $notice->addToInboxes(); return true; } + + function finish() { + } } ini_set("max_execution_time", "0"); @@ -52,6 +61,8 @@ ini_set("max_input_time", "0"); set_time_limit(0); mb_internal_encoding('UTF-8'); -$handler = new InboxQueueHandler($resource); +$id = ($argc > 1) ? $argv[1] : null; + +$handler = new InboxQueueHandler($id); $handler->runOnce(); diff --git a/scripts/memcachedqueuehandler.php b/scripts/memcachedqueuehandler.php old mode 100644 new mode 100755 index 43231fa2c..6e819b41f --- a/scripts/memcachedqueuehandler.php +++ b/scripts/memcachedqueuehandler.php @@ -29,6 +29,7 @@ define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); define('LACONICA', true); require_once(INSTALLDIR . '/lib/common.php'); +require_once(INSTALLDIR . '/lib/queuehandler.php'); set_error_handler('common_error_handler'); @@ -39,13 +40,22 @@ class MemcachedQueueHandler extends QueueHandler return 'memcached'; } + function start() { + $this->log(LOG_INFO, "INITIALIZE"); + return true; + } + function handle_notice($notice) { // XXX: fork here - common_log(LOG_INFO, "Blowing memcached for $notice->id"); + $this->log(LOG_INFO, "Blowing memcached for $notice->id"); $notice->blowCaches(); return true; } + + function finish() { + } + } ini_set("max_execution_time", "0"); @@ -53,6 +63,8 @@ ini_set("max_input_time", "0"); set_time_limit(0); mb_internal_encoding('UTF-8'); -$handler = new MemcachedQueueHandler($resource); +$id = ($argc > 1) ? $argv[1] : null; + +$handler = new MemcachedQueueHandler($id); $handler->runOnce(); -- cgit v1.2.3 From 7c383dc1d46cae8abc6d1e5c7eb93ad7cdd91f63 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 23 Apr 2009 10:08:26 +0000 Subject: alert to what transport we're checking for --- lib/queuehandler.php | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/lib/queuehandler.php b/lib/queuehandler.php index 9ce9e32b3..fde650d9e 100644 --- a/lib/queuehandler.php +++ b/lib/queuehandler.php @@ -36,7 +36,7 @@ class QueueHandler extends Daemon $this->set_id($id); } } - + function class_name() { return ucfirst($this->transport()) . 'Handler'; @@ -46,7 +46,7 @@ class QueueHandler extends Daemon { return strtolower($this->class_name().'.'.$this->get_id()); } - + function get_id() { return $this->_id; @@ -56,16 +56,16 @@ class QueueHandler extends Daemon { $this->_id = $id; } - + function transport() { return null; } - + function start() { } - + function finish() { } @@ -74,14 +74,14 @@ class QueueHandler extends Daemon { return true; } - + function run() { if (!$this->start()) { return false; } - $this->log(LOG_INFO, 'checking for queued notices'); $transport = $this->transport(); + $this->log(LOG_INFO, 'checking for queued notices for "' . $transport . '"'); do { $qi = Queue_item::top($transport); if ($qi) { @@ -113,7 +113,7 @@ class QueueHandler extends Daemon } else { $this->clear_old_claims(); $this->idle(5); - } + } } while (true); if (!$this->finish()) { return false; @@ -127,7 +127,7 @@ class QueueHandler extends Daemon sleep($timeout); } } - + function clear_old_claims() { $qi = new Queue_item(); @@ -137,10 +137,9 @@ class QueueHandler extends Daemon $qi->free(); unset($qi); } - + function log($level, $msg) { common_log($level, $this->class_name() . ' ('. $this->get_id() .'): '.$msg); } } - \ No newline at end of file -- cgit v1.2.3 From 290ae7888c4d8dbcb703920960b10bca635563ed Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 23 Apr 2009 10:08:51 +0000 Subject: blow subs cache after updating inboxes --- scripts/inboxqueuehandler.php | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/inboxqueuehandler.php b/scripts/inboxqueuehandler.php index c76b80389..73d31e854 100755 --- a/scripts/inboxqueuehandler.php +++ b/scripts/inboxqueuehandler.php @@ -49,6 +49,7 @@ class InboxQueueHandler extends QueueHandler { $this->log(LOG_INFO, "Distributing notice to inboxes for $notice->id"); $notice->addToInboxes(); + $notice->blowSubsCache(); return true; } -- cgit v1.2.3 From 1c0d82de3bb7f75649a017a7d5632a6e070876c2 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 23 Apr 2009 10:09:08 +0000 Subject: 8-char limit on transports --- lib/util.php | 3 ++- scripts/memcachedqueuehandler.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/util.php b/lib/util.php index d77039b74..f862d7fcc 100644 --- a/lib/util.php +++ b/lib/util.php @@ -886,7 +886,8 @@ function common_enqueue_notice($notice) } if (common_config('memcached', 'enabled')) { - $transports[] = 'memcached'; + // Note: limited to 8 chars + $transports[] = 'memcache'; } if (common_config('inboxes', 'enabled') === true || diff --git a/scripts/memcachedqueuehandler.php b/scripts/memcachedqueuehandler.php index 6e819b41f..185b781f7 100755 --- a/scripts/memcachedqueuehandler.php +++ b/scripts/memcachedqueuehandler.php @@ -37,7 +37,7 @@ class MemcachedQueueHandler extends QueueHandler { function transport() { - return 'memcached'; + return 'memcache'; } function start() { -- cgit v1.2.3 From a9df5eab100bce97da3e028851d224ea2e9fff80 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 23 Apr 2009 10:38:51 +0000 Subject: insert into user's inbox at Web time --- classes/Notice.php | 76 ++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 51 insertions(+), 25 deletions(-) diff --git a/classes/Notice.php b/classes/Notice.php index ebed0b8af..27b98de1c 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -197,7 +197,9 @@ class Notice extends Memcached_DataObject $notice->saveTags(); $notice->saveGroups(); - if (!common_config('queue', 'enabled')) { + if (common_config('queue', 'enabled')) { + $notice->addToAuthorInbox(); + } else { $notice->addToInboxes(); } @@ -282,16 +284,8 @@ class Notice extends Memcached_DataObject { // Clear the user's cache $cache = common_memcache(); - if ($cache) { - $user = User::staticGet($this->profile_id); - if (!empty($user)) { - $cache->delete(common_cache_key('user:notices_with_friends:' . $user->id)); - if ($blowLast) { - $cache->delete(common_cache_key('user:notices_with_friends:' . $user->id . ';last')); - } - } - $user->free(); - unset($user); + if (!empty($cache)) { + $cache->delete(common_cache_key('user:notices_with_friends:' . $this->profile_id)); } $this->blowNoticeCache($blowLast); $this->blowPublicCache($blowLast); @@ -665,6 +659,33 @@ class Notice extends Memcached_DataObject return; } + function addToAuthorInbox() + { + $enabled = common_config('inboxes', 'enabled'); + + if ($enabled === true || $enabled === 'transitional') { + $user = User::staticGet('id', $this->profile_id); + if (empty($user)) { + return; + } + $inbox = new Notice_inbox(); + $UT = common_config('db','type')=='pgsql'?'"user"':'user'; + $qry = 'INSERT INTO notice_inbox (user_id, notice_id, created) ' . + "SELECT $UT.id, " . $this->id . ", '" . $this->created . "' " . + "FROM $UT " . + "WHERE $UT.id = " . $this->profile_id . ' ' . + 'AND NOT EXISTS (SELECT user_id, notice_id ' . + 'FROM notice_inbox ' . + "WHERE user_id = " . $this->profile_id . ' '. + 'AND notice_id = ' . $this->id . ' )'; + if ($enabled === 'transitional') { + $qry .= " AND $UT.inboxed = 1"; + } + $inbox->query($qry); + } + return; + } + function saveGroups() { $enabled = common_config('inboxes', 'enabled'); @@ -717,24 +738,29 @@ class Notice extends Memcached_DataObject // FIXME: do this in an offline daemon - $inbox = new Notice_inbox(); - $UT = common_config('db','type')=='pgsql'?'"user"':'user'; - $qry = 'INSERT INTO notice_inbox (user_id, notice_id, created, source) ' . - "SELECT $UT.id, " . $this->id . ", '" . $this->created . "', 2 " . - "FROM $UT JOIN group_member ON $UT.id = group_member.profile_id " . - 'WHERE group_member.group_id = ' . $group->id . ' ' . - 'AND NOT EXISTS (SELECT user_id, notice_id ' . - 'FROM notice_inbox ' . - "WHERE user_id = $UT.id " . - 'AND notice_id = ' . $this->id . ' )'; - if ($enabled === 'transitional') { - $qry .= " AND $UT.inboxed = 1"; - } - $result = $inbox->query($qry); + $this->addToGroupInboxes($group); } } } + function addToGroupInboxes($group) + { + $inbox = new Notice_inbox(); + $UT = common_config('db','type')=='pgsql'?'"user"':'user'; + $qry = 'INSERT INTO notice_inbox (user_id, notice_id, created, source) ' . + "SELECT $UT.id, " . $this->id . ", '" . $this->created . "', 2 " . + "FROM $UT JOIN group_member ON $UT.id = group_member.profile_id " . + 'WHERE group_member.group_id = ' . $group->id . ' ' . + 'AND NOT EXISTS (SELECT user_id, notice_id ' . + 'FROM notice_inbox ' . + "WHERE user_id = $UT.id " . + 'AND notice_id = ' . $this->id . ' )'; + if ($enabled === 'transitional') { + $qry .= " AND $UT.inboxed = 1"; + } + $result = $inbox->query($qry); + } + function saveReplies() { // Alternative reply format -- cgit v1.2.3 From 2bdf192dabb9dfbbc889c3387bf5261a2d4166ce Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Thu, 23 Apr 2009 21:35:21 +0000 Subject: XHR alerts for server-side errors: 404, 502, 503, 504. There is also a 7 second timeout if the server doesn't get back with a response. --- js/util.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/js/util.js b/js/util.js index 13036f7ca..c7b1272c8 100644 --- a/js/util.js +++ b/js/util.js @@ -166,6 +166,25 @@ $(document).ready(function(){ $("#notice_action-submit").addClass("disabled"); return true; }, + timeout: 1000, + error: function (xhr, textStatus, errorThrown) { $("#form_notice").removeClass("processing"); + $("#notice_action-submit").removeAttr("disabled"); + $("#notice_action-submit").removeClass("disabled"); + + if (textStatus == "timeout") { + alert ("Sorry! We had trouble sending your notice. The servers are overloaded. Please try again, and contact the site administrator if this problem persists"); + } + else { + switch(xhr.status) { + default: case 404: + alert("Sorry! We had trouble sending your notice. Please report the problem to the site administrator if this happens again."); + break; + case 502: case 503: case 504: + alert("Sorry! We had trouble sending your notice. The servers are overloaded. Please try again, and contact the site administrator if this problem persists."); + break; + } + } + }, success: function(xml) { if ($("#error", xml).length > 0) { var result = document._importNode($("p", xml).get(0), true); result = result.textContent || result.innerHTML; -- cgit v1.2.3 From 83ba1b0b5ef10dc1101ba35bcde4710fd13179cc Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Thu, 23 Apr 2009 21:51:49 +0000 Subject: The real 7 seconds (7000) timeout for XHR posting. --- js/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/util.js b/js/util.js index c7b1272c8..16422df57 100644 --- a/js/util.js +++ b/js/util.js @@ -166,7 +166,7 @@ $(document).ready(function(){ $("#notice_action-submit").addClass("disabled"); return true; }, - timeout: 1000, + timeout: 7000, error: function (xhr, textStatus, errorThrown) { $("#form_notice").removeClass("processing"); $("#notice_action-submit").removeAttr("disabled"); $("#notice_action-submit").removeClass("disabled"); -- cgit v1.2.3 From 12867d114d8d40bf9a45b3e1eb9b0e50d736d333 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Fri, 24 Apr 2009 17:22:43 +0000 Subject: UI for server errors. --- js/util.js | 15 +++------------ theme/base/css/display.css | 11 +++++++++-- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/js/util.js b/js/util.js index 16422df57..15a14625c 100644 --- a/js/util.js +++ b/js/util.js @@ -166,23 +166,14 @@ $(document).ready(function(){ $("#notice_action-submit").addClass("disabled"); return true; }, - timeout: 7000, error: function (xhr, textStatus, errorThrown) { $("#form_notice").removeClass("processing"); $("#notice_action-submit").removeAttr("disabled"); $("#notice_action-submit").removeClass("disabled"); - - if (textStatus == "timeout") { - alert ("Sorry! We had trouble sending your notice. The servers are overloaded. Please try again, and contact the site administrator if this problem persists"); + if ($(".error", xhr.responseXML).length > 0) { + $('#form_notice').append(document._importNode($(".error", xhr.responseXML).get(0), true)); } else { - switch(xhr.status) { - default: case 404: - alert("Sorry! We had trouble sending your notice. Please report the problem to the site administrator if this happens again."); - break; - case 502: case 503: case 504: - alert("Sorry! We had trouble sending your notice. The servers are overloaded. Please try again, and contact the site administrator if this problem persists."); - break; - } + alert("Sorry! We had trouble sending your notice ("+xhr.status+" "+xhr.statusText+"). Please report the problem to the site administrator if this happens again."); } }, success: function(xml) { if ($("#error", xml).length > 0) { diff --git a/theme/base/css/display.css b/theme/base/css/display.css index 2fb1c007f..0bc2e68b6 100644 --- a/theme/base/css/display.css +++ b/theme/base/css/display.css @@ -86,7 +86,7 @@ border:0; .error, .success { -padding:4px 7px; +padding:4px 1.55%; border-radius:4px; -moz-border-radius:4px; -webkit-border-radius:4px; @@ -426,6 +426,7 @@ line-height:1; #form_notice fieldset { border:0; padding:0; +position:relative; } #form_notice legend { display:none; @@ -480,7 +481,13 @@ margin-bottom:7px; margin-left:18px; float:left; } - +#form_notice .error { +float:left; +clear:both; +width:96.9%; +margin-bottom:0; +line-height:1.618; +} /* entity_profile */ .entity_profile { -- cgit v1.2.3 From ecb09fb8646def7f6a7c5fc0fc2d4df6676edd06 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 24 Apr 2009 13:31:03 -0400 Subject: check for existence of xmlrpc extension in LinkbackPlugin --- plugins/LinkbackPlugin.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/LinkbackPlugin.php b/plugins/LinkbackPlugin.php index 881ead99e..93a0294c4 100644 --- a/plugins/LinkbackPlugin.php +++ b/plugins/LinkbackPlugin.php @@ -121,6 +121,12 @@ class LinkbackPlugin extends Plugin { $args = array($this->notice->uri, $url); + if (!extension_loaded('xmlrpc')) { + if (!dl('xmlrpc.so')) { + common_log(LOG_ERR, "Can't pingback; xmlrpc extension not available."); + } + } + $request = xmlrpc_encode_request('pingback.ping', $args); $context = stream_context_create(array('http' => array('method' => "POST", 'header' => @@ -141,7 +147,7 @@ class LinkbackPlugin extends Plugin } // Largely cadged from trackback_cls.php by - // Ran Aroussi , GPL2 + // Ran Aroussi , GPL2 or any later version // http://phptrackback.sourceforge.net/ function getTrackback($text, $url) -- cgit v1.2.3 From c008c0d4a56ec265ba6e10d208f9954510296f12 Mon Sep 17 00:00:00 2001 From: Robin Millette Date: Fri, 24 Apr 2009 20:01:03 +0000 Subject: fixed trac#1215, 1216, 1217 and 1219: subscribers/subscriptions people tagclouds. --- lib/subpeopletagcloudsection.php | 1 + lib/subscriberspeopleselftagcloudsection.php | 10 +++++++++- lib/subscriberspeopletagcloudsection.php | 5 +++-- lib/subscriptionspeopleselftagcloudsection.php | 9 ++++++++- lib/subscriptionspeopletagcloudsection.php | 4 +++- 5 files changed, 24 insertions(+), 5 deletions(-) diff --git a/lib/subpeopletagcloudsection.php b/lib/subpeopletagcloudsection.php index d98f28afa..9f6948dc9 100644 --- a/lib/subpeopletagcloudsection.php +++ b/lib/subpeopletagcloudsection.php @@ -74,3 +74,4 @@ class SubPeopleTagCloudSection extends TagCloudSection $this->out->elementEnd('li'); } } + diff --git a/lib/subscriberspeopleselftagcloudsection.php b/lib/subscriberspeopleselftagcloudsection.php index b5a39c6de..115241a53 100644 --- a/lib/subscriberspeopleselftagcloudsection.php +++ b/lib/subscriberspeopleselftagcloudsection.php @@ -49,6 +49,14 @@ class SubscribersPeopleSelfTagCloudSection extends SubPeopleTagCloudSection } function query() { - return 'select tag, count(tag) as weight from subscription left join profile_tag on tagger = subscriber where subscribed=%d and subscribed != subscriber and tagger = tagged group by tag order by weight desc'; +// return 'select tag, count(tag) as weight from subscription left join profile_tag on tagger = subscriber where subscribed=%d and subscribed != subscriber and tagger = tagged group by tag order by weight desc'; + + + return 'select tag, count(tag) as weight from subscription left join profile_tag on tagger = subscriber where subscribed=%d and subscribed != subscriber and tagger = tagged and tag is not null group by tag order by weight desc'; + +// return 'select tag, count(tag) as weight from subscription left join profile_tag on tagger = subscribed where subscriber=%d and subscribed != subscriber and tagger = tagged and tag is not null group by tag order by weight desc'; + + } } + diff --git a/lib/subscriberspeopletagcloudsection.php b/lib/subscriberspeopletagcloudsection.php index 23011efdd..4dafbc1c7 100644 --- a/lib/subscriberspeopletagcloudsection.php +++ b/lib/subscriberspeopletagcloudsection.php @@ -53,8 +53,9 @@ class SubscribersPeopleTagCloudSection extends SubPeopleTagCloudSection return common_local_url('subscribers', array('nickname' => $nickname, 'tag' => $tag)); } - function query() { - return 'select tag, count(tag) as weight from subscription left join profile_tag on subscriber=tagged and subscribed=tagger where subscribed=%d and subscriber != subscribed group by tag order by weight desc'; +// return 'select tag, count(tag) as weight from subscription left join profile_tag on subscriber=tagged and subscribed=tagger where subscribed=%d and subscriber != subscribed group by tag order by weight desc'; + return 'select tag, count(tag) as weight from subscription left join profile_tag on subscriber=tagged and subscribed=tagger where subscribed=%d and subscriber != subscribed and tag is not null group by tag order by weight desc'; } } + diff --git a/lib/subscriptionspeopleselftagcloudsection.php b/lib/subscriptionspeopleselftagcloudsection.php index 8ac65adb0..3896294d2 100644 --- a/lib/subscriptionspeopleselftagcloudsection.php +++ b/lib/subscriptionspeopleselftagcloudsection.php @@ -49,6 +49,13 @@ class SubscriptionsPeopleSelfTagCloudSection extends SubPeopleTagCloudSection } function query() { - return 'select tag, count(tag) as weight from subscription left join profile_tag on tagger = subscriber where subscribed=%d and subscriber != subscribed and tagger = tagged group by tag order by weight desc'; +// return 'select tag, count(tag) as weight from subscription left join profile_tag on tagger = subscriber where subscribed=%d and subscriber != subscribed and tagger = tagged group by tag order by weight desc'; + + + + return 'select tag, count(tag) as weight from subscription left join profile_tag on tagger = subscribed where subscriber=%d and subscribed != subscriber and tagger = tagged and tag is not null group by tag order by weight desc'; + +// return 'select tag, count(tag) as weight from subscription left join profile_tag on tagger = subscriber where subscribed=%d and subscribed != subscriber and tagger = tagged and tag is not null group by tag order by weight desc'; } } + diff --git a/lib/subscriptionspeopletagcloudsection.php b/lib/subscriptionspeopletagcloudsection.php index c3f7d1763..f9c8672e3 100644 --- a/lib/subscriptionspeopletagcloudsection.php +++ b/lib/subscriptionspeopletagcloudsection.php @@ -54,6 +54,8 @@ class SubscriptionsPeopleTagCloudSection extends SubPeopleTagCloudSection } function query() { - return 'select tag, count(tag) as weight from subscription left join profile_tag on subscriber=tagger and subscribed=tagged where subscriber=%d and subscriber != subscribed group by tag order by weight desc'; +// return 'select tag, count(tag) as weight from subscription left join profile_tag on subscriber=tagger and subscribed=tagged where subscriber=%d and subscriber != subscribed group by tag order by weight desc'; + return 'select tag, count(tag) as weight from subscription left join profile_tag on subscriber=tagger and subscribed=tagged where subscriber=%d and subscriber != subscribed and tag is not null group by tag order by weight desc'; } } + -- cgit v1.2.3 From d71fbe9d9693cd5426be74807ff8f18fc6376c56 Mon Sep 17 00:00:00 2001 From: Robin Millette Date: Fri, 24 Apr 2009 20:28:39 +0000 Subject: fixed subscriptions dropdown action --- lib/galleryaction.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/galleryaction.php b/lib/galleryaction.php index 0484918ce..8fa11a756 100644 --- a/lib/galleryaction.php +++ b/lib/galleryaction.php @@ -134,9 +134,11 @@ class GalleryAction extends Action $this->elementStart('li', array('id'=>'filter_tags_item')); $this->elementStart('form', array('name' => 'bytag', 'id' => 'bytag', + 'action' => common_path('?action=' . $this->trimmed('action')), 'method' => 'post')); $this->dropdown('tag', _('Tag'), $content, _('Choose a tag to narrow list'), false, $tag); + $this->hidden('nickname', $this->user->nickname); $this->submit('submit', _('Go')); $this->elementEnd('form'); $this->elementEnd('li'); @@ -169,4 +171,4 @@ class GalleryAction extends Action { return array(); } -} \ No newline at end of file +} -- cgit v1.2.3 From 5e6eb27f843a22b80ac114f382682fba0c37589e Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sat, 25 Apr 2009 14:20:24 -0400 Subject: first pass at Comet plugin; doesn't yet update --- plugins/Comet/CometPlugin.php | 138 ++++++++++++++ plugins/Comet/bayeux.class.inc.php | 129 +++++++++++++ plugins/Comet/bayeux.class.inc.phps | 123 ++++++++++++ plugins/Comet/jquery.comet.js | 363 ++++++++++++++++++++++++++++++++++++ plugins/Comet/updatetimeline.js | 3 + 5 files changed, 756 insertions(+) create mode 100644 plugins/Comet/CometPlugin.php create mode 100644 plugins/Comet/bayeux.class.inc.php create mode 100644 plugins/Comet/bayeux.class.inc.phps create mode 100644 plugins/Comet/jquery.comet.js create mode 100644 plugins/Comet/updatetimeline.js diff --git a/plugins/Comet/CometPlugin.php b/plugins/Comet/CometPlugin.php new file mode 100644 index 000000000..10f8c198c --- /dev/null +++ b/plugins/Comet/CometPlugin.php @@ -0,0 +1,138 @@ +. + * + * @category Plugin + * @package Laconica + * @author Evan Prodromou + * @copyright 2009 Control Yourself, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + */ + +if (!defined('LACONICA')) { + exit(1); +} + +/** + * Plugin to do realtime updates using Comet + * + * @category Plugin + * @package Laconica + * @author Evan Prodromou + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + */ + +class CometPlugin extends Plugin +{ + var $server = null; + + function __construct($server=null) + { + $this->server = $server; + + parent::__construct(); + } + + function onEndShowScripts($action) + { + $timeline = null; + + switch ($action->trimmed('action')) { + case 'public': + $timeline = '/timelines/public'; + break; + default: + return true; + } + + $action->element('script', array('type' => 'text/javascript', + 'src' => common_path('plugins/Comet/jquery.comet.js')), + ' '); + $action->elementStart('script', array('type' => 'text/javascript')); + $action->raw("var _timelineServer = \"$this->server\"; ". + "var _timeline = \"$timeline\";"); + $action->elementEnd('script'); + $action->element('script', array('type' => 'text/javascript', + 'src' => common_path('plugins/Comet/updatetimeline.js')), + ' '); + return true; + } + + function onEndNoticeSave($notice) + { + $this->log(LOG_INFO, "Called for save notice."); + + $timelines = array(); + + // XXX: Add other timelines; this is just for the public one + + if ($notice->is_local || + ($notice->is_local == 0 && !common_config('public', 'localonly'))) { + $timelines[] = '/timelines/public'; + } + + if (count($timelines) > 0) { + // Require this, since we need it + require_once(INSTALLDIR.'/plugins/Comet/bayeux.class.inc.php'); + + $json = $this->noticeAsJson($notice); + + $this->log(LOG_DEBUG, "JSON = '$json'"); + + // Bayeux? Comet? Huh? These terms confuse me + $bay = new Bayeux($this->server); + + foreach ($timelines as $timeline) { + $this->log(LOG_INFO, "Posting notice $notice->id to '$timeline'."); + $bay->publish($timeline, $json); + $this->log(LOG_DEBUG, "Done posting notice $notice->id to '$timeline'."); + } + + $bay = NULL; + } + + $this->log(LOG_DEBUG, "All done."); + return true; + } + + function noticeAsJson($notice) + { + // FIXME: this code should be abstracted to a neutral third + // party, like Notice::asJson(). I'm not sure of the ethics + // of refactoring from within a plugin, so I'm just abusing + // the TwitterApiAction method. Don't do this unless you're me! + + require_once(INSTALLDIR.'/lib/twitterapi.php'); + + $act = new TwitterApiAction('/dev/null'); + + $arr = $act->twitter_status_array($notice, true); + return $arr; + } + + // Push this up to Plugin + + function log($level, $msg) + { + common_log($level, get_class($this) . ': '.$msg); + } +} diff --git a/plugins/Comet/bayeux.class.inc.php b/plugins/Comet/bayeux.class.inc.php new file mode 100644 index 000000000..602a7b644 --- /dev/null +++ b/plugins/Comet/bayeux.class.inc.php @@ -0,0 +1,129 @@ + http://morglog.alleycatracing.com + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +class Bayeux +{ + private $oCurl = ''; + private $nNextId = 0; + + public $sUrl = ''; + + function __construct($sUrl) + { + $this->sUrl = $sUrl; + + $this->oCurl = curl_init(); + + $aHeaders = array(); + $aHeaders[] = 'Connection: Keep-Alive'; + + curl_setopt($this->oCurl, CURLOPT_URL, $sUrl); + curl_setopt($this->oCurl, CURLOPT_HTTPHEADER, $aHeaders); + curl_setopt($this->oCurl, CURLOPT_HEADER, 0); + curl_setopt($this->oCurl, CURLOPT_POST, 1); + curl_setopt($this->oCurl, CURLOPT_RETURNTRANSFER,1); + + $this->handShake(); + } + + function __destruct() + { + $this->disconnect(); + } + + function handShake() + { + $msgHandshake = array(); + $msgHandshake['channel'] = '/meta/handshake'; + $msgHandshake['version'] = "1.0"; + $msgHandshake['minimumVersion'] = "0.9"; + $msgHandshake['supportedConnectionTypes'] = array('long-polling'); + $msgHandshake['id'] = $this->nNextId++; + + curl_setopt($this->oCurl, CURLOPT_POSTFIELDS, "message=".urlencode(str_replace('\\', '', json_encode(array($msgHandshake))))); + + $data = curl_exec($this->oCurl); + + if(curl_errno($this->oCurl)) + die("Error: " . curl_error($this->oCurl)); + + $oReturn = json_decode($data); + + common_debug(print_r($oReturn, true)); + + if (is_array($oReturn)) { + $oReturn = $oReturn[0]; + } + + $bSuccessful = ($oReturn->successful) ? true : false; + + if($bSuccessful) + { + $this->clientId = $oReturn->clientId; + + $this->connect(); + } + } + + public function connect() + { + $aMsg['channel'] = '/meta/connect'; + $aMsg['id'] = $this->nNextId++; + $aMsg['clientId'] = $this->clientId; + $aMsg['connectionType'] = 'long-polling'; + + curl_setopt($this->oCurl, CURLOPT_POSTFIELDS, "message=".urlencode(str_replace('\\', '', json_encode(array($aMsg))))); + + $data = curl_exec($this->oCurl); + } + + function disconnect() + { + $msgHandshake = array(); + $msgHandshake['channel'] = '/meta/disconnect'; + $msgHandshake['id'] = $this->nNextId++; + $msgHandshake['clientId'] = $this->clientId; + + curl_setopt($this->oCurl, CURLOPT_POSTFIELDS, "message=".urlencode(str_replace('\\', '', json_encode(array($msgHandshake))))); + + curl_exec($this->oCurl); + } + + public function publish($sChannel, $oData) + { + if(!$sChannel || !$oData) + return; + + $aMsg = array(); + + $aMsg['channel'] = $sChannel; + $aMsg['id'] = $this->nNextId++; + $aMsg['data'] = $oData; + $aMsg['clientId'] = $this->clientId; + + curl_setopt($this->oCurl, CURLOPT_POSTFIELDS, "message=".urlencode(str_replace('\\', '', json_encode(array($aMsg))))); + + $data = curl_exec($this->oCurl); +// var_dump($data); + } +} diff --git a/plugins/Comet/bayeux.class.inc.phps b/plugins/Comet/bayeux.class.inc.phps new file mode 100644 index 000000000..ea004a453 --- /dev/null +++ b/plugins/Comet/bayeux.class.inc.phps @@ -0,0 +1,123 @@ + http://morglog.alleycatracing.com + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +class Bayeux + { + private $oCurl = ''; + private $nNextId = 0; + + public $sUrl = ''; + + function __construct($sUrl) + { + $this->sUrl = $sUrl; + + $this->oCurl = curl_init(); + + $aHeaders = array(); + $aHeaders[] = 'Connection: Keep-Alive'; + + curl_setopt($this->oCurl, CURLOPT_URL, $sUrl); + curl_setopt($this->oCurl, CURLOPT_HTTPHEADER, $aHeaders); + curl_setopt($this->oCurl, CURLOPT_HEADER, 0); + curl_setopt($this->oCurl, CURLOPT_POST, 1); + curl_setopt($this->oCurl, CURLOPT_RETURNTRANSFER,1); + + $this->handShake(); + } + + function __destruct() + { + $this->disconnect(); + } + + function handShake() + { + $msgHandshake = array(); + $msgHandshake['channel'] = '/meta/handshake'; + $msgHandshake['version'] = "1.0"; + $msgHandshake['minimumVersion'] = "0.9"; + $msgHandshake['id'] = $this->nNextId++; + + curl_setopt($this->oCurl, CURLOPT_POSTFIELDS, "message=".urlencode(str_replace('\\', '', json_encode(array($msgHandshake))))); + + $data = curl_exec($this->oCurl); + + if(curl_errno($this->oCurl)) + die("Error: " . curl_error($this->oCurl)); + + $oReturn = json_decode($data); + $oReturn = $oReturn[0]; + + $bSuccessful = ($oReturn->successful) ? true : false; + + if($bSuccessful) + { + $this->clientId = $oReturn->clientId; + + $this->connect(); + } + } + + public function connect() + { + $aMsg['channel'] = '/meta/connect'; + $aMsg['id'] = $this->nNextId++; + $aMsg['clientId'] = $this->clientId; + $aMsg['connectionType'] = 'long-polling'; + + curl_setopt($this->oCurl, CURLOPT_POSTFIELDS, "message=".urlencode(str_replace('\\', '', json_encode(array($aMsg))))); + + $data = curl_exec($this->oCurl); + } + + function disconnect() + { + $msgHandshake = array(); + $msgHandshake['channel'] = '/meta/disconnect'; + $msgHandshake['id'] = $this->nNextId++; + $msgHandshake['clientId'] = $this->clientId; + + curl_setopt($this->oCurl, CURLOPT_POSTFIELDS, "message=".urlencode(str_replace('\\', '', json_encode(array($msgHandshake))))); + + curl_exec($this->oCurl); + } + + public function publish($sChannel, $oData) + { + if(!$sChannel || !$oData) + return; + + $aMsg = array(); + + $aMsg['channel'] = $sChannel; + $aMsg['id'] = $this->nNextId++; + $aMsg['data'] = $oData; + $aMsg['clientId'] = $this->clientId; + + curl_setopt($this->oCurl, CURLOPT_POSTFIELDS, "message=".urlencode(str_replace('\\', '', json_encode(array($aMsg))))); + + $data = curl_exec($this->oCurl); +// var_dump($data); + } + } diff --git a/plugins/Comet/jquery.comet.js b/plugins/Comet/jquery.comet.js new file mode 100644 index 000000000..2124e882c --- /dev/null +++ b/plugins/Comet/jquery.comet.js @@ -0,0 +1,363 @@ +(function($) +{ + var msgHandshake = + { + version: '1.0', + minimumVersion: '0.9', + channel: '/meta/handshake' + }; + + var oTransport = function() + { + this._bXD = + (($.comet._sUrl.substring(0,4) == 'http') && ($.comet._sUrl.substr(7,location.href.length).replace(/\/.*/, '') != location.host)) + ? + true + :false; + + this.connectionType = (this._bXD) ? 'callback-polling' : 'long-polling'; + + this.startup = function(oReturn) + { + if(this._comet._bConnected) return; + this.tunnelInit(); + }; + + this.tunnelInit = function() + { + var msgConnect = + { + channel: '/meta/connect', + clientId: $.comet.clientId, + id: String($.comet._nNextId++), + connectionType: $.comet._oTransport.connectionType + }; + + this.openTunnel(msgConnect); + }; + + this.openTunnel = function(oMsg) + { + $.comet._bPolling = true; + + this._send($.comet._sUrl, oMsg, function(sReturn) + { + var oReturn = (typeof sReturn != "object") ? (eval('(' + sReturn + ')')) : sReturn; + $.comet._bPolling = false; + $.comet.deliver(oReturn); + $.comet._oTransport.closeTunnel(); + }); + }; + + this.closeTunnel = function() + { + if(!$.comet._bInitialized) return; + + if($.comet._advice) + { + if($.comet._advice.reconnect == 'none') return; + + if($.comet._advice.interval > 0) + { + setTimeout($.comet._oTransport._connect, $.comet._advice.interval); + } + else + { + $.comet._oTransport._connect(); + } + } + else + { + $.comet._oTransport._connect(); + } + }; + + this._connect = function() + { + if(!$.comet._bInitialized) return; + + if($.comet._bPolling) return; + + if($.comet._advice && $.comet._advice.reconnect == 'handshake') + { + $.comet._bConnected = false; + $.comet.init($.comet._sUrl); + } + else if($.comet._bConnected) + { + var msgConnect = + { + //jsonp: 'test', + clientId: $.comet.clientId, + id: String($.comet._nNextId++), + channel: '/meta/connect', + connectionType: $.comet._oTransport.connectionType + }; + $.comet._oTransport.openTunnel(msgConnect); + } + }; + + this._send = function(sUrl, oMsg, fCallback) { + //default callback will check advice, deliver messages, and reconnect + var fCallback = (fCallback) ? fCallback : function(sReturn) + { + var oReturn = (typeof sReturn != "object") ? (eval('(' + sReturn + ')')) : sReturn; + + $.comet.deliver(oReturn); + + if($.comet._advice) + { + if($.comet._advice.reconnect == 'none') + return; + + if($.comet._advice.interval > 0) + { + setTimeout($.comet._oTransport._connect, $.comet._advice.interval); + } + else + { + $.comet._oTransport._connect(); + } + } + else + { + $.comet._oTransport._connect(); + } + }; + + //regular AJAX for same domain calls + if((!this._bXD) && (this.connectionType == 'long-polling')) + { + this._pollRequest = $.ajax({ + url: sUrl, + type: 'post', + beforeSend: function(oXhr) { oXhr.setRequestHeader('Connection', 'Keep-Alive'); }, + data: { message: JSON.stringify(oMsg) }, + success: fCallback + }); + } + else // JSONP callback for cross domain + { + this._pollRequest = $.ajax({ + url: sUrl, + dataType: 'jsonp', + jsonp: 'jsonp', + beforeSend: function(oXhr) { oXhr.setRequestHeader('Connection', 'Keep-Alive'); }, + data: + { + message: JSON.stringify($.extend(oMsg,{connectionType: 'callback-polling' })) + }, + success: fCallback + }); + } + } + }; + + $.comet = new function() + { + this.CONNECTED = 'CONNECTED'; + this.CONNECTING = 'CONNECTING'; + this.DISCONNECTED = 'DISCONNECTED'; + this.DISCONNECTING = 'DISCONNECTING'; + + this._aMessageQueue = []; + this._aSubscriptions = []; + this._aSubscriptionCallbacks = []; + this._bInitialized = false; + this._bConnected = false; + this._nBatch = 0; + this._nNextId = 0; + // just define the transport, do not assign it yet. + this._oTransport = ''; //oTransport; + this._sUrl = ''; + + this.supportedConectionTypes = [ 'long-polling', 'callback-polling' ]; + + this.clientId = ''; + + this._bTrigger = true; // this sends $.event.trigger(channel, data) + + this.init = function(sUrl) + { + this._sUrl = (sUrl) ? sUrl : '/cometd'; + + this._oTransport = new oTransport(); + + this._aMessageQueue = []; + this._aSubscriptions = []; + this._bInitialized = true; + this.startBatch(); + + var oMsg = $.extend(msgHandshake, {id: String(this._nNextId++)}); + + this._oTransport._send(this._sUrl, oMsg, $.comet._finishInit); + }; + + this._finishInit = function(sReturn) + { + var oReturn = (typeof sReturn != "object") ? (eval('(' + sReturn + ')')[0]) : sReturn[0]; + + if(oReturn.advice) + $.comet._advice = oReturn.advice; + + var bSuccess = (oReturn.successful) ? oReturn.successful : false; + // do version check + + if(bSuccess) + { + // pick transport ? + // ...... + + $.comet._oTransport._comet = $.comet; + $.comet._oTransport.version = $.comet.version; + + $.comet.clientId = oReturn.clientId; + $.comet._oTransport.startup(oReturn); + $.comet.endBatch(); + } + }; + + this._sendMessage = function(oMsg) + { + if($.comet._nBatch <= 0) + { + if(oMsg.length > 0) + for(var i in oMsg) + { + oMsg[i].clientId = String($.comet.clientId); + oMsg[i].id = String($.comet._nNextId++); + } + else + { + oMsg.clientId = String($.comet.clientId); + oMsg.id = String($.comet._nNextId++); + } + + $.comet._oTransport._send($.comet._sUrl, oMsg); + } + else + { + $.comet._aMessageQueue.push(oMsg); + } + }; + + + this.startBatch = function() { this._nBatch++ }; + this.endBatch = function() { + if(--this._nBatch <= 0) + { + this._nBatch = 0; + if(this._aMessageQueue.length > 0) + { + this._sendMessage(this._aMessageQueue); + this._aMessageQueue = []; + } + } + }; + + this.subscribe = function(sSubscription, fCallback) + { + // if this topic has not been subscribed to yet, send the message now + if(!this._aSubscriptions[sSubscription]) + { + this._aSubscriptions.push(sSubscription) + + if (fCallback) { + this._aSubscriptionCallbacks[sSubscription] = fCallback; + } + + this._sendMessage({ channel: '/meta/subscribe', subscription: sSubscription }); + } + + //$.event.add(window, sSubscription, fCallback); + }; + + this.unsubscribe = function(sSubscription) { + $.comet._sendMessage({ channel: '/meta/unsubscribe', subscription: sSubscription }); + }; + + this.publish = function(sChannel, oData) + { + $.comet._sendMessage({channel: sChannel, data: oData}); + }; + + this.deliver = function(sReturn) + { + var oReturn = sReturn;//eval(sReturn); + + $(oReturn).each(function() + { + $.comet._deliver(this); + }); + }; + + this.disconnect = function() + { + $($.comet._aSubscriptions).each(function(i) + { + $.comet.unsubscribe($.comet._aSubscriptions[i]); + }); + + $.comet._sendMessage({channel:'/meta/disconnect'}); + + $.comet._bInitialized = false; + } + + this._deliver = function(oMsg,oData) + { + if(oMsg.advice) + { + $.comet._advice = oMsg.advice; + } + + switch(oMsg.channel) + { + case '/meta/connect': + if(oMsg.successful && !$.comet._bConnected) + { + $.comet._bConnected = $.comet._bInitialized; + $.comet.endBatch(); + /* + $.comet._sendMessage(msgConnect); + */ + } + else + {} + //$.comet._bConnected = false; + break; + + // add in subscription handling stuff + case '/meta/subscribe': + if(!oMsg.successful) + { + $.comet._oTransport._cancelConnect(); + return; + } + break; + + case '/meta/unsubscribe': + if(!oMsg.successful) + { + $.comet._oTransport._cancelConnect(); + return; + } + break; + + } + + if(oMsg.data) + { + if($.comet._bTrigger) + { + $.event.trigger(oMsg.channel, [oMsg]); + } + + var cb = $.comet._aSubscriptionCallbacks[oMsg.channel]; + if (cb) { + cb(oMsg); + } + } + }; +}; + +})(jQuery); diff --git a/plugins/Comet/updatetimeline.js b/plugins/Comet/updatetimeline.js new file mode 100644 index 000000000..f4da1f47c --- /dev/null +++ b/plugins/Comet/updatetimeline.js @@ -0,0 +1,3 @@ +// update the local timeline from a Comet server +// + -- cgit v1.2.3 From 056d0a2555bb6783a2bb4632d2c6ad9f52dde5ec Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sat, 25 Apr 2009 14:20:57 -0400 Subject: remove unused duplicate file --- plugins/Comet/bayeux.class.inc.phps | 123 ------------------------------------ 1 file changed, 123 deletions(-) delete mode 100644 plugins/Comet/bayeux.class.inc.phps diff --git a/plugins/Comet/bayeux.class.inc.phps b/plugins/Comet/bayeux.class.inc.phps deleted file mode 100644 index ea004a453..000000000 --- a/plugins/Comet/bayeux.class.inc.phps +++ /dev/null @@ -1,123 +0,0 @@ - http://morglog.alleycatracing.com - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -class Bayeux - { - private $oCurl = ''; - private $nNextId = 0; - - public $sUrl = ''; - - function __construct($sUrl) - { - $this->sUrl = $sUrl; - - $this->oCurl = curl_init(); - - $aHeaders = array(); - $aHeaders[] = 'Connection: Keep-Alive'; - - curl_setopt($this->oCurl, CURLOPT_URL, $sUrl); - curl_setopt($this->oCurl, CURLOPT_HTTPHEADER, $aHeaders); - curl_setopt($this->oCurl, CURLOPT_HEADER, 0); - curl_setopt($this->oCurl, CURLOPT_POST, 1); - curl_setopt($this->oCurl, CURLOPT_RETURNTRANSFER,1); - - $this->handShake(); - } - - function __destruct() - { - $this->disconnect(); - } - - function handShake() - { - $msgHandshake = array(); - $msgHandshake['channel'] = '/meta/handshake'; - $msgHandshake['version'] = "1.0"; - $msgHandshake['minimumVersion'] = "0.9"; - $msgHandshake['id'] = $this->nNextId++; - - curl_setopt($this->oCurl, CURLOPT_POSTFIELDS, "message=".urlencode(str_replace('\\', '', json_encode(array($msgHandshake))))); - - $data = curl_exec($this->oCurl); - - if(curl_errno($this->oCurl)) - die("Error: " . curl_error($this->oCurl)); - - $oReturn = json_decode($data); - $oReturn = $oReturn[0]; - - $bSuccessful = ($oReturn->successful) ? true : false; - - if($bSuccessful) - { - $this->clientId = $oReturn->clientId; - - $this->connect(); - } - } - - public function connect() - { - $aMsg['channel'] = '/meta/connect'; - $aMsg['id'] = $this->nNextId++; - $aMsg['clientId'] = $this->clientId; - $aMsg['connectionType'] = 'long-polling'; - - curl_setopt($this->oCurl, CURLOPT_POSTFIELDS, "message=".urlencode(str_replace('\\', '', json_encode(array($aMsg))))); - - $data = curl_exec($this->oCurl); - } - - function disconnect() - { - $msgHandshake = array(); - $msgHandshake['channel'] = '/meta/disconnect'; - $msgHandshake['id'] = $this->nNextId++; - $msgHandshake['clientId'] = $this->clientId; - - curl_setopt($this->oCurl, CURLOPT_POSTFIELDS, "message=".urlencode(str_replace('\\', '', json_encode(array($msgHandshake))))); - - curl_exec($this->oCurl); - } - - public function publish($sChannel, $oData) - { - if(!$sChannel || !$oData) - return; - - $aMsg = array(); - - $aMsg['channel'] = $sChannel; - $aMsg['id'] = $this->nNextId++; - $aMsg['data'] = $oData; - $aMsg['clientId'] = $this->clientId; - - curl_setopt($this->oCurl, CURLOPT_POSTFIELDS, "message=".urlencode(str_replace('\\', '', json_encode(array($aMsg))))); - - $data = curl_exec($this->oCurl); -// var_dump($data); - } - } -- cgit v1.2.3 From 262dbeac787ad3aecb28c470484eb3fc8d036d93 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 26 Apr 2009 12:06:50 -0400 Subject: Some updates for testing Comet --- plugins/Comet/bayeux.class.inc.php | 2 - plugins/Comet/jquery.comet.js | 1814 ++++++++++++++++++++++++++++-------- plugins/Comet/updatetimeline.js | 27 + 3 files changed, 1478 insertions(+), 365 deletions(-) diff --git a/plugins/Comet/bayeux.class.inc.php b/plugins/Comet/bayeux.class.inc.php index 602a7b644..785d3e393 100644 --- a/plugins/Comet/bayeux.class.inc.php +++ b/plugins/Comet/bayeux.class.inc.php @@ -69,8 +69,6 @@ class Bayeux $oReturn = json_decode($data); - common_debug(print_r($oReturn, true)); - if (is_array($oReturn)) { $oReturn = $oReturn[0]; } diff --git a/plugins/Comet/jquery.comet.js b/plugins/Comet/jquery.comet.js index 2124e882c..6de437fa8 100644 --- a/plugins/Comet/jquery.comet.js +++ b/plugins/Comet/jquery.comet.js @@ -1,363 +1,1451 @@ -(function($) -{ - var msgHandshake = - { - version: '1.0', - minimumVersion: '0.9', - channel: '/meta/handshake' - }; - - var oTransport = function() - { - this._bXD = - (($.comet._sUrl.substring(0,4) == 'http') && ($.comet._sUrl.substr(7,location.href.length).replace(/\/.*/, '') != location.host)) - ? - true - :false; - - this.connectionType = (this._bXD) ? 'callback-polling' : 'long-polling'; - - this.startup = function(oReturn) - { - if(this._comet._bConnected) return; - this.tunnelInit(); - }; - - this.tunnelInit = function() - { - var msgConnect = - { - channel: '/meta/connect', - clientId: $.comet.clientId, - id: String($.comet._nNextId++), - connectionType: $.comet._oTransport.connectionType - }; - - this.openTunnel(msgConnect); - }; - - this.openTunnel = function(oMsg) - { - $.comet._bPolling = true; - - this._send($.comet._sUrl, oMsg, function(sReturn) - { - var oReturn = (typeof sReturn != "object") ? (eval('(' + sReturn + ')')) : sReturn; - $.comet._bPolling = false; - $.comet.deliver(oReturn); - $.comet._oTransport.closeTunnel(); - }); - }; - - this.closeTunnel = function() - { - if(!$.comet._bInitialized) return; - - if($.comet._advice) - { - if($.comet._advice.reconnect == 'none') return; - - if($.comet._advice.interval > 0) - { - setTimeout($.comet._oTransport._connect, $.comet._advice.interval); - } - else - { - $.comet._oTransport._connect(); - } - } - else - { - $.comet._oTransport._connect(); - } - }; - - this._connect = function() - { - if(!$.comet._bInitialized) return; - - if($.comet._bPolling) return; - - if($.comet._advice && $.comet._advice.reconnect == 'handshake') - { - $.comet._bConnected = false; - $.comet.init($.comet._sUrl); - } - else if($.comet._bConnected) - { - var msgConnect = - { - //jsonp: 'test', - clientId: $.comet.clientId, - id: String($.comet._nNextId++), - channel: '/meta/connect', - connectionType: $.comet._oTransport.connectionType - }; - $.comet._oTransport.openTunnel(msgConnect); - } - }; - - this._send = function(sUrl, oMsg, fCallback) { - //default callback will check advice, deliver messages, and reconnect - var fCallback = (fCallback) ? fCallback : function(sReturn) - { - var oReturn = (typeof sReturn != "object") ? (eval('(' + sReturn + ')')) : sReturn; - - $.comet.deliver(oReturn); - - if($.comet._advice) - { - if($.comet._advice.reconnect == 'none') - return; - - if($.comet._advice.interval > 0) - { - setTimeout($.comet._oTransport._connect, $.comet._advice.interval); - } - else - { - $.comet._oTransport._connect(); - } - } - else - { - $.comet._oTransport._connect(); - } - }; - - //regular AJAX for same domain calls - if((!this._bXD) && (this.connectionType == 'long-polling')) - { - this._pollRequest = $.ajax({ - url: sUrl, - type: 'post', - beforeSend: function(oXhr) { oXhr.setRequestHeader('Connection', 'Keep-Alive'); }, - data: { message: JSON.stringify(oMsg) }, - success: fCallback - }); - } - else // JSONP callback for cross domain - { - this._pollRequest = $.ajax({ - url: sUrl, - dataType: 'jsonp', - jsonp: 'jsonp', - beforeSend: function(oXhr) { oXhr.setRequestHeader('Connection', 'Keep-Alive'); }, - data: - { - message: JSON.stringify($.extend(oMsg,{connectionType: 'callback-polling' })) - }, - success: fCallback - }); - } - } - }; - - $.comet = new function() - { - this.CONNECTED = 'CONNECTED'; - this.CONNECTING = 'CONNECTING'; - this.DISCONNECTED = 'DISCONNECTED'; - this.DISCONNECTING = 'DISCONNECTING'; - - this._aMessageQueue = []; - this._aSubscriptions = []; - this._aSubscriptionCallbacks = []; - this._bInitialized = false; - this._bConnected = false; - this._nBatch = 0; - this._nNextId = 0; - // just define the transport, do not assign it yet. - this._oTransport = ''; //oTransport; - this._sUrl = ''; - - this.supportedConectionTypes = [ 'long-polling', 'callback-polling' ]; - - this.clientId = ''; - - this._bTrigger = true; // this sends $.event.trigger(channel, data) - - this.init = function(sUrl) - { - this._sUrl = (sUrl) ? sUrl : '/cometd'; - - this._oTransport = new oTransport(); - - this._aMessageQueue = []; - this._aSubscriptions = []; - this._bInitialized = true; - this.startBatch(); - - var oMsg = $.extend(msgHandshake, {id: String(this._nNextId++)}); - - this._oTransport._send(this._sUrl, oMsg, $.comet._finishInit); - }; - - this._finishInit = function(sReturn) - { - var oReturn = (typeof sReturn != "object") ? (eval('(' + sReturn + ')')[0]) : sReturn[0]; - - if(oReturn.advice) - $.comet._advice = oReturn.advice; - - var bSuccess = (oReturn.successful) ? oReturn.successful : false; - // do version check - - if(bSuccess) - { - // pick transport ? - // ...... - - $.comet._oTransport._comet = $.comet; - $.comet._oTransport.version = $.comet.version; - - $.comet.clientId = oReturn.clientId; - $.comet._oTransport.startup(oReturn); - $.comet.endBatch(); - } - }; - - this._sendMessage = function(oMsg) - { - if($.comet._nBatch <= 0) - { - if(oMsg.length > 0) - for(var i in oMsg) - { - oMsg[i].clientId = String($.comet.clientId); - oMsg[i].id = String($.comet._nNextId++); - } - else - { - oMsg.clientId = String($.comet.clientId); - oMsg.id = String($.comet._nNextId++); - } - - $.comet._oTransport._send($.comet._sUrl, oMsg); - } - else - { - $.comet._aMessageQueue.push(oMsg); - } - }; - - - this.startBatch = function() { this._nBatch++ }; - this.endBatch = function() { - if(--this._nBatch <= 0) - { - this._nBatch = 0; - if(this._aMessageQueue.length > 0) - { - this._sendMessage(this._aMessageQueue); - this._aMessageQueue = []; - } - } - }; - - this.subscribe = function(sSubscription, fCallback) - { - // if this topic has not been subscribed to yet, send the message now - if(!this._aSubscriptions[sSubscription]) - { - this._aSubscriptions.push(sSubscription) - - if (fCallback) { - this._aSubscriptionCallbacks[sSubscription] = fCallback; - } - - this._sendMessage({ channel: '/meta/subscribe', subscription: sSubscription }); - } - - //$.event.add(window, sSubscription, fCallback); - }; - - this.unsubscribe = function(sSubscription) { - $.comet._sendMessage({ channel: '/meta/unsubscribe', subscription: sSubscription }); - }; - - this.publish = function(sChannel, oData) - { - $.comet._sendMessage({channel: sChannel, data: oData}); - }; - - this.deliver = function(sReturn) - { - var oReturn = sReturn;//eval(sReturn); - - $(oReturn).each(function() - { - $.comet._deliver(this); - }); - }; - - this.disconnect = function() - { - $($.comet._aSubscriptions).each(function(i) - { - $.comet.unsubscribe($.comet._aSubscriptions[i]); - }); - - $.comet._sendMessage({channel:'/meta/disconnect'}); - - $.comet._bInitialized = false; - } - - this._deliver = function(oMsg,oData) - { - if(oMsg.advice) - { - $.comet._advice = oMsg.advice; - } - - switch(oMsg.channel) - { - case '/meta/connect': - if(oMsg.successful && !$.comet._bConnected) - { - $.comet._bConnected = $.comet._bInitialized; - $.comet.endBatch(); - /* - $.comet._sendMessage(msgConnect); - */ - } - else - {} - //$.comet._bConnected = false; - break; - - // add in subscription handling stuff - case '/meta/subscribe': - if(!oMsg.successful) - { - $.comet._oTransport._cancelConnect(); - return; - } - break; - - case '/meta/unsubscribe': - if(!oMsg.successful) - { - $.comet._oTransport._cancelConnect(); - return; - } - break; - - } - - if(oMsg.data) - { - if($.comet._bTrigger) - { - $.event.trigger(oMsg.channel, [oMsg]); - } - - var cb = $.comet._aSubscriptionCallbacks[oMsg.channel]; - if (cb) { - cb(oMsg); - } - } - }; -}; - -})(jQuery); +/** + * Copyright 2008 Mort Bay Consulting Pty. Ltd. + * Dual licensed under the Apache License 2.0 and the MIT license. + * ---------------------------------------------------------------------------- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http: *www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ---------------------------------------------------------------------------- + * Licensed under the MIT license; + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * ---------------------------------------------------------------------------- + * $Revision$ $Date$ + */ +(function($) +{ + /** + * The constructor for a Comet object. + * There is a default Comet instance already created at the variable $.cometd, + * and hence that can be used to start a comet conversation with a server. + * In the rare case a page needs more than one comet conversation, a new instance can be + * created via: + *
+     * var url2 = ...;
+     * var cometd2 = new $.Cometd();
+     * cometd2.init(url2);
+     * 
+ */ + $.Cometd = function(name) + { + var _name = name || 'default'; + var _logPriorities = { debug: 1, info: 2, warn: 3, error: 4 }; + var _logLevel = 'info'; + var _url; + var _xd = false; + var _transport; + var _status = 'disconnected'; + var _messageId = 0; + var _clientId = null; + var _batch = 0; + var _messageQueue = []; + var _listeners = {}; + var _backoff = 0; + var _backoffIncrement = 1000; + var _maxBackoff = 60000; + var _scheduledSend = null; + var _extensions = []; + var _advice = {}; + var _handshakeProps; + + /** + * Returns the name assigned to this Comet object, or the string 'default' + * if no name has been explicitely passed as parameter to the constructor. + */ + this.getName = function() + { + return _name; + }; + + /** + * Configures the initial comet communication with the comet server. + * @param cometURL the URL of the comet server + */ + this.configure = function(cometURL) + { + _configure(cometURL); + }; + + function _configure(cometURL) + { + _url = cometURL; + _debug('Initializing comet with url: {}', _url); + + // Check immediately if we're cross domain + // If cross domain, the handshake must not send the long polling transport type + var urlParts = /(^https?:)?(\/\/(([^:\/\?#]+)(:(\d+))?))?([^\?#]*)/.exec(cometURL); + if (urlParts[3]) _xd = urlParts[3] != location.host; + + // Temporary setup a transport to send the initial handshake + // The transport may be changed as a result of handshake + if (_xd) + _transport = newCallbackPollingTransport(); + else + _transport = newLongPollingTransport(); + _debug('Initial transport is {}', _transport.getType()); + }; + + /** + * Configures and establishes the comet communication with the comet server + * via a handshake and a subsequent connect. + * @param cometURL the URL of the comet server + * @param handshakeProps an object to be merged with the handshake message + * @see #configure(cometURL) + * @see #handshake(handshakeProps) + */ + this.init = function(cometURL, handshakeProps) + { + _configure(cometURL); + _handshake(handshakeProps); + }; + + /** + * Establishes the comet communication with the comet server + * via a handshake and a subsequent connect. + * @param handshakeProps an object to be merged with the handshake message + */ + this.handshake = function(handshakeProps) + { + _handshake(handshakeProps); + }; + + /** + * Disconnects from the comet server. + * @param disconnectProps an object to be merged with the disconnect message + */ + this.disconnect = function(disconnectProps) + { + var bayeuxMessage = { + channel: '/meta/disconnect' + }; + var message = $.extend({}, disconnectProps, bayeuxMessage); + // Deliver immediately + // The handshake and connect mechanism make use of startBatch(), and in case + // of a failed handshake the disconnect would not be delivered if using _send(). + _setStatus('disconnecting'); + _deliver([message], false); + }; + + /** + * Marks the start of a batch of application messages to be sent to the server + * in a single request, obtaining a single response containing (possibly) many + * application reply messages. + * Messages are held in a queue and not sent until {@link #endBatch()} is called. + * If startBatch() is called multiple times, then an equal number of endBatch() + * calls must be made to close and send the batch of messages. + * @see #endBatch() + */ + this.startBatch = function() + { + _startBatch(); + }; + + /** + * Marks the end of a batch of application messages to be sent to the server + * in a single request. + * @see #startBatch() + */ + this.endBatch = function() + { + _endBatch(true); + }; + + /** + * Subscribes to the given channel, performing the given callback in the given scope + * when a message for the channel arrives. + * @param channel the channel to subscribe to + * @param scope the scope of the callback + * @param callback the callback to call when a message is delivered to the channel + * @param subscribeProps an object to be merged with the subscribe message + * @return the subscription handle to be passed to {@link #unsubscribe(object)} + */ + this.subscribe = function(channel, scope, callback, subscribeProps) + { + var subscription = this.addListener(channel, scope, callback); + + // Send the subscription message after the subscription registration to avoid + // races where the server would deliver a message to the subscribers, but here + // on the client the subscription has not been added yet to the data structures + var bayeuxMessage = { + channel: '/meta/subscribe', + subscription: channel + }; + var message = $.extend({}, subscribeProps, bayeuxMessage); + _send(message); + + return subscription; + }; + + /** + * Unsubscribes the subscription obtained with a call to {@link #subscribe(string, object, function)}. + * @param subscription the subscription to unsubscribe. + */ + this.unsubscribe = function(subscription, unsubscribeProps) + { + // Remove the local listener before sending the message + // This ensures that if the server fails, this client does not get notifications + this.removeListener(subscription); + var bayeuxMessage = { + channel: '/meta/unsubscribe', + subscription: subscription[0] + }; + var message = $.extend({}, unsubscribeProps, bayeuxMessage); + _send(message); + }; + + /** + * Publishes a message on the given channel, containing the given content. + * @param channel the channel to publish the message to + * @param content the content of the message + * @param publishProps an object to be merged with the publish message + */ + this.publish = function(channel, content, publishProps) + { + var bayeuxMessage = { + channel: channel, + data: content + }; + var message = $.extend({}, publishProps, bayeuxMessage); + _send(message); + }; + + /** + * Adds a listener for bayeux messages, performing the given callback in the given scope + * when a message for the given channel arrives. + * @param channel the channel the listener is interested to + * @param scope the scope of the callback + * @param callback the callback to call when a message is delivered to the channel + * @returns the subscription handle to be passed to {@link #removeListener(object)} + * @see #removeListener(object) + */ + this.addListener = function(channel, scope, callback) + { + // The data structure is a map, where each subscription + // holds the callback to be called and its scope. + + // Normalize arguments + if (!callback) + { + callback = scope; + scope = undefined; + } + + var subscription = { + scope: scope, + callback: callback + }; + + var subscriptions = _listeners[channel]; + if (!subscriptions) + { + subscriptions = []; + _listeners[channel] = subscriptions; + } + // Pushing onto an array appends at the end and returns the id associated with the element increased by 1. + // Note that if: + // a.push('a'); var hb=a.push('b'); delete a[hb-1]; var hc=a.push('c'); + // then: + // hc==3, a.join()=='a',,'c', a.length==3 + var subscriptionIndex = subscriptions.push(subscription) - 1; + _debug('Added listener: channel \'{}\', callback \'{}\', index {}', channel, callback.name, subscriptionIndex); + + // The subscription to allow removal of the listener is made of the channel and the index + return [channel, subscriptionIndex]; + }; + + /** + * Removes the subscription obtained with a call to {@link #addListener(string, object, function)}. + * @param subscription the subscription to unsubscribe. + */ + this.removeListener = function(subscription) + { + var subscriptions = _listeners[subscription[0]]; + if (subscriptions) + { + delete subscriptions[subscription[1]]; + _debug('Removed listener: channel \'{}\', index {}', subscription[0], subscription[1]); + } + }; + + /** + * Removes all listeners registered with {@link #addListener(channel, scope, callback)} or + * {@link #subscribe(channel, scope, callback)}. + */ + this.clearListeners = function() + { + _listeners = {}; + }; + + /** + * Returns a string representing the status of the bayeux communication with the comet server. + */ + this.getStatus = function() + { + return _status; + }; + + /** + * Sets the backoff period used to increase the backoff time when retrying an unsuccessful or failed message. + * Default value is 1 second, which means if there is a persistent failure the retries will happen + * after 1 second, then after 2 seconds, then after 3 seconds, etc. So for example with 15 seconds of + * elapsed time, there will be 5 retries (at 1, 3, 6, 10 and 15 seconds elapsed). + * @param period the backoff period to set + * @see #getBackoffIncrement() + */ + this.setBackoffIncrement = function(period) + { + _backoffIncrement = period; + }; + + /** + * Returns the backoff period used to increase the backoff time when retrying an unsuccessful or failed message. + * @see #setBackoffIncrement(period) + */ + this.getBackoffIncrement = function() + { + return _backoffIncrement; + }; + + /** + * Returns the backoff period to wait before retrying an unsuccessful or failed message. + */ + this.getBackoffPeriod = function() + { + return _backoff; + }; + + /** + * Sets the log level for console logging. + * Valid values are the strings 'error', 'warn', 'info' and 'debug', from + * less verbose to more verbose. + * @param level the log level string + */ + this.setLogLevel = function(level) + { + _logLevel = level; + }; + + /** + * Registers an extension whose callbacks are called for every incoming message + * (that comes from the server to this client implementation) and for every + * outgoing message (that originates from this client implementation for the + * server). + * The format of the extension object is the following: + *
+         * {
+         *     incoming: function(message) { ... },
+         *     outgoing: function(message) { ... }
+         * }
+         * Both properties are optional, but if they are present they will be called
+         * respectively for each incoming message and for each outgoing message.
+         * 
+ * @param name the name of the extension + * @param extension the extension to register + * @return true if the extension was registered, false otherwise + * @see #unregisterExtension(name) + */ + this.registerExtension = function(name, extension) + { + var existing = false; + for (var i = 0; i < _extensions.length; ++i) + { + var existingExtension = _extensions[i]; + if (existingExtension.name == name) + { + existing = true; + return false; + } + } + if (!existing) + { + _extensions.push({ + name: name, + extension: extension + }); + _debug('Registered extension \'{}\'', name); + return true; + } + else + { + _info('Could not register extension with name \'{}\': another extension with the same name already exists'); + return false; + } + }; + + /** + * Unregister an extension previously registered with + * {@link #registerExtension(name, extension)}. + * @param name the name of the extension to unregister. + * @return true if the extension was unregistered, false otherwise + */ + this.unregisterExtension = function(name) + { + var unregistered = false; + $.each(_extensions, function(index, extension) + { + if (extension.name == name) + { + _extensions.splice(index, 1); + unregistered = true; + _debug('Unregistered extension \'{}\'', name); + return false; + } + }); + return unregistered; + }; + + /** + * Starts a the batch of messages to be sent in a single request. + * @see _endBatch(deliverMessages) + */ + function _startBatch() + { + ++_batch; + }; + + /** + * Ends the batch of messages to be sent in a single request, + * optionally delivering messages present in the message queue depending + * on the given argument. + * @param deliverMessages whether to deliver the messages in the queue or not + * @see _startBatch() + */ + function _endBatch(deliverMessages) + { + --_batch; + if (_batch < 0) _batch = 0; + if (deliverMessages && _batch == 0 && !_isDisconnected()) + { + var messages = _messageQueue; + _messageQueue = []; + if (messages.length > 0) _deliver(messages, false); + } + }; + + function _nextMessageId() + { + return ++_messageId; + }; + + /** + * Converts the given response into an array of bayeux messages + * @param response the response to convert + * @return an array of bayeux messages obtained by converting the response + */ + function _convertToMessages(response) + { + if (response === undefined) return []; + if (response instanceof Array) return response; + if (response instanceof String || typeof response == 'string') return eval('(' + response + ')'); + if (response instanceof Object) return [response]; + throw 'Conversion Error ' + response + ', typeof ' + (typeof response); + }; + + function _setStatus(newStatus) + { + _debug('{} -> {}', _status, newStatus); + _status = newStatus; + }; + + function _isDisconnected() + { + return _status == 'disconnecting' || _status == 'disconnected'; + }; + + /** + * Sends the initial handshake message + */ + function _handshake(handshakeProps) + { + _debug('Starting handshake'); + _clientId = null; + + // Start a batch. + // This is needed because handshake and connect are async. + // It may happen that the application calls init() then subscribe() + // and the subscribe message is sent before the connect message, if + // the subscribe message is not held until the connect message is sent. + // So here we start a batch to hold temporarly any message until + // the connection is fully established. + _batch = 0; + _startBatch(); + + // Save the original properties provided by the user + // Deep copy to avoid the user to be able to change them later + _handshakeProps = $.extend(true, {}, handshakeProps); + + var bayeuxMessage = { + version: '1.0', + minimumVersion: '0.9', + channel: '/meta/handshake', + supportedConnectionTypes: _xd ? ['callback-polling'] : ['long-polling', 'callback-polling'] + }; + // Do not allow the user to mess with the required properties, + // so merge first the user properties and *then* the bayeux message + var message = $.extend({}, handshakeProps, bayeuxMessage); + + // We started a batch to hold the application messages, + // so here we must bypass it and deliver immediately. + _setStatus('handshaking'); + _deliver([message], false); + }; + + function _findTransport(handshakeResponse) + { + var transportTypes = handshakeResponse.supportedConnectionTypes; + if (_xd) + { + // If we are cross domain, check if the server supports it, that's the only option + if ($.inArray('callback-polling', transportTypes) >= 0) return _transport; + } + else + { + // Check if we can keep long-polling + if ($.inArray('long-polling', transportTypes) >= 0) return _transport; + + // The server does not support long-polling + if ($.inArray('callback-polling', transportTypes) >= 0) return newCallbackPollingTransport(); + } + return null; + }; + + function _delayedHandshake() + { + _setStatus('handshaking'); + _delayedSend(function() + { + _handshake(_handshakeProps); + }); + }; + + function _delayedConnect() + { + _setStatus('connecting'); + _delayedSend(function() + { + _connect(); + }); + }; + + function _delayedSend(operation) + { + _cancelDelayedSend(); + var delay = _backoff; + _debug("Delayed send: backoff {}, interval {}", _backoff, _advice.interval); + if (_advice.interval && _advice.interval > 0) + delay += _advice.interval; + _scheduledSend = _setTimeout(operation, delay); + }; + + function _cancelDelayedSend() + { + if (_scheduledSend !== null) clearTimeout(_scheduledSend); + _scheduledSend = null; + }; + + function _setTimeout(funktion, delay) + { + return setTimeout(function() + { + try + { + funktion(); + } + catch (x) + { + _debug('Exception during scheduled execution of function \'{}\': {}', funktion.name, x); + } + }, delay); + }; + + /** + * Sends the connect message + */ + function _connect() + { + _debug('Starting connect'); + var message = { + channel: '/meta/connect', + connectionType: _transport.getType() + }; + _setStatus('connecting'); + _deliver([message], true); + _setStatus('connected'); + }; + + function _send(message) + { + if (_batch > 0) + _messageQueue.push(message); + else + _deliver([message], false); + }; + + /** + * Delivers the messages to the comet server + * @param messages the array of messages to send + */ + function _deliver(messages, comet) + { + // We must be sure that the messages have a clientId. + // This is not guaranteed since the handshake may take time to return + // (and hence the clientId is not known yet) and the application + // may create other messages. + $.each(messages, function(index, message) + { + message['id'] = _nextMessageId(); + if (_clientId) message['clientId'] = _clientId; + messages[index] = _applyOutgoingExtensions(message); + }); + + var self = this; + var envelope = { + url: _url, + messages: messages, + onSuccess: function(request, response) + { + try + { + _handleSuccess.call(self, request, response, comet); + } + catch (x) + { + _debug('Exception during execution of success callback: {}', x); + } + }, + onFailure: function(request, reason, exception) + { + try + { + _handleFailure.call(self, request, messages, reason, exception, comet); + } + catch (x) + { + _debug('Exception during execution of failure callback: {}', x); + } + } + }; + _debug('Sending request to {}, message(s): {}', envelope.url, JSON.stringify(envelope.messages)); + _transport.send(envelope, comet); + }; + + function _applyIncomingExtensions(message) + { + for (var i = 0; i < _extensions.length; ++i) + { + var extension = _extensions[i]; + var callback = extension.extension.incoming; + if (callback && typeof callback === 'function') + { + _debug('Calling incoming extension \'{}\', callback \'{}\'', extension.name, callback.name); + message = _applyExtension(extension.name, callback, message) || message; + } + } + return message; + }; + + function _applyOutgoingExtensions(message) + { + for (var i = 0; i < _extensions.length; ++i) + { + var extension = _extensions[i]; + var callback = extension.extension.outgoing; + if (callback && typeof callback === 'function') + { + _debug('Calling outgoing extension \'{}\', callback \'{}\'', extension.name, callback.name); + message = _applyExtension(extension.name, callback, message) || message; + } + } + return message; + }; + + function _applyExtension(name, callback, message) + { + try + { + return callback(message); + } + catch (x) + { + _debug('Exception during execution of extension \'{}\': {}', name, x); + return message; + } + }; + + function _handleSuccess(request, response, comet) + { + var messages = _convertToMessages(response); + _debug('Received response {}', JSON.stringify(messages)); + + // Signal the transport it can deliver other queued requests + _transport.complete(request, true, comet); + + for (var i = 0; i < messages.length; ++i) + { + var message = messages[i]; + message = _applyIncomingExtensions(message); + + if (message.advice) _advice = message.advice; + + var channel = message.channel; + switch (channel) + { + case '/meta/handshake': + _handshakeSuccess(message); + break; + case '/meta/connect': + _connectSuccess(message); + break; + case '/meta/disconnect': + _disconnectSuccess(message); + break; + case '/meta/subscribe': + _subscribeSuccess(message); + break; + case '/meta/unsubscribe': + _unsubscribeSuccess(message); + break; + default: + _messageSuccess(message); + break; + } + } + }; + + function _handleFailure(request, messages, reason, exception, comet) + { + var xhr = request.xhr; + _debug('Request failed, status: {}, reason: {}, exception: {}', xhr && xhr.status, reason, exception); + + // Signal the transport it can deliver other queued requests + _transport.complete(request, false, comet); + + for (var i = 0; i < messages.length; ++i) + { + var message = messages[i]; + var channel = message.channel; + switch (channel) + { + case '/meta/handshake': + _handshakeFailure(xhr, message); + break; + case '/meta/connect': + _connectFailure(xhr, message); + break; + case '/meta/disconnect': + _disconnectFailure(xhr, message); + break; + case '/meta/subscribe': + _subscribeFailure(xhr, message); + break; + case '/meta/unsubscribe': + _unsubscribeFailure(xhr, message); + break; + default: + _messageFailure(xhr, message); + break; + } + } + }; + + function _handshakeSuccess(message) + { + if (message.successful) + { + _debug('Handshake successful'); + // Save clientId, figure out transport, then follow the advice to connect + _clientId = message.clientId; + + var newTransport = _findTransport(message); + if (newTransport === null) + { + throw 'Could not agree on transport with server'; + } + else + { + if (_transport.getType() != newTransport.getType()) + { + _debug('Changing transport from {} to {}', _transport.getType(), newTransport.getType()); + _transport = newTransport; + } + } + + // Notify the listeners + // Here the new transport is in place, as well as the clientId, so + // the listener can perform a publish() if it wants, and the listeners + // are notified before the connect below. + _notifyListeners('/meta/handshake', message); + + var action = _advice.reconnect ? _advice.reconnect : 'retry'; + switch (action) + { + case 'retry': + _delayedConnect(); + break; + default: + break; + } + } + else + { + _debug('Handshake unsuccessful'); + + var retry = !_isDisconnected() && _advice.reconnect != 'none'; + if (!retry) _setStatus('disconnected'); + + _notifyListeners('/meta/handshake', message); + _notifyListeners('/meta/unsuccessful', message); + + // Only try again if we haven't been disconnected and + // the advice permits us to retry the handshake + if (retry) + { + _increaseBackoff(); + _debug('Handshake failure, backing off and retrying in {} ms', _backoff); + _delayedHandshake(); + } + } + }; + + function _handshakeFailure(xhr, message) + { + _debug('Handshake failure'); + + // Notify listeners + var failureMessage = { + successful: false, + failure: true, + channel: '/meta/handshake', + request: message, + xhr: xhr, + advice: { + action: 'retry', + interval: _backoff + } + }; + + var retry = !_isDisconnected() && _advice.reconnect != 'none'; + if (!retry) _setStatus('disconnected'); + + _notifyListeners('/meta/handshake', failureMessage); + _notifyListeners('/meta/unsuccessful', failureMessage); + + // Only try again if we haven't been disconnected and the + // advice permits us to try again + if (retry) + { + _increaseBackoff(); + _debug('Handshake failure, backing off and retrying in {} ms', _backoff); + _delayedHandshake(); + } + }; + + function _connectSuccess(message) + { + var action = _isDisconnected() ? 'none' : (_advice.reconnect ? _advice.reconnect : 'retry'); + if (!_isDisconnected()) _setStatus(action == 'retry' ? 'connecting' : 'disconnecting'); + + if (message.successful) + { + _debug('Connect successful'); + + // End the batch and allow held messages from the application + // to go to the server (see _handshake() where we start the batch). + // The batch is ended before notifying the listeners, so that + // listeners can batch other cometd operations + _endBatch(true); + + // Notify the listeners after the status change but before the next connect + _notifyListeners('/meta/connect', message); + + // Connect was successful. + // Normally, the advice will say "reconnect: 'retry', interval: 0" + // and the server will hold the request, so when a response returns + // we immediately call the server again (long polling) + switch (action) + { + case 'retry': + _resetBackoff(); + _delayedConnect(); + break; + default: + _resetBackoff(); + _setStatus('disconnected'); + break; + } + } + else + { + _debug('Connect unsuccessful'); + + // Notify the listeners after the status change but before the next action + _notifyListeners('/meta/connect', message); + _notifyListeners('/meta/unsuccessful', message); + + // Connect was not successful. + // This may happen when the server crashed, the current clientId + // will be invalid, and the server will ask to handshake again + switch (action) + { + case 'retry': + _increaseBackoff(); + _delayedConnect(); + break; + case 'handshake': + // End the batch but do not deliver the messages until we connect successfully + _endBatch(false); + _resetBackoff(); + _delayedHandshake(); + break; + case 'none': + _resetBackoff(); + _setStatus('disconnected'); + break; + } + } + }; + + function _connectFailure(xhr, message) + { + _debug('Connect failure'); + + // Notify listeners + var failureMessage = { + successful: false, + failure: true, + channel: '/meta/connect', + request: message, + xhr: xhr, + advice: { + action: 'retry', + interval: _backoff + } + }; + _notifyListeners('/meta/connect', failureMessage); + _notifyListeners('/meta/unsuccessful', failureMessage); + + if (!_isDisconnected()) + { + var action = _advice.reconnect ? _advice.reconnect : 'retry'; + switch (action) + { + case 'retry': + _increaseBackoff(); + _debug('Connect failure, backing off and retrying in {} ms', _backoff); + _delayedConnect(); + break; + case 'handshake': + _resetBackoff(); + _delayedHandshake(); + break; + case 'none': + _resetBackoff(); + break; + default: + _debug('Unrecognized reconnect value: {}', action); + break; + } + } + }; + + function _disconnectSuccess(message) + { + if (message.successful) + { + _debug('Disconnect successful'); + _disconnect(false); + _notifyListeners('/meta/disconnect', message); + } + else + { + _debug('Disconnect unsuccessful'); + _disconnect(true); + _notifyListeners('/meta/disconnect', message); + _notifyListeners('/meta/usuccessful', message); + } + }; + + function _disconnect(abort) + { + _cancelDelayedSend(); + if (abort) _transport.abort(); + _clientId = null; + _setStatus('disconnected'); + _batch = 0; + _messageQueue = []; + _resetBackoff(); + }; + + function _disconnectFailure(xhr, message) + { + _debug('Disconnect failure'); + _disconnect(true); + + var failureMessage = { + successful: false, + failure: true, + channel: '/meta/disconnect', + request: message, + xhr: xhr, + advice: { + action: 'none', + interval: 0 + } + }; + _notifyListeners('/meta/disconnect', failureMessage); + _notifyListeners('/meta/unsuccessful', failureMessage); + }; + + function _subscribeSuccess(message) + { + if (message.successful) + { + _debug('Subscribe successful'); + _notifyListeners('/meta/subscribe', message); + } + else + { + _debug('Subscribe unsuccessful'); + _notifyListeners('/meta/subscribe', message); + _notifyListeners('/meta/unsuccessful', message); + } + }; + + function _subscribeFailure(xhr, message) + { + _debug('Subscribe failure'); + + var failureMessage = { + successful: false, + failure: true, + channel: '/meta/subscribe', + request: message, + xhr: xhr, + advice: { + action: 'none', + interval: 0 + } + }; + _notifyListeners('/meta/subscribe', failureMessage); + _notifyListeners('/meta/unsuccessful', failureMessage); + }; + + function _unsubscribeSuccess(message) + { + if (message.successful) + { + _debug('Unsubscribe successful'); + _notifyListeners('/meta/unsubscribe', message); + } + else + { + _debug('Unsubscribe unsuccessful'); + _notifyListeners('/meta/unsubscribe', message); + _notifyListeners('/meta/unsuccessful', message); + } + }; + + function _unsubscribeFailure(xhr, message) + { + _debug('Unsubscribe failure'); + + var failureMessage = { + successful: false, + failure: true, + channel: '/meta/unsubscribe', + request: message, + xhr: xhr, + advice: { + action: 'none', + interval: 0 + } + }; + _notifyListeners('/meta/unsubscribe', failureMessage); + _notifyListeners('/meta/unsuccessful', failureMessage); + }; + + function _messageSuccess(message) + { + if (message.successful === undefined) + { + if (message.data) + { + // It is a plain message, and not a bayeux meta message + _notifyListeners(message.channel, message); + } + else + { + _debug('Unknown message {}', JSON.stringify(message)); + } + } + else + { + if (message.successful) + { + _debug('Publish successful'); + _notifyListeners('/meta/publish', message); + } + else + { + _debug('Publish unsuccessful'); + _notifyListeners('/meta/publish', message); + _notifyListeners('/meta/unsuccessful', message); + } + } + }; + + function _messageFailure(xhr, message) + { + _debug('Publish failure'); + + var failureMessage = { + successful: false, + failure: true, + channel: message.channel, + request: message, + xhr: xhr, + advice: { + action: 'none', + interval: 0 + } + }; + _notifyListeners('/meta/publish', failureMessage); + _notifyListeners('/meta/unsuccessful', failureMessage); + }; + + function _notifyListeners(channel, message) + { + // Notify direct listeners + _notify(channel, message); + + // Notify the globbing listeners + var channelParts = channel.split("/"); + var last = channelParts.length - 1; + for (var i = last; i > 0; --i) + { + var channelPart = channelParts.slice(0, i).join('/') + '/*'; + // We don't want to notify /foo/* if the channel is /foo/bar/baz, + // so we stop at the first non recursive globbing + if (i == last) _notify(channelPart, message); + // Add the recursive globber and notify + channelPart += '*'; + _notify(channelPart, message); + } + }; + + function _notify(channel, message) + { + var subscriptions = _listeners[channel]; + if (subscriptions && subscriptions.length > 0) + { + for (var i = 0; i < subscriptions.length; ++i) + { + var subscription = subscriptions[i]; + // Subscriptions may come and go, so the array may have 'holes' + if (subscription) + { + try + { + _debug('Notifying subscription: channel \'{}\', callback \'{}\'', channel, subscription.callback.name); + subscription.callback.call(subscription.scope, message); + } + catch (x) + { + // Ignore exceptions from callbacks + _warn('Exception during execution of callback \'{}\' on channel \'{}\' for message {}, exception: {}', subscription.callback.name, channel, JSON.stringify(message), x); + } + } + } + } + }; + + function _resetBackoff() + { + _backoff = 0; + }; + + function _increaseBackoff() + { + if (_backoff < _maxBackoff) _backoff += _backoffIncrement; + }; + + var _error = this._error = function(text, args) + { + _log('error', _format.apply(this, arguments)); + }; + + var _warn = this._warn = function(text, args) + { + _log('warn', _format.apply(this, arguments)); + }; + + var _info = this._info = function(text, args) + { + _log('info', _format.apply(this, arguments)); + }; + + var _debug = this._debug = function(text, args) + { + _log('debug', _format.apply(this, arguments)); + }; + + function _log(level, text) + { + var priority = _logPriorities[level]; + var configPriority = _logPriorities[_logLevel]; + if (!configPriority) configPriority = _logPriorities['info']; + if (priority >= configPriority) + { + if (window.console) window.console.log(text); + } + }; + + function _format(text) + { + var braces = /\{\}/g; + var result = ''; + var start = 0; + var count = 0; + while (braces.test(text)) + { + result += text.substr(start, braces.lastIndex - start - 2); + var arg = arguments[++count]; + result += arg !== undefined ? arg : '{}'; + start = braces.lastIndex; + } + result += text.substr(start, text.length - start); + return result; + }; + + function newLongPollingTransport() + { + return $.extend({}, new Transport('long-polling'), new LongPollingTransport()); + }; + + function newCallbackPollingTransport() + { + return $.extend({}, new Transport('callback-polling'), new CallbackPollingTransport()); + }; + + /** + * Base object with the common functionality for transports. + * The key responsibility is to allow at most 2 outstanding requests to the server, + * to avoid that requests are sent behind a long poll. + * To achieve this, we have one reserved request for the long poll, and all other + * requests are serialized one after the other. + */ + var Transport = function(type) + { + var _maxRequests = 2; + var _requestIds = 0; + var _cometRequest = null; + var _requests = []; + var _packets = []; + + this.getType = function() + { + return type; + }; + + this.send = function(packet, comet) + { + if (comet) + _cometSend(this, packet); + else + _send(this, packet); + }; + + function _cometSend(self, packet) + { + if (_cometRequest !== null) throw 'Concurrent comet requests not allowed, request ' + _cometRequest.id + ' not yet completed'; + + var requestId = ++_requestIds; + _debug('Beginning comet request {}', requestId); + + var request = {id: requestId}; + _debug('Delivering comet request {}', requestId); + self.deliver(packet, request); + _cometRequest = request; + }; + + function _send(self, packet) + { + var requestId = ++_requestIds; + _debug('Beginning request {}, {} other requests, {} queued requests', requestId, _requests.length, _packets.length); + + var request = {id: requestId}; + // Consider the comet request which should always be present + if (_requests.length < _maxRequests - 1) + { + _debug('Delivering request {}', requestId); + self.deliver(packet, request); + _requests.push(request); + } + else + { + _packets.push([packet, request]); + _debug('Queued request {}, {} queued requests', requestId, _packets.length); + } + }; + + this.complete = function(request, success, comet) + { + if (comet) + _cometComplete(request); + else + _complete(this, request, success); + }; + + function _cometComplete(request) + { + var requestId = request.id; + if (_cometRequest !== request) throw 'Comet request mismatch, completing request ' + requestId; + + // Reset comet request + _cometRequest = null; + _debug('Ended comet request {}', requestId); + }; + + function _complete(self, request, success) + { + var requestId = request.id; + var index = $.inArray(request, _requests); + // The index can be negative the request has been aborted + if (index >= 0) _requests.splice(index, 1); + _debug('Ended request {}, {} other requests, {} queued requests', requestId, _requests.length, _packets.length); + + if (_packets.length > 0) + { + var packet = _packets.shift(); + if (success) + { + _debug('Dequeueing and sending request {}, {} queued requests', packet[1].id, _packets.length); + _send(self, packet[0]); + } + else + { + _debug('Dequeueing and failing request {}, {} queued requests', packet[1].id, _packets.length); + // Keep the semantic of calling response callbacks asynchronously after the request + setTimeout(function() { packet[0].onFailure(packet[1], 'error'); }, 0); + } + } + }; + + this.abort = function() + { + for (var i = 0; i < _requests.length; ++i) + { + var request = _requests[i]; + _debug('Aborting request {}', request.id); + if (request.xhr) request.xhr.abort(); + } + if (_cometRequest) + { + _debug('Aborting comet request {}', _cometRequest.id); + if (_cometRequest.xhr) _cometRequest.xhr.abort(); + } + _cometRequest = null; + _requests = []; + _packets = []; + }; + }; + + var LongPollingTransport = function() + { + this.deliver = function(packet, request) + { + request.xhr = $.ajax({ + url: packet.url, + type: 'POST', + contentType: 'text/json;charset=UTF-8', + beforeSend: function(xhr) + { + xhr.setRequestHeader('Connection', 'Keep-Alive'); + return true; + }, + data: JSON.stringify(packet.messages), + success: function(response) { packet.onSuccess(request, response); }, + error: function(xhr, reason, exception) { packet.onFailure(request, reason, exception); } + }); + }; + }; + + var CallbackPollingTransport = function() + { + var _maxLength = 2000; + this.deliver = function(packet, request) + { + // Microsoft Internet Explorer has a 2083 URL max length + // We must ensure that we stay within that length + var messages = JSON.stringify(packet.messages); + // Encode the messages because all brackets, quotes, commas, colons, etc + // present in the JSON will be URL encoded, taking many more characters + var urlLength = packet.url.length + encodeURI(messages).length; + _debug('URL length: {}', urlLength); + // Let's stay on the safe side and use 2000 instead of 2083 + // also because we did not count few characters among which + // the parameter name 'message' and the parameter 'jsonp', + // which sum up to about 50 chars + if (urlLength > _maxLength) + { + var x = packet.messages.length > 1 ? + 'Too many bayeux messages in the same batch resulting in message too big ' + + '(' + urlLength + ' bytes, max is ' + _maxLength + ') for transport ' + this.getType() : + 'Bayeux message too big (' + urlLength + ' bytes, max is ' + _maxLength + ') ' + + 'for transport ' + this.getType(); + // Keep the semantic of calling response callbacks asynchronously after the request + _setTimeout(function() { packet.onFailure(request, 'error', x); }, 0); + } + else + { + $.ajax({ + url: packet.url, + type: 'GET', + dataType: 'jsonp', + jsonp: 'jsonp', + beforeSend: function(xhr) + { + xhr.setRequestHeader('Connection', 'Keep-Alive'); + return true; + }, + data: + { + // In callback-polling, the content must be sent via the 'message' parameter + message: messages + }, + success: function(response) { packet.onSuccess(request, response); }, + error: function(xhr, reason, exception) { packet.onFailure(request, reason, exception); } + }); + } + }; + }; + }; + + /** + * The JS object that exposes the comet API to applications + */ + $.cometd = new $.Cometd(); // The default instance + +})(jQuery); diff --git a/plugins/Comet/updatetimeline.js b/plugins/Comet/updatetimeline.js index f4da1f47c..6612b5116 100644 --- a/plugins/Comet/updatetimeline.js +++ b/plugins/Comet/updatetimeline.js @@ -1,3 +1,30 @@ // update the local timeline from a Comet server // +var updater = function() +{ + var _handshook = false; + var _connected = false; + var _cometd; + + return { + init: function() + { + _cometd = $.cometd; // Uses the default Comet object + _cometd.init(_timelineServer); + _cometd.subscribe(_timeline, this, receive); + $(window).unload(leave); + } + } + + function leave() + { + _cometd.disconnect(); + } + + function receive(message) + { + var noticeItem = makeNoticeItem(message.data); + var noticeList = $('ul.notices'); + } +}(); -- cgit v1.2.3 From 84072aa5cf6124d59a06a7f0a7945c00ee2836da Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 26 Apr 2009 12:13:49 -0400 Subject: run 'set names' after each connection to deal with UTF8 correctly --- classes/Memcached_DataObject.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php index 5f71f716b..877bbf2e0 100644 --- a/classes/Memcached_DataObject.php +++ b/classes/Memcached_DataObject.php @@ -227,4 +227,20 @@ class Memcached_DataObject extends DB_DataObject $c->set($ckey, $cached, MEMCACHE_COMPRESSED, $expiry); return new ArrayWrapper($cached); } + + // We overload so that 'SET NAMES "utf8"' is called for + // each connection + + function _connect() + { + global $_DB_DATAOBJECT; + $exists = !empty($this->_database_dsn_md5) && + isset($_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]); + $result = parent::_connect(); + if (!$exists) { + $DB = &$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]; + $DB->query('SET NAMES "utf8"'); + } + return $result; + } } -- cgit v1.2.3 From 068f6801cc59488bfc50ef399a2a4d22b1b7e9c2 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 26 Apr 2009 12:27:32 -0400 Subject: Revert "run 'set names' after each connection to deal with UTF8 correctly" This reverts commit 84072aa5cf6124d59a06a7f0a7945c00ee2836da. This commit caused grievous harm to old notices on identi.ca. Reverting until we figure out how to convert the old notices. --- classes/Memcached_DataObject.php | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php index 877bbf2e0..5f71f716b 100644 --- a/classes/Memcached_DataObject.php +++ b/classes/Memcached_DataObject.php @@ -227,20 +227,4 @@ class Memcached_DataObject extends DB_DataObject $c->set($ckey, $cached, MEMCACHE_COMPRESSED, $expiry); return new ArrayWrapper($cached); } - - // We overload so that 'SET NAMES "utf8"' is called for - // each connection - - function _connect() - { - global $_DB_DATAOBJECT; - $exists = !empty($this->_database_dsn_md5) && - isset($_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]); - $result = parent::_connect(); - if (!$exists) { - $DB = &$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]; - $DB->query('SET NAMES "utf8"'); - } - return $result; - } } -- cgit v1.2.3 From ccf45d454c68f7f667d07e0db608569e049ec285 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 26 Apr 2009 15:08:49 -0400 Subject: Lots of tweaking to make things work Did some tweaking and maneuvering to make things work. This version will now show a "notice received" alert box -- lots of progress! Had to test with Java server, not Python server. --- plugins/Comet/CometPlugin.php | 22 +- plugins/Comet/json2.js | 478 ++++++++++++++++++++++++++++++++++++++++ plugins/Comet/updatetimeline.js | 48 ++-- 3 files changed, 516 insertions(+), 32 deletions(-) create mode 100644 plugins/Comet/json2.js diff --git a/plugins/Comet/CometPlugin.php b/plugins/Comet/CometPlugin.php index 10f8c198c..f60d40075 100644 --- a/plugins/Comet/CometPlugin.php +++ b/plugins/Comet/CometPlugin.php @@ -56,6 +56,8 @@ class CometPlugin extends Plugin { $timeline = null; + $this->log(LOG_DEBUG, 'got action ' . $action->trimmed('action')); + switch ($action->trimmed('action')) { case 'public': $timeline = '/timelines/public'; @@ -64,16 +66,18 @@ class CometPlugin extends Plugin return true; } - $action->element('script', array('type' => 'text/javascript', - 'src' => common_path('plugins/Comet/jquery.comet.js')), + $scripts = array('jquery.comet.js', 'json2.js', 'updatetimeline.js'); + + foreach ($scripts as $script) { + $action->element('script', array('type' => 'text/javascript', + 'src' => common_path('plugins/Comet/'.$script)), ' '); + } + $action->elementStart('script', array('type' => 'text/javascript')); - $action->raw("var _timelineServer = \"$this->server\"; ". - "var _timeline = \"$timeline\";"); + $action->raw("$(document).ready(function() { updater.init(\"$this->server\", \"$timeline\");});"); $action->elementEnd('script'); - $action->element('script', array('type' => 'text/javascript', - 'src' => common_path('plugins/Comet/updatetimeline.js')), - ' '); + return true; } @@ -96,21 +100,17 @@ class CometPlugin extends Plugin $json = $this->noticeAsJson($notice); - $this->log(LOG_DEBUG, "JSON = '$json'"); - // Bayeux? Comet? Huh? These terms confuse me $bay = new Bayeux($this->server); foreach ($timelines as $timeline) { $this->log(LOG_INFO, "Posting notice $notice->id to '$timeline'."); $bay->publish($timeline, $json); - $this->log(LOG_DEBUG, "Done posting notice $notice->id to '$timeline'."); } $bay = NULL; } - $this->log(LOG_DEBUG, "All done."); return true; } diff --git a/plugins/Comet/json2.js b/plugins/Comet/json2.js new file mode 100644 index 000000000..7e27df518 --- /dev/null +++ b/plugins/Comet/json2.js @@ -0,0 +1,478 @@ +/* + http://www.JSON.org/json2.js + 2009-04-16 + + Public Domain. + + NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. + + See http://www.JSON.org/js.html + + This file creates a global JSON object containing two methods: stringify + and parse. + + JSON.stringify(value, replacer, space) + value any JavaScript value, usually an object or array. + + replacer an optional parameter that determines how object + values are stringified for objects. It can be a + function or an array of strings. + + space an optional parameter that specifies the indentation + of nested structures. If it is omitted, the text will + be packed without extra whitespace. If it is a number, + it will specify the number of spaces to indent at each + level. If it is a string (such as '\t' or ' '), + it contains the characters used to indent at each level. + + This method produces a JSON text from a JavaScript value. + + When an object value is found, if the object contains a toJSON + method, its toJSON method will be called and the result will be + stringified. A toJSON method does not serialize: it returns the + value represented by the name/value pair that should be serialized, + or undefined if nothing should be serialized. The toJSON method + will be passed the key associated with the value, and this will be + bound to the object holding the key. + + For example, this would serialize Dates as ISO strings. + + Date.prototype.toJSON = function (key) { + function f(n) { + // Format integers to have at least two digits. + return n < 10 ? '0' + n : n; + } + + return this.getUTCFullYear() + '-' + + f(this.getUTCMonth() + 1) + '-' + + f(this.getUTCDate()) + 'T' + + f(this.getUTCHours()) + ':' + + f(this.getUTCMinutes()) + ':' + + f(this.getUTCSeconds()) + 'Z'; + }; + + You can provide an optional replacer method. It will be passed the + key and value of each member, with this bound to the containing + object. The value that is returned from your method will be + serialized. If your method returns undefined, then the member will + be excluded from the serialization. + + If the replacer parameter is an array of strings, then it will be + used to select the members to be serialized. It filters the results + such that only members with keys listed in the replacer array are + stringified. + + Values that do not have JSON representations, such as undefined or + functions, will not be serialized. Such values in objects will be + dropped; in arrays they will be replaced with null. You can use + a replacer function to replace those with JSON values. + JSON.stringify(undefined) returns undefined. + + The optional space parameter produces a stringification of the + value that is filled with line breaks and indentation to make it + easier to read. + + If the space parameter is a non-empty string, then that string will + be used for indentation. If the space parameter is a number, then + the indentation will be that many spaces. + + Example: + + text = JSON.stringify(['e', {pluribus: 'unum'}]); + // text is '["e",{"pluribus":"unum"}]' + + + text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t'); + // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]' + + text = JSON.stringify([new Date()], function (key, value) { + return this[key] instanceof Date ? + 'Date(' + this[key] + ')' : value; + }); + // text is '["Date(---current time---)"]' + + + JSON.parse(text, reviver) + This method parses a JSON text to produce an object or array. + It can throw a SyntaxError exception. + + The optional reviver parameter is a function that can filter and + transform the results. It receives each of the keys and values, + and its return value is used instead of the original value. + If it returns what it received, then the structure is not modified. + If it returns undefined then the member is deleted. + + Example: + + // Parse the text. Values that look like ISO date strings will + // be converted to Date objects. + + myData = JSON.parse(text, function (key, value) { + var a; + if (typeof value === 'string') { + a = +/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value); + if (a) { + return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4], + +a[5], +a[6])); + } + } + return value; + }); + + myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) { + var d; + if (typeof value === 'string' && + value.slice(0, 5) === 'Date(' && + value.slice(-1) === ')') { + d = new Date(value.slice(5, -1)); + if (d) { + return d; + } + } + return value; + }); + + + This is a reference implementation. You are free to copy, modify, or + redistribute. + + This code should be minified before deployment. + See http://javascript.crockford.com/jsmin.html + + USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO + NOT CONTROL. +*/ + +/*jslint evil: true */ + +/*global JSON */ + +/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply, + call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours, + getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join, + lastIndex, length, parse, prototype, push, replace, slice, stringify, + test, toJSON, toString, valueOf +*/ + +// Create a JSON object only if one does not already exist. We create the +// methods in a closure to avoid creating global variables. + +if (!this.JSON) { + JSON = {}; +} +(function () { + + function f(n) { + // Format integers to have at least two digits. + return n < 10 ? '0' + n : n; + } + + if (typeof Date.prototype.toJSON !== 'function') { + + Date.prototype.toJSON = function (key) { + + return this.getUTCFullYear() + '-' + + f(this.getUTCMonth() + 1) + '-' + + f(this.getUTCDate()) + 'T' + + f(this.getUTCHours()) + ':' + + f(this.getUTCMinutes()) + ':' + + f(this.getUTCSeconds()) + 'Z'; + }; + + String.prototype.toJSON = + Number.prototype.toJSON = + Boolean.prototype.toJSON = function (key) { + return this.valueOf(); + }; + } + + var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + gap, + indent, + meta = { // table of character substitutions + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\f': '\\f', + '\r': '\\r', + '"' : '\\"', + '\\': '\\\\' + }, + rep; + + + function quote(string) { + +// If the string contains no control characters, no quote characters, and no +// backslash characters, then we can safely slap some quotes around it. +// Otherwise we must also replace the offending characters with safe escape +// sequences. + + escapable.lastIndex = 0; + return escapable.test(string) ? + '"' + string.replace(escapable, function (a) { + var c = meta[a]; + return typeof c === 'string' ? c : + '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); + }) + '"' : + '"' + string + '"'; + } + + + function str(key, holder) { + +// Produce a string from holder[key]. + + var i, // The loop counter. + k, // The member key. + v, // The member value. + length, + mind = gap, + partial, + value = holder[key]; + +// If the value has a toJSON method, call it to obtain a replacement value. + + if (value && typeof value === 'object' && + typeof value.toJSON === 'function') { + value = value.toJSON(key); + } + +// If we were called with a replacer function, then call the replacer to +// obtain a replacement value. + + if (typeof rep === 'function') { + value = rep.call(holder, key, value); + } + +// What happens next depends on the value's type. + + switch (typeof value) { + case 'string': + return quote(value); + + case 'number': + +// JSON numbers must be finite. Encode non-finite numbers as null. + + return isFinite(value) ? String(value) : 'null'; + + case 'boolean': + case 'null': + +// If the value is a boolean or null, convert it to a string. Note: +// typeof null does not produce 'null'. The case is included here in +// the remote chance that this gets fixed someday. + + return String(value); + +// If the type is 'object', we might be dealing with an object or an array or +// null. + + case 'object': + +// Due to a specification blunder in ECMAScript, typeof null is 'object', +// so watch out for that case. + + if (!value) { + return 'null'; + } + +// Make an array to hold the partial results of stringifying this object value. + + gap += indent; + partial = []; + +// Is the value an array? + + if (Object.prototype.toString.apply(value) === '[object Array]') { + +// The value is an array. Stringify every element. Use null as a placeholder +// for non-JSON values. + + length = value.length; + for (i = 0; i < length; i += 1) { + partial[i] = str(i, value) || 'null'; + } + +// Join all of the elements together, separated with commas, and wrap them in +// brackets. + + v = partial.length === 0 ? '[]' : + gap ? '[\n' + gap + + partial.join(',\n' + gap) + '\n' + + mind + ']' : + '[' + partial.join(',') + ']'; + gap = mind; + return v; + } + +// If the replacer is an array, use it to select the members to be stringified. + + if (rep && typeof rep === 'object') { + length = rep.length; + for (i = 0; i < length; i += 1) { + k = rep[i]; + if (typeof k === 'string') { + v = str(k, value); + if (v) { + partial.push(quote(k) + (gap ? ': ' : ':') + v); + } + } + } + } else { + +// Otherwise, iterate through all of the keys in the object. + + for (k in value) { + if (Object.hasOwnProperty.call(value, k)) { + v = str(k, value); + if (v) { + partial.push(quote(k) + (gap ? ': ' : ':') + v); + } + } + } + } + +// Join all of the member texts together, separated with commas, +// and wrap them in braces. + + v = partial.length === 0 ? '{}' : + gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + + mind + '}' : '{' + partial.join(',') + '}'; + gap = mind; + return v; + } + } + +// If the JSON object does not yet have a stringify method, give it one. + + if (typeof JSON.stringify !== 'function') { + JSON.stringify = function (value, replacer, space) { + +// The stringify method takes a value and an optional replacer, and an optional +// space parameter, and returns a JSON text. The replacer can be a function +// that can replace values, or an array of strings that will select the keys. +// A default replacer method can be provided. Use of the space parameter can +// produce text that is more easily readable. + + var i; + gap = ''; + indent = ''; + +// If the space parameter is a number, make an indent string containing that +// many spaces. + + if (typeof space === 'number') { + for (i = 0; i < space; i += 1) { + indent += ' '; + } + +// If the space parameter is a string, it will be used as the indent string. + + } else if (typeof space === 'string') { + indent = space; + } + +// If there is a replacer, it must be a function or an array. +// Otherwise, throw an error. + + rep = replacer; + if (replacer && typeof replacer !== 'function' && + (typeof replacer !== 'object' || + typeof replacer.length !== 'number')) { + throw new Error('JSON.stringify'); + } + +// Make a fake root object containing our value under the key of ''. +// Return the result of stringifying the value. + + return str('', {'': value}); + }; + } + + +// If the JSON object does not yet have a parse method, give it one. + + if (typeof JSON.parse !== 'function') { + JSON.parse = function (text, reviver) { + +// The parse method takes a text and an optional reviver function, and returns +// a JavaScript value if the text is a valid JSON text. + + var j; + + function walk(holder, key) { + +// The walk method is used to recursively walk the resulting structure so +// that modifications can be made. + + var k, v, value = holder[key]; + if (value && typeof value === 'object') { + for (k in value) { + if (Object.hasOwnProperty.call(value, k)) { + v = walk(value, k); + if (v !== undefined) { + value[k] = v; + } else { + delete value[k]; + } + } + } + } + return reviver.call(holder, key, value); + } + + +// Parsing happens in four stages. In the first stage, we replace certain +// Unicode characters with escape sequences. JavaScript handles many characters +// incorrectly, either silently deleting them, or treating them as line endings. + + cx.lastIndex = 0; + if (cx.test(text)) { + text = text.replace(cx, function (a) { + return '\\u' + + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); + }); + } + +// In the second stage, we run the text against regular expressions that look +// for non-JSON patterns. We are especially concerned with '()' and 'new' +// because they can cause invocation, and '=' because it can cause mutation. +// But just to be safe, we want to reject all unexpected forms. + +// We split the second stage into 4 regexp operations in order to work around +// crippling inefficiencies in IE's and Safari's regexp engines. First we +// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we +// replace all simple value tokens with ']' characters. Third, we delete all +// open brackets that follow a colon or comma or that begin the text. Finally, +// we look to see that the remaining characters are only whitespace or ']' or +// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval. + + if (/^[\],:{}\s]*$/. +test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@'). +replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']'). +replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) { + +// In the third stage we use the eval function to compile the text into a +// JavaScript structure. The '{' operator is subject to a syntactic ambiguity +// in JavaScript: it can begin a block or an object literal. We wrap the text +// in parens to eliminate the ambiguity. + + j = eval('(' + text + ')'); + +// In the optional fourth stage, we recursively walk the new structure, passing +// each name/value pair to a reviver function for possible transformation. + + return typeof reviver === 'function' ? + walk({'': j}, '') : j; + } + +// If the text is not JSON parseable, then a SyntaxError is thrown. + + throw new SyntaxError('JSON.parse'); + }; + } +}()); diff --git a/plugins/Comet/updatetimeline.js b/plugins/Comet/updatetimeline.js index 6612b5116..7b22445e3 100644 --- a/plugins/Comet/updatetimeline.js +++ b/plugins/Comet/updatetimeline.js @@ -3,28 +3,34 @@ var updater = function() { - var _handshook = false; - var _connected = false; - var _cometd; + var _cometd; - return { - init: function() - { - _cometd = $.cometd; // Uses the default Comet object - _cometd.init(_timelineServer); - _cometd.subscribe(_timeline, this, receive); - $(window).unload(leave); - } - } + return { + init: function(server, timeline) + { + _cometd = $.cometd; // Uses the default Comet object + _cometd.setLogLevel('debug'); + _cometd.init(server); + _cometd.subscribe(timeline, receive); + $(window).unload(leave); + } + } - function leave() - { - _cometd.disconnect(); - } + function leave() + { + _cometd.disconnect(); + } - function receive(message) - { - var noticeItem = makeNoticeItem(message.data); - var noticeList = $('ul.notices'); - } + function receive(message) + { + alert("Received notice."); + var noticeItem = makeNoticeItem(message.data); + var noticeList = $('ul.notices'); + } + + function makeNoticeItem(data) + { + return ''; + } }(); + -- cgit v1.2.3 From 7dbb5fb8fdf7c4f82c212863a17793a50f887f58 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 26 Apr 2009 15:37:00 -0400 Subject: Make notice auto-update Shows notices auto-updating --- plugins/Comet/CometPlugin.php | 5 +++++ plugins/Comet/updatetimeline.js | 37 ++++++++++++++++++++++++++++++++++--- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/plugins/Comet/CometPlugin.php b/plugins/Comet/CometPlugin.php index f60d40075..a7a4f4b23 100644 --- a/plugins/Comet/CometPlugin.php +++ b/plugins/Comet/CometPlugin.php @@ -126,6 +126,11 @@ class CometPlugin extends Plugin $act = new TwitterApiAction('/dev/null'); $arr = $act->twitter_status_array($notice, true); + $arr['url'] = $notice->bestUrl(); + + $profile = $notice->getProfile(); + $arr['user']['profile_url'] = $profile->profileurl; + return $arr; } diff --git a/plugins/Comet/updatetimeline.js b/plugins/Comet/updatetimeline.js index 7b22445e3..c6eefb447 100644 --- a/plugins/Comet/updatetimeline.js +++ b/plugins/Comet/updatetimeline.js @@ -23,14 +23,45 @@ var updater = function() function receive(message) { - alert("Received notice."); var noticeItem = makeNoticeItem(message.data); - var noticeList = $('ul.notices'); + $("#notices_primary .notices").prepend(noticeItem, true); + $("#notices_primary .notice:first").css({display:"none"}); + $("#notices_primary .notice:first").fadeIn(2500); + NoticeHover(); + NoticeReply(); } function makeNoticeItem(data) { - return ''; + user = data['user']; + ni = "
  • "+ + "
    "+ + ""+ + ""+ + "\""+user['screen_name']+"\"/"+ + ""+user['screen_name']+""+ + ""+ + ""+ + "

    "+data['text']+"

    "+ + "
    "+ + "
    "+ + "
    "+ + "
    Published
    "+ + "
    "+ + ""+ + "a few seconds ago"+ + " "+ + "
    "+ + "
    "+ + "
    "+ + "
    From
    "+ + "
    "+data['source']+"
    "+ + "
    "+ + "
    "+ + "
    "+ + "
    "+ + "
  • "; + return ni; } }(); -- cgit v1.2.3 From 781341d91fd4c7406d8687e7828ab86f9696cf66 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 26 Apr 2009 15:41:55 -0400 Subject: README for the comet plugin --- plugins/Comet/README | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 plugins/Comet/README diff --git a/plugins/Comet/README b/plugins/Comet/README new file mode 100644 index 000000000..4abd40af7 --- /dev/null +++ b/plugins/Comet/README @@ -0,0 +1,26 @@ +This is a plugin to automatically load notices in the browser no +matter who creates them -- the kind of thing we see with +search.twitter.com, rejaw.com, or FriendFeed's "real time" news. + +NOTE: this is an insecure version; don't roll it out on a production +server. + +It requires a cometd server. I've only had the cometd-java server work +correctly; something's wiggy with the Twisted-based server. + +After you have a cometd server installed, just add this code to your +config.php: + + require_once(INSTALLDIR.'/plugins/Comet/CometPlugin.php'); + $cp = new CometPlugin('http://example.com:8080/cometd/'); + +Change 'example.com:8080' to the name and port of the server you +installed cometd on. + +TODO: + +* Needs to be tested with Ajax submission. Probably messes everything + up. +* Add more timelines: personal inbox and tags would be great. +* Add security. In particular, only let the PHP code publish notices + to the cometd server. Currently, it doesn't try to authenticate. -- cgit v1.2.3 From e438334c00ebe29c01bfc5b02aa64cffdb43cb46 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 26 Apr 2009 18:00:06 -0400 Subject: add live updating for tag pages --- plugins/Comet/CometPlugin.php | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/plugins/Comet/CometPlugin.php b/plugins/Comet/CometPlugin.php index a7a4f4b23..cff0d4c9d 100644 --- a/plugins/Comet/CometPlugin.php +++ b/plugins/Comet/CometPlugin.php @@ -62,6 +62,14 @@ class CometPlugin extends Plugin case 'public': $timeline = '/timelines/public'; break; + case 'tag': + $tag = $action->trimmed('tag'); + if (!empty($tag)) { + $timeline = '/timelines/tag/'.$tag; + } else { + return true; + } + break; default: return true; } @@ -94,6 +102,14 @@ class CometPlugin extends Plugin $timelines[] = '/timelines/public'; } + $tags = $this->getNoticeTags($notice); + + if (!empty($tags)) { + foreach ($tags as $tag) { + $timelines[] = '/timelines/tag/' . $tag; + } + } + if (count($timelines) > 0) { // Require this, since we need it require_once(INSTALLDIR.'/plugins/Comet/bayeux.class.inc.php'); @@ -134,6 +150,26 @@ class CometPlugin extends Plugin return $arr; } + function getNoticeTags($notice) + { + $tags = null; + + $nt = new Notice_tag(); + $nt->notice_id = $notice->id; + + if ($nt->find()) { + $tags = array(); + while ($nt->fetch()) { + $tags[] = $nt->tag; + } + } + + $nt->free(); + $nt = null; + + return $tags; + } + // Push this up to Plugin function log($level, $msg) -- cgit v1.2.3 From db3b56a2fdf51e97e9859aa731674947571667aa Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 26 Apr 2009 20:50:39 -0400 Subject: Display rendered HTML for a notice Display the rendered HTML for a notice --- plugins/Comet/CometPlugin.php | 1 + plugins/Comet/updatetimeline.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/Comet/CometPlugin.php b/plugins/Comet/CometPlugin.php index cff0d4c9d..2e0bb40a4 100644 --- a/plugins/Comet/CometPlugin.php +++ b/plugins/Comet/CometPlugin.php @@ -143,6 +143,7 @@ class CometPlugin extends Plugin $arr = $act->twitter_status_array($notice, true); $arr['url'] = $notice->bestUrl(); + $arr['html'] = htmlspecialchars($notice->rendered); $profile = $notice->getProfile(); $arr['user']['profile_url'] = $profile->profileurl; diff --git a/plugins/Comet/updatetimeline.js b/plugins/Comet/updatetimeline.js index c6eefb447..55511d35f 100644 --- a/plugins/Comet/updatetimeline.js +++ b/plugins/Comet/updatetimeline.js @@ -34,6 +34,8 @@ var updater = function() function makeNoticeItem(data) { user = data['user']; + html = data['html'].replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); + ni = "
  • "+ "
    "+ ""+ @@ -42,7 +44,7 @@ var updater = function() ""+user['screen_name']+""+ ""+ ""+ - "

    "+data['text']+"

    "+ + "

    "+html+"

    "+ "
    "+ "
    "+ "
    "+ -- cgit v1.2.3 From e97223b2ba3f9f1818ba12b707c53c0ebdcab144 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 26 Apr 2009 21:15:11 -0400 Subject: Don't add a notice if it already exists on the page Try not to interfere with Ajax posting; don't show something if it's already on the page. --- plugins/Comet/updatetimeline.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/Comet/updatetimeline.js b/plugins/Comet/updatetimeline.js index 55511d35f..de750baba 100644 --- a/plugins/Comet/updatetimeline.js +++ b/plugins/Comet/updatetimeline.js @@ -23,6 +23,14 @@ var updater = function() function receive(message) { + id = message.data.id; + + // Don't add it if it already exists + + if ($("#notice-"+id).length > 0) { + return; + } + var noticeItem = makeNoticeItem(message.data); $("#notices_primary .notices").prepend(noticeItem, true); $("#notices_primary .notice:first").css({display:"none"}); -- cgit v1.2.3 From 7405d9dfa684975309150537069a1268a67ed6be Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 26 Apr 2009 21:16:09 -0400 Subject: Don't add a node if it's already there Try not to double-add a node on Ajax submit. Normally not a big deal, but may happen if the CometPlugin (or in the future Strophe or other auto-update plugins) is enabled. --- js/util.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/js/util.js b/js/util.js index 15a14625c..f15c4f2bb 100644 --- a/js/util.js +++ b/js/util.js @@ -188,11 +188,15 @@ $(document).ready(function(){ alert(result); } else { - $("#notices_primary .notices").prepend(document._importNode($("li", xml).get(0), true)); - $("#notices_primary .notice:first").css({display:"none"}); - $("#notices_primary .notice:first").fadeIn(2500); - NoticeHover(); - NoticeReply(); + li = $("li", xml).get(0); + id = li.id; + if ($("#"+li.id).length == 0) { + $("#notices_primary .notices").prepend(document._importNode(li, true)); + $("#notices_primary .notice:first").css({display:"none"}); + $("#notices_primary .notice:first").fadeIn(2500); + NoticeHover(); + NoticeReply(); + } } $("#notice_data-text").val(""); counter(); -- cgit v1.2.3 From efe8c47d7d9e91eb8308845b8b0717e84e36e346 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Mon, 27 Apr 2009 20:07:22 +0000 Subject: Minor CSS order/cleanup. --- theme/base/css/display.css | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/theme/base/css/display.css b/theme/base/css/display.css index 0bc2e68b6..dc6b4bc29 100644 --- a/theme/base/css/display.css +++ b/theme/base/css/display.css @@ -842,23 +842,6 @@ text-transform:lowercase; } - -.notice-data { -position:absolute; -top:18px; -right:0; -min-height:50px; -margin-bottom:4px; -} -.notice .entry-content .notice-data dt { -display:none; -} - -.notice-data a { -display:block; -outline:none; -} - .notice-options { padding-left:2%; float:left; @@ -1036,6 +1019,8 @@ padding-right:30px; .hentry .entry-content p { margin-bottom:18px; } +.system_notice ul, +.instructions ul, .hentry entry-content ol, .hentry .entry-content ul { list-style-position:inside; @@ -1160,9 +1145,6 @@ clear:both; margin-bottom:0; } -.instructions ul { -list-style-position:inside; -} .instructions p, .instructions ul { margin-bottom:18px; -- cgit v1.2.3 From 6a20ef71d3b2b325ce24318e2ba4483d6c8732ce Mon Sep 17 00:00:00 2001 From: CiaranG Date: Tue, 28 Apr 2009 13:05:48 +0100 Subject: Fixed typo in stopdaemons.sh - was not stopping the new memcached queue handler --- scripts/stopdaemons.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/stopdaemons.sh b/scripts/stopdaemons.sh index 196991de0..f6d71eddf 100755 --- a/scripts/stopdaemons.sh +++ b/scripts/stopdaemons.sh @@ -25,7 +25,7 @@ DIR=`php $SDIR/getpiddir.php` for f in jabberhandler ombhandler publichandler smshandler pinghandler \ xmppconfirmhandler xmppdaemon twitterhandler facebookhandler \ - memcachedhandler inboxhandler; do + memcachehandler inboxhandler; do FILES="$DIR/$f.*.pid" for ff in "$FILES" ; do -- cgit v1.2.3 From 5b78f95e972f9f19ea46607e8b9544b8f7c4207a Mon Sep 17 00:00:00 2001 From: CiaranG Date: Tue, 28 Apr 2009 13:30:54 +0100 Subject: Only start daemons that are required, according to the site config. There is the potential to not start some more - see the checks in getvaliddaemons.php --- scripts/getvaliddaemons.php | 52 +++++++++++++++++++++++++++++++++++++++++++++ scripts/startdaemons.sh | 6 ++---- 2 files changed, 54 insertions(+), 4 deletions(-) create mode 100755 scripts/getvaliddaemons.php diff --git a/scripts/getvaliddaemons.php b/scripts/getvaliddaemons.php new file mode 100755 index 000000000..482e63af7 --- /dev/null +++ b/scripts/getvaliddaemons.php @@ -0,0 +1,52 @@ +#!/usr/bin/env php +. + */ + +/** + * Utility script to get a list of daemons that should run, based on the + * current configuration. This is used by startdaemons.sh to determine what + * it should and shouldn't start up. The output is a list of space-separated + * daemon names. + */ + + +# Abort if called from a web server +if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) { + print "This script must be run from the command line\n"; + exit(); +} + +define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); +define('LACONICA', true); + +require_once(INSTALLDIR . '/lib/common.php'); + +if(common_config('xmpp','enabled')) { + echo "xmppdaemon.php jabberqueuehandler.php publicqueuehandler.php "; + echo "xmppconfirmhandler.php "; +} +if(common_config('memcached','enabled')) { + echo "memcachedqueuehandler.php "; +} +echo "ombqueuehandler.php "; +echo "twitterqueuehandler.php "; +echo "facebookqueuehandler.php "; +echo "pingqueuehandler.php "; +echo "inboxqueuehandler.php "; +echo "smsqueuehandler.php "; diff --git a/scripts/startdaemons.sh b/scripts/startdaemons.sh index 66f9ed4e0..3869e95c4 100755 --- a/scripts/startdaemons.sh +++ b/scripts/startdaemons.sh @@ -21,11 +21,9 @@ # Note that the 'maildaemon' needs to run as a mail filter. DIR=`dirname $0` +DAEMONS=`php $DIR/getvaliddaemons.php` -for f in xmppdaemon.php jabberqueuehandler.php publicqueuehandler.php \ - xmppconfirmhandler.php smsqueuehandler.php ombqueuehandler.php \ - twitterqueuehandler.php facebookqueuehandler.php pingqueuehandler.php \ - memcachedqueuehandler.php inboxqueuehandler.php; do +for f in $DAEMONS; do echo -n "Starting $f..."; php $DIR/$f -- cgit v1.2.3 From c7105c2af1ebe3cddd477265c6fea59a61d0c7e5 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 28 Apr 2009 13:07:05 -0400 Subject: Change to avoid a join in notice inbox The join in notice_inbox is causing temp-table sorting on identi.ca, so I'm trying a finer-tuned approach. --- classes/Notice.php | 31 ++++++++++++--- classes/Notice_inbox.php | 101 ++++++++++++++++++++++++++++++++++++++++++++++- classes/User.php | 29 +------------- 3 files changed, 127 insertions(+), 34 deletions(-) diff --git a/classes/Notice.php b/classes/Notice.php index 27b98de1c..b087c94bc 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -215,6 +215,7 @@ class Notice extends Memcached_DataObject if (common_config('queue', 'enabled')) { $notice->blowAuthorCaches(); } else { + common_debug("Blowing caches for new notice."); $notice->blowCaches(); } } @@ -285,7 +286,7 @@ class Notice extends Memcached_DataObject // Clear the user's cache $cache = common_memcache(); if (!empty($cache)) { - $cache->delete(common_cache_key('user:notices_with_friends:' . $this->profile_id)); + $cache->delete(common_cache_key('notice_inbox:by_user:'.$this->profile_id)); } $this->blowNoticeCache($blowLast); $this->blowPublicCache($blowLast); @@ -307,9 +308,9 @@ class Notice extends Memcached_DataObject $member->group_id = $group_inbox->group_id; if ($member->find()) { while ($member->fetch()) { - $cache->delete(common_cache_key('user:notices_with_friends:' . $member->profile_id)); + $cache->delete(common_cache_key('notice_inbox:by_user:' . $member->profile_id)); if ($blowLast) { - $cache->delete(common_cache_key('user:notices_with_friends:' . $member->profile_id . ';last')); + $cache->delete(common_cache_key('notice_inbox:by_user:' . $member->profile_id . ';last')); } } } @@ -352,9 +353,9 @@ class Notice extends Memcached_DataObject 'WHERE subscription.subscribed = ' . $this->profile_id); while ($user->fetch()) { - $cache->delete(common_cache_key('user:notices_with_friends:' . $user->id)); + $cache->delete(common_cache_key('notice_inbox:by_user:'.$user_id)); if ($blowLast) { - $cache->delete(common_cache_key('user:notices_with_friends:' . $user->id . ';last')); + $cache->delete(common_cache_key('notice_inbox:by_user:'.$user_id.';last')); } } $user->free(); @@ -613,6 +614,26 @@ class Notice extends Memcached_DataObject return $wrapper; } + function getStreamByIds($ids) + { + $cache = common_memcache(); + + if (!empty($cache)) { + $notices = array(); + foreach ($ids as $id) { + $notices[] = Notice::staticGet('id', $id); + } + return new ArrayWrapper($notices); + } else { + $notice = new Notice(); + $notice->whereAdd('id in (' . implode(', ', $ids) . ')'); + $notice->orderBy('id DESC'); + + $notice->find(); + return $notice; + } + } + function publicStream($offset=0, $limit=20, $since_id=0, $before_id=0, $since=null) { diff --git a/classes/Notice_inbox.php b/classes/Notice_inbox.php index 81ddb4538..162da74fe 100644 --- a/classes/Notice_inbox.php +++ b/classes/Notice_inbox.php @@ -1,7 +1,7 @@ INBOX_CACHE_WINDOW) { + common_debug('Doing direct DB hit for notice_inbox since the params are screwy.'); + return Notice_inbox::_streamDirect($user_id, $offset, $limit, $since_id, $before_id, $since); + } + + $idkey = common_cache_key('notice_inbox:by_user:'.$user_id); + + $idstr = $cache->get($idkey); + + if (!empty($idstr)) { + // Cache hit! Woohoo! + common_debug('Cache hit for notice_inbox.'); + $window = explode(',', $idstr); + $ids = array_slice($window, $offset, $limit); + return $ids; + } + + $laststr = common_cache_key($idkey.';last'); + + if (!empty($laststr)) { + common_debug('Cache hit for notice_inbox on last item.'); + + $window = explode(',', $laststr); + $last_id = $window[0]; + $new_ids = Notice_inbox::_streamDirect($user_id, 0, INBOX_CACHE_WINDOW, + $last_id, null, null); + + $new_window = array_merge($new_ids, $window); + + $new_windowstr = implode(',', $new_window); + + $result = $cache->set($idkey, $new_windowstr); + $result = $cache->set($idkey . ';last', $new_windowstr); + + $ids = array_slice($new_window, $offset, $limit); + + return $ids; + } + + $window = Notice_inbox::_streamDirect($user_id, 0, INBOX_CACHE_WINDOW, + null, null, null); + + $windowstr = implode(',', $new_window); + + $result = $cache->set($idkey, $windowstr); + $result = $cache->set($idkey . ';last', $windowstr); + + $ids = array_slice($window, $offset, $limit); + + return $ids; + } + + function _streamDirect($user_id, $offset, $limit, $since_id, $before_id, $since) + { + $inbox = new Notice_inbox(); + + $inbox->user_id = $user_id; + + if ($since_id != 0) { + $inbox->whereAdd('notice_id > ' . $since_id); + } + + if ($before_id != 0) { + $inbox->whereAdd('notice_id < ' . $before_id); + } + + if (!is_null($since)) { + $inbox->whereAdd('created > \'' . date('Y-m-d H:i:s', $since) . '\''); + } + + $inbox->orderBy('notice_id DESC'); + + if (!is_null($offset)) { + $inbox->limit($offset, $limit); + } + + $ids = array(); + + if ($inbox->find()) { + while ($inbox->fetch()) { + $ids[] = $inbox->notice_id; + } + } + + return $ids; + } } diff --git a/classes/User.php b/classes/User.php index 098381f73..ce7ea1464 100644 --- a/classes/User.php +++ b/classes/User.php @@ -451,34 +451,9 @@ class User extends Memcached_DataObject } else if ($enabled === true || ($enabled == 'transitional' && $this->inboxed == 1)) { - $cache = common_memcache(); + $ids = Notice_inbox::stream($this->id, $offset, $limit, $since_id, $before_id, $since); - if (!empty($cache)) { - - # Get the notices out of the cache - - $notices = $cache->get(common_cache_key($cachekey)); - - # On a cache hit, return a DB-object-like wrapper - - if ($notices !== false) { - $wrapper = new ArrayWrapper(array_slice($notices, $offset, $limit)); - return $wrapper; - } - } - - $inbox = Notice_inbox::stream($this->id, $offset, $limit, $since_id, $before_id, $since); - - $ids = array(); - - while ($inbox->fetch()) { - $ids[] = $inbox->notice_id; - } - - $inbox->free(); - unset($inbox); - - return Notice::getStreamByIds($ids, 'user:notices_with_friends:' . $this->id); + return Notice::getStreamByIds($ids); } } -- cgit v1.2.3 From fe53e780be5db4ceb2831a1d69faec6130a10deb Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 28 Apr 2009 13:31:56 -0400 Subject: Remove some debug comments in query-by-id --- classes/Notice.php | 5 ++--- classes/Notice_inbox.php | 4 ---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/classes/Notice.php b/classes/Notice.php index b087c94bc..49d0939c1 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -215,7 +215,6 @@ class Notice extends Memcached_DataObject if (common_config('queue', 'enabled')) { $notice->blowAuthorCaches(); } else { - common_debug("Blowing caches for new notice."); $notice->blowCaches(); } } @@ -353,9 +352,9 @@ class Notice extends Memcached_DataObject 'WHERE subscription.subscribed = ' . $this->profile_id); while ($user->fetch()) { - $cache->delete(common_cache_key('notice_inbox:by_user:'.$user_id)); + $cache->delete(common_cache_key('notice_inbox:by_user:'.$user->id)); if ($blowLast) { - $cache->delete(common_cache_key('notice_inbox:by_user:'.$user_id.';last')); + $cache->delete(common_cache_key('notice_inbox:by_user:'.$user->id.';last')); } } $user->free(); diff --git a/classes/Notice_inbox.php b/classes/Notice_inbox.php index 162da74fe..f32137038 100644 --- a/classes/Notice_inbox.php +++ b/classes/Notice_inbox.php @@ -50,7 +50,6 @@ class Notice_inbox extends Memcached_DataObject if (empty($cache) || $since_id != 0 || $before_id != 0 || !is_null($since) || ($offset + $limit) > INBOX_CACHE_WINDOW) { - common_debug('Doing direct DB hit for notice_inbox since the params are screwy.'); return Notice_inbox::_streamDirect($user_id, $offset, $limit, $since_id, $before_id, $since); } @@ -60,7 +59,6 @@ class Notice_inbox extends Memcached_DataObject if (!empty($idstr)) { // Cache hit! Woohoo! - common_debug('Cache hit for notice_inbox.'); $window = explode(',', $idstr); $ids = array_slice($window, $offset, $limit); return $ids; @@ -69,8 +67,6 @@ class Notice_inbox extends Memcached_DataObject $laststr = common_cache_key($idkey.';last'); if (!empty($laststr)) { - common_debug('Cache hit for notice_inbox on last item.'); - $window = explode(',', $laststr); $last_id = $window[0]; $new_ids = Notice_inbox::_streamDirect($user_id, 0, INBOX_CACHE_WINDOW, -- cgit v1.2.3 From e85cddba45c2ce02d135f00acdcfa37cb9168130 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Tue, 28 Apr 2009 23:31:00 -0700 Subject: Ticket #1428 - Changed replies API method to "mentions". --- actions/twitapistatuses.php | 38 +++++++++++++++++++++----------------- lib/router.php | 4 ++-- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/actions/twitapistatuses.php b/actions/twitapistatuses.php index 323c4f1f8..3abeba367 100644 --- a/actions/twitapistatuses.php +++ b/actions/twitapistatuses.php @@ -144,10 +144,10 @@ class TwitapistatusesAction extends TwitterapiAction break; case 'atom': if (isset($apidata['api_arg'])) { - $selfuri = $selfuri = common_root_url() . + $selfuri = common_root_url() . 'api/statuses/friends_timeline/' . $apidata['api_arg'] . '.atom'; } else { - $selfuri = $selfuri = common_root_url() . + $selfuri = common_root_url() . 'api/statuses/friends_timeline.atom'; } $this->show_atom_timeline($notice, $title, $id, $link, $subtitle, null, $selfuri); @@ -231,10 +231,10 @@ class TwitapistatusesAction extends TwitterapiAction break; case 'atom': if (isset($apidata['api_arg'])) { - $selfuri = $selfuri = common_root_url() . + $selfuri = common_root_url() . 'api/statuses/user_timeline/' . $apidata['api_arg'] . '.atom'; } else { - $selfuri = $selfuri = common_root_url() . + $selfuri = common_root_url() . 'api/statuses/user_timeline.atom'; } $this->show_atom_timeline($notice, $title, $id, $link, $subtitle, $suplink, $selfuri); @@ -344,7 +344,7 @@ class TwitapistatusesAction extends TwitterapiAction $this->show($args, $apidata); } - function replies($args, $apidata) + function mentions($args, $apidata) { parent::handle($args); @@ -360,11 +360,13 @@ class TwitapistatusesAction extends TwitterapiAction $profile = $user->getProfile(); $sitename = common_config('site', 'name'); - $title = sprintf(_('%1$s / Updates replying to %2$s'), $sitename, $user->nickname); + $title = sprintf(_('%1$s / Updates mentioning %2$s'), + $sitename, $user->nickname); $taguribase = common_config('integration', 'taguri'); - $id = "tag:$taguribase:Replies:".$user->id; + $id = "tag:$taguribase:Mentions:".$user->id; $link = common_local_url('replies', array('nickname' => $user->nickname)); - $subtitle = sprintf(_('%1$s updates that reply to updates from %2$s / %3$s.'), $sitename, $user->nickname, $profile->getBestName()); + $subtitle = sprintf(_('%1$s updates that reply to updates from %2$s / %3$s.'), + $sitename, $user->nickname, $profile->getBestName()); if (!$page) { $page = 1; @@ -385,7 +387,8 @@ class TwitapistatusesAction extends TwitterapiAction $since = strtotime($this->arg('since')); - $notice = $user->getReplies((($page-1)*20), $count, $since_id, $before_id, $since); + $notice = $user->getReplies((($page-1)*20), + $count, $since_id, $before_id, $since); $notices = array(); while ($notice->fetch()) { @@ -400,14 +403,10 @@ class TwitapistatusesAction extends TwitterapiAction $this->show_rss_timeline($notices, $title, $link, $subtitle); break; case 'atom': - if (isset($apidata['api_arg'])) { - $selfuri = $selfuri = common_root_url() . - 'api/statuses/replies/' . $apidata['api_arg'] . '.atom'; - } else { - $selfuri = $selfuri = common_root_url() . - 'api/statuses/replies.atom'; - } - $this->show_atom_timeline($notices, $title, $id, $link, $subtitle, null, $selfuri); + $selfuri = common_root_url() . + ltrim($_SERVER['QUERY_STRING'], 'p='); + $this->show_atom_timeline($notices, $title, $id, $link, $subtitle, + null, $selfuri); break; case 'json': $this->show_json_timeline($notices); @@ -418,6 +417,11 @@ class TwitapistatusesAction extends TwitterapiAction } + function replies($args, $apidata) + { + call_user_func(array($this, 'mentions'), $args, $apidata); + } + function show($args, $apidata) { parent::handle($args); diff --git a/lib/router.php b/lib/router.php index 6fb2f9487..12590b790 100644 --- a/lib/router.php +++ b/lib/router.php @@ -231,12 +231,12 @@ class Router $m->connect('api/statuses/:method', array('action' => 'api', 'apiaction' => 'statuses'), - array('method' => '(public_timeline|friends_timeline|user_timeline|update|replies|friends|followers|featured)(\.(atom|rss|xml|json))?')); + array('method' => '(public_timeline|friends_timeline|user_timeline|update|replies|mentions|friends|followers|featured)(\.(atom|rss|xml|json))?')); $m->connect('api/statuses/:method/:argument', array('action' => 'api', 'apiaction' => 'statuses'), - array('method' => '(user_timeline|friends_timeline|replies|show|destroy|friends|followers)')); + array('method' => '(user_timeline|friends_timeline|replies|mentions|show|destroy|friends|followers)')); // users -- cgit v1.2.3 From 10ef8a2f7112a83188e9702d480abd3c6062c26c Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 29 Apr 2009 11:27:45 -0400 Subject: Move algorithm for caching to Notice class Moved the algorithm for notice stream caching to the Notice class. --- classes/Notice.php | 55 +++++++++++++++++++++++++++++++++++++++++++++++ classes/Notice_inbox.php | 56 +++++------------------------------------------- 2 files changed, 60 insertions(+), 51 deletions(-) diff --git a/classes/Notice.php b/classes/Notice.php index 49d0939c1..faabb1e14 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -967,4 +967,59 @@ class Notice extends Memcached_DataObject array('notice' => $this->id)); } } + + function stream($fn, $args, $cachekey, $offset=0, $limit=20, $since_id=0, $before_id=0, $since=null) + { + $cache = common_memcache(); + + if (empty($cache) || + $since_id != 0 || $before_id != 0 || !is_null($since) || + ($offset + $limit) > NOTICE_CACHE_WINDOW) { + return call_user_func_array($fn, array_merge($args, array($offset, $limit, $since_id, + $before_id, $since))); + } + + $idkey = common_cache_key($cachekey); + + $idstr = $cache->get($idkey); + + if (!empty($idstr)) { + // Cache hit! Woohoo! + $window = explode(',', $idstr); + $ids = array_slice($window, $offset, $limit); + return $ids; + } + + $laststr = common_cache_key($idkey.';last'); + + if (!empty($laststr)) { + $window = explode(',', $laststr); + $last_id = $window[0]; + $new_ids = call_user_func_array($fn, array_merge($args, array(0, NOTICE_CACHE_WINDOW, + $last_id, 0, null))); + + $new_window = array_merge($new_ids, $window); + + $new_windowstr = implode(',', $new_window); + + $result = $cache->set($idkey, $new_windowstr); + $result = $cache->set($idkey . ';last', $new_windowstr); + + $ids = array_slice($new_window, $offset, $limit); + + return $ids; + } + + $window = call_user_func_array($fn, array_merge($args, array(0, NOTICE_CACHE_WINDOW, + 0, 0, null))); + + $windowstr = implode(',', $new_window); + + $result = $cache->set($idkey, $windowstr); + $result = $cache->set($idkey . ';last', $windowstr); + + $ids = array_slice($window, $offset, $limit); + + return $ids; + } } diff --git a/classes/Notice_inbox.php b/classes/Notice_inbox.php index f32137038..dec14b0d1 100644 --- a/classes/Notice_inbox.php +++ b/classes/Notice_inbox.php @@ -43,58 +43,12 @@ class Notice_inbox extends Memcached_DataObject /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE - function stream($user_id, $offset=0, $limit=20, $since_id=0, $before_id=0, $since=null) + function stream($user_id, $offset, $limit, $since_id, $before_id, $since) { - $cache = common_memcache(); - - if (empty($cache) || - $since_id != 0 || $before_id != 0 || !is_null($since) || - ($offset + $limit) > INBOX_CACHE_WINDOW) { - return Notice_inbox::_streamDirect($user_id, $offset, $limit, $since_id, $before_id, $since); - } - - $idkey = common_cache_key('notice_inbox:by_user:'.$user_id); - - $idstr = $cache->get($idkey); - - if (!empty($idstr)) { - // Cache hit! Woohoo! - $window = explode(',', $idstr); - $ids = array_slice($window, $offset, $limit); - return $ids; - } - - $laststr = common_cache_key($idkey.';last'); - - if (!empty($laststr)) { - $window = explode(',', $laststr); - $last_id = $window[0]; - $new_ids = Notice_inbox::_streamDirect($user_id, 0, INBOX_CACHE_WINDOW, - $last_id, null, null); - - $new_window = array_merge($new_ids, $window); - - $new_windowstr = implode(',', $new_window); - - $result = $cache->set($idkey, $new_windowstr); - $result = $cache->set($idkey . ';last', $new_windowstr); - - $ids = array_slice($new_window, $offset, $limit); - - return $ids; - } - - $window = Notice_inbox::_streamDirect($user_id, 0, INBOX_CACHE_WINDOW, - null, null, null); - - $windowstr = implode(',', $new_window); - - $result = $cache->set($idkey, $windowstr); - $result = $cache->set($idkey . ';last', $windowstr); - - $ids = array_slice($window, $offset, $limit); - - return $ids; + return Notice::stream(array('Notice_inbox', '_streamDirect'), + array($user_id), + 'notice_inbox:by_user:'.$user_id, + $offset, $limit, $since_id, $before_id, $since); } function _streamDirect($user_id, $offset, $limit, $since_id, $before_id, $since) -- cgit v1.2.3 From a4d959b8a2254d173bdf45f418f6add9f6f62cda Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 29 Apr 2009 12:05:31 -0400 Subject: Public stream uses IDs method Public stream now uses IDs method --- classes/Notice.php | 55 +++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 44 insertions(+), 11 deletions(-) diff --git a/classes/Notice.php b/classes/Notice.php index faabb1e14..6a7522bd3 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -635,25 +635,58 @@ class Notice extends Memcached_DataObject function publicStream($offset=0, $limit=20, $since_id=0, $before_id=0, $since=null) { + $ids = Notice::stream(array('Notice', '_publicStreamDirect'), + array(), + 'public', + $offset, $limit, $since_id, $before_id, $since); - $parts = array(); + return Notice::getStreamByIds($ids); + } + + function _publicStreamDirect($offset=0, $limit=20, $since_id=0, $before_id=0, $since=null) + { + $notice = new Notice(); + + $notice->selectAdd(); // clears it + $notice->selectAdd('id'); - $qry = 'SELECT * FROM notice '; + $notice->orderBy('id DESC'); + + if (!is_null($offset)) { + $notice->limit($offset, $limit); + } if (common_config('public', 'localonly')) { - $parts[] = 'is_local = 1'; + $notice->whereAdd('is_local = 1'); } else { # -1 == blacklisted - $parts[] = 'is_local != -1'; + $notice->whereAdd('is_local != -1'); } - if ($parts) { - $qry .= ' WHERE ' . implode(' AND ', $parts); + if ($since_id != 0) { + $notice->whereAdd('id > ' . $since_id); } - return Notice::getStream($qry, - 'public', - $offset, $limit, $since_id, $before_id, null, $since); + if ($before_id != 0) { + $notice->whereAdd('id < ' . $before_id); + } + + if (!is_null($since)) { + $notice->whereAdd('created > \'' . date('Y-m-d H:i:s', $since) . '\''); + } + + $ids = array(); + + if ($notice->find()) { + while ($notice->fetch()) { + $ids[] = $notice->id; + } + } + + $notice->free(); + $notice = NULL; + + return $ids; } function addToInboxes() @@ -990,7 +1023,7 @@ class Notice extends Memcached_DataObject return $ids; } - $laststr = common_cache_key($idkey.';last'); + $laststr = $cache->get($idkey.';last'); if (!empty($laststr)) { $window = explode(',', $laststr); @@ -1013,7 +1046,7 @@ class Notice extends Memcached_DataObject $window = call_user_func_array($fn, array_merge($args, array(0, NOTICE_CACHE_WINDOW, 0, 0, null))); - $windowstr = implode(',', $new_window); + $windowstr = implode(',', $window); $result = $cache->set($idkey, $windowstr); $result = $cache->set($idkey . ';last', $windowstr); -- cgit v1.2.3 From 1e8ea1eb460b163176c4d7d1e7dffa500024ef91 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 29 Apr 2009 16:09:03 -0400 Subject: Make the tag stream use ID mechanism --- classes/Notice.php | 5 +---- classes/Notice_tag.php | 61 +++++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 52 insertions(+), 14 deletions(-) diff --git a/classes/Notice.php b/classes/Notice.php index 6a7522bd3..2bb466155 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -328,10 +328,7 @@ class Notice extends Memcached_DataObject $tag->notice_id = $this->id; if ($tag->find()) { while ($tag->fetch()) { - $cache->delete(common_cache_key('notice_tag:notice_stream:' . $tag->tag)); - if ($blowLast) { - $cache->delete(common_cache_key('notice_tag:notice_stream:' . $tag->tag . ';last')); - } + $tag->blowCache($blowLast); } } $tag->free(); diff --git a/classes/Notice_tag.php b/classes/Notice_tag.php index f2247299a..e5b772243 100644 --- a/classes/Notice_tag.php +++ b/classes/Notice_tag.php @@ -37,21 +37,62 @@ class Notice_tag extends Memcached_DataObject ###END_AUTOCODE static function getStream($tag, $offset=0, $limit=20) { - $qry = - 'SELECT notice.* ' . - 'FROM notice JOIN notice_tag ON notice.id = notice_tag.notice_id ' . - "WHERE notice_tag.tag = '%s' "; - - return Notice::getStream(sprintf($qry, $tag), - 'notice_tag:notice_stream:' . common_keyize($tag), - $offset, $limit); + + $ids = Notice::stream(array('Notice_tag', '_streamDirect'), + array($tag), + 'notice_tag:notice_ids:' . common_keyize($tag), + $offset, $limit); + + return Notice::getStreamByIds($ids); + } + + function _streamDirect($tag, $offset, $limit, $since_id, $before_id, $since) + { + $nt = new Notice_tag(); + + $nt->tag = $tag; + + $nt->selectAdd(); + $nt->selectAdd('notice_id'); + + if ($since_id != 0) { + $nt->whereAdd('notice_id > ' . $since_id); + } + + if ($before_id != 0) { + $nt->whereAdd('notice_id < ' . $before_id); + } + + if (!is_null($since)) { + $nt->whereAdd('created > \'' . date('Y-m-d H:i:s', $since) . '\''); + } + + $nt->orderBy('notice_id DESC'); + + if (!is_null($offset)) { + $nt->limit($offset, $limit); + } + + $ids = array(); + + if ($nt->find()) { + while ($nt->fetch()) { + $ids[] = $nt->notice_id; + } + } + + return $ids; } - function blowCache() + function blowCache($blowLast=false) { $cache = common_memcache(); if ($cache) { - $cache->delete(common_cache_key('notice_tag:notice_stream:' . $this->tag)); + $idkey = common_cache_key('notice_tag:notice_ids:' . common_keyize($this->tag)); + $cache->delete($idkey); + if ($blowLast) { + $cache->delete($idkey.';last'); + } } } -- cgit v1.2.3 From 8295402fb30a3854bae3b9d6c457c7c0e432c51a Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 29 Apr 2009 13:16:52 -0700 Subject: Added 'mentions' the the list of API methods requiring bare auth --- actions/api.php | 1 + 1 file changed, 1 insertion(+) diff --git a/actions/api.php b/actions/api.php index d2f0a2eff..8762b4bcd 100644 --- a/actions/api.php +++ b/actions/api.php @@ -130,6 +130,7 @@ class ApiAction extends Action 'statuses/friends_timeline', 'statuses/friends', 'statuses/replies', + 'statuses/mentions', 'statuses/followers', 'favorites/favorites'); -- cgit v1.2.3 From b79fef307481b36b4d04dbabb54e3f6d9edf6896 Mon Sep 17 00:00:00 2001 From: CiaranG Date: Wed, 29 Apr 2009 23:43:42 +0100 Subject: Fixed remote subscription, broken in fc6cedd2227d9d560736e494f431e2b40b26b45c --- actions/accesstoken.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/accesstoken.php b/actions/accesstoken.php index bb68d3314..46b43c702 100644 --- a/actions/accesstoken.php +++ b/actions/accesstoken.php @@ -59,7 +59,7 @@ class AccesstokenAction extends Action try { common_debug('getting request from env variables', __FILE__); common_remove_magic_from_request(); - $req = OAuthRequest::from_request('POST', common_locale_url('accesstoken')); + $req = OAuthRequest::from_request('POST', common_local_url('accesstoken')); common_debug('getting a server', __FILE__); $server = omb_oauth_server(); common_debug('fetching the access token', __FILE__); -- cgit v1.2.3 From aee641ee1e311fb0af0f9f6d75ca7fae2c7d8477 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 29 Apr 2009 20:45:33 -0400 Subject: make replies use new query format --- classes/Notice.php | 4 ++-- classes/Reply.php | 47 +++++++++++++++++++++++++++++++++++++++++++++-- classes/User.php | 10 +++------- 3 files changed, 50 insertions(+), 11 deletions(-) diff --git a/classes/Notice.php b/classes/Notice.php index 2bb466155..808631f4d 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -380,9 +380,9 @@ class Notice extends Memcached_DataObject $reply->notice_id = $this->id; if ($reply->find()) { while ($reply->fetch()) { - $cache->delete(common_cache_key('user:replies:'.$reply->profile_id)); + $cache->delete(common_cache_key('reply:stream:'.$reply->profile_id)); if ($blowLast) { - $cache->delete(common_cache_key('user:replies:'.$reply->profile_id.';last')); + $cache->delete(common_cache_key('reply:stream:'.$reply->profile_id.';last')); } } } diff --git a/classes/Reply.php b/classes/Reply.php index af86aaf87..4439053b4 100644 --- a/classes/Reply.php +++ b/classes/Reply.php @@ -4,7 +4,7 @@ */ require_once INSTALLDIR.'/classes/Memcached_DataObject.php'; -class Reply extends Memcached_DataObject +class Reply extends Memcached_DataObject { ###START_AUTOCODE /* the code below is auto generated do not remove the above tag */ @@ -13,7 +13,7 @@ class Reply extends Memcached_DataObject public $notice_id; // int(4) primary_key not_null public $profile_id; // int(4) primary_key not_null public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP - public $replied_id; // int(4) + public $replied_id; // int(4) /* Static get */ function staticGet($k,$v=null) @@ -21,4 +21,47 @@ class Reply extends Memcached_DataObject /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE + + function stream($user_id, $offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) + { + $ids = Notice::stream(array('Reply', '_streamDirect'), + array($user_id), + 'reply:stream:' . $user_id, + $offset, $limit, $since_id, $before_id, $since); + return $ids; + } + + function _streamDirect($user_id, $offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) + { + $reply = new Reply(); + $reply->profile_id = $user_id; + + if ($since_id != 0) { + $reply->whereAdd('notice_id > ' . $since_id); + } + + if ($before_id != 0) { + $reply->whereAdd('notice_id < ' . $before_id); + } + + if (!is_null($since)) { + $reply->whereAdd('modified > \'' . date('Y-m-d H:i:s', $since) . '\''); + } + + $reply->orderBy('notice_id DESC'); + + if (!is_null($offset)) { + $reply->limit($offset, $limit); + } + + $ids = array(); + + if ($reply->find()) { + while ($reply->fetch()) { + $ids[] = $reply->notice_id; + } + } + + return $ids; + } } diff --git a/classes/User.php b/classes/User.php index ce7ea1464..b76e45c33 100644 --- a/classes/User.php +++ b/classes/User.php @@ -401,13 +401,9 @@ class User extends Memcached_DataObject function getReplies($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) { - $qry = - 'SELECT notice.* ' . - 'FROM notice JOIN reply ON notice.id = reply.notice_id ' . - 'WHERE reply.profile_id = %d '; - return Notice::getStream(sprintf($qry, $this->id), - 'user:replies:'.$this->id, - $offset, $limit, $since_id, $before_id, null, $since); + $ids = Reply::stream($this->id, $offset, $limit, $since_id, $before_id, $since); + common_debug("Ids = " . implode(',', $ids)); + return Notice::getStreamByIds($ids); } function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) -- cgit v1.2.3 From 8a142b272c87678268106df48497b90664be323a Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 1 May 2009 07:08:01 -0400 Subject: ignore Eclipse project files --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 83a53dfa3..da6947bfd 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,6 @@ dataobject.ini *.rej .#* *.swp +.buildpath +.project +.settings -- cgit v1.2.3 From 9cac6413a342445a998773458b215d129c2be2d1 Mon Sep 17 00:00:00 2001 From: Ori Avtalion Date: Fri, 1 May 2009 07:11:28 -0400 Subject: Add s to user favorite notices --- actions/favoritesrss.php | 2 +- actions/showfavorites.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/actions/favoritesrss.php b/actions/favoritesrss.php index f85bf1b19..6b46b8dec 100644 --- a/actions/favoritesrss.php +++ b/actions/favoritesrss.php @@ -107,7 +107,7 @@ class FavoritesrssAction extends Rss10Action $c = array('url' => common_local_url('favoritesrss', array('nickname' => $user->nickname)), - 'title' => sprintf(_("%s favorite notices"), $user->nickname), + 'title' => sprintf(_("%s's favorite notices"), $user->nickname), 'link' => common_local_url('showfavorites', array('nickname' => $user->nickname)), diff --git a/actions/showfavorites.php b/actions/showfavorites.php index 6e011d5ca..eed62a2ab 100644 --- a/actions/showfavorites.php +++ b/actions/showfavorites.php @@ -74,9 +74,9 @@ class ShowfavoritesAction extends Action function title() { if ($this->page == 1) { - return sprintf(_("%s favorite notices"), $this->user->nickname); + return sprintf(_("%s's favorite notices"), $this->user->nickname); } else { - return sprintf(_("%s favorite notices, page %d"), + return sprintf(_("%s's favorite notices, page %d"), $this->user->nickname, $this->page); } -- cgit v1.2.3 From c5e72e248fa70b5e038c74b73b581884112706d5 Mon Sep 17 00:00:00 2001 From: Ori Avtalion Date: Fri, 1 May 2009 07:12:13 -0400 Subject: Several whitespace fixes --- actions/openidsettings.php | 4 ++-- actions/recoverpassword.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/actions/openidsettings.php b/actions/openidsettings.php index 92469d20f..5f59ebc01 100644 --- a/actions/openidsettings.php +++ b/actions/openidsettings.php @@ -67,8 +67,8 @@ class OpenidsettingsAction extends AccountSettingsAction function getInstructions() { - return _('[OpenID](%%doc.openid%%) lets you log into many sites ' . - ' with the same user account. '. + return _('[OpenID](%%doc.openid%%) lets you log into many sites' . + ' with the same user account.'. ' Manage your associated OpenIDs from here.'); } diff --git a/actions/recoverpassword.php b/actions/recoverpassword.php index 620fe7eb8..82263fcd5 100644 --- a/actions/recoverpassword.php +++ b/actions/recoverpassword.php @@ -151,11 +151,11 @@ class RecoverpasswordAction extends Action $this->element('p', null, _('If you\'ve forgotten or lost your' . ' password, you can get a new one sent to' . - ' the email address you have stored ' . + ' the email address you have stored' . ' in your account.')); } else if ($this->mode == 'reset') { $this->element('p', null, - _('You\'ve been identified. Enter a ' . + _('You\'ve been identified. Enter a' . ' new password below. ')); } $this->elementEnd('div'); -- cgit v1.2.3 From 609ac4c22463af88c206968134ab16e75e500edd Mon Sep 17 00:00:00 2001 From: Ori Avtalion Date: Fri, 1 May 2009 07:12:37 -0400 Subject: Fix link to identi.ca in JavaScript badge --- js/identica-badge.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/identica-badge.js b/js/identica-badge.js index 869230b7a..ffa55ae93 100644 --- a/js/identica-badge.js +++ b/js/identica-badge.js @@ -128,7 +128,7 @@ var a = document.createElement('A'); a.innerHTML = 'get this'; a.target = '_blank'; - a.href = 'http://identica/doc/badge'; + a.href = 'http://identi.ca/doc/badge'; $.s.f.appendChild(a); $.s.appendChild($.s.f); $.f.getUser(); -- cgit v1.2.3 From a86a0e91a5acb5ea894a3d066f9adf3b1ef305ae Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 1 May 2009 08:00:37 -0700 Subject: add favor, reply, delete buttons for cometed notices --- plugins/Comet/CometPlugin.php | 16 ++++++++- plugins/Comet/updatetimeline.js | 74 ++++++++++++++++++++++++++++++++++++++--- 2 files changed, 85 insertions(+), 5 deletions(-) diff --git a/plugins/Comet/CometPlugin.php b/plugins/Comet/CometPlugin.php index 2e0bb40a4..48ac9dcad 100644 --- a/plugins/Comet/CometPlugin.php +++ b/plugins/Comet/CometPlugin.php @@ -82,8 +82,22 @@ class CometPlugin extends Plugin ' '); } + $user = common_current_user(); + + if (!empty($user->id)) { + $user_id = $user->id; + } else { + $user_id = 0; + } + + $replyurl = common_local_url('newnotice'); + $favorurl = common_local_url('favor'); + // FIXME: need to find a better way to pass this pattern in + $deleteurl = common_local_url('deletenotice', + array('notice' => '0000000000')); + $action->elementStart('script', array('type' => 'text/javascript')); - $action->raw("$(document).ready(function() { updater.init(\"$this->server\", \"$timeline\");});"); + $action->raw("$(document).ready(function() { updater.init(\"$this->server\", \"$timeline\", $user_id, \"$replyurl\", \"$favorurl\", \"$deleteurl\"); });"); $action->elementEnd('script'); return true; diff --git a/plugins/Comet/updatetimeline.js b/plugins/Comet/updatetimeline.js index de750baba..e89b3bddf 100644 --- a/plugins/Comet/updatetimeline.js +++ b/plugins/Comet/updatetimeline.js @@ -3,14 +3,26 @@ var updater = function() { + var _server; + var _timeline; + var _userid; + var _replyurl; + var _favorurl; + var _deleteurl; var _cometd; return { - init: function(server, timeline) + init: function(server, timeline, userid, replyurl, favorurl, deleteurl) { _cometd = $.cometd; // Uses the default Comet object _cometd.setLogLevel('debug'); _cometd.init(server); + _server = server; + _timeline = timeline; + _userid = userid; + _favorurl = favorurl; + _replyurl = replyurl; + _deleteurl = deleteurl; _cometd.subscribe(timeline, receive); $(window).unload(leave); } @@ -34,7 +46,7 @@ var updater = function() var noticeItem = makeNoticeItem(message.data); $("#notices_primary .notices").prepend(noticeItem, true); $("#notices_primary .notice:first").css({display:"none"}); - $("#notices_primary .notice:first").fadeIn(2500); + $("#notices_primary .notice:first").fadeIn(1000); NoticeHover(); NoticeReply(); } @@ -68,10 +80,64 @@ var updater = function() "
    "+data['source']+"
    "+ "
    "+ "
    "+ - "
    "+ - "
    "+ + "
    "; + + if (_userid != 0) { + var input = $("form#form_notice fieldset input#token"); + var session_key = input.val(); + ni = ni+makeFavoriteForm(data['id'], session_key); + ni = ni+makeReplyLink(data['id'], data['user']['screen_name']); + if (_userid == data['user']['id']) { + ni = ni+makeDeleteLink(data['id']); + } + } + + ni = ni+"
    "+ "
  • "; return ni; } + + function makeFavoriteForm(id, session_key) + { + var ff; + + ff = "
    "+ + "
    "+ + "Favor this notice"+ // XXX: i18n + ""+ + ""+ + ""+ + "
    "+ + "
    "; + return ff; + } + + function makeReplyLink(id, nickname) + { + var rl; + rl = "
    "+ + "
    Reply to this notice
    "+ + "
    "+ + "Reply "+id+""+ + ""+ + "
    "+ + "
    "; + return rl; + } + + function makeDeleteLink(id) + { + var dl, delurl; + delurl = _deleteurl.replace("0000000000", id); + + dl = "
    "+ + "
    Delete this notice
    "+ + "
    "+ + "Delete"+ + "
    "+ + "
    "; + + return dl; + } }(); -- cgit v1.2.3 From 5affe093aba97a0e4ac559b685a240d568929ffb Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 1 May 2009 08:39:47 -0700 Subject: add in_reply_to link and make HTML in source work correctly --- plugins/Comet/CometPlugin.php | 9 +++++++++ plugins/Comet/updatetimeline.js | 19 +++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/plugins/Comet/CometPlugin.php b/plugins/Comet/CometPlugin.php index 48ac9dcad..0f2fcd701 100644 --- a/plugins/Comet/CometPlugin.php +++ b/plugins/Comet/CometPlugin.php @@ -158,6 +158,15 @@ class CometPlugin extends Plugin $arr = $act->twitter_status_array($notice, true); $arr['url'] = $notice->bestUrl(); $arr['html'] = htmlspecialchars($notice->rendered); + $arr['source'] = htmlspecialchars($arr['source']); + + if (!empty($notice->reply_to)) { + $reply_to = Notice::staticGet('id', $notice->reply_to); + if (!empty($reply_to)) { + $arr['in_reply_to_status_url'] = $reply_to->bestUrl(); + } + $reply_to = null; + } $profile = $notice->getProfile(); $arr['user']['profile_url'] = $profile->profileurl; diff --git a/plugins/Comet/updatetimeline.js b/plugins/Comet/updatetimeline.js index e89b3bddf..170949e9b 100644 --- a/plugins/Comet/updatetimeline.js +++ b/plugins/Comet/updatetimeline.js @@ -54,7 +54,8 @@ var updater = function() function makeNoticeItem(data) { user = data['user']; - html = data['html'].replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); + html = data['html'].replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"'); + source = data['source'].replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"'); ni = "
  • "+ "
    "+ @@ -77,9 +78,19 @@ var updater = function() ""+ "
    "+ "
    From
    "+ - "
    "+data['source']+"
    "+ - "
    "+ - "
    "+ + "
    "+source+"
    "+ // may have a link, I think + ""; + + if (data['in_reply_to_status_id']) { + ni = ni+"
    "+ + "
    To
    "+ + "
    "+ + "in reply to"+ + "
    "+ + "
    "; + } + + ni = ni+""+ "
    "; if (_userid != 0) { -- cgit v1.2.3 From b12e72ae312488caf7cb1e1a396eb05dd38326a9 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 1 May 2009 09:42:38 -0700 Subject: optionally add a username/password on server side for Comet --- plugins/Comet/CometPlugin.php | 8 +++++--- plugins/Comet/bayeux.class.inc.php | 9 ++++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/plugins/Comet/CometPlugin.php b/plugins/Comet/CometPlugin.php index 0f2fcd701..45251c66f 100644 --- a/plugins/Comet/CometPlugin.php +++ b/plugins/Comet/CometPlugin.php @@ -45,9 +45,11 @@ class CometPlugin extends Plugin { var $server = null; - function __construct($server=null) + function __construct($server=null, $username=null, $password=null) { - $this->server = $server; + $this->server = $server; + $this->username = $username; + $this->password = $password; parent::__construct(); } @@ -131,7 +133,7 @@ class CometPlugin extends Plugin $json = $this->noticeAsJson($notice); // Bayeux? Comet? Huh? These terms confuse me - $bay = new Bayeux($this->server); + $bay = new Bayeux($this->server, $this->user, $this->password); foreach ($timelines as $timeline) { $this->log(LOG_INFO, "Posting notice $notice->id to '$timeline'."); diff --git a/plugins/Comet/bayeux.class.inc.php b/plugins/Comet/bayeux.class.inc.php index 785d3e393..39ad8a8fc 100644 --- a/plugins/Comet/bayeux.class.inc.php +++ b/plugins/Comet/bayeux.class.inc.php @@ -26,9 +26,12 @@ class Bayeux private $oCurl = ''; private $nNextId = 0; + private $sUser = ''; + private $sPassword = ''; + public $sUrl = ''; - function __construct($sUrl) + function __construct($sUrl, $sUser='', $sPassword='') { $this->sUrl = $sUrl; @@ -43,6 +46,10 @@ class Bayeux curl_setopt($this->oCurl, CURLOPT_POST, 1); curl_setopt($this->oCurl, CURLOPT_RETURNTRANSFER,1); + if (!is_null($sUser) && mb_strlen($sUser) > 0) { + curl_setopt($this->oCurl, CURLOPT_USERPWD,"$sUser:$sPassword"); + } + $this->handShake(); } -- cgit v1.2.3 From deb07487bd0802fa6a89cfc8ddd56af93945eb4c Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Fri, 1 May 2009 17:00:36 +0000 Subject: 60 seconds hard timeout for XHR notice posting. JavaScript throws an alert message to the client if the server doesn't respond back in any way. --- js/util.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/js/util.js b/js/util.js index f15c4f2bb..3f14bc61c 100644 --- a/js/util.js +++ b/js/util.js @@ -166,14 +166,20 @@ $(document).ready(function(){ $("#notice_action-submit").addClass("disabled"); return true; }, + timeout: '60000', error: function (xhr, textStatus, errorThrown) { $("#form_notice").removeClass("processing"); $("#notice_action-submit").removeAttr("disabled"); $("#notice_action-submit").removeClass("disabled"); - if ($(".error", xhr.responseXML).length > 0) { - $('#form_notice').append(document._importNode($(".error", xhr.responseXML).get(0), true)); + if (textStatus == "timeout") { + alert ("Sorry! We had trouble sending your notice. The servers are overloaded. Please try again, and contact the site administrator if this problem persists"); } else { - alert("Sorry! We had trouble sending your notice ("+xhr.status+" "+xhr.statusText+"). Please report the problem to the site administrator if this happens again."); + if ($(".error", xhr.responseXML).length > 0) { + $('#form_notice').append(document._importNode($(".error", xhr.responseXML).get(0), true)); + } + else { + alert("Sorry! We had trouble sending your notice ("+xhr.status+" "+xhr.statusText+"). Please report the problem to the site administrator if this happens again."); + } } }, success: function(xml) { if ($("#error", xml).length > 0) { @@ -189,7 +195,6 @@ $(document).ready(function(){ } else { li = $("li", xml).get(0); - id = li.id; if ($("#"+li.id).length == 0) { $("#notices_primary .notices").prepend(document._importNode(li, true)); $("#notices_primary .notice:first").css({display:"none"}); -- cgit v1.2.3 From 3328ec545c36fc2408cdb9d048effe24feafe218 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 1 May 2009 11:27:57 -0700 Subject: make profile notice getting use ids --- classes/Notice.php | 6 +++--- classes/Profile.php | 53 +++++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 48 insertions(+), 11 deletions(-) diff --git a/classes/Notice.php b/classes/Notice.php index 808631f4d..eceed325b 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -363,10 +363,10 @@ class Notice extends Memcached_DataObject { if ($this->is_local) { $cache = common_memcache(); - if ($cache) { - $cache->delete(common_cache_key('profile:notices:'.$this->profile_id)); + if (!empty($cache)) { + $cache->delete(common_cache_key('profile:notice_ids:'.$this->profile_id)); if ($blowLast) { - $cache->delete(common_cache_key('profile:notices:'.$this->profile_id.';last')); + $cache->delete(common_cache_key('profile:notice_ids:'.$this->profile_id.';last')); } } } diff --git a/classes/Profile.php b/classes/Profile.php index f3bfe299c..ae5641d79 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -155,14 +155,51 @@ class Profile extends Memcached_DataObject function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0) { - $qry = - 'SELECT * ' . - 'FROM notice ' . - 'WHERE profile_id = %d '; - - return Notice::getStream(sprintf($qry, $this->id), - 'profile:notices:'.$this->id, - $offset, $limit, $since_id, $before_id); + // XXX: I'm not sure this is going to be any faster. It probably isn't. + $ids = Notice::stream(array($this, '_streamDirect'), + array(), + 'profile:notice_ids:' . $this->id, + $offset, $limit, $since_id, $before_id); + + return Notice::getStreamByIds($ids); + } + + function _streamDirect($offset, $limit, $since_id, $before_id, $since) + { + $notice = new Notice(); + + $notice->profile_id = $this->id; + + $notice->selectAdd(); + $notice->selectAdd('id'); + + if ($since_id != 0) { + $notice->whereAdd('id > ' . $since_id); + } + + if ($before_id != 0) { + $notice->whereAdd('id < ' . $before_id); + } + + if (!is_null($since)) { + $notice->whereAdd('created > \'' . date('Y-m-d H:i:s', $since) . '\''); + } + + $notice->orderBy('id DESC'); + + if (!is_null($offset)) { + $notice->limit($offset, $limit); + } + + $ids = array(); + + if ($notice->find()) { + while ($notice->fetch()) { + $ids[] = $notice->id; + } + } + + return $ids; } function isMember($group) -- cgit v1.2.3 From 021b520a11d3449a1476182e1ad117582999d364 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 1 May 2009 11:38:50 -0700 Subject: Make user group stream use IDs --- classes/Notice.php | 4 ++-- classes/User_group.php | 53 ++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 47 insertions(+), 10 deletions(-) diff --git a/classes/Notice.php b/classes/Notice.php index eceed325b..c036e6e9e 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -299,9 +299,9 @@ class Notice extends Memcached_DataObject $group_inbox->notice_id = $this->id; if ($group_inbox->find()) { while ($group_inbox->fetch()) { - $cache->delete(common_cache_key('group:notices:'.$group_inbox->group_id)); + $cache->delete(common_cache_key('user_group:notice_ids:' . $group_inbox->group_id)); if ($blowLast) { - $cache->delete(common_cache_key('group:notices:'.$group_inbox->group_id.';last')); + $cache->delete(common_cache_key('user_group:notice_ids:' . $group_inbox->group_id.';last')); } $member = new Group_member(); $member->group_id = $group_inbox->group_id; diff --git a/classes/User_group.php b/classes/User_group.php index d152f9d56..7cc31e702 100755 --- a/classes/User_group.php +++ b/classes/User_group.php @@ -50,13 +50,50 @@ class User_group extends Memcached_DataObject function getNotices($offset, $limit) { - $qry = - 'SELECT notice.* ' . - 'FROM notice JOIN group_inbox ON notice.id = group_inbox.notice_id ' . - 'WHERE group_inbox.group_id = %d '; - return Notice::getStream(sprintf($qry, $this->id), - 'group:notices:'.$this->id, - $offset, $limit); + $ids = Notice::stream(array($this, '_streamDirect'), + array(), + 'user_group:notice_ids:' . $this->id, + $offset, $limit); + + return Notice::getStreamByIds($ids); + } + + function _streamDirect($offset, $limit, $since_id, $before_id, $since) + { + $inbox = new Group_inbox(); + + $inbox->group_id = $this->id; + + $inbox->selectAdd(); + $inbox->selectAdd('notice_id'); + + if ($since_id != 0) { + $inbox->whereAdd('notice_id > ' . $since_id); + } + + if ($before_id != 0) { + $inbox->whereAdd('notice_id < ' . $before_id); + } + + if (!is_null($since)) { + $inbox->whereAdd('created > \'' . date('Y-m-d H:i:s', $since) . '\''); + } + + $inbox->orderBy('notice_id DESC'); + + if (!is_null($offset)) { + $inbox->limit($offset, $limit); + } + + $ids = array(); + + if ($inbox->find()) { + while ($inbox->fetch()) { + $ids[] = $inbox->notice_id; + } + } + + return $ids; } function allowedNickname($nickname) @@ -91,7 +128,7 @@ class User_group extends Memcached_DataObject function setOriginal($filename) { $imagefile = new ImageFile($this->id, Avatar::path($filename)); - + $orig = clone($this); $this->original_logo = Avatar::url($filename); $this->homepage_logo = Avatar::url($imagefile->resize(AVATAR_PROFILE_SIZE)); -- cgit v1.2.3 From 5314d9b2cfaef3f2fd0ead262e18d1776fd99c8d Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 1 May 2009 12:01:28 -0700 Subject: make faves work with ids --- classes/Fave.php | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++-- classes/Notice.php | 4 ++-- classes/User.php | 38 +++++++++++++++++--------------------- 3 files changed, 70 insertions(+), 25 deletions(-) diff --git a/classes/Fave.php b/classes/Fave.php index 24df5938c..915b4572f 100644 --- a/classes/Fave.php +++ b/classes/Fave.php @@ -4,7 +4,7 @@ */ require_once INSTALLDIR.'/classes/Memcached_DataObject.php'; -class Fave extends Memcached_DataObject +class Fave extends Memcached_DataObject { ###START_AUTOCODE /* the code below is auto generated do not remove the above tag */ @@ -31,9 +31,58 @@ class Fave extends Memcached_DataObject } return $fave; } - + function &pkeyGet($kv) { return Memcached_DataObject::pkeyGet('Fave', $kv); } + + function stream($user_id, $offset=0, $limit=NOTICES_PER_PAGE) + { + $ids = Notice::stream(array('Fave', '_streamDirect'), + array($user_id), + 'fave:ids_by_user:'.$user_id, + $offset, $limit); + return $ids; + } + + function _streamDirect($user_id, $offset, $limit, $since_id, $before_id, $since) + { + $fav = new Fave(); + + $fav->user_id = $user_id; + + $fav->selectAdd(); + $fav->selectAdd('notice_id'); + + if ($since_id != 0) { + $fav->whereAdd('notice_id > ' . $since_id); + } + + if ($before_id != 0) { + $fav->whereAdd('notice_id < ' . $before_id); + } + + if (!is_null($since)) { + $fav->whereAdd('modified > \'' . date('Y-m-d H:i:s', $since) . '\''); + } + + // NOTE: we sort by fave time, not by notice time! + + $fav->orderBy('modified DESC'); + + if (!is_null($offset)) { + $fav->limit($offset, $limit); + } + + $ids = array(); + + if ($fav->find()) { + while ($fav->fetch()) { + $ids[] = $fav->notice_id; + } + } + + return $ids; + } } diff --git a/classes/Notice.php b/classes/Notice.php index c036e6e9e..771a4e715 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -412,9 +412,9 @@ class Notice extends Memcached_DataObject $fave->notice_id = $this->id; if ($fave->find()) { while ($fave->fetch()) { - $cache->delete(common_cache_key('user:faves:'.$fave->user_id)); + $cache->delete(common_cache_key('fave:ids_by_user:'.$fave->user_id)); if ($blowLast) { - $cache->delete(common_cache_key('user:faves:'.$fave->user_id.';last')); + $cache->delete(common_cache_key('fave:ids_by_user:'.$fave->user_id.';last')); } } } diff --git a/classes/User.php b/classes/User.php index b76e45c33..b5ac7b220 100644 --- a/classes/User.php +++ b/classes/User.php @@ -349,30 +349,31 @@ class User extends Memcached_DataObject $cache = common_memcache(); // XXX: Kind of a hack. + if ($cache) { // This is the stream of favorite notices, in rev chron // order. This forces it into cache. - $faves = $this->favoriteNotices(0, NOTICE_CACHE_WINDOW); - $cnt = 0; - while ($faves->fetch()) { - if ($faves->id < $notice->id) { - // If we passed it, it's not a fave - return false; - } else if ($faves->id == $notice->id) { - // If it matches a cached notice, then it's a fave - return true; - } - $cnt++; + + $ids = Fave::stream($this->id, 0, NOTICE_CACHE_WINDOW); + + // If it's in the list, then it's a fave + + if (in_array($notice->id, $ids)) { + return true; } + // If we're not past the end of the cache window, // then the cache has all available faves, so this one // is not a fave. - if ($cnt < NOTICE_CACHE_WINDOW) { + + if (count($ids) < NOTICE_CACHE_WINDOW) { return false; } + // Otherwise, cache doesn't have all faves; // fall through to the default } + $fave = Fave::pkeyGet(array('user_id' => $this->id, 'notice_id' => $notice->id)); return ((is_null($fave)) ? false : true); @@ -418,13 +419,8 @@ class User extends Memcached_DataObject function favoriteNotices($offset=0, $limit=NOTICES_PER_PAGE) { - $qry = - 'SELECT notice.* ' . - 'FROM notice JOIN fave ON notice.id = fave.notice_id ' . - 'WHERE fave.user_id = %d '; - return Notice::getStream(sprintf($qry, $this->id), - 'user:faves:'.$this->id, - $offset, $limit); + $ids = Fave::stream($this->id, $offset, $limit); + return Notice::getStreamByIds($ids); } function noticesWithFriends($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) @@ -459,8 +455,8 @@ class User extends Memcached_DataObject if ($cache) { // Faves don't happen chronologically, so we need to blow // ;last cache, too - $cache->delete(common_cache_key('user:faves:'.$this->id)); - $cache->delete(common_cache_key('user:faves:'.$this->id).';last'); + $cache->delete(common_cache_key('fave:ids_by_user:'.$this->id)); + $cache->delete(common_cache_key('fave:ids_by_user:'.$this->id.';last')); } } -- cgit v1.2.3 From 6a12598695637e7ebdc613977c797413957cc464 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 3 May 2009 21:36:03 -0700 Subject: add pingvine notice source --- db/notice_source.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/db/notice_source.sql b/db/notice_source.sql index ce44f3235..17720028d 100644 --- a/db/notice_source.sql +++ b/db/notice_source.sql @@ -24,6 +24,7 @@ VALUES ('peoplebrowsr', 'PeopleBrowsr', 'http://www.peoplebrowsr.com/', now()), ('Pikchur','Pikchur','http://www.pikchur.com/', now()), ('Ping.fm','Ping.fm','http://ping.fm/', now()), + ('pingvine','PingVine','http://pingvine.com/', now()), ('pocketwit','PockeTwit','http://code.google.com/p/pocketwit/', now()), ('posty','Posty','http://spreadingfunkyness.com/posty/', now()), ('royalewithcheese','Royale With Cheese','http://p.hellyeah.org/', now()), -- cgit v1.2.3 From 3e7b1e69e3e97ac007465376b62084f10bcf97ca Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Tue, 28 Apr 2009 17:08:20 -0700 Subject: Added dirty dates to Foreign_link --- classes/Foreign_link.php | 2 ++ classes/laconica.ini | 2 ++ db/laconica.sql | 2 ++ 3 files changed, 6 insertions(+) diff --git a/classes/Foreign_link.php b/classes/Foreign_link.php index afc0e2180..af2b3f189 100644 --- a/classes/Foreign_link.php +++ b/classes/Foreign_link.php @@ -17,6 +17,8 @@ class Foreign_link extends Memcached_DataObject public $noticesync; // tinyint(1) not_null default_1 public $friendsync; // tinyint(1) not_null default_2 public $profilesync; // tinyint(1) not_null default_1 + public $last_noticesync; // datetime() + public $last_friendsync; // datetime() public $created; // datetime() not_null public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP diff --git a/classes/laconica.ini b/classes/laconica.ini index 529454d99..c05419588 100755 --- a/classes/laconica.ini +++ b/classes/laconica.ini @@ -55,6 +55,8 @@ credentials = 2 noticesync = 145 friendsync = 145 profilesync = 145 +last_noticesync = 14 +last_friendsync = 14 created = 142 modified = 384 diff --git a/db/laconica.sql b/db/laconica.sql index 5b57494d9..c9730098e 100644 --- a/db/laconica.sql +++ b/db/laconica.sql @@ -289,6 +289,8 @@ create table foreign_link ( noticesync tinyint not null default 1 comment 'notice synchronization, bit 1 = sync outgoing, bit 2 = sync incoming, bit 3 = filter local replies', friendsync tinyint not null default 2 comment 'friend synchronization, bit 1 = sync outgoing, bit 2 = sync incoming', profilesync tinyint not null default 1 comment 'profile synchronization, bit 1 = sync outgoing, bit 2 = sync incoming', + last_noticesync datetime default null comment 'last time notices were imported', + last_friendsync datetime default null comment 'last time friends were imported', created datetime not null comment 'date this record was created', modified timestamp comment 'date this record was modified', -- cgit v1.2.3 From 11e0db8c2cec18337fd960ccda055dd14d89f9d7 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Thu, 7 May 2009 18:22:14 -0700 Subject: Twitter friends sync now does 25 users at a time and uses last_friendsync field to prioritize --- actions/twittersettings.php | 4 +++- scripts/synctwitterfriends.php | 38 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/actions/twittersettings.php b/actions/twittersettings.php index 45725d3ff..0b98eef59 100644 --- a/actions/twittersettings.php +++ b/actions/twittersettings.php @@ -261,7 +261,7 @@ class TwittersettingsAction extends ConnectSettingsAction 'alt' => ($other->fullname) ? $other->fullname : $other->nickname)); - + $this->element('span', 'fn nickname', $other->nickname); $this->elementEnd('a'); $this->elementEnd('li'); @@ -375,6 +375,8 @@ class TwittersettingsAction extends ConnectSettingsAction if ($friendsync) { save_twitter_friends($user, $twit_user->id, $screen_name, $password); + $flink->last_friendsync = common_sql_now(); + $flink->update(); } $this->showForm(_('Twitter settings saved.'), true); diff --git a/scripts/synctwitterfriends.php b/scripts/synctwitterfriends.php index 794301f0f..bd08ba58d 100755 --- a/scripts/synctwitterfriends.php +++ b/scripts/synctwitterfriends.php @@ -32,8 +32,25 @@ define('LACONICA', true); require_once(INSTALLDIR . '/lib/common.php'); +// Make a lockfile +$lockfilename = lockFilename(); +if (!($lockfile = @fopen($lockfilename, "w"))) { + print "Already running... exiting.\n"; + exit(1); +} + +// Obtain an exlcusive lock on file (will fail if script is already going) +if (!@flock( $lockfile, LOCK_EX | LOCK_NB, &$wouldblock) || $wouldblock) { + // Script already running - abort + @fclose($lockfile); + print "Already running... exiting.\n"; + exit(1); +} + $flink = new Foreign_link(); $flink->service = 1; // Twitter +$flink->orderBy('last_friendsync'); +$flink->limit(25); // sync this many users during this run $cnt = $flink->find(); print "Updating Twitter friends subscriptions for $cnt users.\n"; @@ -60,8 +77,11 @@ while ($flink->fetch()) { continue; } - $result = save_twitter_friends($user, $fuser->id, - $fuser->nickname, $flink->credentials); + save_twitter_friends($user, $fuser->id, $fuser->nickname, $flink->credentials); + + $flink->last_friendsync = common_sql_now(); + $flink->update(); + if (defined('SCRIPT_DEBUG')) { print "\nDONE\n"; } else { @@ -70,4 +90,18 @@ while ($flink->fetch()) { } } +function lockFilename() +{ + $piddir = common_config('daemon', 'piddir'); + if (!$piddir) { + $piddir = '/var/run'; + } + + return $piddir . '/synctwitterfriends.lock'; +} + +// Cleanup +fclose($lockfile); +unlink($lockfilename); + exit(0); -- cgit v1.2.3 From 9a8095079dc602c7f2b74e48237445d682844de6 Mon Sep 17 00:00:00 2001 From: CiaranG Date: Fri, 8 May 2009 08:14:50 +0100 Subject: PostgreSQL - added dirty dates to Foreign_link - see 3e7b1e69e3e97ac007465376b62084f10bcf97ca --- db/laconica_pg.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/db/laconica_pg.sql b/db/laconica_pg.sql index f879d7936..a27a616f2 100644 --- a/db/laconica_pg.sql +++ b/db/laconica_pg.sql @@ -291,6 +291,8 @@ create table foreign_link ( noticesync int not null default 1 /* comment 'notice synchronisation, bit 1 = sync outgoing, bit 2 = sync incoming, bit 3 = filter local replies' */, friendsync int not null default 2 /* comment 'friend synchronisation, bit 1 = sync outgoing, bit 2 = sync incoming */, profilesync int not null default 1 /* comment 'profile synchronization, bit 1 = sync outgoing, bit 2 = sync incoming' */, + last_noticesync timestamp default null /* comment 'last time notices were imported' */, + last_friendsync timestamp default null /* comment 'last time friends were imported' */, created timestamp not null default CURRENT_TIMESTAMP /* comment 'date this record was created' */, modified timestamp /* comment 'date this record was modified' */, -- cgit v1.2.3 From c6816c163e813ac4bc8163cba7ab08c54d8320d5 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 15 May 2009 14:18:04 -0400 Subject: reformat action.php --- lib/action.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/action.php b/lib/action.php index 2ec9329e0..4bd41c226 100644 --- a/lib/action.php +++ b/lib/action.php @@ -98,15 +98,15 @@ class Action extends HTMLOutputter // lawsuit Event::handle('EndShowHTML', array($this)); } if (Event::handle('StartShowHead', array($this))) { - $this->showHead(); + $this->showHead(); Event::handle('EndShowHead', array($this)); } if (Event::handle('StartShowBody', array($this))) { - $this->showBody(); + $this->showBody(); Event::handle('EndShowBody', array($this)); } if (Event::handle('StartEndHTML', array($this))) { - $this->endHTML(); + $this->endHTML(); Event::handle('EndEndHTML', array($this)); } } @@ -347,7 +347,7 @@ class Action extends HTMLOutputter // lawsuit { $this->elementStart('body', (common_current_user()) ? array('id' => $this->trimmed('action'), 'class' => 'user_in') - : array('id' => $this->trimmed('action'))); + : array('id' => $this->trimmed('action'))); $this->elementStart('div', array('id' => 'wrap')); if (Event::handle('StartShowHeader', array($this))) { $this->showHeader(); @@ -431,10 +431,10 @@ class Action extends HTMLOutputter // lawsuit _('Connect'), _('Connect to SMS, Twitter'), false, 'nav_connect'); } $this->menuItem(common_local_url('invite'), - _('Invite'), - sprintf(_('Invite friends and colleagues to join you on %s'), - common_config('site', 'name')), - false, 'nav_invitecontact'); + _('Invite'), + sprintf(_('Invite friends and colleagues to join you on %s'), + common_config('site', 'name')), + false, 'nav_invitecontact'); $this->menuItem(common_local_url('logout'), _('Logout'), _('Logout from the site'), false, 'nav_logout'); } @@ -629,7 +629,7 @@ class Action extends HTMLOutputter // lawsuit $this->elementStart('div', array('id' => 'aside_primary', 'class' => 'aside')); if (Event::handle('StartShowExportData', array($this))) { - $this->showExportData(); + $this->showExportData(); Event::handle('EndShowExportData', array($this)); } if (Event::handle('StartShowSections', array($this))) { -- cgit v1.2.3 From 14662354dc501e811dd714aa72fd8001842ee672 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 15 May 2009 14:22:49 -0400 Subject: add hooks for subgroupnav showing --- EVENTS.txt | 6 +++++ lib/subgroupnav.php | 68 +++++++++++++++++++++++++++++------------------------ 2 files changed, 43 insertions(+), 31 deletions(-) diff --git a/EVENTS.txt b/EVENTS.txt index 5edf59245..07fc446c3 100644 --- a/EVENTS.txt +++ b/EVENTS.txt @@ -100,6 +100,12 @@ StartPublicGroupNav: Showing the public group nav menu EndPublicGroupNav: At the end of the public group nav menu - $action: the current action +StartSubGroupNav: Showing the subscriptions group nav menu +- $action: the current action + +EndSubGroupNav: At the end of the subscriptions group nav menu +- $action: the current action + RouterInitialized: After the router instance has been initialized - $m: the Net_URL_Mapper that has just been set up diff --git a/lib/subgroupnav.php b/lib/subgroupnav.php index 31c3ea0b5..4a9b36ae8 100644 --- a/lib/subgroupnav.php +++ b/lib/subgroupnav.php @@ -74,38 +74,44 @@ class SubGroupNav extends Widget $this->out->elementStart('ul', array('class' => 'nav')); - $this->out->menuItem(common_local_url('subscriptions', - array('nickname' => - $this->user->nickname)), - _('Subscriptions'), - sprintf(_('People %s subscribes to'), - $this->user->nickname), - $action == 'subscriptions', - 'nav_subscriptions'); - $this->out->menuItem(common_local_url('subscribers', - array('nickname' => - $this->user->nickname)), - _('Subscribers'), - sprintf(_('People subscribed to %s'), - $this->user->nickname), - $action == 'subscribers', - 'nav_subscribers'); - $this->out->menuItem(common_local_url('usergroups', - array('nickname' => - $this->user->nickname)), - _('Groups'), - sprintf(_('Groups %s is a member of'), - $this->user->nickname), - $action == 'usergroups', - 'nav_usergroups'); - if (!is_null($cur) && $this->user->id === $cur->id) { - $this->out->menuItem(common_local_url('invite'), - _('Invite'), - sprintf(_('Invite friends and colleagues to join you on %s'), - common_config('site', 'name')), - $action == 'invite', - 'nav_invite'); + if (Event::handle('StartSubGroupNav', array($this))) { + + $this->out->menuItem(common_local_url('subscriptions', + array('nickname' => + $this->user->nickname)), + _('Subscriptions'), + sprintf(_('People %s subscribes to'), + $this->user->nickname), + $action == 'subscriptions', + 'nav_subscriptions'); + $this->out->menuItem(common_local_url('subscribers', + array('nickname' => + $this->user->nickname)), + _('Subscribers'), + sprintf(_('People subscribed to %s'), + $this->user->nickname), + $action == 'subscribers', + 'nav_subscribers'); + $this->out->menuItem(common_local_url('usergroups', + array('nickname' => + $this->user->nickname)), + _('Groups'), + sprintf(_('Groups %s is a member of'), + $this->user->nickname), + $action == 'usergroups', + 'nav_usergroups'); + if (!is_null($cur) && $this->user->id === $cur->id) { + $this->out->menuItem(common_local_url('invite'), + _('Invite'), + sprintf(_('Invite friends and colleagues to join you on %s'), + common_config('site', 'name')), + $action == 'invite', + 'nav_invite'); + } + + Event::handle('EndSubGroupNav', array($this)); } + $this->out->elementEnd('ul'); } } -- cgit v1.2.3 From 6b4410d9eace776182f373886785cfd1f2736764 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 15 May 2009 15:07:23 -0400 Subject: add a hook to muck around with the arguments array after it's initialized --- EVENTS.txt | 2 ++ index.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/EVENTS.txt b/EVENTS.txt index 07fc446c3..e0ce11666 100644 --- a/EVENTS.txt +++ b/EVENTS.txt @@ -109,3 +109,5 @@ EndSubGroupNav: At the end of the subscriptions group nav menu RouterInitialized: After the router instance has been initialized - $m: the Net_URL_Mapper that has just been set up +ArgsInitialized: After the argument array has been initialized +- $args: associative array of arguments, can be modified diff --git a/index.php b/index.php index e24bde917..0c69e226f 100644 --- a/index.php +++ b/index.php @@ -101,6 +101,8 @@ function main() $args = array_merge($args, $_REQUEST); + Event::handle('ArgsInitialize', array(&$args)); + $action = $args['action']; if (!$action || !preg_match('/^[a-zA-Z0-9_-]*$/', $action)) { -- cgit v1.2.3 From 9d13890a859eb657c1ee95b1b2a1144fdf46d6b4 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 15 May 2009 17:11:28 -0400 Subject: add a hook for the page notice --- lib/action.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/action.php b/lib/action.php index 4bd41c226..6b130b6d5 100644 --- a/lib/action.php +++ b/lib/action.php @@ -591,7 +591,10 @@ class Action extends HTMLOutputter // lawsuit 'class' => 'system_notice')); $this->element('dt', null, _('Page notice')); $this->elementStart('dd'); - $this->showPageNotice(); + if (Event::handle('StartShowPageNotice', array($this))) { + $this->showPageNotice(); + Event::handle('EndShowPageNotice', array($this)); + } $this->elementEnd('dd'); $this->elementEnd('dl'); } -- cgit v1.2.3 From caadd8ed93d7a388a9868af6732db3214b08fd6a Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 15 May 2009 17:57:26 -0400 Subject: add WikiHashtagsPlugin --- plugins/WikiHashtagsPlugin.php | 109 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 plugins/WikiHashtagsPlugin.php diff --git a/plugins/WikiHashtagsPlugin.php b/plugins/WikiHashtagsPlugin.php new file mode 100644 index 000000000..4d386e198 --- /dev/null +++ b/plugins/WikiHashtagsPlugin.php @@ -0,0 +1,109 @@ +. + * + * @category Plugin + * @package Laconica + * @author Evan Prodromou + * @copyright 2008 Control Yourself, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + */ + +if (!defined('LACONICA')) { + exit(1); +} + +define('WIKIHASHTAGSPLUGIN_VERSION', '0.1'); + +/** + * Plugin to use WikiHashtags + * + * @category Plugin + * @package Laconica + * @author Evan Prodromou + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + * + * @see Event + */ + +class WikiHashtagsPlugin extends Plugin +{ + function __construct($code=null) + { + parent::__construct(); + } + + function onStartShowSections($action) + { + common_debug('WikiHashtags: got called'); + $name = $action->trimmed('action'); + + if ($name == 'tag') { + common_debug('WikiHashtags: called by tag'); + + $taginput = $action->trimmed('tag'); + $tag = common_canonical_tag($taginput); + + if (!empty($tag)) { + common_debug('WikiHashtags: have a tag: ' . $tag); + + $url = sprintf('http://hashtags.wikia.com/index.php?title=%s&action=render', + urlencode($tag)); + $editurl = sprintf('http://hashtags.wikia.com/index.php?title=%s&action=edit', + urlencode($tag)); + + common_debug('WikiHashtags: have an url: ' . $url); + + $context = stream_context_create(array('http' => array('method' => "GET", + 'header' => + "User-Agent: " . $this->userAgent()))); + $html = @file_get_contents($url, false, $context); + + common_debug('WikiHashtags: results are: ' . $html); + + $action->elementStart('div', array('id' => 'wikihashtags', 'class' => 'section')); + + $action->element('h2', null, _('WikiHashtags')); + + if (!empty($html)) { + $action->element('style', null, 'span.editsection { display: none }'); + $action->raw($html); + $action->element('a', array('href' => $editurl), + _('Edit')); + } else { + $action->element('a', array('href' => $editurl), + sprintf(_('Start the article for #%s on WikiHashtags'), $tag)); + } + + $action->elementEnd('div'); + } + } + + return true; + } + + function userAgent() + { + return 'WikiHashtagsPlugin/'.WIKIHASHTAGSPLUGIN_VERSION . + ' Laconica/' . LACONICA_VERSION; + } +} -- cgit v1.2.3 From 311e471c146b4ba6c17dec34246e5a1c832bb92b Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 15 May 2009 17:57:26 -0400 Subject: add WikiHashtagsPlugin --- plugins/WikiHashtagsPlugin.php | 109 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 plugins/WikiHashtagsPlugin.php diff --git a/plugins/WikiHashtagsPlugin.php b/plugins/WikiHashtagsPlugin.php new file mode 100644 index 000000000..4d386e198 --- /dev/null +++ b/plugins/WikiHashtagsPlugin.php @@ -0,0 +1,109 @@ +. + * + * @category Plugin + * @package Laconica + * @author Evan Prodromou + * @copyright 2008 Control Yourself, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + */ + +if (!defined('LACONICA')) { + exit(1); +} + +define('WIKIHASHTAGSPLUGIN_VERSION', '0.1'); + +/** + * Plugin to use WikiHashtags + * + * @category Plugin + * @package Laconica + * @author Evan Prodromou + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + * + * @see Event + */ + +class WikiHashtagsPlugin extends Plugin +{ + function __construct($code=null) + { + parent::__construct(); + } + + function onStartShowSections($action) + { + common_debug('WikiHashtags: got called'); + $name = $action->trimmed('action'); + + if ($name == 'tag') { + common_debug('WikiHashtags: called by tag'); + + $taginput = $action->trimmed('tag'); + $tag = common_canonical_tag($taginput); + + if (!empty($tag)) { + common_debug('WikiHashtags: have a tag: ' . $tag); + + $url = sprintf('http://hashtags.wikia.com/index.php?title=%s&action=render', + urlencode($tag)); + $editurl = sprintf('http://hashtags.wikia.com/index.php?title=%s&action=edit', + urlencode($tag)); + + common_debug('WikiHashtags: have an url: ' . $url); + + $context = stream_context_create(array('http' => array('method' => "GET", + 'header' => + "User-Agent: " . $this->userAgent()))); + $html = @file_get_contents($url, false, $context); + + common_debug('WikiHashtags: results are: ' . $html); + + $action->elementStart('div', array('id' => 'wikihashtags', 'class' => 'section')); + + $action->element('h2', null, _('WikiHashtags')); + + if (!empty($html)) { + $action->element('style', null, 'span.editsection { display: none }'); + $action->raw($html); + $action->element('a', array('href' => $editurl), + _('Edit')); + } else { + $action->element('a', array('href' => $editurl), + sprintf(_('Start the article for #%s on WikiHashtags'), $tag)); + } + + $action->elementEnd('div'); + } + } + + return true; + } + + function userAgent() + { + return 'WikiHashtagsPlugin/'.WIKIHASHTAGSPLUGIN_VERSION . + ' Laconica/' . LACONICA_VERSION; + } +} -- cgit v1.2.3 From c6526c84f5891117fa74a9b6bdae4df4374af18b Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 15 May 2009 18:16:32 -0400 Subject: License link, no title --- plugins/WikiHashtagsPlugin.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/plugins/WikiHashtagsPlugin.php b/plugins/WikiHashtagsPlugin.php index 4d386e198..141cb07d2 100644 --- a/plugins/WikiHashtagsPlugin.php +++ b/plugins/WikiHashtagsPlugin.php @@ -82,13 +82,20 @@ class WikiHashtagsPlugin extends Plugin $action->elementStart('div', array('id' => 'wikihashtags', 'class' => 'section')); - $action->element('h2', null, _('WikiHashtags')); - if (!empty($html)) { - $action->element('style', null, 'span.editsection { display: none }'); + $action->element('style', null, + "span.editsection { display: none }\n". + "table.toc { display: none }"); $action->raw($html); - $action->element('a', array('href' => $editurl), + $action->elementStart('p'); + $action->element('a', array('href' => $editurl, + 'title' => sprintf(_('Edit the article for #%s on WikiHashtags'), $tag)), _('Edit')); + $action->element('a', array('href' => 'http://www.gnu.org/copyleft/fdl.html', + 'title' => _('Shared under the terms of the GNU Free Documentation License'), + 'rel' => 'license'), + 'GNU FDL'); + $action->elementEnd('p'); } else { $action->element('a', array('href' => $editurl), sprintf(_('Start the article for #%s on WikiHashtags'), $tag)); -- cgit v1.2.3 From 8ebfea4425ea4119850cd4263b67c879ba71a7fa Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 15 May 2009 18:16:32 -0400 Subject: License link, no title --- plugins/WikiHashtagsPlugin.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/plugins/WikiHashtagsPlugin.php b/plugins/WikiHashtagsPlugin.php index 4d386e198..141cb07d2 100644 --- a/plugins/WikiHashtagsPlugin.php +++ b/plugins/WikiHashtagsPlugin.php @@ -82,13 +82,20 @@ class WikiHashtagsPlugin extends Plugin $action->elementStart('div', array('id' => 'wikihashtags', 'class' => 'section')); - $action->element('h2', null, _('WikiHashtags')); - if (!empty($html)) { - $action->element('style', null, 'span.editsection { display: none }'); + $action->element('style', null, + "span.editsection { display: none }\n". + "table.toc { display: none }"); $action->raw($html); - $action->element('a', array('href' => $editurl), + $action->elementStart('p'); + $action->element('a', array('href' => $editurl, + 'title' => sprintf(_('Edit the article for #%s on WikiHashtags'), $tag)), _('Edit')); + $action->element('a', array('href' => 'http://www.gnu.org/copyleft/fdl.html', + 'title' => _('Shared under the terms of the GNU Free Documentation License'), + 'rel' => 'license'), + 'GNU FDL'); + $action->elementEnd('p'); } else { $action->element('a', array('href' => $editurl), sprintf(_('Start the article for #%s on WikiHashtags'), $tag)); -- cgit v1.2.3 From 5a0edc9b8cbfa10d4dd72603d95708c50e3b8cdb Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 17 May 2009 12:37:04 -0400 Subject: remove debugging calls --- plugins/WikiHashtagsPlugin.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/plugins/WikiHashtagsPlugin.php b/plugins/WikiHashtagsPlugin.php index 141cb07d2..6d186a5fe 100644 --- a/plugins/WikiHashtagsPlugin.php +++ b/plugins/WikiHashtagsPlugin.php @@ -54,32 +54,25 @@ class WikiHashtagsPlugin extends Plugin function onStartShowSections($action) { - common_debug('WikiHashtags: got called'); $name = $action->trimmed('action'); if ($name == 'tag') { - common_debug('WikiHashtags: called by tag'); $taginput = $action->trimmed('tag'); $tag = common_canonical_tag($taginput); if (!empty($tag)) { - common_debug('WikiHashtags: have a tag: ' . $tag); $url = sprintf('http://hashtags.wikia.com/index.php?title=%s&action=render', urlencode($tag)); $editurl = sprintf('http://hashtags.wikia.com/index.php?title=%s&action=edit', urlencode($tag)); - common_debug('WikiHashtags: have an url: ' . $url); - $context = stream_context_create(array('http' => array('method' => "GET", 'header' => "User-Agent: " . $this->userAgent()))); $html = @file_get_contents($url, false, $context); - common_debug('WikiHashtags: results are: ' . $html); - $action->elementStart('div', array('id' => 'wikihashtags', 'class' => 'section')); if (!empty($html)) { -- cgit v1.2.3 From dcd69eec9098fd6bc6340a233796d6b242953057 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Mon, 18 May 2009 23:23:00 +0000 Subject: Increase entity_profile fn, nickname font-size slightly. Gave entity_profile more width. --- theme/base/css/display.css | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/theme/base/css/display.css b/theme/base/css/display.css index dc6b4bc29..8029a5eee 100644 --- a/theme/base/css/display.css +++ b/theme/base/css/display.css @@ -492,7 +492,7 @@ line-height:1.618; /* entity_profile */ .entity_profile { position:relative; -width:67.702%; +width:74.702%; min-height:123px; float:left; margin-bottom:18px; @@ -528,12 +528,15 @@ margin-bottom:4px; .entity_profile .entity_nickname { margin-left:11px; display:inline; -font-weight:bold; } .entity_profile .entity_nickname { margin-left:0; } - +.entity_profile .fn, +.entity_profile .nickname { +font-size:1.1em; +font-weight:bold; +} .entity_profile .entity_fn dd:before { content: "("; font-weight:normal; @@ -555,7 +558,7 @@ display:none; /*entity_actions*/ .entity_actions { float:right; -margin-left:4.35%; +margin-left:2.35%; max-width:25%; } .entity_actions h2 { -- cgit v1.2.3 From b118ef633a3c1f3446f01a5b22db8fbfb5e4406a Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 22 May 2009 10:03:47 -0400 Subject: Add Gravity to notice sources --- db/notice_source.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/db/notice_source.sql b/db/notice_source.sql index 17720028d..7c31a9af4 100644 --- a/db/notice_source.sql +++ b/db/notice_source.sql @@ -9,6 +9,7 @@ VALUES ('Do','Gnome Do','http://do.davebsd.com/wiki/index.php?title=Microblog_Plugin', now()), ('Facebook','Facebook','http://apps.facebook.com/identica/', now()), ('feed2omb','feed2omb','http://projects.ciarang.com/p/feed2omb/', now()), + ('gravity', 'Gravity', 'http://mobileways.de/gravity', now()), ('Gwibber','Gwibber','http://launchpad.net/gwibber', now()), ('HelloTxt','HelloTxt','http://hellotxt.com/', now()), ('identicatools','Laconica Tools','http://bitbucketlabs.net/laconica-tools/', now()), -- cgit v1.2.3 From 18b130456287a24ac9024b57dc7a38d1dcaa498f Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Mon, 25 May 2009 14:23:00 -0700 Subject: Add EventBox to notice sources --- db/notice_source.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/db/notice_source.sql b/db/notice_source.sql index 7c31a9af4..221b1ee01 100644 --- a/db/notice_source.sql +++ b/db/notice_source.sql @@ -7,6 +7,7 @@ VALUES ('cliqset', 'Cliqset', 'http://www.cliqset.com/', now()), ('deskbar','Deskbar-Applet','http://www.gnome.org/projects/deskbar-applet/', now()), ('Do','Gnome Do','http://do.davebsd.com/wiki/index.php?title=Microblog_Plugin', now()), + ('eventbox','EventBox','http://thecosmicmachine.com/eventbox/ ', now()), ('Facebook','Facebook','http://apps.facebook.com/identica/', now()), ('feed2omb','feed2omb','http://projects.ciarang.com/p/feed2omb/', now()), ('gravity', 'Gravity', 'http://mobileways.de/gravity', now()), -- cgit v1.2.3 From 5f2cf2553cbe97b9983c8c5d0a85abb00b1a8375 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Tue, 26 May 2009 02:23:19 +0000 Subject: Ticket #1196 - Fixed: Warning on invite tab in Facebook App --- actions/facebookinvite.php | 65 +++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/actions/facebookinvite.php b/actions/facebookinvite.php index 1302064ad..2207580f7 100644 --- a/actions/facebookinvite.php +++ b/actions/facebookinvite.php @@ -17,7 +17,9 @@ * along with this program. If not, see . */ -if (!defined('LACONICA')) { exit(1); } +if (!defined('LACONICA')) { + exit(1); +} require_once(INSTALLDIR.'/lib/facebookaction.php'); @@ -67,7 +69,7 @@ class FacebookinviteAction extends FacebookAction function showSuccessContent() { - $this->element('h2', null, sprintf(_('Thanks for inviting your friends to use %s'), + $this->element('h2', null, sprintf(_('Thanks for inviting your friends to use %s'), common_config('site', 'name'))); $this->element('p', null, _('Invitations have been sent to the following users:')); @@ -89,16 +91,6 @@ class FacebookinviteAction extends FacebookAction function showFormContent() { - - // Get a list of users who are already using the app for exclusion - $exclude_ids = $this->facebook->api_client->friends_getAppUsers(); - $exclude_ids_csv = null; - - // fbml needs these as a csv string, not an array - if ($exclude_ids) { - $exclude_ids_csv = implode(',', $exclude_ids); - } - $content = sprintf(_('You have been invited to %s'), common_config('site', 'name')) . htmlentities(''); @@ -109,36 +101,43 @@ class FacebookinviteAction extends FacebookAction 'content' => $content)); $this->hidden('invite', 'true'); $actiontext = sprintf(_('Invite your friends to use %s'), common_config('site', 'name')); - - $multi_params = array('showborder' => 'false'); + + $multi_params = array('showborder' => 'false'); $multi_params['actiontext'] = $actiontext; - - if ($exclude_ids_csv) { + $multi_params['bypass'] = 'cancel'; + + // Get a list of users who are already using the app for exclusion + $exclude_ids = $this->facebook->api_client->friends_getAppUsers(); + $exclude_ids_csv = null; + + // fbml needs these as a csv string, not an array + if ($exclude_ids) { + $exclude_ids_csv = implode(',', $exclude_ids); $multi_params['exclude_ids'] = $exclude_ids_csv; } - $multi_params['bypass'] = 'cancel'; - $this->element('fb:multi-friend-selector', $multi_params); - $this->elementEnd('fb:request-form'); - $this->element('h2', null, sprintf(_('Friends already using %s:'), - common_config('site', 'name'))); - $this->elementStart('ul', array('id' => 'facebook-friends')); - - foreach ($exclude_ids as $friend) { - $this->elementStart('li'); - $this->element('fb:profile-pic', array('uid' => $friend, 'size' => 'square')); - $this->element('fb:name', array('uid' => $friend, - 'capitalize' => 'true')); - $this->elementEnd('li'); - } + if ($exclude_ids) { - $this->elementEnd("ul"); + $this->element('h2', null, sprintf(_('Friends already using %s:'), + common_config('site', 'name'))); + $this->elementStart('ul', array('id' => 'facebook-friends')); + + foreach ($exclude_ids as $friend) { + $this->elementStart('li'); + $this->element('fb:profile-pic', array('uid' => $friend, 'size' => 'square')); + $this->element('fb:name', array('uid' => $friend, + 'capitalize' => 'true')); + $this->elementEnd('li'); + } + + $this->elementEnd("ul"); + } } - - function title() + + function title() { return sprintf(_('Send invitations')); } -- cgit v1.2.3 From a1f83b293394af34782f74640c3d29f800bdc0bf Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 26 May 2009 15:22:12 -0400 Subject: added qtwitter --- db/notice_source.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/db/notice_source.sql b/db/notice_source.sql index 7c31a9af4..e7ccadde3 100644 --- a/db/notice_source.sql +++ b/db/notice_source.sql @@ -28,6 +28,7 @@ VALUES ('pingvine','PingVine','http://pingvine.com/', now()), ('pocketwit','PockeTwit','http://code.google.com/p/pocketwit/', now()), ('posty','Posty','http://spreadingfunkyness.com/posty/', now()), + ('qtwitter','qTwitter','http://qtwitter.ayoy.net/', now()), ('royalewithcheese','Royale With Cheese','http://p.hellyeah.org/', now()), ('rssdent','rssdent','http://github.com/zcopley/rssdent/tree/master', now()), ('rygh.no','rygh.no','http://rygh.no/', now()), -- cgit v1.2.3 From 74b08bff53b614a0d3da56e848940cd3e9ca70ce Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 26 May 2009 15:27:13 -0400 Subject: Added AgentSolo.com --- db/notice_source.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/db/notice_source.sql b/db/notice_source.sql index a22967b1b..ac73d3d13 100644 --- a/db/notice_source.sql +++ b/db/notice_source.sql @@ -2,6 +2,7 @@ INSERT INTO notice_source (code, name, url, created) VALUES ('adium', 'Adium', 'http://www.adiumx.com/', now()), + ('AgentSolo.com','AgentSolo.com','http://www.agentsolo.com/', now()), ('betwittered','BeTwittered','http://www.32hours.com/betwitteredinfo/', now()), ('bti','bti','http://gregkh.github.com/bti/', now()), ('cliqset', 'Cliqset', 'http://www.cliqset.com/', now()), -- cgit v1.2.3 From b2c28faf526e55ddc97d42692048e644b004e1f8 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Tue, 26 May 2009 21:14:42 +0000 Subject: Removed silly "dented:" status prefix from Facebook App --- actions/facebookhome.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/actions/facebookhome.php b/actions/facebookhome.php index 5946e6c98..4c2b26355 100644 --- a/actions/facebookhome.php +++ b/actions/facebookhome.php @@ -138,9 +138,6 @@ class FacebookhomeAction extends FacebookAction function setDefaults() { - // A default prefix string for notices - $this->facebook->api_client->data_setUserPreference( - FACEBOOK_NOTICE_PREFIX, 'dented: '); $this->facebook->api_client->data_setUserPreference( FACEBOOK_PROMPTED_UPDATE_PREF, 'false'); } -- cgit v1.2.3 From 2b81dcb25329c496c7c4f2c99334b79ba0421c1e Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Fri, 15 May 2009 21:44:58 +0000 Subject: Better err handling when trying to get Facebook client --- lib/facebookutil.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/facebookutil.php b/lib/facebookutil.php index ec3987273..242d2e06f 100644 --- a/lib/facebookutil.php +++ b/lib/facebookutil.php @@ -27,9 +27,21 @@ define("FACEBOOK_PROMPTED_UPDATE_PREF", 2); function getFacebook() { + static $facebook = null; + $apikey = common_config('facebook', 'apikey'); $secret = common_config('facebook', 'secret'); - return new Facebook($apikey, $secret); + + if ($facebook === null) { + $facebook = new Facebook($apikey, $secret); + } + + if (!$facebook) { + common_log(LOG_ERR, 'Could not make new Facebook client obj!', + __FILE__); + } + + return $facebook; } function updateProfileBox($facebook, $flink, $notice) { @@ -92,7 +104,6 @@ function isFacebookBound($notice, $flink) { } - function facebookBroadcastNotice($notice) { $facebook = getFacebook(); -- cgit v1.2.3