ernestdefoe/giveaways 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ernestdefoe/giveaways

Composer 安装命令:

composer require ernestdefoe/giveaways

包简介

Run provably-fair giveaways and raffles on your Flarum 2 forum — earn-entries engine, scheduled auto-draws, winner notifications.

README 文档

README

License: MIT Latest Stable Version

Run provably-fair giveaways on your Flarum community. Members enter with one click, earn bonus entries for being active, and winners are drawn automatically — with a published seed and entrant fingerprint anyone can verify.

status

Giveaways page

Features

  • 🎁 Beautiful giveaways page — a dedicated /giveaways page with cards, live countdowns, status badges and entrant counts.
  • 🎟️ One-click entry — registered members enter instantly. The button shows their current entry count.
  • Earn-entries engine — grant a one-time bonus when entrants post in the community, rewarding real activity.
  • 🗂️ Categories — organise giveaways into colour-coded categories with filter pills, badges and an inline manager.
  • 🎯 Eligibility rules — optionally require a minimum post count or account age to enter.
  • ⏱️ Scheduled auto-draw — set an end time and the winners are drawn automatically by the scheduler. Hosts can also draw now at any time.
  • 🔔 Winner notifications — every winner gets an in-app alert linking straight to the giveaway.
  • 📦 Prize claiming — winners get a "You won!" banner with a one-click Claim button; the host is notified and can see per-winner claim status, plus optional claim instructions (e.g. "DM me your address").
  • 🛡️ Provably fair — every draw publishes a random seed and a SHA-256 hash of the full entrant list, so the result is independently reproducible and tamper-evident.
  • 🏆 Multiple winners — draw any number of weighted winners in a single fair pass.
  • 🔐 Granular permissions — separate enter, create own, and manage all permissions.

Screenshots

Giveaway page — enter, requirements & live countdown

Giveaway detail

Provably-fair results — published winners, seed & entrant hash

Drawn giveaway with winners and fairness data

Installation

composer require ernestdefoe/giveaways

Then enable Giveaways in your admin panel and review the permissions grid.

Scheduled draws require Flarum's scheduler to be running. Add this to your server's crontab:

* * * * * cd /path/to/flarum && php flarum schedule:run >> /dev/null 2>&1

Without it, giveaways won't auto-draw at their end time — but you can still draw manually from each giveaway page.

Updating

composer update ernestdefoe/giveaways
php flarum migrate
php flarum cache:clear

How the fair draw works

When a giveaway is drawn:

  1. The full entrant list is serialized in a fixed order (userId:entries, sorted by user id) and hashed with SHA-256 — this is the entrant hash.
  2. A random seed is generated.
  3. For each winner slot i, the winner is chosen by SHA-256(seed:i) reduced over the weighted entry pool, removing each winner before the next pick.

Because the seed and entrant hash are published on the giveaway page, anyone can re-run the algorithm and confirm the winners were not manipulated.

Permissions

Permission Default Description
giveaways.enter Members Enter giveaways
giveaways.create Admins Create and manage own giveaways
giveaways.manage Admins Manage all giveaways

Settings

  • Show a "Giveaways" link in the main navigation — toggle the nav item.
  • Navigation label — customise the link text.

License

MIT © ernestdefoe

统计信息

  • 总下载量: 91
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固