1.8.x Tính Năng: Clipboard Image to Posts

Preview

Tác giả: Nitje

Phiên bản: 0.0.2

Gửi lúc: 09/09/2025

Cập nhật lúc: 18/12/2025

Show Thread Forum Display
Mô tả
This is how the insertion works:
Paste an image or any others type of attachment from the clipboard into the editor text box.
Upload: The plugin uploads the file using the MyBB upload function (e.g., as clipboard_YYYYMMDD_HHMMSS.png -> if it is a screenshot, usually on Windows with Chrome the image is marked as "image.png").
Inline placement: At the exact last cursor position, the plugin places the placeholder [attach-ment=ID] in the text.

Representation: At the bottom of the post, the image appears normally in the attachment list (file name e.g. clipboard_.... png).
In the text, the image will appear inline, just as if you had clicked "Paste to post" at the bottom.
Removing the tag: If you delete the [attach-ment=ID] tag from the text, the image will only remain as an attachment.
Scope: The plugin only applies to newthread.php, newreply.php, and editpost.php. The normal upload function remains unchanged.


Installation
Upload plugin files to inc/plugins/.
Activate in ACP.
In the ACP settings for DEBUG can be made.

Error Case & Permissions
If nothing happens during the insertion except that the cursor jumps up, the plugin probably couldn't create the required script:

Check the write permissions of the scripts folder in question (the web server user must be allowed to write).
Procedure (practical example): Set the folder to 0757 for a short time, Activate plugin, Reset rights.
Background: Your login user (e.g. ABC) may be different from the web server user (e.g. XYZ). The decisive factor is that XYZ has write permissions.


I've also had the problem with a user that it still didn't work. I'm using a freshly installed MyBB, and no modifications have been made to the editor of my official forum by other add-ons. For example, attachments, additional upload or link buttons that aren't normally there, which could cause this plugin to fail.

Uninstall
Only when deactivating and uninstalling does the plugin remove the associated script again (clean for future updates).
Đây là cách hoạt động của chèn:

Dán hình ảnh hoặc bất kỳ loại tệp đính kèm nào khác từ khay nhớ tạm vào hộp văn bản trình chỉnh sửa.
Tải lên: Plugin tải lên tệp bằng chức năng tải lên MyBB (ví dụ: clipboard_YYYYMMDD_HHMMSS.png -> nếu đó là ảnh chụp màn hình, thường trên Windows có Chrome, hình ảnh được đánh dấu là "image.png").
Vị trí nội tuyến: Tại vị trí con trỏ cuối cùng chính xác, plugin đặt trình giữ chỗ [attach-ment=ID] trong văn bản.

Đại diện: Ở cuối bài đăng, hình ảnh xuất hiện bình thường trong danh sách tệp đính kèm (tên tệp, ví dụ: clipboard_.... png).
Trong văn bản, hình ảnh sẽ xuất hiện nội tuyến, giống như thể bạn đã nhấp vào "Dán để đăng" ở dưới cùng.
Xóa thẻ: Nếu bạn xóa thẻ [attach-ment=ID] khỏi văn bản, hình ảnh sẽ chỉ còn dưới dạng tệp đính kèm.
Phạm vi: Plugin chỉ áp dụng cho newthread.php, newreply.php và editpost.php. Chức năng tải lên bình thường vẫn không thay đổi.


Lắp ráp
Tải tệp plugin lên inc/plugins/.
Kích hoạt trong ACP.
Trong cài đặt ACP cho DEBUG có thể được thực hiện.

Trường hợp lỗi và quyền
Nếu không có gì xảy ra trong quá trình chèn ngoại trừ con trỏ nhảy lên, plugin có thể không thể tạo tập lệnh cần thiết:

Kiểm tra quyền ghi của thư mục tập lệnh được đề cập (người dùng máy chủ web phải được phép ghi).
Thủ tục (ví dụ thực tế): Đặt thư mục thành 0757 trong một thời gian ngắn, Kích hoạt plugin, Đặt lại quyền.
Nền: Người dùng đăng nhập của bạn (ví dụ: ABC) có thể khác với người dùng máy chủ web (ví dụ: XYZ). Yếu tố quyết định là XYZ có quyền ghi.


Tôi cũng gặp vấn đề với một người dùng rằng nó vẫn không hoạt động. Tôi đang sử dụng MyBB mới cài đặt và không có sửa đổi nào được thực hiện đối với trình chỉnh sửa của diễn đàn chính thức của tôi bởi các tiện ích bổ sung khác. Ví dụ: tệp đính kèm, nút tải lên bổ sung hoặc nút liên kết thường không có ở đó, điều này có thể khiến plugin này bị lỗi.

Gỡ cài đặt
Chỉ khi hủy kích hoạt và gỡ cài đặt, plugin mới xóa lại tập lệnh được liên kết (sạch cho các bản cập nhật trong tương lai).