XF 2.2 Как изменить оригиналы загруженных картинок, фото в /internal_data/attachments/ ?

Версия XenForo
2.2

Grammy

Проверенные
Сообщения
34
Реакции
26
Баллы
1,720
Добрый день!
Задачка у меня получилась..
Загружено довольно много фоток, в том числе (по работе) с флагом радужным, и надо в связи с ЛГБТ*экстремизмом - требуется их убрать, а на их место, чтобы не было ошибки загрузки - вставить заглушку..
Я смотрю - на Маке пишут в свойствах, что это sprite kit document, сама картинка просматривается адекватно.
ПОэтому видимо прямое сжатие этих оригиналов и не получается...
Но - как быть? Я бы хоть все файлы заменил на микро-заглушки...
 
, задачи массового переименования не стоит ,это легко.
Но я сделал одну заглушку 10*10 пкс, её называю именем предыдущего файла в папке оригиналов - а она не видна..
 
, задачи массового переименования не стоит ,это легко.
Но я сделал одну заглушку 10*10 пкс, её называю именем предыдущего файла в папке оригиналов - а она не видна..
Уже видна - кеширование мешало :)
В частной странице открыл - замена пошла.
Метод работает ,кому не очень дороги старые картинки, а их ну очень много :)
 
ЧатГПТ подсказал примерно так же.
ПОдробно :)
"Замена файлов вложений сообщений форума XenForo вручную путем непосредственной работы с файлами на сервере - это несколько сложный процесс, и к нему следует подходить с осторожностью, чтобы не повредить базу данных или файловую структуру. Если вы не знакомы с этим процессом, рекомендуется использовать встроенные функции XenForo или обратиться за помощью к кому-то с большим опытом.
Here's a general outline on how you could manually replace an attachment file in XenForo:


Backup: Before doing anything, make sure you have a complete backup of your XenForo database and files.

Identify the Attachment: Every attachment in XenForo has a unique ID. You need to find out this ID to identify which file you want to replace. You can do this by looking at the URL of the attachment in the browser, or by querying the database and looking in the xf_attachment and xf_attachment_data tables.

Locate the File on the Server: Once you have the attachment ID, you can locate the actual file on the server. XenForo typically stores these files in an internal data structure, often in an internal_data folder, within subdirectories that represent the attachment ID.

Prepare Your Image: Make sure your new image is of the same type (i.e., has the same file extension) as the one you're replacing. If it's not, you'll need to convert it. The file name on the server usually has the .data extension, but this doesn't affect the MIME type when served by XenForo.

Replace the File: Rename your replacement file to match the name of the existing .data file you want to replace. Then, upload it to the correct location on the server, overwriting the old file. Make sure the permissions and ownership of the file match those of the other attachments so that the web server can access it.

Update Database (if necessary): If the new file has a different size or if you've also changed the file name, you may need to update the corresponding entries in the xf_attachment and xf_attachment_data tables in your XenForo database to reflect these changes.

Clear Cache: After making changes, it might be necessary to clear the cache so that XenForo recognizes the changes. This can often be done within the Admin Control Panel or by manually deleting cache files on the server.

Verify: Finally, check the forum to make sure the new image is displaying correctly.


Please remember that manipulating files and database records directly can be risky and may result in data corruption if not done properly. If you're not confident in performing these tasks, consider asking for professional assistance or contacting XenForo support for guidance."
 
Современный облачный хостинг провайдер | Aéza
Назад
Сверху Снизу