wszdb/flarum-autolock
Composer 安装命令:
composer require wszdb/flarum-autolock
包简介
Automatically lock discussions after reaching a specified number of posts
README 文档
README
🔒 Automatically lock discussions when they reach a specified number of posts.
🔒 Flarum 贴子自动锁定插件,设置后,某个贴子回复数量超过特定楼层时,自动锁定,同时支持对特定标签(Tags)锁定豁免.
✨ New in v2.4.0
- 🏷️ Tag Exemption: Configure specific tags to be exempt from auto-locking
- 🎛️ Multi-Tag Support: Select one or multiple tags for exemption
- 🌐 Enhanced UI: Intuitive tag selector in admin panel
Features
- ✅ Automatic Locking: Discussions are automatically locked when reaching the configured post count
- 🏷️ Tag Exemption: Exempt specific tags from auto-locking (NEW in v2.2)
- ⚙️ Configurable Threshold: Set custom post count threshold in admin panel (default: 100)
- 🎛️ Enable/Disable Toggle: Easy on/off switch in admin settings
- 🌍 Multi-language Support: English and Simplified Chinese included
- 🚀 Event-Driven: Uses Flarum's native event system for optimal performance
- 🔧 Zero Configuration: Works out of the box with sensible defaults
- 📊 Detailed Logging: Comprehensive logs for debugging and monitoring
Installation
Install via Composer:
composer require wszdb/flarum-autolock
Enable the extension:
php flarum extension:enable wszdb-autolock
Clear cache:
php flarum cache:clear
Configuration
- Navigate to Admin Panel → Extensions
- Find Auto Lock extension
- Click Settings button
- Configure options:
- Enable Auto Lock: Toggle to enable/disable the feature
- Post Count Threshold: Set the number of posts after which discussions will be locked (minimum: 1, default: 100)
- Exempt Tags: Select tags that should be exempt from auto-locking (NEW in v2.2)
How It Works
Post Count Calculation
The extension uses the following formula to calculate total posts:
Total Posts = comment_count (replies) + 1 (original post)
Example:
- Original post = Floor 1
- 99 replies = Floor 2-100
- Total = 100 floors
When total >= threshold → Auto lock ✅
Tag Exemption (v2.2)
Discussions with exempt tags will never be auto-locked, regardless of post count:
- Admin selects exempt tags in extension settings
- When a post is published, the extension checks discussion tags
- If any tag matches exempt list → Skip auto-lock
- Otherwise → Apply normal threshold logic
Trigger Logic
- When a new post is published, the extension listens to the
Postedevent - It refreshes the discussion data and calculates total posts
- Checks if discussion has any exempt tags (v2.2)
- If total posts ≥ threshold and discussion is not locked, it locks the discussion
- All actions are logged for monitoring
License
This extension is licensed under the MIT License.
Links
- Packagist
- GitHub Repository
- Flarum Community
- This plugin is fully automatically developed using AiPy. Invitation Code: XOFS.
- 本插件使用AiPy全自动开发完成,邀请码:XOFS.
Developed by wszdb
wszdb/flarum-autolock 适用场景与选型建议
wszdb/flarum-autolock 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 69 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 10 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「extension」 「moderation」 「flarum」 「auto-lock」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 wszdb/flarum-autolock 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 wszdb/flarum-autolock 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 wszdb/flarum-autolock 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A custom URL rule class for Yii 2 which allows to create translated URL rules
The Yii2 extension uses jQuery jquery.carousel-1.1.min.js and makes image carousel from php array of structure defined.
A CakePHP plugin for adding threaded comments with moderation support
Laravel Profanity Filter - Powerful PHP package for detecting, filtering, and masking profanity in multiple languages. Supports leet speak, custom word lists, case sensitivity, and seamless Laravel integration.
TYPO3 CMS extension to create gallery content element with preset crop ratios and pagination
UI Kit 3 Extension for Yii2
统计信息
- 总下载量: 69
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 20
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-10-07