]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'master' of root@laconi.ca:/var/www/laconi.ca/software/laconica
authorEvan Prodromou <git@evanprodromou.name>
Wed, 28 Jan 2009 13:24:29 +0000 (08:24 -0500)
committerEvan Prodromou <git@evanprodromou.name>
Wed, 28 Jan 2009 13:24:29 +0000 (08:24 -0500)
16 files changed:
actions/facebookhome.php
actions/favoritesrss.php
actions/profilesettings.php
actions/register.php
actions/showgroup.php
actions/subscribers.php
actions/twittersettings.php
js/facebookapp.js
lib/facebookaction.php
lib/facebookutil.php
lib/grouplist.php
lib/profilelist.php
scripts/update_facebook.php
theme/base/css/display.css
theme/default/css/display.css
theme/identica/css/display.css

index e17c0f8137b199a72f64c7d1f3371309a9c9b1bf..4eaf0b4f76bcd99a925a052e81a39a5ef035df33 100644 (file)
@@ -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()
index ad72dce9e729c3ec88d67728adbb714ef8a90ba8..f85bf1b19002f288a04fd2175ee7c94f6f4c5435 100644 (file)
@@ -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;
-    }
 }
-
index 6dd4775e5a036455788d8df6f731db1856e9acae..82e6c3c82f78cb27b18d13a567166b70f4ca39bc 100644 (file)
@@ -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')));
index 433c6c2914bb95db96b354aa80fa53df8f0b665e..df64196da2c91f057bbc2b8c32cae13a74b6e975 100644 (file)
@@ -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');
index 99367a97cb6db84b534891cf6d3a2f7d99c613d0..c29b7d4263e814689e6b8d06675beb7637625e95 100644 (file)
@@ -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)) {
index fb8733c773ce494f5f31273f902ae486bee972d7..25200079c4b8ede04eb03213bd5d9687b321d83a 100644 (file)
@@ -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();
index bb0bc5946a63eef61d4d6580618fd71eee4f17a9..b3bf67dc3f6b254d5b2783d018ee2f68ee8cbfe3 100644 (file)
@@ -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');
index c7e8d6aa228bab161897af405718e13a5b4da8ad..8ef9aa532bf79f5f3f330a1c8a882594dd2ce111 100644 (file)
@@ -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);      
+}
index a12c7d6f94c6a2a53a9410d2643a2cd268373698..63ac66250b000f17db567d28858f880877aaa5bc 100644 (file)
@@ -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));
     }
     
     /**
index 8454590d6c3c36c69e5cbec644e927bd90862304..beab51366081b90b77a9775bf0f3cef04a225bd3 100644 (file)
@@ -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()
index 629bdd05df9d481e7bac94c5508675ae624f5b59..4c448e250d5011b13d3d8280fac33c97cf482bd5 100644 (file)
@@ -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');
index 499d74f7b58400552fc76314a6b8241a1c94afdf..6e14c0b692fd7d667f6c535df1a30db301df9d58 100644 (file)
@@ -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()
+    {
+    }
 }
index d2c1c3ffb92f8390dbc6141aeae08194cb9ce47e..485b2a342d90121ca434fdd7a6199edb8969a1db 100755 (executable)
@@ -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);
 
index 289329bbc984042d67c962dd986e97332a5f35f9..166044c7186b4bbf6e32cf113abd3d6361cf9cb7 100644 (file)
@@ -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;
index fb25d32d06bb9a0b4ad2aed66ced1ce570383762..97a6a12a8f2631ace41e87b1682dc44ae986d904 100644 (file)
@@ -106,7 +106,8 @@ padding:2px 4px;
 }
 
 #content,
-#site_nav_local_views a {
+#site_nav_local_views a,
+#aside_primary {
 border-color:#fff;
 }
 #content,
index 19beb1f90b5abf2149d015ec623fed7d6ba25ac2..15c22148d3cb12e105d10f73e691ff66b5697a69 100644 (file)
@@ -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);