X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fattachmentnoticesection.php;h=b59568749c8360bc44f10f932cf442e88fedb069;hb=fb4b004435403dd0d4126a0c11c9fa5c557e9dba;hp=53a3b63c1cac9de7ea64b7417467caf56f99b417;hpb=670ad53215eaaa40a55a1977b373a62940c50a42;p=quix0rs-gnu-social.git diff --git a/lib/attachmentnoticesection.php b/lib/attachmentnoticesection.php index 53a3b63c1c..b59568749c 100644 --- a/lib/attachmentnoticesection.php +++ b/lib/attachmentnoticesection.php @@ -42,7 +42,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ - class AttachmentNoticeSection extends NoticeSection { function showContent() { @@ -53,13 +52,14 @@ class AttachmentNoticeSection extends NoticeSection function getNotices() { $notice = new Notice; - $f2p = new File_to_post; - $f2p->file_id = $this->out->attachment->id; - $notice->joinAdd($f2p); + + $notice->joinAdd(array('id', 'file_to_post:post_id')); + $notice->whereAdd(sprintf('file_to_post.file_id = %d', $this->out->attachment->id)); + $notice->orderBy('created desc'); $notice->selectAdd('post_id as id'); $notice->find(); - return $notice; + return $notice; } function title() @@ -73,4 +73,3 @@ class AttachmentNoticeSection extends NoticeSection return 'popular_notices'; } } -