diff options
-rw-r--r-- | actions/facebookhome.php | 3 | ||||
-rw-r--r-- | actions/favoritesrss.php | 42 | ||||
-rw-r--r-- | actions/profilesettings.php | 2 | ||||
-rw-r--r-- | actions/register.php | 2 | ||||
-rw-r--r-- | actions/showgroup.php | 2 | ||||
-rw-r--r-- | actions/subscribers.php | 4 | ||||
-rw-r--r-- | actions/twittersettings.php | 4 | ||||
-rw-r--r-- | js/facebookapp.js | 47 | ||||
-rw-r--r-- | lib/facebookaction.php | 3 | ||||
-rw-r--r-- | lib/facebookutil.php | 7 | ||||
-rw-r--r-- | lib/grouplist.php | 6 | ||||
-rw-r--r-- | lib/profilelist.php | 19 | ||||
-rwxr-xr-x | scripts/update_facebook.php | 12 | ||||
-rw-r--r-- | theme/base/css/display.css | 13 | ||||
-rw-r--r-- | theme/default/css/display.css | 3 | ||||
-rw-r--r-- | theme/identica/css/display.css | 7 |
16 files changed, 110 insertions, 66 deletions
diff --git a/actions/facebookhome.php b/actions/facebookhome.php index e17c0f813..4eaf0b4f7 100644 --- a/actions/facebookhome.php +++ b/actions/facebookhome.php @@ -122,7 +122,6 @@ class FacebookhomeAction extends FacebookAction // XXX: Do some error handling here $this->setDefaults(); - //$this->showHome($flink, _('You can now use Identi.ca from Facebook!')); $this->getUpdatePermission(); return; @@ -154,6 +153,8 @@ class FacebookhomeAction extends FacebookAction $notice_form = new FacebookNoticeForm($this, $post_action, null, $post_action, $this->user); $notice_form->show(); + + } function title() diff --git a/actions/favoritesrss.php b/actions/favoritesrss.php index ad72dce9e..f85bf1b19 100644 --- a/actions/favoritesrss.php +++ b/actions/favoritesrss.php @@ -44,22 +44,32 @@ require_once INSTALLDIR.'/lib/rssaction.php'; * @package Laconica * @author Evan Prodromou <evan@controlyourself.ca> * @author Robin Millette <millette@controlyourself.ca> + * @author Zach Copley <zach@controlyourself.ca> * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 * @link http://laconi.ca/ */ class FavoritesrssAction extends Rss10Action { - var $user = null; + /** The user whose favorites to display */ + + var $user = null; + /** - * Initialization. - * - * @return boolean false if user doesn't exist + * Find the user to display by supplied nickname + * + * @param array $args Arguments from $_REQUEST + * + * @return boolean success */ - function init() + + function prepare($args) { + parent::prepare($args); + $nickname = $this->trimmed('nickname'); $this->user = User::staticGet('nickname', $nickname); + if (!$this->user) { $this->clientError(_('No such user.')); return false; @@ -67,7 +77,7 @@ class FavoritesrssAction extends Rss10Action return true; } } - + /** * Get notices * @@ -94,30 +104,26 @@ class FavoritesrssAction extends Rss10Action function getChannel() { $user = $this->user; - $c = array('url' => common_local_url('favoritesrss', - array('nickname' => - $user->nickname)), + $c = array('url' => common_local_url('favoritesrss', + array('nickname' => + $user->nickname)), 'title' => sprintf(_("%s favorite notices"), $user->nickname), 'link' => common_local_url('showfavorites', - array('nickname' => - $user->nickname)), - 'description' => sprintf(_('Feed of favorite notices of %s'), $user->nickname)); + array('nickname' => + $user->nickname)), + 'description' => sprintf(_('Feed of favorite notices of %s'), + $user->nickname)); return $c; } /** * Get image. * - * @return voir + * @return void */ function getImage() { return null; } - function isReadOnly() - { - return true; - } } - diff --git a/actions/profilesettings.php b/actions/profilesettings.php index 6dd4775e5..82e6c3c82 100644 --- a/actions/profilesettings.php +++ b/actions/profilesettings.php @@ -83,7 +83,7 @@ class ProfilesettingsAction extends AccountSettingsAction $user = common_current_user(); $profile = $user->getProfile(); - $this->elementStart('form', array('method' => 'POST', + $this->elementStart('form', array('method' => 'post', 'id' => 'form_settings_profile', 'class' => 'form_settings', 'action' => common_local_url('profilesettings'))); diff --git a/actions/register.php b/actions/register.php index 433c6c291..df64196da 100644 --- a/actions/register.php +++ b/actions/register.php @@ -428,7 +428,7 @@ class RegisterAction extends Action $this->element('input', $attrs); $this->text(_('My text and files are available under ')); $this->element('a', array('href' => common_config('license', 'url')), - common_config('license', 'title')); + common_config('license', 'title'), _("Creative Commons Attribution 3.0")); $this->text(_(' except this private data: password, '. 'email address, IM address, phone number.')); $this->elementEnd('li'); diff --git a/actions/showgroup.php b/actions/showgroup.php index 99367a97c..c29b7d426 100644 --- a/actions/showgroup.php +++ b/actions/showgroup.php @@ -269,7 +269,7 @@ class ShowgroupAction extends Action $this->elementStart('div', 'entity_actions'); $this->element('h2', null, _('Group actions')); $this->elementStart('ul'); - $this->elementStart('li', array('id' => 'entity_subscribe')); + $this->elementStart('li', 'entity_subscribe'); $cur = common_current_user(); if ($cur) { if ($cur->isMember($this->group)) { diff --git a/actions/subscribers.php b/actions/subscribers.php index fb8733c77..25200079c 100644 --- a/actions/subscribers.php +++ b/actions/subscribers.php @@ -96,9 +96,9 @@ class SubscribersAction extends GalleryAction class SubscribersList extends ProfileList { - function showOwnerControls($profile) + function showBlockForm() { - $bf = new BlockForm($this->out, $profile, + $bf = new BlockForm($this->out, $this->profile, array('action' => 'subscribers', 'nickname' => $this->owner->nickname)); $bf->show(); diff --git a/actions/twittersettings.php b/actions/twittersettings.php index bb0bc5946..b3bf67dc3 100644 --- a/actions/twittersettings.php +++ b/actions/twittersettings.php @@ -57,7 +57,7 @@ class TwittersettingsAction extends ConnectSettingsAction function title() { - _('Twitter settings'); + return _('Twitter settings'); } /** @@ -109,7 +109,7 @@ class TwittersettingsAction extends ConnectSettingsAction $this->elementStart('li', array('id' => 'settings_twitter_remove')); $this->element('span', 'twitter_user', $fuser->nickname); $this->element('a', array('href' => $fuser->uri), $fuser->uri); - $this->element('p', 'form_guide', + $this->element('p', 'form_note', _('Current verified Twitter account.')); $this->hidden('flink_foreign_id', $flink->foreign_id); $this->elementEnd('li'); diff --git a/js/facebookapp.js b/js/facebookapp.js index c7e8d6aa2..8ef9aa532 100644 --- a/js/facebookapp.js +++ b/js/facebookapp.js @@ -1,18 +1,31 @@ /* - * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2008, Controlez-Vous, Inc. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ -
\ No newline at end of file +* Laconica - a distributed open-source microblogging tool +* Copyright (C) 2008, Controlez-Vous, Inc. +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU Affero General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 Affero General Public License for more details. +* +* You should have received a copy of the GNU Affero General Public License +* along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +var max = 140; +var noticeBox = document.getElementById('notice_data-text'); + +noticeBox.addEventListener('keyup', keypress); +noticeBox.addEventListener('keydown', keypress); +noticeBox.addEventListener('keypress', keypress); +noticeBox.addEventListener('change', keypress); + +// Do our the countdown +function keypress(evt) { + document.getElementById('notice_text-count').setTextValue( + max - noticeBox.getValue().length); +} diff --git a/lib/facebookaction.php b/lib/facebookaction.php index a12c7d6f9..63ac66250 100644 --- a/lib/facebookaction.php +++ b/lib/facebookaction.php @@ -122,8 +122,7 @@ class FacebookAction extends Action // Add a timestamp to the file so Facebook cache wont ignore our changes $ts = filemtime(INSTALLDIR.'/js/facebookapp.js'); - $this->element('script', array('type' => 'text/javascript', - 'src' => common_path('js/facebookapp.js') . '?ts=' . $ts)); + $this->element('script', array('src' => common_path('js/facebookapp.js') . '?ts=' . $ts)); } /** diff --git a/lib/facebookutil.php b/lib/facebookutil.php index 8454590d6..beab51366 100644 --- a/lib/facebookutil.php +++ b/lib/facebookutil.php @@ -32,11 +32,12 @@ function getFacebookNotices($since) 'FROM notice ' . 'JOIN foreign_link ' . 'WHERE notice.profile_id = foreign_link.user_id ' . - 'AND foreign_link.service = 2 ' . - 'ORDER BY notice.created DESC'; + 'AND foreign_link.service = 2'; // XXX: What should the limit be? - return Notice::getStreamDirect($qry, 0, 100, 0, 0, null, $since); + //static function getStreamDirect($qry, $offset, $limit, $since_id, $before_id, $order, $since) { + + return Notice::getStreamDirect($qry, 0, 1000, 0, 0, null, $since); } function getFacebook() diff --git a/lib/grouplist.php b/lib/grouplist.php index 629bdd05d..4c448e250 100644 --- a/lib/grouplist.php +++ b/lib/grouplist.php @@ -158,6 +158,9 @@ class GroupList extends Widget $this->out->elementEnd('div'); if ($user) { + $this->out->elementStart('div', 'entity_actions'); + $this->out->elementStart('ul'); + $this->out->elementStart('li', 'entity_subscribe'); # XXX: special-case for user looking at own # subscriptions page if ($user->isMember($this->group)) { @@ -167,6 +170,9 @@ class GroupList extends Widget $jf = new JoinForm($this->out, $this->group); $jf->show(); } + $this->out->elementEnd('li'); + $this->out->elementEnd('ul'); + $this->out->elementEnd('div'); } $this->out->elementEnd('li'); diff --git a/lib/profilelist.php b/lib/profilelist.php index 499d74f7b..6e14c0b69 100644 --- a/lib/profilelist.php +++ b/lib/profilelist.php @@ -191,9 +191,14 @@ class ProfileList extends Widget $this->out->elementEnd('div'); + $this->out->elementStart('div', 'entity_actions'); + + $this->out->elementStart('ul'); + if ($user && $user->id != $this->profile->id) { # XXX: special-case for user looking at own # subscriptions page + $this->out->elementStart('li', 'entity_subscribe'); if ($user->isSubscribed($this->profile)) { $usf = new UnsubscribeForm($this->out, $this->profile); $usf->show(); @@ -201,8 +206,18 @@ class ProfileList extends Widget $sf = new SubscribeForm($this->out, $this->profile); $sf->show(); } + $this->out->elementEnd('li'); + $this->out->elementStart('li', 'entity_block'); + if ($user && $user->id == $this->owner->id) { + $this->showBlockForm(); + } + $this->out->elementEnd('li'); } + $this->out->elementEnd('ul'); + + $this->out->elementEnd('div'); + $this->out->elementEnd('li'); } @@ -217,4 +232,8 @@ class ProfileList extends Widget { return htmlspecialchars($text); } + + function showBlockForm() + { + } } diff --git a/scripts/update_facebook.php b/scripts/update_facebook.php index d2c1c3ffb..485b2a342 100755 --- a/scripts/update_facebook.php +++ b/scripts/update_facebook.php @@ -46,9 +46,9 @@ $facebook = getFacebook(); $current_time = time(); -$notice = getFacebookNotices(getLastUpdated()); +$since = getLastUpdated(); -print date('r', $current_time) . " Looking for notices to send to Facebook...\n"; +$notice = getFacebookNotices($since); $cnt = 0; @@ -81,9 +81,13 @@ while($notice->fetch()) { } } -updateLastUpdated($current_time); +if ($cnt > 0) { + print date('r', $current_time) . + ": Found $cnt new notices to send to Facebook since last run at " . + date('Y-m-d H:i:s', $since) . "\n"; -print "Sent $cnt notices to Facebook.\n"; + updateLastUpdated($current_time); +} exit(0); diff --git a/theme/base/css/display.css b/theme/base/css/display.css index 289329bbc..166044c71 100644 --- a/theme/base/css/display.css +++ b/theme/base/css/display.css @@ -391,13 +391,15 @@ float:left; } #aside_primary { -width:286px; +width:284px; float:left; margin-left:2px; padding:18px; border-radius:7px; -moz-border-radius:7px; -webkit-border-radius:7px; +border-width:1px; +border-style:solid; } /*Start: FORM NOTICE*/ @@ -688,12 +690,6 @@ min-height:60px; } -.profile .form_group_join, -.profile .form_group_leave, -.profile .form_user_subscribe, -.profile .form_user_unsubscribe { -float:right; -} .profile .form_group_join legend, .profile .form_group_leave legend, .profile .form_user_subscribe legend, @@ -796,9 +792,6 @@ text-decoration:none; .vcard .url:hover { text-decoration:underline; } -.vcard .fn { -font-style:italic; -} .notice .entry-title { float:left; diff --git a/theme/default/css/display.css b/theme/default/css/display.css index fb25d32d0..97a6a12a8 100644 --- a/theme/default/css/display.css +++ b/theme/default/css/display.css @@ -106,7 +106,8 @@ padding:2px 4px; } #content, -#site_nav_local_views a { +#site_nav_local_views a, +#aside_primary { border-color:#fff; } #content, diff --git a/theme/identica/css/display.css b/theme/identica/css/display.css index 19beb1f90..15c22148d 100644 --- a/theme/identica/css/display.css +++ b/theme/identica/css/display.css @@ -10,7 +10,7 @@ html, body, a:active { -background-color:#ddd; +background-color:#F0F2F5; } body { font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; @@ -106,7 +106,8 @@ padding:2px 4px; } #content, -#site_nav_local_views a { +#site_nav_local_views a, +#aside_primary { border-color:#fff; } #content, @@ -115,7 +116,7 @@ background-color:#fff; } #site_nav_local_views a { -background-color:rgba(255, 255, 255, 0.2); +background-color:rgba(151, 191, 209, 0.3); } #site_nav_local_views a:hover { background-color:rgba(255, 255, 255, 0.7); |