From 00d3d70a7db23851dcc0b8c0ec718d6a53c72337 Mon Sep 17 00:00:00 2001 From: "ken.sedgwick" Date: Fri, 13 Mar 2009 16:50:58 -0700 Subject: [PATCH 01/12] Fixed version issues in laconica RPM spec file. Fixed missing avatar directory in RPM packaging. --- scripts/laconica.spec | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/scripts/laconica.spec b/scripts/laconica.spec index 2df41c9323..502959fb1d 100644 --- a/scripts/laconica.spec +++ b/scripts/laconica.spec @@ -1,11 +1,14 @@ +# This version needs to match the tarball and unpacked directory name. +%define LACVER 0.7.2.1 + BuildRequires: php-pear BuildRequires: httpd-devel Name: laconica -Version: 0.7.1 +Version: %{LACVER} Release: 1%{?dist} License: GAGPL v3 or later -Source: laconica-0.7.1.tar.gz +Source: laconica-%{version}.tar.gz Group: Applications/Internet Summary: Laconica, the Open Source microblogging platform BuildArch: noarch @@ -49,6 +52,8 @@ cp -a * %{buildroot}%{wwwpath} mkdir -p %{buildroot}%{_datadir}/laconica cp -a db %{buildroot}%{_datadir}/laconica/db +mkdir -p %{buildroot}%{_datadir}/laconica/avatar + mkdir -p %{buildroot}%{_sysconfdir}/httpd/conf.d cat > %{buildroot}%{_sysconfdir}/httpd/conf.d/laconica.conf <<"EOF" Alias /laconica/ "/var/www/laconica/" @@ -74,6 +79,12 @@ rm -rf %buildroot %config(noreplace) %{_sysconfdir}/httpd/conf.d/laconica.conf %changelog +* Fri Mar 13 2009 Ken Sedgwick - 0.7.2.1-1 +- Factored laconica version to the first line of the file. + +* Wed Mar 03 2009 Zach Copley - 0.7.2 +- Changed version number to 0.7.2. + * Sat Feb 28 2009 Ken Sedgwick - 0.7.1-1 - Modified RPM for Fedora. From ab2946047cd08c6b66cbc57410fa8a99430530f6 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Fri, 3 Apr 2009 13:19:33 -0700 Subject: [PATCH 02/12] Only kill control and surrogates, leave UTF-8 formatting chars alone. --- lib/util.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/util.php b/lib/util.php index a43666fa5c..11f0f297e0 100644 --- a/lib/util.php +++ b/lib/util.php @@ -581,10 +581,8 @@ function common_shorten_link($url, $reverse = false) function common_xml_safe_str($str) { - $xmlStr = htmlentities(iconv('UTF-8', 'UTF-8//IGNORE', $str), ENT_NOQUOTES, 'UTF-8'); - - // Replace control, formatting, and surrogate characters with '*', ala Twitter - return preg_replace('/[\p{Cc}\p{Cf}\p{Cs}]/u', '*', $str); + // Neutralize control codes and surrogates + return preg_replace('/[\p{Cc}\p{Cs}]/u', '*', $str); } function common_tag_link($tag) From e1fec6db2fdc9c28878c8f87bd5b55d1b1e5e1fa Mon Sep 17 00:00:00 2001 From: Robin Millette Date: Fri, 3 Apr 2009 20:34:27 +0000 Subject: [PATCH 03/12] Simplified code for empty public timeline. --- actions/public.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/actions/public.php b/actions/public.php index fca90488fe..5a2720a9ad 100644 --- a/actions/public.php +++ b/actions/public.php @@ -168,14 +168,13 @@ class PublicAction extends Action function showPageNotice() { - $notice = Notice::publicStream(0, 1); + $notice = new Notice; if (!$notice) { $this->serverError(_('Could not retrieve public stream.')); return; } - // no notices in the public stream, let's get out of here if ($notice->count()) { return; } From 96982477220316ee7af0326dc6ff42d2438b540e Mon Sep 17 00:00:00 2001 From: Robin Millette Date: Fri, 3 Apr 2009 20:35:18 +0000 Subject: [PATCH 04/12] Added filler text to popular page for when it's empty, encouraging user to add favorites and/or register. --- actions/favorited.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/actions/favorited.php b/actions/favorited.php index 231b978973..20a354674f 100644 --- a/actions/favorited.php +++ b/actions/favorited.php @@ -143,6 +143,25 @@ class FavoritedAction extends Action $this->elementStart('div', 'instructions'); $this->raw($output); $this->elementEnd('div'); + + $favorite = new Fave; + + if ($favorite->count()) { + return; + } + + $message = _('Favorite notices appear on this page but noone has favorited one yet.') . ' '; + + if (common_logged_in()) { + $message .= _('Be the first to add a notice to your favorites by clicking the fave button next to any notice you like.'); + } + else { + $message .= _('Why not [register an account](%%action.register%%) and be the first to add a notice to your favorites!'); + } + + $this->elementStart('div', 'blankfiller'); + $this->raw(common_markup_to_html($message)); + $this->elementEnd('div'); } /** From 439d521c86e07fc7bc0c84e62022fc160f8f0fcf Mon Sep 17 00:00:00 2001 From: Robin Millette Date: Fri, 3 Apr 2009 20:37:29 +0000 Subject: [PATCH 05/12] Tiny change to the public tag cloud dealing with empty page. --- actions/publictagcloud.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/publictagcloud.php b/actions/publictagcloud.php index 5322372b2a..5bc7e0cbff 100644 --- a/actions/publictagcloud.php +++ b/actions/publictagcloud.php @@ -63,7 +63,7 @@ class PublictagcloudAction extends Action sprintf(_('These are most popular recent tags on %s '), common_config('site', 'name'))); - $tags = new Notice_tag(); + $tags = new Notice_tag; if ($tags->count()) { return; } From d83f6c32690b34a4aa283f8665c9fa2c4f7df185 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Fri, 3 Apr 2009 14:16:32 -0700 Subject: [PATCH 06/12] Add Yatca to notice sources --- db/notice_source.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db/notice_source.sql b/db/notice_source.sql index d28a09383f..5d48e66b62 100644 --- a/db/notice_source.sql +++ b/db/notice_source.sql @@ -45,4 +45,5 @@ VALUES ('twitux','Twitux','http://live.gnome.org/DanielMorales/Twitux', now()), ('twitvim','TwitVim','http://vim.sourceforge.net/scripts/script.php?script_id=2204', now()), ('urfastr','urfastr','http://urfastr.net/', now()), - ('adium', 'Adium', 'http://www.adiumx.com/', now()); + ('adium', 'Adium', 'http://www.adiumx.com/', now()), + ('yatca','Yatca','http://www.yatca.com/', now()); From 61a08c91d5475a6eaedc56d999a8814b48a0fbb5 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Fri, 3 Apr 2009 15:59:08 -0700 Subject: [PATCH 07/12] Bumped version number for upcoming 0.7.3 release --- scripts/laconica.spec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/laconica.spec b/scripts/laconica.spec index 0e51237a24..331e10671b 100644 --- a/scripts/laconica.spec +++ b/scripts/laconica.spec @@ -1,5 +1,5 @@ # This version needs to match the tarball and unpacked directory name. -%define LACVER 0.7.2.1 +%define LACVER 0.7.3 BuildRequires: php-pear BuildRequires: httpd-devel @@ -79,15 +79,15 @@ rm -rf %buildroot %config(noreplace) %{_sysconfdir}/httpd/conf.d/laconica.conf %changelog +* Wed Apr 03 2009 Zach Copley - 0.7.3 +- Changed version number to 0.7.3. + * Fri Mar 13 2009 Ken Sedgwick - 0.7.2.1-1 - Factored laconica version to the first line of the file. * Wed Mar 03 2009 Zach Copley - 0.7.2 - Changed version number to 0.7.2. -* Wed Mar 03 2009 Zach Copley - 0.7.2 -- Changed version number to 0.7.2. - * Sat Feb 28 2009 Ken Sedgwick - 0.7.1-1 - Modified RPM for Fedora. From bd52139436ba6e43ead6fd6acff43a90a1224f04 Mon Sep 17 00:00:00 2001 From: Robin Millette Date: Sun, 5 Apr 2009 00:46:39 +0000 Subject: [PATCH 08/12] bookmarklet inspired by wordpress press this. --- doc-src/bookmarklet | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 doc-src/bookmarklet diff --git a/doc-src/bookmarklet b/doc-src/bookmarklet new file mode 100644 index 0000000000..03c0e97c9d --- /dev/null +++ b/doc-src/bookmarklet @@ -0,0 +1,8 @@ +A bookmarklet is a small piece of javascript code used as a bookmark. This one will let you post to %%site.name%% simply by selecting some text on a page and pressing the bookmarklet. + +Drag-and-drop the following link to your bookmarks bar or right-click it and add it to your browser favorites to keep it handy. + + +Post to %%site.name%% + + From 1ee24a2aaf6d07f0f6ffd4697da88c43b140bd13 Mon Sep 17 00:00:00 2001 From: Robin Millette Date: Sun, 5 Apr 2009 23:11:40 +0000 Subject: [PATCH 09/12] added filler text to people search, suggesting other search options. --- actions/peoplesearch.php | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/actions/peoplesearch.php b/actions/peoplesearch.php index 9e515ade1a..6fbb19b882 100644 --- a/actions/peoplesearch.php +++ b/actions/peoplesearch.php @@ -60,14 +60,8 @@ class PeoplesearchAction extends SearchAction function showResults($q, $page) { - $profile = new Profile(); - - // lcase it for comparison - // $q = strtolower($q); - $search_engine = $profile->getSearchEngine('identica_people'); - $search_engine->set_sort_mode('chron'); // Ask for an extra to see if there's more. $search_engine->limit((($page-1)*PROFILES_PER_PAGE), PROFILES_PER_PAGE + 1); @@ -81,14 +75,34 @@ class PeoplesearchAction extends SearchAction $terms = preg_split('/[\s,]+/', $q); $results = new PeopleSearchResults($profile, $terms, $this); $results->show(); - } else { - $this->element('p', 'error', _('No results')); - } - - $profile->free(); - - $this->pagination($page > 1, $cnt > PROFILES_PER_PAGE, + $profile->free(); + $this->pagination($page > 1, $cnt > PROFILES_PER_PAGE, $page, 'peoplesearch', array('q' => $q)); + + } else { + $this->element('p', 'error', _('No results.')); + + $qe = urlencode($q); + $message = _(<<elementStart('div', 'blankfiller'); + $this->raw(common_markup_to_html($message)); + $this->elementEnd('div'); + $profile->free(); + } } } From 84d2aa7df49dc85603dd6c2d60c1f605800a458c Mon Sep 17 00:00:00 2001 From: Robin Millette Date: Mon, 6 Apr 2009 01:14:59 +0000 Subject: [PATCH 10/12] refactored search suggestions and added forgotten sprintf. --- actions/peoplesearch.php | 21 ++------------------- lib/searchaction.php | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/actions/peoplesearch.php b/actions/peoplesearch.php index 6fbb19b882..3ce719dd55 100644 --- a/actions/peoplesearch.php +++ b/actions/peoplesearch.php @@ -82,25 +82,8 @@ class PeoplesearchAction extends SearchAction } else { $this->element('p', 'error', _('No results.')); - $qe = urlencode($q); - $message = _(<<elementStart('div', 'blankfiller'); - $this->raw(common_markup_to_html($message)); - $this->elementEnd('div'); +//TODO + $this->searchSuggestions($q); $profile->free(); } } diff --git a/lib/searchaction.php b/lib/searchaction.php index c762db16f0..697262ccdb 100644 --- a/lib/searchaction.php +++ b/lib/searchaction.php @@ -133,5 +133,28 @@ class SearchAction extends Action $this->showResults($q, $page); } } + + function searchSuggestions($q) { + $qe = urlencode($q); + $message = sprintf(_(<<elementStart('div', 'blankfiller'); + $this->raw(common_markup_to_html($message)); + $this->elementEnd('div'); + } } From 9ad8307b7ee60b3263733b8b8c3d7ac6f350a452 Mon Sep 17 00:00:00 2001 From: Robin Millette Date: Mon, 6 Apr 2009 05:04:11 +0000 Subject: [PATCH 11/12] external search now depends on site.server. --- actions/peoplesearch.php | 2 -- lib/searchaction.php | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/actions/peoplesearch.php b/actions/peoplesearch.php index 3ce719dd55..65d970dd15 100644 --- a/actions/peoplesearch.php +++ b/actions/peoplesearch.php @@ -81,8 +81,6 @@ class PeoplesearchAction extends SearchAction } else { $this->element('p', 'error', _('No results.')); - -//TODO $this->searchSuggestions($q); $profile->free(); } diff --git a/lib/searchaction.php b/lib/searchaction.php index 697262ccdb..918f8dd9af 100644 --- a/lib/searchaction.php +++ b/lib/searchaction.php @@ -146,8 +146,8 @@ You can also try your search on other engines: * [Twingly](http://www.twingly.com/search?q=%s&content=microblog&site=identi.ca) * [Tweet scan](http://www.tweetscan.com/indexi.php?s=%s) -* [Google](http://www.google.com/search?q=site%%3Aidenti.ca+%s) -* [Yahoo](http://search.yahoo.com/search?p=site%%3Aidenti.ca+%s) +* [Google](http://www.google.com/search?q=site%%3A%%%%site.server%%%%+%s) +* [Yahoo](http://search.yahoo.com/search?p=site%%3A%%%%site.server%%%%+%s) E_O_T From 17fb51f747c023392cd6127abe9b019e693f0544 Mon Sep 17 00:00:00 2001 From: Robin Millette Date: Tue, 7 Apr 2009 03:26:33 +0000 Subject: [PATCH 12/12] added filler text to notice and group search, suggesting other search options. --- actions/groupsearch.php | 26 ++++++++++++++++---------- actions/noticesearch.php | 21 +++++++++++++-------- 2 files changed, 29 insertions(+), 18 deletions(-) diff --git a/actions/groupsearch.php b/actions/groupsearch.php index 109a53ce11..31c4ffd948 100644 --- a/actions/groupsearch.php +++ b/actions/groupsearch.php @@ -72,12 +72,23 @@ class GroupsearchAction extends SearchAction $terms = preg_split('/[\s,]+/', $q); $results = new GroupSearchResults($user_group, $terms, $this); $results->show(); - } else { - $this->element('p', 'error', _('No results')); - } - $user_group->free(); - $this->pagination($page > 1, $cnt > GROUPS_PER_PAGE, + $user_group->free(); + $this->pagination($page > 1, $cnt > GROUPS_PER_PAGE, $page, 'groupsearch', array('q' => $q)); + } else { + $this->element('p', 'error', _('No results.')); + $this->searchSuggestions($q); + if (common_logged_in()) { + $message = _('If you can\'t find the group you\'re looking for, you can [create it](%%action.newgroup%%) yourself.'); + } + else { + $message = _('Why not [register an account](%%action.register%%) and [create the group](%%action.newgroup%%) yourself!'); + } + $this->elementStart('div', 'blankfiller'); + $this->raw(common_markup_to_html($message)); + $this->elementEnd('div'); + $user_group->free(); + } } } @@ -98,10 +109,5 @@ class GroupSearchResults extends GroupList { return preg_replace($this->pattern, '\\1', htmlspecialchars($text)); } - - function isReadOnly() - { - return true; - } } diff --git a/actions/noticesearch.php b/actions/noticesearch.php index 9058cf53c3..a4308450b4 100644 --- a/actions/noticesearch.php +++ b/actions/noticesearch.php @@ -114,22 +114,27 @@ class NoticesearchAction extends SearchAction $cnt = $notice->find(); } if ($cnt === 0) { - $this->element('p', 'error', _('No results')); + $this->element('p', 'error', _('No results.')); + + $this->searchSuggestions($q); + if (common_logged_in()) { + $message = sprintf(_('Be the first to [post on this topic](%%%%action.newnotice%%%%?status_textarea=%s)!'), urlencode($q)); + } + else { + $message = sprintf(_('Why not [register an account](%%%%action.register%%%%) and be the first to [post on this topic](%%%%action.newnotice%%%%?status_textarea=%s)!'), urlencode($q)); + } + + $this->elementStart('div', 'blankfiller'); + $this->raw(common_markup_to_html($message)); + $this->elementEnd('div'); return; } $terms = preg_split('/[\s,]+/', $q); $nl = new SearchNoticeList($notice, $this, $terms); - $cnt = $nl->show(); - $this->pagination($page > 1, $cnt > NOTICES_PER_PAGE, $page, 'noticesearch', array('q' => $q)); } - - function isReadOnly() - { - return true; - } } class SearchNoticeList extends NoticeList {