]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch '0.8.x' into userdesign
authorZach Copley <zach@controlyourself.ca>
Mon, 15 Jun 2009 18:50:08 +0000 (11:50 -0700)
committerZach Copley <zach@controlyourself.ca>
Mon, 15 Jun 2009 18:50:08 +0000 (11:50 -0700)
* 0.8.x: (32 commits)
  updates to Status_network
  makeadmin action
  make admins of groups
  show aliases when showing a group
  Link and distribute notices tagged for a group alias
  Code for adding and saving group aliases
  Styles for group block
  add correct li for css magic for block stuff
  typo in profileminilist class
  return count from show
  try to get the right class for profileminilist
  fix perms for classes/statusnet.ini
  fixup perms for classes
  Added Group_alias class
  add a table for group aliases
  Cross-browser notice_attach
  Allow users to be unblocked from a group
  Some UI improvements for blocking and unblocking
  The rest of the things necessary to make group block work
  Make group block work
  ...

Conflicts:
db/laconica.sql
lib/common.php

1  2 
classes/laconica.ini
db/laconica.sql
lib/common.php
lib/noticelist.php
lib/profileaction.php

diff --combined classes/laconica.ini
index 07aa016fef9921e9736898d4d1b27e16c01aca1a,df292bbffd4f3485b4e95cff5f94a1ee8fd38691..c04ae758f4785a50f32b579b8618c9e542459f4f
mode 100755,100644..100755
@@@ -38,18 -38,6 +38,18 @@@ modified = 38
  [consumer__keys]
  consumer_key = K
  
 +[design]
 +id = 129
 +backgroundcolor = 1
 +contentcolor = 1
 +sidebarcolor = 1
 +textcolor = 1
 +linkcolor = 1
 +backgroundimage = 2
 +
 +[design__keys]
 +id = N
 +
  [fave]
  notice_id = 129
  user_id = 129
@@@ -170,6 -158,24 +170,24 @@@ id = 
  service = K
  uri = U
  
+ [group_alias]
+ alias = 130
+ group_id = 129
+ modified = 384
+ [group_alias__keys]
+ alias = K
+ [group_block]
+ group_id = 129
+ blocked = 129
+ blocker = 129
+ modified = 384
+ [group_block__keys]
+ group_id = K
+ blocked = K
  [group_inbox]
  group_id = 129
  notice_id = 129
@@@ -424,8 -430,6 +442,8 @@@ uri = 
  autosubscribe = 17
  urlshorteningservice = 2
  inboxed = 17
 +design_id = 1
 +viewdesigns = 17
  created = 142
  modified = 384
  
diff --combined db/laconica.sql
index 2ca084e48df19b368c23596cb82fd1602732226e,b8c0824f5aa765b024a924c124142d5ac482aab7..bd95d1ade639063ccdbd1ac15cf6f2f11edc486d
@@@ -41,7 -41,6 +41,7 @@@ create table sms_carrier 
  /* local users */
  
  create table user (
 +
      id integer primary key comment 'foreign key to profile table' references profile (id),
      nickname varchar(64) unique key comment 'nickname or username, duped in profile',
      password varchar(255) comment 'salted password, can be null for OpenID users',
@@@ -70,9 -69,6 +70,9 @@@
      autosubscribe tinyint default 0 comment 'automatically subscribe to users who subscribe to us',
      urlshorteningservice varchar(50) default 'ur1.ca' comment 'service to use for auto-shortening URLs',
      inboxed tinyint default 0 comment 'has an inbox been created for this user?',
 +    design_id integer comment 'id of a design' references design(id),
 +    viewdesigns tinyint default 1 comment 'whether to view user-provided designs',
 +
      created datetime not null comment 'date this record was created',
      modified timestamp comment 'date this record was modified',
  
@@@ -431,49 -427,50 +431,50 @@@ create table group_inbox 
  
  create table file (
      id integer primary key auto_increment,
-     url varchar(255), mimetype varchar(50),
-     size integer,
-     title varchar(255),
-     date integer(11),
-     protected integer(1),
+     url varchar(255) comment 'destination URL after following redirections',
+     mimetype varchar(50) comment 'mime type of resource',
+     size integer comment 'size of resource when available',
+     title varchar(255) comment 'title of resource when available',
+     date integer(11) comment 'date of resource according to http query',
+     protected integer(1) comment 'true when URL is private (needs login)',
  
      unique(url)
  ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
  
  create table file_oembed (
      id integer primary key auto_increment,
-     file_id integer,
-     version varchar(20),
-     type varchar(20),
-     provider varchar(50),
-     provider_url varchar(255),
-     width integer,
-     height integer,
-     html text,
-     title varchar(255),
-     author_name varchar(50),
-     author_url varchar(255),
-     url varchar(255),
+     file_id integer comment 'oEmbed for that URL/file' references file (id),
+     version varchar(20) comment 'oEmbed spec. version',
+     type varchar(20) comment 'oEmbed type: photo, video, link, rich',
+     provider varchar(50) comment 'name of this oEmbed provider',
+     provider_url varchar(255) comment 'URL of this oEmbed provider',
+     width integer comment 'width of oEmbed resource when available',
+     height integer comment 'height of oEmbed resource when available',
+     html text comment 'html representation of this oEmbed resource when applicable',
+     title varchar(255) comment 'title of oEmbed resource when available',
+     author_name varchar(50) comment 'author name for this oEmbed resource',
+     author_url varchar(255) comment 'author URL for this oEmbed resource',
+     url varchar(255) comment 'URL for this oEmbed resource when applicable (photo, link)',
  
      unique(file_id)
  ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
  
  create table file_redirection (
      id integer primary key auto_increment,
-     url varchar(255),
-     file_id integer,
-     redirections integer,
-     httpcode integer,
+     url varchar(255) comment 'short URL (or any other kind of redirect) for file (id)',
+     file_id integer comment 'short URL for what URL/file' references file (id),
+     redirections integer comment 'redirect count',
+     httpcode integer comment 'HTTP status code (20x, 30x, etc.)',
  
      unique(url)
  ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
  
  create table file_thumbnail (
      id integer primary key auto_increment,
-     file_id integer,
-     url varchar(255),
-     width integer,
-     height integer,
+     file_id integer comment 'thumbnail for what URL/file' references file (id),
+     url varchar(255) comment 'URL of thumbnail',
+     width integer comment 'width of thumbnail',
+     height integer comment 'height of thumbnail',
  
      unique(file_id),
      unique(url)
  
  create table file_to_post (
      id integer primary key auto_increment,
-     file_id integer,
-     post_id integer,
+     file_id integer comment 'id of URL/file' references file (id),
+     post_id integer comment 'id of the notice it belongs to' references notice (id),
  
      unique(file_id, post_id)
  ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
  
 +create table design (
 +    id integer primary key auto_increment comment 'design ID',
 +    backgroundcolor integer comment 'main background color',
 +    contentcolor integer comment 'content area background color',
 +    sidebarcolor integer comment 'sidebar background color',
 +    textcolor integer comment 'text color',
 +    linkcolor integer comment 'link color',
 +    backgroundimage varchar(255) comment 'background image, if any'
 +) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
++
+ create table group_block (
+    group_id integer not null comment 'group profile is blocked from' references user_group (id),
+    blocked integer not null comment 'profile that is blocked' references profile (id),
+    blocker integer not null comment 'user making the block' references user (id),
+    modified timestamp comment 'date of blocking',
+    constraint primary key (group_id, blocked)
+ ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
+ create table group_alias (
+    alias varchar(64) primary key comment 'additional nickname for the group',
+    group_id integer not null comment 'group profile is blocked from' references user_group (id),
+    modified timestamp comment 'date alias was created',
+    index group_alias_group_id_idx (group_id)
+ ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
diff --combined lib/common.php
index a55fb264e11c18f4546539932b6d18c07124e7df,b4e87445e6a476237a3d6057ed7ea484a277edfa..eb3bf4e4dc3cf3ff9c787ce37926b3d29ab2ae4d
@@@ -71,14 -71,6 +71,14 @@@ $config 
          array('name' => 'Just another Laconica microblog',
                'server' => $_server,
                'theme' => 'default',
 +              'skin' => 'default',
 +              'design' =>
 +              array('backgroundcolor' => '#F0F2F5',
 +                    'contentcolor' => '#FFFFFF',
 +                    'sidebarcolor' => '#CEE1E9',
 +                    'textcolor' => '#000000',
 +                    'linkcolor' => '#002E6E',
 +                    'backgroundimage' => null),
                'path' => $_path,
                'logfile' => null,
                'logo' => null,
          'user_quota' => 50000000,
          'monthly_quota' => 15000000,
          ),
+         'group' =>
+         array('maxaliases' => 3),
          );
  
  $config['db'] = &PEAR::getStaticProperty('DB_DataObject','options');
diff --combined lib/noticelist.php
index e44997004519a11978430cf4ebeff56719ddd784,c312292abacc1999a09b28ca90cede5a7296dbfb..ad792441a3794765df430698c0721a65b0737e37
@@@ -50,6 -50,7 +50,6 @@@ require_once INSTALLDIR.'/lib/attachmen
   * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
   * @link     http://laconi.ca/
   * @see      Notice
 - * @see      StreamAction
   * @see      NoticeListItem
   * @see      ProfileNoticeList
   */
@@@ -205,24 -206,10 +205,10 @@@ class NoticeListItem extends Widge
          return 'shownotice' !== $this->out->args['action'];
      }
  
- /*
-     function attachmentCount($discriminant = true) {
-         $file_oembed = new File_oembed;
-         $query = "select count(*) as c from file_oembed join file_to_post on file_oembed.file_id = file_to_post.file_id where post_id=" . $this->notice->id;
-         $file_oembed->query($query);
-         $file_oembed->fetch();
-         return intval($file_oembed->c);
-     }
- */
-     function showWithAttachment() {
-     }
      function showNoticeInfo()
      {
          $this->out->elementStart('div', 'entry-content');
          $this->showNoticeLink();
- //        $this->showWithAttachment();
          $this->showNoticeSource();
          $this->showContext();
          $this->out->elementEnd('div');
diff --combined lib/profileaction.php
index a14d3846e66bfd08440b5a5e30ff8dcc9d59137c,298f34b2212f3773c540dc92c485d2f713d51dcd..2519922b2b28e8292e9a4a51e270b8e6af3e8416
@@@ -47,8 -47,9 +47,8 @@@ require_once INSTALLDIR.'/lib/groupmini
   * @link     http://laconi.ca/
   */
  
 -class ProfileAction extends Action
 +class ProfileAction extends OwnerDesignAction
  {
 -    var $user    = null;
      var $page    = null;
      var $profile = null;
      var $tag     = null;
          $this->element('h2', null, _('Subscriptions'));
  
          if ($profile) {
-             $pml = new ProfileMiniList($profile, $this->user, $this);
+             $pml = new ProfileMiniList($profile, $this);
              $cnt = $pml->show();
              if ($cnt == 0) {
                  $this->element('p', null, _('(None)'));
          $this->element('h2', null, _('Subscribers'));
  
          if ($profile) {
-             $pml = new ProfileMiniList($profile, $this->user, $this);
+             $pml = new ProfileMiniList($profile, $this);
              $cnt = $pml->show();
              if ($cnt == 0) {
                  $this->element('p', null, _('(None)'));