From a7089de22851060c551c9f43366bc197bddebb07 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 26 Apr 2009 12:13:49 -0400 Subject: run 'set names' after each connection to deal with UTF8 correctly --- classes/Memcached_DataObject.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'classes') diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php index 5f71f716b..877bbf2e0 100644 --- a/classes/Memcached_DataObject.php +++ b/classes/Memcached_DataObject.php @@ -227,4 +227,20 @@ class Memcached_DataObject extends DB_DataObject $c->set($ckey, $cached, MEMCACHE_COMPRESSED, $expiry); return new ArrayWrapper($cached); } + + // We overload so that 'SET NAMES "utf8"' is called for + // each connection + + function _connect() + { + global $_DB_DATAOBJECT; + $exists = !empty($this->_database_dsn_md5) && + isset($_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]); + $result = parent::_connect(); + if (!$exists) { + $DB = &$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]; + $DB->query('SET NAMES "utf8"'); + } + return $result; + } } -- cgit v1.2.3-54-g00ecf From 86770ccde7914219a0a572ced6dd21fa65566e1d Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 26 Apr 2009 12:27:32 -0400 Subject: Revert "run 'set names' after each connection to deal with UTF8 correctly" This reverts commit 84072aa5cf6124d59a06a7f0a7945c00ee2836da. This commit caused grievous harm to old notices on identi.ca. Reverting until we figure out how to convert the old notices. --- classes/Memcached_DataObject.php | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'classes') diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php index 877bbf2e0..5f71f716b 100644 --- a/classes/Memcached_DataObject.php +++ b/classes/Memcached_DataObject.php @@ -227,20 +227,4 @@ class Memcached_DataObject extends DB_DataObject $c->set($ckey, $cached, MEMCACHE_COMPRESSED, $expiry); return new ArrayWrapper($cached); } - - // We overload so that 'SET NAMES "utf8"' is called for - // each connection - - function _connect() - { - global $_DB_DATAOBJECT; - $exists = !empty($this->_database_dsn_md5) && - isset($_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]); - $result = parent::_connect(); - if (!$exists) { - $DB = &$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]; - $DB->query('SET NAMES "utf8"'); - } - return $result; - } } -- cgit v1.2.3-54-g00ecf From 698228acb9a6262f2fb4e0c82118249aa94cc0f8 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 26 Apr 2009 13:16:59 -0400 Subject: Revert "Revert "run 'set names' after each connection to deal with UTF8 correctly"" This reverts commit 86770ccde7914219a0a572ced6dd21fa65566e1d. --- classes/Memcached_DataObject.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'classes') diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php index 5f71f716b..877bbf2e0 100644 --- a/classes/Memcached_DataObject.php +++ b/classes/Memcached_DataObject.php @@ -227,4 +227,20 @@ class Memcached_DataObject extends DB_DataObject $c->set($ckey, $cached, MEMCACHE_COMPRESSED, $expiry); return new ArrayWrapper($cached); } + + // We overload so that 'SET NAMES "utf8"' is called for + // each connection + + function _connect() + { + global $_DB_DATAOBJECT; + $exists = !empty($this->_database_dsn_md5) && + isset($_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]); + $result = parent::_connect(); + if (!$exists) { + $DB = &$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]; + $DB->query('SET NAMES "utf8"'); + } + return $result; + } } -- cgit v1.2.3-54-g00ecf From 59340b274a41658c29cb7ae58ec92c06c52635c3 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 22 May 2009 21:08:22 -0400 Subject: laconica.ini change after automated createTables.php --- classes/laconica.ini | 118 +++++++++++++++++++++++++-------------------------- 1 file changed, 58 insertions(+), 60 deletions(-) mode change 100644 => 100755 classes/laconica.ini (limited to 'classes') diff --git a/classes/laconica.ini b/classes/laconica.ini old mode 100644 new mode 100755 index 316923af0..92bbb35d4 --- a/classes/laconica.ini +++ b/classes/laconica.ini @@ -46,6 +46,64 @@ modified = 384 notice_id = K user_id = K +[file] +id = 129 +url = 2 +mimetype = 2 +size = 1 +title = 2 +date = 1 +protected = 1 + +[file__keys] +id = N + +[file_oembed] +id = 129 +file_id = 1 +version = 2 +type = 2 +provider = 2 +provider_url = 2 +width = 1 +height = 1 +html = 34 +title = 2 +author_name = 2 +author_url = 2 +url = 2 + +[file_oembed__keys] +id = N + +[file_redirection] +id = 129 +url = 2 +file_id = 1 +redirections = 1 +httpcode = 1 + +[file_redirection__keys] +id = N + +[file_thumbnail] +id = 129 +file_id = 1 +url = 2 +width = 1 +height = 1 + +[file_thumbnail__keys] +id = N + +[file_to_post] +id = 129 +file_id = 1 +post_id = 1 + +[file_to_post__keys] +id = N + [foreign_link] user_id = 129 foreign_id = 129 @@ -392,63 +450,3 @@ modified = 384 [user_openid__keys] canonical = K display = U - -[file] -id = 129 -url = 2 -mimetype = 2 -size = 1 -title = 2 -date = 1 -protected = 1 - -[file__keys] -id = N - -[file_oembed] -id = 129 -file_id = 129 -version = 2 -type = 2 -provider = 2 -provider_url = 2 -width = 1 -height = 1 -html = 34 -title = 2 -author_name = 2 -author_url = 2 -url = 2 - -[file_oembed__keys] -id = N - -[file_redirection] -id = 129 -url = 2 -file_id = 129 -redirections = 1 -httpcode = 1 - -[file_redirection__keys] -id = N - -[file_thumbnail] -id = 129 -file_id = 129 -url = 2 -width = 1 -height = 1 - -[file_thumbnail__keys] -id = N - -[file_to_post] -id = 129 -file_id = 129 -post_id = 129 - -[file_to_post__keys] -id = N - - -- cgit v1.2.3-54-g00ecf From d216e3bbbbf04fb5b52b84fca0663dc2e023da02 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 22 May 2009 21:08:58 -0400 Subject: fix x bit on laconica.ini --- classes/laconica.ini | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 classes/laconica.ini (limited to 'classes') diff --git a/classes/laconica.ini b/classes/laconica.ini old mode 100755 new mode 100644 -- cgit v1.2.3-54-g00ecf From 68d90bcab04713d53cf3731d45729a617e68a2fa Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 22 May 2009 21:11:46 -0400 Subject: some class files had x bit set --- classes/Group_inbox.php | 0 classes/Group_member.php | 0 classes/Related_group.php | 0 classes/Status_network.php | 0 classes/User_group.php | 0 5 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 classes/Group_inbox.php mode change 100755 => 100644 classes/Group_member.php mode change 100755 => 100644 classes/Related_group.php mode change 100755 => 100644 classes/Status_network.php mode change 100755 => 100644 classes/User_group.php (limited to 'classes') diff --git a/classes/Group_inbox.php b/classes/Group_inbox.php old mode 100755 new mode 100644 diff --git a/classes/Group_member.php b/classes/Group_member.php old mode 100755 new mode 100644 diff --git a/classes/Related_group.php b/classes/Related_group.php old mode 100755 new mode 100644 diff --git a/classes/Status_network.php b/classes/Status_network.php old mode 100755 new mode 100644 diff --git a/classes/User_group.php b/classes/User_group.php old mode 100755 new mode 100644 -- cgit v1.2.3-54-g00ecf From ed1e1d9f440acfbb99c7a6e3d2b5c11fdcfa27ce Mon Sep 17 00:00:00 2001 From: Robin Millette Date: Wed, 27 May 2009 03:47:45 -0400 Subject: Handles local aliases (redirection) for file uploads attached to notices. --- .gitignore | 6 ++++++ actions/file.php | 40 ++++++++++++++++++++++++++++++++++++++++ actions/newnotice.php | 15 ++++++++++----- classes/File_redirection.php | 2 +- lib/router.php | 2 -- lib/util.php | 5 +++++ 6 files changed, 62 insertions(+), 8 deletions(-) create mode 100644 actions/file.php (limited to 'classes') diff --git a/.gitignore b/.gitignore index da6947bfd..3418d8ee5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ avatar/* files/* +file/* _darcs/* logs/* config.php @@ -16,3 +17,8 @@ dataobject.ini .buildpath .project .settings +TODO.rym +config-*.php +good-config.php +lac08.log +php.log diff --git a/actions/file.php b/actions/file.php new file mode 100644 index 000000000..1179dbe9a --- /dev/null +++ b/actions/file.php @@ -0,0 +1,40 @@ +. + */ + +if (!defined('LACONICA')) { exit(1); } + +require_once(INSTALLDIR.'/actions/shownotice.php'); + +class FileAction extends ShowNoticeAction +{ + function showPage() { + $source_url = common_local_url('file', array('notice' => $this->notice->id)); + $query = "select file_redirection.url as url from file join file_redirection on file.id = file_redirection.file_id where file.url = '$source_url'"; + $file = new File_redirection; + $file->query($query); + $file->fetch(); + if (empty($file->url)) { + die('nothing attached here'); + } else { + header("Location: {$file->url}"); + die(); + } + } +} + diff --git a/actions/newnotice.php b/actions/newnotice.php index d7507c118..aebdab3cc 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -110,7 +110,7 @@ class NewnoticeAction extends Action } function isFileAttached() { - return $_FILES['attach']['error'] === UPLOAD_ERR_OK; + return isset($_FILES['attach']['error']) && ($_FILES['attach']['error'] === UPLOAD_ERR_OK); } /** @@ -205,14 +205,19 @@ class NewnoticeAction extends Action $destination = "file/{$notice->id}-$filename"; if (move_uploaded_file($_FILES['attach']['tmp_name'], INSTALLDIR . "/$destination")) { $file = new File; -// $file->url = common_local_url('file', array('notice' => $notice->id)); - $file->url = common_path($destination); + $file->url = common_local_url('file', array('notice' => $notice->id)); +// $file->url = common_path($destination); $file->size = filesize(INSTALLDIR . "/$destination"); $file->date = time(); $file->mimetype = $_FILES['attach']['type']; - if ($ok = $file->insert()) { + if ($file_id = $file->insert()) { + $file_redir = new File_redirection; + $file_redir->url = common_path($destination); + $file_redir->file_id = $file_id; + $file_redir->insert(); + $f2p = new File_to_post; - $f2p->file_id = $ok; + $f2p->file_id = $file_id; $f2p->post_id = $notice->id; $f2p->insert(); } else { diff --git a/classes/File_redirection.php b/classes/File_redirection.php index 0eae68178..212cc3615 100644 --- a/classes/File_redirection.php +++ b/classes/File_redirection.php @@ -133,7 +133,7 @@ class File_redirection extends Memcached_DataObject $file->limit(1); $file->orderBy('len'); $file->find(true); - if (!empty($file->id)) { + if (!empty($file->url) && (strlen($file->url) < strlen($long_url))) { return $file->url; } diff --git a/lib/router.php b/lib/router.php index bd482eafa..456d1793e 100644 --- a/lib/router.php +++ b/lib/router.php @@ -164,11 +164,9 @@ class Router array('action' => 'newnotice'), array('replyto' => '[A-Za-z0-9_-]+')); -/* $m->connect('notice/:notice/file', array('action' => 'file'), array('notice' => '[0-9]+')); -*/ $m->connect('notice/:notice', array('action' => 'shownotice'), diff --git a/lib/util.php b/lib/util.php index d56f44f7b..ab1272309 100644 --- a/lib/util.php +++ b/lib/util.php @@ -499,6 +499,11 @@ function common_linkify($url) { // if this URL is an attachment, then we set class='attachment' and id='attahcment-ID' // where ID is the id of the attachment for the given URL. +// +// we need a better test telling what can be shown as an attachment +// we're currently picking up oembeds only. +// I think the best option is another file_view table in the db +// and associated dbobject. $query = "select file_oembed.file_id as file_id from file join file_oembed on file.id = file_oembed.file_id where file.url='$longurl'"; $file = new File; $file->query($query); -- cgit v1.2.3-54-g00ecf From d068680e1913a32eba0f5b0e1e746ac66ec638d3 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 27 May 2009 14:57:45 -0400 Subject: optionally use SET NAMES for utf8 to DB --- README | 4 ++++ classes/Memcached_DataObject.php | 4 +++- lib/common.php | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'classes') diff --git a/README b/README index 7b2dcacc5..c23d4e464 100644 --- a/README +++ b/README @@ -906,6 +906,10 @@ mirror: you can set this to an array of DSNs, like the above and adding the slaves to this array. Note that if you want some requests to go to the 'database' (master) server, you'll need to include it in this array, too. +utf8: whether to talk to the database in UTF-8 mode. This is the default + with new installations, but older sites may want to turn it off + until they get their databases fixed up. See "UTF-8 database" + above for details. syslog ------ diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php index 877bbf2e0..52ad4100f 100644 --- a/classes/Memcached_DataObject.php +++ b/classes/Memcached_DataObject.php @@ -239,7 +239,9 @@ class Memcached_DataObject extends DB_DataObject $result = parent::_connect(); if (!$exists) { $DB = &$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]; - $DB->query('SET NAMES "utf8"'); + if (common_config('db', 'utf8')) { + $DB->query('SET NAMES "utf8"'); + } } return $result; } diff --git a/lib/common.php b/lib/common.php index f983c4d16..8f95c2361 100644 --- a/lib/common.php +++ b/lib/common.php @@ -167,6 +167,7 @@ $config['db'] = 'require_prefix' => 'classes/', 'class_prefix' => '', 'mirror' => null, + 'utf8' => true, 'db_driver' => 'DB', # XXX: JanRain libs only work with DB 'quote_identifiers' => false, 'type' => 'mysql' ); -- cgit v1.2.3-54-g00ecf From 3d13a44b66e254f88a7c2aa36190fa8e9df8fec3 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 27 May 2009 17:59:49 -0700 Subject: Upgraded foreign_id column to handle new 64-bit Facebook user IDs. See: http://developers.facebook.com/news.php?blog=1&story=226 --- classes/Foreign_link.php | 2 +- db/laconica.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'classes') diff --git a/classes/Foreign_link.php b/classes/Foreign_link.php index 606560951..c0b356ece 100644 --- a/classes/Foreign_link.php +++ b/classes/Foreign_link.php @@ -11,7 +11,7 @@ class Foreign_link extends Memcached_DataObject public $__table = 'foreign_link'; // table name public $user_id; // int(4) primary_key not_null - public $foreign_id; // int(4) primary_key not_null + public $foreign_id; // bigint(8) primary_key not_null unsigned public $service; // int(4) primary_key not_null public $credentials; // varchar(255) public $noticesync; // tinyint(1) not_null default_1 diff --git a/db/laconica.sql b/db/laconica.sql index 0b20bc172..a11e31692 100644 --- a/db/laconica.sql +++ b/db/laconica.sql @@ -285,7 +285,7 @@ create table foreign_user ( create table foreign_link ( user_id int comment 'link to user on this system, if exists' references user (id), - foreign_id int comment 'link ' references foreign_user(id), + foreign_id bigint unsigned comment 'link to user on foreign service, if exists' references foreign_user(id), service int not null comment 'foreign key to service' references foreign_service(id), credentials varchar(255) comment 'authc credentials, typically a password', noticesync tinyint not null default 1 comment 'notice synchronization, bit 1 = sync outgoing, bit 2 = sync incoming, bit 3 = filter local replies', -- cgit v1.2.3-54-g00ecf From f8dae2bbc9600a4ad474e924dc540491e29e2767 Mon Sep 17 00:00:00 2001 From: Robin Millette Date: Sun, 31 May 2009 21:03:55 -0400 Subject: Refactored some attachment code and fixed upload bug in interface. --- actions/newnotice.php | 38 ++++++-------------------------------- classes/File.php | 26 ++++++++++++++++++++++++++ lib/noticeform.php | 2 -- 3 files changed, 32 insertions(+), 34 deletions(-) (limited to 'classes') diff --git a/actions/newnotice.php b/actions/newnotice.php index 29b748dd1..a24d62684 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -131,37 +131,10 @@ class NewnoticeAction extends Action } function isRespectsQuota($user) { - if ($_FILES['attach']['size'] > common_config('attachments', 'file_quota')) { - $this->clientError(sprintf(_('No file may be larger than %d bytes ' . - 'and the file you sent was %d bytes. Try to upload a smaller version.'), - common_config('attachments', 'file_quota'), $_FILES['attach']['size'])); - } - - $query = "select sum(size) as total from file join file_to_post on file_to_post.file_id = file.id join notice on file_to_post.post_id = notice.id where profile_id = {$user->id} and file.url like '%/notice/%/file'"; $file = new File; - $file->query($query); - $file->fetch(); - $total = $file->total + $_FILES['attach']['size']; - if ($total > common_config('attachments', 'user_quota')) { - $this->clientError(sprintf(_('A file this large would exceed your user quota of %d bytes.'), common_config('attachments', 'user_quota'))); - } - - $query .= ' month(modified) = month(now()) and year(modified) = year(now())'; - $file2 = new File; - $file2->query($query); - $file2->fetch(); - $total2 = $file2->total + $_FILES['attach']['size']; - if ($total2 > common_config('attachments', 'monthly_quota')) { - $this->clientError(sprintf(_('A file this large would exceed your monthly quota of %d bytes.'), common_config('attachments', 'monthly_quota'))); - } - return true; - } - - function isValidFileAttached($user) { - return isset($_FILES['attach']['error']) - && ($_FILES['attach']['error'] === UPLOAD_ERR_OK) - && $this->isSupportedFileType() - && $this->isRespectsQuota($user); + $ret = $file->isRespectsQuota($user); + if (true === $ret) return true; + $this->clientError($ret); } /** @@ -212,6 +185,7 @@ class NewnoticeAction extends Action $replyto = 'false'; } + if (isset($_FILES['attach']['error'])) { switch ($_FILES['attach']['error']) { case UPLOAD_ERR_NO_FILE: // no file uploaded @@ -223,8 +197,7 @@ class NewnoticeAction extends Action // lets check if we really support its format // and it doesn't go over quotas - - if (!$this->isValidFileAttached($user)) { + if (!$this->isSupportedFileType() || !$this->isRespectsQuota($user)) { die('clientError() should trigger an exception before reaching here.'); } break; @@ -250,6 +223,7 @@ class NewnoticeAction extends Action default: die('Should never reach here.'); } + } $notice = Notice::saveNew($user->id, $content_shortened, 'web', 1, ($replyto == 'false') ? null : $replyto); diff --git a/classes/File.php b/classes/File.php index e5913115b..24ab11b8e 100644 --- a/classes/File.php +++ b/classes/File.php @@ -120,4 +120,30 @@ class File extends Memcached_DataObject File_to_post::processNew($file_id, $notice_id); return $x; } + + function isRespectsQuota($user) { + if ($_FILES['attach']['size'] > common_config('attachments', 'file_quota')) { + return sprintf(_('No file may be larger than %d bytes ' . + 'and the file you sent was %d bytes. Try to upload a smaller version.'), + common_config('attachments', 'file_quota'), $_FILES['attach']['size']); + } + + $query = "select sum(size) as total from file join file_to_post on file_to_post.file_id = file.id join notice on file_to_post.post_id = notice.id where profile_id = {$user->id} and file.url like '%/notice/%/file'"; + $this->query($query); + $this->fetch(); + $total = $this->total + $_FILES['attach']['size']; + if ($total > common_config('attachments', 'user_quota')) { + return sprintf(_('A file this large would exceed your user quota of %d bytes.'), common_config('attachments', 'user_quota')); + } + + $query .= ' month(modified) = month(now()) and year(modified) = year(now())'; + $this->query($query); + $this->fetch(); + $total = $this->total + $_FILES['attach']['size']; + if ($total > common_config('attachments', 'monthly_quota')) { + return sprintf(_('A file this large would exceed your monthly quota of %d bytes.'), common_config('attachments', 'monthly_quota')); + } + return true; + } } + diff --git a/lib/noticeform.php b/lib/noticeform.php index 5f438327d..7c88bd7b1 100644 --- a/lib/noticeform.php +++ b/lib/noticeform.php @@ -156,9 +156,7 @@ class NoticeForm extends Form $this->out->hidden('notice_return-to', $this->action, 'returnto'); } $this->out->hidden('notice_in-reply-to', $this->action, 'inreplyto'); - $this->out->hidden('MAX_FILE_SIZE', common_config('attachments', 'file_quota')); - } /** -- cgit v1.2.3-54-g00ecf From 27af3c67a2a9ea856aa2de041a986d452cce3025 Mon Sep 17 00:00:00 2001 From: Robin Millette Date: Tue, 9 Jun 2009 15:18:12 -0400 Subject: Improve file upload and attachment interface. --- classes/Notice.php | 12 ++++++++++++ lib/common.php | 1 + lib/noticelist.php | 8 ++++---- 3 files changed, 17 insertions(+), 4 deletions(-) (limited to 'classes') diff --git a/classes/Notice.php b/classes/Notice.php index 1b5c0ab0a..0b1017e12 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -277,6 +277,18 @@ class Notice extends Memcached_DataObject return true; } + function getUploadedAttachment() { + $post = clone $this; + $query = 'select file.url as uploaded from file join file_to_post on file.id = file_id where post_id=' . $post->escape($post->id) . ' and url like "%/notice/%/file"'; + $post->query($query); + $post->fetch(); + $ret = $post->uploaded; +// var_dump($post); + $post->free(); +// die(); + return $ret; + } + function hasAttachments() { $post = clone $this; $query = "select count(file_id) as n_attachments from file join file_to_post on (file_id = file.id) join notice on (post_id = notice.id) where post_id = " . $post->escape($post->id); diff --git a/lib/common.php b/lib/common.php index ceb50337c..5aafdfe0e 100644 --- a/lib/common.php +++ b/lib/common.php @@ -188,6 +188,7 @@ $config = 'application/vnd.oasis.opendocument.formula-template', 'application/vnd.oasis.opendocument.text-master', 'application/vnd.oasis.opendocument.text-web', + 'application/x-zip', 'application/zip', 'text/plain', 'video/mpeg', diff --git a/lib/noticelist.php b/lib/noticelist.php index 5513e317e..9ace341d8 100644 --- a/lib/noticelist.php +++ b/lib/noticelist.php @@ -364,6 +364,10 @@ class NoticeListItem extends Widget // versions (>> 0.4.x) $this->out->raw(common_render_content($this->notice->content, $this->notice)); } + $uploaded = $this->notice->getUploadedAttachment(); + if ($uploaded) { + $this->out->element('a', array('href' => $uploaded, 'class' => 'attachment'), $uploaded); + } $this->out->elementEnd('p'); } @@ -395,10 +399,6 @@ class NoticeListItem extends Widget 'title' => $dt), common_date_string($this->notice->created)); - $f2p = File_to_post::staticGet('post_id', $this->notice->id); - if (!empty($f2p)) { - $this->out->text(_(' (with attachments) ')); - } $this->out->elementEnd('a'); $this->out->elementEnd('dd'); $this->out->elementEnd('dl'); -- cgit v1.2.3-54-g00ecf