summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-06-14 14:54:20 -0700
committerEvan Prodromou <evan@controlyourself.ca>2009-06-14 14:54:20 -0700
commitdaf2e7ef47b6ed071e764858c4b1a9f5eaadb65d (patch)
treef9d2b5042d318ed616458825232955d3ef42b7fd
parentb6ef8e735b8deeaf3e11a03574888a479b1679b7 (diff)
parent21e89d6f724fe8d54788a73b4b8325fdef647af3 (diff)
Merge branch '0.8.x' of git@gitorious.org:+laconica-developers/laconica/dev into 0.8.x
-rw-r--r--db/laconica.sql55
-rw-r--r--lib/noticelist.php14
2 files changed, 28 insertions, 41 deletions
diff --git a/db/laconica.sql b/db/laconica.sql
index a11e31692..7f52a5ef7 100644
--- a/db/laconica.sql
+++ b/db/laconica.sql
@@ -427,49 +427,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)
@@ -477,8 +478,8 @@ create table file_thumbnail (
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;
diff --git a/lib/noticelist.php b/lib/noticelist.php
index fadc238a4..c312292ab 100644
--- a/lib/noticelist.php
+++ b/lib/noticelist.php
@@ -206,24 +206,10 @@ class NoticeListItem extends Widget
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');