Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Binkterm Auto-Read Own Posts Mod

A zero-touch, client-side plugin for BinktermPHP that automatically marks your own authored echomail messages as read.


The Problem

When you compose and post a message to an FTN echo area in BinktermPHP, the message is stored in the echomail table without creating an entry in message_read_status and without advancing the last_read_id subscription watermark.

Consequently:

  • The message you just wrote appears bold with an unread envelope in the message list.
  • Unread badge counters on the dashboard, navbar, and Echo List page increment by 1 for your own message.

The Solution

This mod automatically intercepts message posting on /compose and message rendering on /echomail / /echomail/{echoarea}:

  1. At Post Time: When submitting a message via /compose, the mod discovers the newly generated message ID and invokes Binkterm's bulk read API (POST /api/messages/echomail/read) to mark it as read and advance the subscription watermark before the page redirects.
  2. On Message List Display: When browsing any echo area, the mod scans incoming message lists. Any unread message authored by the active logged-in user is automatically marked as read in the database and updated in the DOM table.

Features

  • Zero-Touch & Upgrade-Proof: Never touches or modifies any core BinktermPHP templates or backend routes. When you update Binkterm via git pull upstream, you will never encounter merge conflicts.
  • Immediate Visual Consistency: Eliminates unread badges, bold text, and closed envelope icons on messages you authored.
  • Watermark-Aware: Utilizes Binkterm's native last_read_id watermark synchronization so unread badges across the dashboard and navigation bar accurately reflect genuine unread messages from others.
  • Multi-Identity Support: Matches both username and real name attributes for the logged-in user.

Quick Install (1-Line Command)

Clone this repository and run the installer pointing to your Binkterm installation:

git clone https://github.com/thewebexpert/binkterm-php-readOwnPostsMod.git
cd binkterm-php-readOwnPostsMod
./install.sh /path/to/binkterm

(If you run the command from a directory adjacent to binkterm, ./install.sh will auto-detect the binkterm folder).


Manual Installation

  1. Copy the JavaScript asset:

    cp public_html/js/read-own-posts.js /path/to/binkterm/public_html/js/
  2. Add the asset to templates/custom/header.insert.twig: Append the following to /path/to/binkterm/templates/custom/header.insert.twig:

    {# Binkterm Auto-Read Own Posts Mod #}
    <script src="/js/read-own-posts.js?v=1.0" defer></script>

Docker Compose Setup

If you run BinktermPHP in Docker, mount the plugin file into your container:

services:
  binkterm-app:
    volumes:
      - ./plugins/binkterm-php-readOwnPostsMod/public_html/js/read-own-posts.js:/var/www/html/public_html/js/read-own-posts.js:ro

Uninstallation

To remove the plugin:

cd binkterm-php-readOwnPostsMod
./uninstall.sh /path/to/binkterm

License

MIT License. See LICENSE for details.

About

A zero-touch BinktermPHP plugin that automatically marks your own authored echomail posts as read and syncs subscription watermarks.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages