From: Evan Prodromou Date: Wed, 28 Jan 2009 13:24:29 +0000 (-0500) Subject: Merge branch 'master' of root@laconi.ca:/var/www/laconi.ca/software/laconica X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f761031d0acdc03add5a6bd9a125575463da2582;hp=c4097750adde556a6ff302c82b6098a5005f5f02;p=quix0rs-gnu-social.git Merge branch 'master' of root@laconi.ca:/var/www/laconi.ca/software/laconica --- diff --git a/actions/facebookhome.php b/actions/facebookhome.php index e17c0f8137..4eaf0b4f76 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 ad72dce9e7..f85bf1b190 100644 --- a/actions/favoritesrss.php +++ b/actions/favoritesrss.php @@ -44,22 +44,32 @@ require_once INSTALLDIR.'/lib/rssaction.php'; * @package Laconica * @author Evan Prodromou * @author Robin Millette + * @author Zach Copley * @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 6dd4775e5a..82e6c3c82f 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 433c6c2914..df64196da2 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 99367a97cb..c29b7d4263 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 fb8733c773..25200079c4 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 bb0bc5946a..b3bf67dc3f 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 c7e8d6aa22..8ef9aa532b 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 . - */ - \ 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 . +*/ + +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 a12c7d6f94..63ac66250b 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 8454590d6c..beab513660 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 629bdd05df..4c448e250d 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 499d74f7b5..6e14c0b692 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 d2c1c3ffb9..485b2a342d 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 289329bbc9..166044c718 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 fb25d32d06..97a6a12a8f 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 19beb1f90b..15c22148d3 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);