X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fattachmentnoticesection.php;h=b59568749c8360bc44f10f932cf442e88fedb069;hb=bb1ac66d741e804aa0df6afeabf7219517eba8a9;hp=b98de8b6fd188f28fa545be13e8531433cc15a91;hpb=c5cf2c4c94794a1aeea32a427ddd50e157fa893d;p=quix0rs-gnu-social.git diff --git a/lib/attachmentnoticesection.php b/lib/attachmentnoticesection.php index b98de8b6fd..b59568749c 100644 --- a/lib/attachmentnoticesection.php +++ b/lib/attachmentnoticesection.php @@ -27,7 +27,7 @@ * @link http://status.net/ */ -if (!defined('STATUSNET')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -42,7 +42,6 @@ if (!defined('STATUSNET')) { * @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,17 +52,19 @@ 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() { + // TRANS: Title. return _('Notices where this attachment appears'); } @@ -72,4 +73,3 @@ class AttachmentNoticeSection extends NoticeSection return 'popular_notices'; } } -