Hiện thị ảnh lớn cả khi member không đăng nhập

Diễn đàn cho truy nhập ảnh lớn, nhưng các loại file khác vẫn phải đăng nhập mới xem được, có thể chỉnh code như sau:

B1) Chỉnh sửa Attachment.php

Mở file:

library/Xenforo/ControllerPublic/Attachment.php

Tìm đến dòng

$attachmentModel = $this->_getAttachmentModel();

Chèn ngay trước dòng đó đoạn mã

        $isimg = false;
        if (isset($attachment['thumbnail_width']))
        {
            if ($attachment['thumbnail_width']>0)
            {
                $isimg = true;
            }
            
        }       
        if (!$isimg)

B2) Chỉnh sửa BBcode

Mở file

library/Xenforo/BbCode/Formatter/Base.php

Tìm đến hàm renderTagAttach() sau đó đến dòng

$template = $this->_view->createTemplateObject('bb_code_tag_attach', array(

Chèn ngay phía trước nó đoạn lệnh

   if (isset($attachment['thumbnail_width']))
        {
            if ($attachment['thumbnail_width']>0)
            {
                $canView = true;               
            }
            
        } 

Chúc thành công!

BForum - The world's leading Blockchain Forum mywebsite.vn