heimrichhannot / contao-filecredits
Contao模块,为图片添加信用支持。
3.5.1
2020-01-17 08:55 UTC
Requires
- php: ~5.4 || ~7.0
- contao-community-alliance/composer-plugin: ~2.4 || ~3.0
- contao/core-bundle: ^3.5.1 || ~4.1
- guzzlehttp/guzzle: ~5.3.1|~6.0
- heimrichhannot/contao-haste_plus: ^1.6.85
- heimrichhannot/contao-request: ^1.2
- heimrichhannot/contao-tagsinput: ~2.0
- dev-master
- 3.5.1
- 3.5.0
- 3.4.1
- 3.4.0
- 3.3.0
- 3.2.5
- 3.2.4
- 3.2.3
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.5
- 3.1.4
- 3.1.3
- 3.1.2
- 3.1.1
- 3.1.0
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.2.6
- 2.2.5
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.16
- 2.1.15
- 2.1.14
- 2.1.13
- 2.1.12
- 2.1.11
- 2.1.10
- 2.1.9
- 2.1.8
- 2.1.7
- 2.1.6
- 2.1.5
- 2.1.4
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.1.1
- 1.1.0
- 1.0.13
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-multisources
This package is auto-updated.
Last update: 2024-09-11 18:09:17 UTC
README
已废弃
请注意,此模块已废弃且不再进一步开发。
Filecredits
Contao模块,为图片和文件添加信用支持。
安装
composer require heimrichhannot/contao-filecredits
禁用命令调度程序(穷人的cron)
出于性能考虑,我们坚持禁用“命令调度程序”(启用 tl_settings.disableCron
)并通过您的服务器crontab中的专用cron作业运行cron作业。
- Contao 4:
* * * * * wget -O /dev/null -q https://[DOMAIN-NAME]/_contao/cron --no-check-certificate
- Contao 3:
* * * * * wget -O /dev/null -q https://[DOMAIN-NAME]/system/cron/cron.php --no-check-certificate
使用自定义cron作业(contao 4)
0 3 * * * /path/to/contao/vendor/heimrichhannot/contao-filecredits/bin/indexer # every day at 03:00
使用自定义cron作业(contao 3)
0 3 * * * /path/to/contao/composer/vendor/heimrichhannot/contao-filecredits/bin/indexer # every day at 03:00
Filecredits 3.x
由于在cron作业中仅使用信用索引,Filecredits 3提供了巨大的性能。Filecredits使用executeResize
钩子,该钩子会在每次调整图片大小时触发。如果您使用响应式图片,则此钩子不仅会触发一次,还会为每个src-set触发。Filecredit 2.x在每次客户端请求中调用钩子,这会根据每页图片的数量降低您的网站性能。Filecredit 3现在触发每日的穷人的cron,或者您可以在crontab中声明自己的cron作业,见安装指南。
Filecredits 2.x
Filecredits 2.x是完全重写的。如果您将自定义模块附加到filecredits 1.x,我们不建议升级。
功能
- 可以在contao文件管理器中直接在文件内添加版权信息
- 图片的页面出现次数将在重建搜索索引时自动添加,或者在加载包含图片的页面时添加
- 有一个后端模块可用于添加具有多个页面出现的自定义Filecredits
- 可以将版权字段添加到任何DCA,作为将版权直接添加到文件而无需转到文件管理器的快捷方式
技术说明
将版权字段添加到非tl_files-DCA
如果您想在某示例图像字段旁边获得快捷的版权字段,可以在DCA中调用以下代码,例如:
\HeimrichHannot\FileCredit\FileCredit::addCopyrightFieldToDca(<the DCA's table name>, <the name of the copyright field to be created>, <the name of the linked file field which copyright is being synced>);
// example:
\HeimrichHannot\FileCredit\FileCredit::addCopyrightFieldToDca('tl_news', 'detailsCopyright', 'detailsSingleSRC');