PHPackages                             zerosonesfun/flarum-log - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. zerosonesfun/flarum-log

ActiveFlarum-extension[Logging &amp; Monitoring](/categories/logging)

zerosonesfun/flarum-log
=======================

Drink Log: track who's drinking and open a log discussion with one click.

1.4.2(3mo ago)038MITJavaScript

Since Mar 7Pushed 3mo agoCompare

[ Source](https://github.com/zerosonesfun/flarum-log)[ Packagist](https://packagist.org/packages/zerosonesfun/flarum-log)[ RSS](/packages/zerosonesfun-flarum-log/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (10)Dependencies (2)Versions (64)Used By (0)

Drink Log (zerosonesfun/flarum-log)
===================================

[](#drink-log-zerosonesfunflarum-log)

A [Flarum](https://flarum.org/) extension that adds a **Drinking** button, tracks who’s drinking (live count + per-user totals), and opens a dated log discussion with an optional **Log** tag.

- **Compatible:** Flarum 1.8.x
- **Install:** `composer require zerosonesfun/flarum-log:"*"`
- **Best experience:** Install [FoF Direct Links](https://github.com/FriendsOfFlarum/direct-links) so the composer opens with title, Log tag, and a simple body template already filled in.

Features
--------

[](#features)

- **“X Drinking” button** (logged-in only): in the **sidebar** on desktop (under “Start a discussion”), and in the **drawer** under the search bar on mobile.
    `X` is the number of users who have clicked in the last 30 minutes (configurable 1–1440).
- **Cooldown:** Each user can add to the live count once per cooldown window; the number goes down as older clicks expire.
- **One click does two things:**
    1. Records your “drinking” click (live count + your **profile total**).
    2. Opens the **new discussion** composer with title `Log - MM/DD/YYYY` and, when configured, the **Log** tag. With **FoF Direct Links**, the composer also opens with a small body template (Date, Time, Location, Amount, Variety).
- **Profile total:** Each user’s public profile shows their total drinks (e.g. “1 drink” or “1.5k drinks”). It increases when they use the button (after cooldown) or when they **manually** create a discussion and add the Log tag, and **decreases by 1** when they delete one of their own discussions that has the Log tag.
- **Profile “Drink Logs” tab:** On a user’s profile, a **Drink Logs** nav item appears under **Posts** (when Tags is enabled and a Log tag is configured). It shows the number of discussions they’ve created with the Log tag; clicking it loads a list of those discussions.
- **Manual Log tag:** If someone starts a new discussion and adds the Log tag in the composer (without using the Drinking button), their profile total still increases by 1.

Installation
------------

[](#installation)

```
composer require zerosonesfun/flarum-log:"*"
php flarum migrate
```

Enable **Drink Log** in Admin → Extensions.

Recommended: FoF Direct Links (best experience)
-----------------------------------------------

[](#recommended-fof-direct-links-best-experience)

For the best experience, install [FriendsOfFlarum/direct-links](https://github.com/FriendsOfFlarum/direct-links):

```
composer require fof/direct-links
```

With Direct Links enabled and a **Log tag slug** set in Drink Log’s settings, clicking the Drinking button opens the composer via a direct link with:

- **Title** pre-filled: `Log - DD/MM/YYYY`
- **Primary tag** pre-selected: your configured Log tag
- **Body** pre-filled with a short template: `Date`, `Time`, `Location`, `Amount`, `Variety`

Without Direct Links, the composer still opens in-app with the title set, and the Log tag is attached when you post (for “Log - date” discussions).

Optional: Tags extension and Log tag
------------------------------------

[](#optional-tags-extension-and-log-tag)

If you use [flarum/tags](https://github.com/flarum/tags):

1. Enable the **Tags** extension.
2. In Administration → Tags, create a tag with the slug you set in Drink Log’s **Log tag slug** (default `log`). The extension does not create the tag for you.

New “Log - date” discussions started from the Drinking button get that tag attached automatically. If a user manually adds the Log tag to any new discussion, their profile drink total also increases by 1. This extension never deletes or changes existing tags.

Admin settings
--------------

[](#admin-settings)

In **Administration → Extensions → Drink Log** you can set:

- **Button label** – Text on the button. Use `{count}` for the number (e.g. `{count} Drinking`).
- **Cooldown (minutes)** – Minutes before a user can add to the live count again (1–1440; default 30).
- **Log tag slug** – Tag slug to attach to “Log - date” discussions and to use with Direct Links. Leave empty to disable auto-tagging and direct-link composer.

Building the frontend (developers)
----------------------------------

[](#building-the-frontend-developers)

```
cd js
npm install
npm run build
```

This updates `js/dist/forum.js` and `js/dist/admin.js`. Commit those files if you ship a pre-built bundle.

Troubleshooting
---------------

[](#troubleshooting)

**“Drink Logs” tab doesn’t appear on user profiles**

The tab only shows when the forum has a valid Log tag. Check:

1. **Tags extension** is enabled (Administration → Extensions).
2. **A tag exists** whose slug matches Drink Log’s “Log tag slug” (default `log`). Create it under Administration → Tags if needed.
3. **Clear Flarum cache** so the forum payload includes the tag id:
    `php flarum cache:clear`
    Then hard-refresh the forum (Ctrl+F5 / Cmd+Shift+R).
4. If you installed from source (e.g. git), run `npm run build` in the extension’s `js` folder and deploy the updated `js/dist/forum.js`.

**Profile drink total doesn’t decrease when a user deletes a log discussion**

The extension now listens for both **Deleting** (hard delete) and **Hidden** (soft delete / “delete” in the UI). After updating, hiding or deleting a discussion that has the Log tag will decrement the author’s total. Clear cache and refresh; if it still doesn’t update, confirm the discussion had the Log tag and the Tags extension is enabled.

Security
--------

[](#security)

- Only logged-in users see and can use the Drinking button.
- The “record drink” API requires authentication; cooldown is enforced per user on the backend.
- Profile totals are public; only the count is stored (no extra personal data).

License
-------

[](#license)

MIT.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance80

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

63

Last Release

104d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1388f65f82a8f3fa5e2af06c8dfe0c8a37d74786ccbd02d64ef85f283b0bf210?d=identicon)[zerosonesfun](/maintainers/zerosonesfun)

---

Top Contributors

[![zerosonesfun](https://avatars.githubusercontent.com/u/41351317?v=4)](https://github.com/zerosonesfun "zerosonesfun (62 commits)")

---

Tags

logextensionflarumdrink

### Embed Badge

![Health badge](/badges/zerosonesfun-flarum-log/health.svg)

```
[![Health](https://phpackages.com/badges/zerosonesfun-flarum-log/health.svg)](https://phpackages.com/packages/zerosonesfun-flarum-log)
```

###  Alternatives

[flarum-lang/russian

Russian language pack for Flarum.

12127.5k](/packages/flarum-lang-russian)[flarum-lang/french

French language pack to localize the Flarum forum software plus its official and third-party extensions.

1936.5k](/packages/flarum-lang-french)[lav45/yii2-activity-logger

Tools to store user activity log for Yii2

3459.5k](/packages/lav45-yii2-activity-logger)[kriss/yii2-log-reader

Yii2 log reader

1242.1k1](/packages/kriss-yii2-log-reader)[opengento/module-webapi-logger

This module allows you to analyze all the webapi rest done call toward your Magento.

1016.9k](/packages/opengento-module-webapi-logger)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
