Logo IndexGram (PHP)
IndexGram (PHP)

IndexGram (PHP)

By Page Telegram
πŸ’› Support Page Telegram directly πŸ’³ Donate
Current Version: 10.11.0
22
Unique Views
6
Free Downloads
0
Donation Downloads

IndexGram v10.11

IndexGram is a self-hosted digital file-cabinet system for publishing, organising, and sharing indexed documents. It is built with plain PHP, SQLite, and vanilla JavaScript β€” no framework, no Composer, no Node. > IndexGram by Amfile.org of Page Telegram Volunteer Services v10.01 2026 ---

Features

Content

  • 3-level topic hierarchy β€” Topics β†’ Sub-topics β†’ Sub-sub-topics (up to 3 levels deep), each with its own OG image and description
  • Topic landing pages β€” Per-topic Markdown pages activatable by admins/editors; shown above documents when enabled; editable via a quick-link on the topic page
  • Document index cards β€” Documents display as responsive multi-column cards with OG image, description excerpt, audience and generic tags, and topic link
  • Collapsible document index β€” Homepage document index is collapsed by default; click the titlebar to expand; state remembered in sessionStorage; auto-opens when a filter is active
  • Search always visible on homepage β€” Keyword, topic, and audience filter form is a persistent section above the topic grid, never hidden inside a collapsible
  • Search at top of topic pages β€” Keyword and tag filters appear at the top of every topic page, above descriptions and sub-topics
  • Home page root topic β€” Admin can pin a specific topic as the root of the Topic Index; the grid then shows that topic's sub-topics instead of the full root list; falls back to full root list if the topic has no children
  • Markdown editor β€” Full Markdown with toolbar (bold, italic, headings, blockquotes, lists, code, links, images, tables, horizontal rules)
  • Revision history β€” Every save creates a revision; editors can compare and review past versions
  • Audience tags β€” Colour-coded tags assignable to documents; filterable on all index views; can be toggled off site-wide in Settings
  • Generic tags β€” Flat grey tags for general content categorisation; always visible; managed in Admin β†’ Generic Tags
  • Full-text search indexing β€” FTS5 search index built on save for fast keyword queries across title, description, and document body; falls back to LIKE if FTS5 is unavailable
  • Keyword + tag + topic filtering β€” Combined filters on the homepage and each topic page
  • RSS Feed Importer β€” Import any RSS 2.0 or Atom feed into documents; downloads images, audio, and PDFs to local storage; converts HTML to Markdown; includes Substack migration support; target topic selectable at step 1 before previewing
  • OPML Collection Importer β€” Import an entire feed collection from an OPML subscription list (Feedly, Inoreader, NewsBlur, Thunderbird exports); upload the .opml file or link to its URL; nested category paths are shown per feed; route each feed to its own topic, auto-create a sub-topic per feed, or send all feeds to one topic; per-feed item limit; safe to re-run thanks to per-item duplicate detection; large collections are processed in configurable batches with an auto-continuing progress screen, so imports of any size survive PHP and proxy timeouts, and can be stopped early keeping everything imported so far
  • Substack ZIP Importer β€” Full Substack archive import from exported ZIP; target topic selectable at the upload step
  • Markdown file import β€” Document and page editors include an "Import Markdown File" section; choose Replace (with confirmation) or Append mode; client-side FileReader, no server round-trip; accepts .md and .txt files
  • Store

  • Grid storefront at /shop/ β€” responsive product grid with categories and sub-categories, product pages with Markdown descriptions, images, SKU, and stock display; fully theme-aware
  • Three store modes β€” Independent (own catalog, cart, checkout), VistaPrint Pro Store (embed your VistaPrint storefront with VP_Tracking partner attribution), or Both
  • Any number of payment processors β€” PayPal (redirect checkout, no API keys), Stripe (hosted card checkout, auto-verified), and unlimited manual methods (Zelle, Venmo, CashApp, cheque, cash, bank transfer) with per-method customer instructions using {order_no} / {total} placeholders
  • Inventory system β€” stock quantities, stock tracking toggle, backorders, hidden/active status, featured products, cost vs. price with live profit-margin calculator and a default margin % applied at a click
  • Ordering system β€” session cart, checkout, tokenised customer order-status pages, flat shipping charge, checkout terms notice, new-order email notifications
  • VistaPrint fulfilment workflow β€” editors/admins process each order from Admin β†’ Store β†’ Orders: per-item "Order at VistaPrint" shortcut links, VistaPrint order # field, payment confirmation, status-update emails to the customer, and revenue / cost / profit-margin display per order
  • Page store plugin β€” any custom page can additionally embed a VistaPrint storefront, a third-party embed (Etsy, Shopify Buy Button…), or a link button to the built-in store
  • News Front Page

  • Toggleable homepage news section β€” newest published documents carrying a configured generic tag (default: the #info tag) displayed like a news site front page: a lead story with full-width image plus a grid of remaining stories
  • Configurable in Admin β†’ Settings: on/off, section title, tag, and story count
  • Marquee Ticker

  • Site-wide scrolling marquee under the nav bar showing the title and description brief of each newly posted document, linking to it; pauses on hover
  • Continuous across pages β€” the scroll position is derived from the wall clock, so navigating the site never restarts the ticker
  • Configurable in Admin β†’ Settings: on/off, label, number of documents, speed
  • Custom Pages

  • Custom pages β€” Admin can create arbitrary static pages (Markdown content, slug, nav label)
  • Sub-pages β€” Any custom page can have child pages; sub-pages appear as dropdown items under their parent in the nav and are listed at the bottom of the parent page; breadcrumb shows the full parent chain
  • Pages in nav β€” Each custom page can be shown as a nav item; sub-pages appear in the parent's nav dropdown
  • Topic sub-menus on pages β€” Custom page nav items can additionally expose a dropdown of selected topics
  • Slug editing β€” The slug of any existing custom page can be renamed in the editor; built-in pages (landing, bibliography) have read-only slugs; guards prevent reserved system paths and collisions with existing page slugs
  • Navigation

  • Unified nav order β€” Admin β†’ Config β†’ Nav Order: drag-and-drop interface to set an arbitrary interleaved display order for all top-level topics and nav-visible pages together; nav_position column stored on both tables
  • Topic sub-menus β€” Top-level topics with sub-topics automatically render as hover dropdown menus; mobile-compatible with tap-to-open
  • External nav links β€” Admin β†’ Nav Links: add labelled external links to the nav bar and footer with sort ordering
  • Logo as home link β€” The site logo (or site title text) in the nav bar is an <a> linking to the site root; the redundant "Home" text link is removed
  • Media

  • Image uploads β€” JPEG, PNG, GIF, WebP, SVG up to 10 MB; inserted into Markdown via toolbar
  • Audio embeds β€” MP3, OGG, WAV up to 50 MB; renders as an HTML <audio> player in documents
  • PDF embeds β€” Upload or link external PDFs; displayed in a resizable iframe (page / tall / fullscreen modes) with download and open controls
  • Video embeds β€” Paste a URL from YouTube, Vimeo, Rumble, Odysee, BitChute, PeerTube, or TikTok; auto-converts to the correct embed
  • Calendar Plugin

  • Shortcode embed β€” Place [cal='slug'] on its own line in any page or document to embed a calendar; override the opening view inline with [cal='slug' view='weekly']
  • iCal / ICS feeds β€” Fetches any public iCal feed URL, including Google Calendar's public iCal address; parsed server-side with a full RFC 5545 iCal parser (line unfolding, TZID conversion, VALUE=DATE all-day events, DURATION fallback)
  • Five display views β€” Monthly (traditional grid), Weekly (7-column day columns), Agenda (grouped upcoming events, 90-day window), Yearly (12 mini-month overview with event indicators), List (sortable table of all events)
  • Interactive navigation β€” Prev / Next and Today buttons navigate between periods without a page reload; view switcher buttons change the active view instantly; event click opens a themed popup with title, date/time, location, description, and link
  • Theme-aware styling β€” All calendar CSS uses the active theme's CSS custom properties (--titlebar-bg, --accent-color, --border-*, --content-bg, etc.) so the calendar automatically matches any theme or colour palette
  • Server-side feed caching β€” Fetched feed data is cached in data/cal_cache/ (configurable TTL per calendar, default 1 hour); cache is served as JSON and protected from direct web access
  • Admin management β€” Admin β†’ Calendars: add/edit/delete calendars (slug, display name, feed URL, default view, cache TTL); Test button fetches the live feed and reports event count; Clear Cache forces an immediate refresh
  • Graceful fallback β€” If the feed URL is unreachable or the calendar slug is not found, a themed error notice is rendered in place of the calendar
  • Sharing & Discovery

  • Open Graph / Twitter Card meta β€” Per-document OG title, description, and image; logo used as site-wide fallback image; correct og:url canonical per page
  • RSS 2.0 feeds β€” Master feed and one feed per topic; marks updated items with [Updated]; auto-discovered by browsers
  • Print view β€” 8.5 Γ— 11 letter layout with @page CSS; PDF embeds shown as filenames; Ctrl+P shortcut on document pages; optional Include cover photo checkbox shows/hides the OG image full-width on the print page (setting persisted in URL via ?cover=1)
  • Auto table of contents β€” Generated in-page from h2/h3 headings when 3 or more are present
  • Access Control

  • Public β€” Visible to everyone
  • Password protected β€” Visitors must enter a password; unlocked for the session
  • Link only β€” Accessible only via a unique token URL; click-to-clipboard share button for editors
  • Users, Roles & Invites

    RolePermissions
    ContributorSubmit documents as drafts; can be restricted to specific topics
    EditorManage all documents, publish contributor drafts, delete documents
    AdminEverything above plus users, invites, themes, settings, backup
  • Contributor workflow β€” Contributor submissions are saved as drafts automatically; editors and admins approve content by publishing
  • Topic restrictions β€” Admins can restrict any user to specific topics; contributors see only their allowed topics in the editor; empty restriction = all topics allowed
  • Topic change β€” Authors can move a document to a different topic (restricted contributors only see their allowed topics)
  • Invite links β€” Role-scoped, optional email restriction, expiry date, max-use count
  • Subscribers & Email Notifications

  • Subscribe widget β€” Public subscription form at /subscribe/; optional fields (name, phone, zip, custom); math captcha option
  • SMTP email β€” Configurable SMTP transport (STARTTLS port 587, SSL/TLS port 465, or plain); PHP mail() fallback; credentials stored in Settings
  • Subscriber notifications β€” Global toggle to email opted-in admin/editor users when a new subscriber signs up; per-user opt-in toggle in Admin β†’ Users
  • Analytics

  • Human-only hit tracking β€” 30+ bot UA patterns filtered at record time; no raw IPs stored (SHA-256 hash of IP + date)
  • Dashboard rankings β€” Total hits and unique daily hits per document, ranked on the admin dashboard
  • Site-wide totals β€” Aggregate total and unique hit counts shown on the dashboard
  • Hit ratio in document list β€” Admin β†’ Documents table shows total / unique hits and the return-rate multiplier (e.g. 42 / 15 Β· 2.8Γ—) per document; tooltip gives the full breakdown
  • Public view stats β€” Document sidebar "Document Info" section shows total views, unique views, and return rate to all visitors
  • Markdown

  • Single line breaks β€” A single newline within a paragraph renders as <br> rather than being collapsed into a space; a blank line still opens a new <p> paragraph
  • Fenced code blocks β€” Triple-backtick blocks with optional language tag; content HTML-escaped and protected from inline processing
  • Tables β€” GitHub-style pipe tables with header / separator / body rows
  • Shortcodes β€” contact-form], [audio, pdf, video, [cal='slug'] β€” all block-level, one per line
  • Design & Theming

  • OS/2 Warp 3.0 aesthetic β€” Deep indigo desktop, rose-purple-to-indigo gradient titlebars, bevelled 3D borders, OS/2-style scrollbars; topic window headings enlarged and centred
  • Modern Sleek theme β€” Clean, flat, gradient-free; topic headings enlarged and centred
  • The Matrix theme β€” Phosphor-green-on-black terminal aesthetic; Courier New monospace font; green glow effects; image tinting; fingerprint: "There is no spoon"
  • Terminator theme β€” Crimson gradient titlebars on near-black desktop; blood-red accent colour; uppercase nav and section headers; fingerprint: "I'll be back"
  • Mr. Robot theme β€” Cold slate/charcoal desktop with #00BCD4 cyan edge; JetBrains Mono / Fira Code monospace stack; GitHub-dark-inspired palette; fingerprint: "Hello, friend"
  • Theme editor β€” Full CSS editor with live preview iframe, colour variable injector, save/activate/duplicate/delete themes
  • Quick colour palette β€” 10 CSS variable pickers in Settings; overrides apply on top of the active theme without editing CSS
  • Sync from file β€” All five built-in themes auto-resync from their source CSS files when the DB copy is stale; new themes seeded via a reusable $seedTheme closure with a comment-header fingerprint string
  • All links as buttons β€” Global bevelled/themed button style for all <a> elements; Markdown body links remain as underlined text
  • Fully responsive β€” CSS grid cards, hamburger nav, collapsible admin sidebar; tested at 900 / 700 / 400 px breakpoints
  • Data & Backup

  • Site backup β€” Download the entire site as a ZIP archive (SQLite database + all uploaded files); one click from Admin β†’ Backup
  • SQL export β€” Stream all table data as INSERT statements for external import or inspection
  • File size summary β€” Backup page shows current database size, uploads size, and total before download
  • ---

    Requirements

  • PHP 8.0 or higher (the code uses match expressions and str_contains)
  • PHP extensions: pdo_sqlite (database), curl (Stripe checkout, calendar/RSS feed fetching), mbstring (importers, text excerpts), gd (image optimisation)
  • SQLite 3 (bundled with PHP via pdo_sqlite)
  • Apache with mod_rewrite enabled and AllowOverride All
  • No Composer. No npm. No build step. ---

    Installation

  • Upload all files to your web root or a subdirectory.
  • Set permissions so PHP can write to the data/ and uploads/ directories:
  • bash
       chmod 750 data/
       chmod 750 uploads/
       
  • Visit https://yoursite.com/setup.php in a browser.
  • Complete the two-step wizard:
  • - Step 1 β€” Site title, description, base URL, footer text - Step 2 β€” Admin username, email, and password
  • The data/installed flag file is created on completion. The setup page becomes inaccessible.
  • > If you move the site to a different URL after setup, update Admin β†’ Settings β†’ Base URL. ---

    Directory Structure

    
    indexgram/
    β”œβ”€β”€ admin/                  Admin panel pages
    β”‚   β”œβ”€β”€ backup.php          Site backup β€” ZIP download and SQL export
    β”‚   β”œβ”€β”€ calendars.php       Calendar plugin β€” CRUD, test feed, clear cache
    β”‚   β”œβ”€β”€ document-edit.php   Markdown editor with media uploads
    β”‚   β”œβ”€β”€ documents.php       Document list with filters
    β”‚   β”œβ”€β”€ generic-tags.php    Generic tag management
    β”‚   β”œβ”€β”€ index.php           Dashboard with hit rankings
    β”‚   β”œβ”€β”€ invites.php         Invite link management
    β”‚   β”œβ”€β”€ nav_links.php       External nav link management
    β”‚   β”œβ”€β”€ nav_order.php       Drag-and-drop unified nav ordering (topics + pages)
    β”‚   β”œβ”€β”€ pages.php           Custom page and sub-page management
    β”‚   β”œβ”€β”€ rss-import.php      RSS/Atom feed importer with media localization
    β”‚   β”œβ”€β”€ settings.php        Site settings, news/marquee, colour palette, email
    β”‚   β”œβ”€β”€ store.php           Store settings, VistaPrint account, payment processors
    β”‚   β”œβ”€β”€ store-categories.php Store categories & sub-categories
    β”‚   β”œβ”€β”€ store-orders.php    Order processing (payment, VistaPrint ref, profit)
    β”‚   β”œβ”€β”€ store-products.php  Product/inventory editor with margin calculator
    β”‚   β”œβ”€β”€ substack-import.php Substack-specific import helper
    β”‚   β”œβ”€β”€ subscribers.php     Subscriber list, CSV export, delete
    β”‚   β”œβ”€β”€ tags.php            Audience tag management
    β”‚   β”œβ”€β”€ themes.php          Theme editor and manager
    β”‚   β”œβ”€β”€ topics.php          Topic/sub-topic management with landing pages
    β”‚   └── users.php           User management with topic restrictions
    β”œβ”€β”€ assets/
    β”‚   β”œβ”€β”€ css/
    β”‚   β”‚   β”œβ”€β”€ calendar.css      Calendar plugin styles (theme-variable-driven)
    β”‚   β”‚   β”œβ”€β”€ matrix.css        Source The Matrix theme
    β”‚   β”‚   β”œβ”€β”€ modern-sleek.css  Source Modern Sleek theme
    β”‚   β”‚   β”œβ”€β”€ mrrobot.css       Source Mr. Robot theme
    β”‚   β”‚   β”œβ”€β”€ os2.css           Source OS/2 Warp 3.0 theme
    β”‚   β”‚   β”œβ”€β”€ print.css         Print stylesheet (8.5 Γ— 11)
    β”‚   β”‚   └── terminator.css    Source Terminator theme
    β”‚   └── js/
    β”‚       β”œβ”€β”€ app.js            Front-end JS (nav, TOC, lightbox, PDF controls)
    β”‚       └── calendar.js       Calendar plugin β€” all five view renderers + event popup
    β”œβ”€β”€ data/                   SQLite database, installed flag, and plugin caches (writable)
    β”‚   └── cal_cache/          Cached iCal feed JSON (auto-created; protected by .htaccess)
    β”œβ”€β”€ includes/
    β”‚   β”œβ”€β”€ auth.php            Session auth, roles, CSRF, flash messages
    β”‚   β”œβ”€β”€ calendar.php        Calendar plugin β€” CalendarPlugin + ICalParser classes
    β”‚   β”œβ”€β”€ db.php              Schema, migrations, seeding
    β”‚   β”œβ”€β”€ footer.php          Public footer template
    β”‚   β”œβ”€β”€ functions.php       All helper functions
    β”‚   β”œβ”€β”€ header.php          Public head + OG meta + nav template (with dropdowns)
    β”‚   β”œβ”€β”€ mail.php            SMTP mailer and subscriber notification helper
    β”‚   β”œβ”€β”€ markdown.php        Custom Markdown parser (shortcode host)
    β”‚   β”œβ”€β”€ pdf.php             PDF embed renderer
    β”‚   β”œβ”€β”€ store.php           Store library β€” catalog, cart, orders, payments + page embeds
    β”‚   β”œβ”€β”€ store_card.php      Product card partial for the storefront grids
    β”‚   └── video.php           Video URL β†’ embed converter
    β”œβ”€β”€ uploads/                User-uploaded files (writable)
    β”‚   β”œβ”€β”€ images/             Logos, favicons, general images
    β”‚   β”œβ”€β”€ audio/              Audio files
    β”‚   β”œβ”€β”€ og/                 OG and topic images
    β”‚   β”œβ”€β”€ pdf/                Uploaded PDFs
    β”‚   └── store/              Product and category images (auto-created)
    β”œβ”€β”€ .htaccess               Clean URL rewrites, data directory protection
    β”œβ”€β”€ config.php              Constants and IS_INSTALLED flag
    β”œβ”€β”€ document.php            Document view (access control, hit tracking)
    β”œβ”€β”€ index.php               Homepage (collapsible topic grid + document card index)
    β”œβ”€β”€ login.php               Login form
    β”œβ”€β”€ logout.php              Session destroy
    β”œβ”€β”€ page.php                Custom static page renderer
    β”œβ”€β”€ print.php               Print-friendly document view
    β”œβ”€β”€ register.php            Invite registration
    β”œβ”€β”€ rss.php                 RSS 2.0 feed (master + per-topic)
    β”œβ”€β”€ setup.php               First-run installation wizard
    β”œβ”€β”€ shop.php                Public storefront β€” grid, cart, checkout, order status
    β”œβ”€β”€ subscribe.php           Public subscriber sign-up form
    β”œβ”€β”€ theme.css.php           Dynamic CSS: active theme + palette overrides
    └── topic.php               Topic view (search first, then sub-topics + document cards)
    
    ---

    Configuration

    Most configuration lives in the admin panel under Settings. The only file-level constant of note is in config.php:
    ConstantDefaultDescription
    MAXIMAGESIZE10 MBMaximum image upload size
    MAXAUDIOSIZE50 MBMaximum audio upload size
    MAXPDFSIZE50 MBMaximum PDF upload size
    ---

    Theme Customisation

    Quick palette (no CSS editing)

    Admin β†’ Settings β†’ Colour Palette β€” 10 colour pickers update CSS variable overrides that are appended after the active theme CSS on every page request. Changes are immediate on next page load.

    Full CSS editing

    Admin β†’ Themes β†’ Edit CSS β€” Edit the full CSS source directly. The colour injector toolbar lets you find-and-replace variable values without manual searching. Save to apply.

    Syncing the built-in themes

    Built-in themes auto-resync from their source files (assets/css/os2.css, assets/css/modern-sleek.css) on boot when the database copy is detected as stale. Use the Sync File button on the Themes list page to force a reload at any time. ---

    Email Setup

    Admin β†’ Settings β†’ Email & Notifications
  • Set From Name and From Email Address.
  • Select SMTP transport and fill in host, port, encryption, username, and password.
  • Check Enable email sending.
  • Use Send Test Email to verify delivery before enabling notifications.
  • SMTP quick reference

    ProviderHostPortEncryption
    Gmail / Google Workspacesmtp.gmail.com587STARTTLS
    Outlook / Office 365smtp.office365.com587STARTTLS
    Brevo (Sendinblue)smtp-relay.brevo.com587STARTTLS
    Mailgunsmtp.mailgun.org587STARTTLS
    > Gmail requires an App Password (not your account password). Generate one at Google Account β†’ Security β†’ 2-Step Verification β†’ App Passwords.

    Subscriber notifications

    Enable the "Send notification email when a new subscriber signs up" global toggle in Settings, then go to Admin β†’ Users and click Notify ON/OFF for each admin or editor who wants to receive alerts. ---

    Store Setup

  • Admin β†’ Store Settings β€” tick Enable the store, choose a store mode:
  • - Independent β€” your own grid catalog with cart and checkout - VistaPrint Pro Store β€” embeds your VistaPrint storefront (paste your storefront URL and optional partner/tracking ID from your VistaPrint account) - Both β€” grid catalog with the VistaPrint embed below it
  • Add payment processors (same page) β€” any number, in three flavours:
  • TypeNeedsBehaviour
    PayPalYour PayPal business emailCustomer is redirected to PayPal with the cart pre-filled
    StripeSecret key (sk…)Hosted Stripe Checkout; payment verified automatically on return
    ManualInstruction textFor Zelle, Venmo, CashApp, cheque, cash, bank transfer β€” your instructions (with {orderno} and {total} placeholders) are shown on the order page; mark Paid in Admin β†’ Store β†’ Orders once received
  • Admin β†’ Store β†’ Categories β€” create categories and sub-categories.
  • Admin β†’ Store β†’ Products β€” add products: set Your Cost (what you pay VistaPrint) and Selling Price β€” the editor shows the live margin, and one click applies your default margin %. Save each product's VistaPrint product URL so staff can re-order it in one click.
  • Process orders at Admin β†’ Store β†’ Orders (editors and admins): confirm payment, click the per-item Order at VistaPrint links to place the fulfilment order from your VistaPrint account, record the VistaPrint order #, update the status (optionally emailing the customer), and watch the profit column.
  • ---

    URL Structure

    URLPage
    /Homepage β€” topic grid + document index
    /topic/{slug}/Topic page β€” search, sub-topics, document cards
    /topic/{slug}/{doc-slug}/Document view
    /print/{slug}/{doc-slug}/Print-friendly document
    /page/{slug}/Custom static page (sub-pages also at /page/{child-slug}/)
    /rss/Master RSS feed
    /rss/{topic-slug}/Per-topic RSS feed
    /shop/Storefront β€” categories + product grid (or VistaPrint embed)
    /shop/cat/{slug}/Store category / sub-category
    /shop/product/{slug}/Product page
    /shop/cartCart
    /shop/checkoutCheckout with payment method selection
    /shop/order/{order-no}/{token}Customer order-status page
    /subscribe/Subscriber sign-up form
    /login/Login
    /register/{token}/Invite registration
    ---

    Security Notes

  • All user input is HTML-escaped with htmlspecialchars() before output
  • Passwords hashed with passwordhash() / passwordverify()
  • CSRF tokens on every state-changing form
  • The data/ directory is blocked by .htaccess (RewriteRule ^data/ - [F,L])
  • Access tokens for link-only documents use bin2hex(random_bytes(16))
  • Hit tracking stores only a SHA-256 hash of IP + date; no raw IPs are recorded
  • SMTP password is stored in the settings table; the data/ directory is not web-accessible
  • Store: customer order pages are gated by a per-order bin2hex(random_bytes(16)) view token; order lists are visible only to editors/admins
  • Store: no card data ever touches the server β€” PayPal and Stripe payments happen on their hosted pages; Stripe sessions are verified server-side with the secret key before an order is marked paid
  • Store: cart and checkout POSTs carry CSRF tokens like every other form; customer IPs are stored only as SHA-256 hashes
---

License

Copyright Β© 2026 Amfile.org / Page Telegram Volunteer Services. All rights reserved.

Download Options

Free Download: Source code is freely available below.
Compiled Versions: Support development with a PayPal donation.

Free Downloads

πŸ“¦ Download Source Code

Changelog

Changelog

All notable changes to IndexGram are documented in this file. > IndexGram by Amfile.org of Page Telegram Volunteer Services ---

[10.11] β€” 2026-07-23

Hyper-Feeds manager β€” preview, edit, purge content

  • Preview any RSS/Atom feed or OPML collection from a URL or uploaded file (Admin β†’ Hyper-Feeds); OPML shows every feed with category path and checkboxes to add only the ones you want
  • Edit saved feed settings (title, URL, topic, draft/published, max items, localize, OPML sub-topic option)
  • Remove feed + content β€” optional +docs deletes documents imported from that feed; legacy also matches article URLs still present in the live feed (older imports)
  • importfeedurl on documents (schema 2026-07-27.1) records which feed produced each import for accurate cleanup and doc counts in the list
  • Lightbox zoom + [subscribe] shortcode

  • Lightbox zoom β€” while viewing an enlarged image: + / βˆ’ toolbar, mouse wheel, +/βˆ’/0 keys, double-click toggle (1Γ— ↔ 2.5Γ—), pinch on touch; drag to pan when zoomed (up to 500%)
  • [subscribe] shortcode β€” embed the site subscribe form on any page (or Store Intro); includes/subscribe_form.php shared with /subscribe; requires Subscribe enabled in Settings
  • Store β€” product image lightbox

  • Click to enlarge on product detail photos (front/back) β€” dark overlay, full-size image, close via backdrop / βœ• / Escape
  • Multi-image gallery β€” when both sides exist, left/right arrows and keyboard ←/β†’ step between them; caption + counter shown
  • Shared lightbox in assets/js/app.js also still handles Markdown md-img embeds site-wide (class ig-lightbox / data-lightbox)
  • Store β€” sales tax (on/off)

  • Admin β†’ Store β†’ Sales Tax β€” enable/disable tax, set rate (%), label (Tax / Sales Tax / VAT), and optional β€œalso tax shipping”
  • Cart, checkout, order confirmation, admin orders, emails β€” tax line when enabled; rate and amount snapshotted on the order (tax, tax_rate)
  • PayPal / Stripe β€” tax included in payment amounts (tax_cart / tax line item)
  • Profit β€” admin profit margin excludes tax (and shipping) so remitted tax is not counted as profit
  • Store products β€” apparel sizes

  • Optional size selection β€” products can enable Apparel β€” require size selection with checkboxes for XS–4XL plus custom sizes (comma-separated)
  • Cart β€” same product in different sizes is separate line items; size shown in cart, checkout, order confirmation, admin orders, PayPal/Stripe line names, and order emails
  • Schema β€” storeproducts.sizesenabled, storeproducts.sizes, storeorder_items.size (migration 2026-07-23.3)
  • Store products β€” front & back images

  • Two-sided product photos β€” products support a Front / Side A image (image) and optional Back / Side B image (image_back); both can be uploaded, replaced, or removed independently in Admin β†’ Store Products
  • Storefront β€” product detail shows front and back side-by-side with labels when both are set; catalog cards continue to use the front image
  • Schema β€” storeproducts.imageback (migration on IGSCHEMAVERSION 2026-07-23.2)
  • Remove feature / OG images

  • Remove current image checkbox on topics, documents, site settings (default OG image, favicon, logo), store products, and store categories β€” clear an image without uploading a replacement
  • igresolveimagefield() / igdelete_upload() β€” shared helpers: new upload wins over remove; replaced/removed files are deleted from uploads/ safely
  • Store intro β€” shortcodes

  • Store Intro field (Admin β†’ Store) now expands the same shortcodes as public pages: [contact-form], [form:slug], [meeting:slug], [cal='slug'], [audio], [pdf], and bare video/PDF URLs
  • rendercontentwith_shortcodes() (includes/markdown.php) β€” shared Markdown + shortcode renderer with POST handling for interactive widgets
  • Shop POST routing β€” cart/checkout actions no longer swallow contact/form/meeting submissions from the intro
  • Store β€” OurProShop / Auth0 iframe fix

  • Root cause β€” OurProShop (*.ourproshop.com) and VistaPrint customer login use Auth0, which sends X-Frame-Options / CSP that forbid embedding in iframes. Browsers correctly refuse with β€œwill not allow … to display the page if another site has embedded it.” That cannot be fixed with sandbox flags or site headers.
  • New default β€” VistaPrint / OurProShop storefronts open via a Visit Store card in a new tab instead of an iframe, so login and checkout work.
  • Display mode β€” Admin β†’ Store Settings and the page Store Plugin add auto / new_tab / iframe. Auto and known Auth0 hosts always use new-tab; iframe mode still offers an β€œOpen in new window” control when embedding is allowed.
  • Helpers β€” storeurlblocksiframe(), storeexternaldisplaymode(), storerenderexternal(), storerendernewtabcard() in includes/store.php; /shop/ and page embeds share the same path.
  • Social Share (topics & pages)

  • Per-topic / per-page toggle β€” new social_share column on topics and pages (default off); enable from the topic edit form or page editor checkboxes
  • Global toggles β€” Settings β†’ Open Graph / Social: Enable on all topics and Enable on all pages independently (socialsharetopics, socialsharepages); share shows when the global flag or the per-item flag is on
  • Helpers β€” topicsocialshareenabled(), pagesocialshareenabled(), socialsharetopicsglobal(), socialsharepagesglobal()
  • Share bar β€” when enabled, the public topic or page shows buttons for X, Facebook, Telegram, and Reddit, plus Copy link for any other network
  • rendersocialshare() (includes/functions.php) β€” builds share intent URLs, scoped CSS that follows theme variables, and a clipboard control
  • Copy link β€” assets/js/app.js handles clipboard write with a short β€œCopied!” confirmation and a document.execCommand fallback
  • ---

    [10.01] β€” 2026-07-13

    Import Fetching β€” curl first

  • igfetchurl() (includes/import-helpers.php) rewritten to prefer the curl extension, matching the calendar plugin's fetcher β€” fixes "Could not fetch the OPML URL" / feed-fetch failures on hosts where allowurlfopen is disabled (the previous implementation used filegetcontents only); browser-like User-Agent, automatic content decompression, up to 10 redirects, and an SSL-verification retry for hosts with incomplete CA bundles; falls back to a stream fetch when curl is absent
  • Actionable error messages β€” fetch failures now surface the transport reason (e.g. Could not resolve host: …, HTTP 404, neither the curl extension nor allowurlfopen is available on this server) in the OPML and single-feed error banners instead of a generic message
  • Because igdownloadfile() and igdownloadog_image() route through the same helper, media localization downloads are fixed on such hosts as well
  • OPML Collection Importer

  • RSS Importer (admin/rss-import.php) β€” new OPML Collection Importer card on the start screen: upload an .opml file (max 5 MB) or link to an OPML URL to import a whole feed collection at once; the export format of Feedly, Inoreader, NewsBlur, Thunderbird, and most feed readers
  • OPML parser (opml_parse()) β€” walks nested <outline> elements recursively; container outlines become a joined category path shown as a badge per feed (e.g. News / Tech); prefers the title attribute over text, falls back to the feed URL; de-duplicates feeds case-insensitively by xmlUrl; rejects non-OPML XML with a clear error
  • Feed selection step β€” checkbox list of all feeds with category badges, feed URL, and site link; All/None toggles
  • Per-feed topic routing β€” every feed row has its own topic dropdown plus a "Set all per-feed topics to" bulk control; feeds left on default follow the global options: Default Target Topic (send all feeds to any one topic) or Sub-topic per feed (create/reuse a topic named after each feed under the default topic, opmlgetorcreatetopic(), respecting the 3-level depth limit); validation requires a default topic only when at least one selected feed lacks a per-feed topic
  • Bulk import β€” each selected feed is fetched live (SSRF-guarded via igsafeurl) and its items run through the shared import pipeline; per-feed max items limit (default 20, 0 = all); draft/published status, media localization, and reprocess-duplicates options as in single-feed import; a failing feed is reported and skipped without aborting the rest
  • Batched processing β€” large collections are processed in configurable batches (Feeds per batch: 1/2/3/5/10, default 3) across separate auto-continuing requests so PHP/proxy timeouts can't kill the run; the work queue, options, and accumulated results live in the session; between batches a progress screen shows a percentage bar, running imported/updated/skipped/failed tallies, and the feeds just processed, then auto-submits the next batch (manual Continue Now button as a no-JS fallback); a Stop & Show Results So Far button finalizes early with everything already imported; each batch gets its own 300 s time limit, and because duplicates are detected per item, an interrupted run can simply be re-run
  • Refactor β€” the single-feed per-item import logic was extracted into rssimportitem(), now shared verbatim by both the single-feed and OPML paths; results table gains a Feed column for OPML runs
  • Large-collection hardening (verified against a real 1,808-feed Liferea export) β€” the parsed feed list is kept in the session instead of round-tripping through a hidden form field; per-feed topic dropdowns are populated lazily via JS from a single master list (inlining the topic options per row made huge collections unrenderable); the selection is submitted as one JSON field so thousands of inputs are not truncated by PHP's maxinputvars (per-input names remain as a no-JS fallback for small collections); the final results table always lists failures but caps successful rows at 500 with a summary note
  • ---

    [10.00] β€” 2026-07-11

    Store β€” Independent Grid Storefront

  • New public storefront (shop.php, clean URL /shop/) β€” grid catalog with categories and sub-categories, product detail pages (Markdown descriptions, image, SKU, stock display), session-based cart, and checkout; honours the active theme via CSS custom properties
  • Catalog schema (includes/db.php) β€” new tables storecategories (self-referencing parentid for sub-categories), storeproducts (price, cost, stock quantity, track-stock / backorder flags, fulfillment type, per-product VistaPrint URL, featured flag), storeorders, and storeorderitems (name/price/cost snapshots at order time)
  • Store library (includes/store.php) β€” catalog queries (deep category descendant listing), cart helpers with stock clamping, transactional order creation with automatic stock decrement, restock-on-cancel, currency formatting, and payment dispatch
  • Store card partial (includes/store_card.php) β€” shared product card used by the store front and category grids
  • Store β€” Payment Processors (any number)

  • Admin β†’ Store Settings β†’ Payment Processors β€” add unlimited payment methods of three types: PayPal (classic cart-upload redirect, no API keys needed), Stripe (hosted Checkout via direct curl API calls, no SDK; payment auto-verified on return), and Manual (Zelle, Venmo, CashApp, cheque, cash, bank transfer β€” customer sees your instruction text with {order_no} / {total} placeholders on the order page)
  • Methods are stored as JSON in the storepaymentmethods setting; each has its own label, enabled toggle, and per-type configuration; Stripe secret key is kept when the field is left blank on edit
  • Order status page (/shop/order/{order-no}/{token}) β€” tokenised customer-facing page showing items, totals, order status, payment status, and manual-payment instructions
  • Store β€” VistaPrint Pro Store Hooks

  • Store modes β€” Independent (grid catalog only), VistaPrint Pro Store (embeds your VistaPrint storefront with optional VP_Tracking partner attribution), or Both
  • VistaPrint account settings (Admin β†’ Store Settings) β€” storefront URL, partner/tracking ID, embed height
  • Per-product VistaPrint link β€” products carry the VistaPrint product URL; staff use it to re-order on the customer's behalf, and (in VistaPrint/Both modes) customers see an "Order directly on VistaPrint" button with partner tracking
  • Page store plugin (admin/pages.php) β€” existing per-page VistaPrint/embed store retained; new Built-in Store type renders a link button to /shop/
  • Store β€” Inventory & Order Processing

  • Admin β†’ Store β†’ Products (editors and admins) β€” full inventory editor: category, SKU, cost vs. selling price with live margin/profit calculator and one-click "apply default margin %" (default margin set in Store Settings), stock quantity, stock tracking, backorders, fulfillment type, featured flag, image upload to uploads/store/
  • Admin β†’ Store β†’ Categories (editors and admins) β€” categories and sub-categories with image, sort order, enable toggle; deleting a category promotes its children one level
  • Admin β†’ Store β†’ Orders (editors and admins) β€” process customer orders: order/payment status, payment reference, VistaPrint order # field, internal notes, per-item "Order at VistaPrint" shortcut links, revenue / cost / profit margin display per order and in the list, optional status-update email to the customer, stock restored on cancel (and re-deducted on un-cancel)
  • New-order notifications β€” comma-separated recipient list in Store Settings, sent via the existing mail layer
  • News Front Page (toggleable)

  • Home page news section (index.php) β€” newest published documents carrying a configured generic tag (defaults to the tag with slug info) rendered like a news site front page: full-width lead story with image plus a responsive grid of remaining stories; each story links to its document and topic
  • Settings (Admin β†’ Settings β†’ News Front Page) β€” on/off toggle, section title, tag picker (any generic tag), story count
  • Marquee Ticker (toggleable, continuous)

  • Site-wide marquee (includes/header.php) β€” scrolling ticker under the nav bar showing the title and description brief of each newly posted document, linking to it; pauses on hover
  • Never restarts while browsing β€” the scroll offset is derived from wall-clock time (Date.now()), so every page load resumes the loop at the same instant; items are duplicated to fill any viewport width without gaps
  • Settings (Admin β†’ Settings β†’ Marquee Ticker) β€” on/off toggle, label, document count, speed (px/second)
  • Infrastructure

  • .htaccess restored β€” clean-URL rewrites for all public routes plus new /shop/… routes; data/ directory protection; existing-file passthrough
  • Shop link added to the nav bar and footer when the store is enabled; Store section added to the admin sidebar (Orders / Products / Categories for editors, Store Settings for admins)
  • New settings seeded in includes/db.php (store, news, marquee); storeactive(), shopurl(), news() and getmarqueedocuments() helpers in includes/functions.php
  • Documentation

  • README β€” new Store, News Front Page, and Marquee Ticker feature sections; step-by-step Store Setup guide with a payment-processor comparison table; /shop/… routes added to the URL structure table; directory tree updated for the new admin pages, includes/store_card.php, shop.php, and uploads/store/
  • README Requirements corrected β€” minimum PHP raised to 8.0 (the codebase uses match and str_contains), and the curl, mbstring, and gd extensions are now listed explicitly
  • README Security Notes β€” added store items: tokenised customer order pages, no card data on the server (hosted PayPal/Stripe pages, server-side Stripe verification), CSRF on cart/checkout, hashed customer IPs
  • ---

    [9.11] β€” 2026-06-17

    Hit Ratio & Return Rate Tracking

  • Admin Documents list (admin/documents.php) β€” SQL query updated to LEFT JOIN pageviews and aggregate COUNT(pv.id) AS totalhits and COUNT(DISTINCT pv.iphash || pv.vieweddate) AS unique_hits per document via GROUP BY d.id; new Hits column displays total / unique with the return-rate multiplier (2.8Γ—) on a second line; hovering the cell shows a full 42 total Β· 15 unique Β· 2.8Γ— return rate tooltip
  • Public document sidebar (document.php) β€” getdochit_stats() called after access checks; "Document Info" sidebar section gains a Views row showing 42 total / 15 unique (2.8Γ—) with the same tooltip; visible to all visitors on publicly accessible documents
  • Import β€” Target Topic at Step 1

  • RSS Importer (admin/rss-import.php) β€” Target Topic dropdown added to the initial Fetch Feed form (step 1); the selected topic_id is carried through POST and pre-selects the matching option in the step-2 preview form, eliminating the need to re-pick the topic after previewing
  • Substack ZIP Importer (admin/substack-import.php) β€” Target Topic dropdown added to the Upload ZIP form (step 1); selection stored in $SESSION['sspresettopicid'] on upload; the preview form's topic selector pre-selects the stored value; session key cleaned up after import completes or on "Start Over"
  • Print β€” Cover Photo Option

  • Print view (print.php) β€” Added optional cover photo (OG image) display to the print layout; an Include cover photo checkbox appears in the print toolbar when the document has an OG image set; photo is hidden by default; toggling the checkbox instantly shows/hides the image via JS without a page reload; history.replaceState updates the URL with ?cover=1 so the preference survives the print dialog re-open; the photo element carries class print-hero-img
  • Print CSS (assets/css/print.css) β€” .print-hero-img updated in both @media print and @media screen blocks: width: 100%; height: auto; display: block replaces the previous max-width/max-height/object-fit rules so the cover photo spans the full content width at its natural aspect ratio
  • Page Slug Editing

  • Pages admin (admin/pages.php) β€” Existing page slugs can now be renamed; the hidden <input name="slug"> for existing pages replaced with a visible editable text input; built-in pages (landing, bibliography) render the slug as a readonly greyed field with an explanatory note
  • A hidden <input name="oldslug"> carries the original slug (set to $editSlug from $GET['edit'] so it remains the DB slug even through validation-error re-renders)
  • POST handler extracts $oldSlug and $slug; $slugChanging flag is true when editing and $slug !== $oldSlug; four guards run before saving: (1) reserved system path check, (2) built-in page guard, (3) collision check against existing pages, (4) self-parent guard
  • UPDATE statement now writes slug=? as the first column with WHERE slug=? using the old slug; redirect after save follows the new slug (?edit=new-slug)
  • Markdown File Import β€” Documents & Pages

  • Document editor (admin/document-edit.php) and Pages editor (admin/pages.php) β€” Both content editors now include an Import Markdown File section between the editor and the media picker
  • UI: file input accepting .md and .txt files; Replace content / Append to content radio buttons (replace is default); Load into Editor button; status message that auto-clears after 4 seconds
  • Implementation is entirely client-side via the browser FileReader API β€” no server round-trip or extra form fields required
  • Replace mode: if the textarea has existing content, a confirm() dialog asks before overwriting; on confirm, textarea.value is set to the file text
  • Append mode: file text is concatenated after a double newline separator; no confirmation required
  • After loading, the file picker is cleared; the textarea is updated in-place so the standard Save submit picks up the imported content as normal
  • ---

    [7.00] β€” 2026-05-21

    Calendar Plugin

  • New Calendar Plugin (includes/calendar.php) β€” self-contained CalendarPlugin class handles database, feed caching, and HTML rendering; ICalParser class handles full RFC 5545 iCal/ICS parsing
  • Shortcode: [cal='slug'] on its own line in any page or document embeds the calendar; optional view override with [cal='slug' view='weekly']; supported view names: monthly / month, weekly / week, agenda, yearly / year, list
  • iCal / ICS parser (ICalParser) β€” fetches any public HTTP(S) iCal feed; unfolds continuation lines (RFC 5545 Β§3.1); parses DTSTART, DTEND, DUE, DURATION, SUMMARY, DESCRIPTION, LOCATION, URL, UID; handles UTC (Z suffix), floating, TZID-qualified, and VALUE=DATE all-day date formats; events sorted ascending by start time
  • Five client-side views rendered by assets/js/calendar.js (vanilla JS, no dependencies):
  • - Monthly β€” 7-column grid; up to 3 event bars per cell with overflow count; today cell highlighted - Weekly β€” 7-column day grid for the current week; all-day and timed events listed per column - Agenda β€” upcoming events grouped by date over a 90-day window from the cursor month; shows time, title, location, and truncated description - Yearly β€” 12 mini-month grids in a responsive CSS grid; today highlighted; days with events shown in bold with underline - List β€” tabular view of all events within a 2-year forward window (Date / Time / Event / Location columns)
  • Event popup β€” clicking any event bar, agenda row, or list row opens a floating themed popup with full title, date, time, location, description (up to 400 chars), and an "Open Event" link; closes on outside click or Γ— button; positioned to stay within the viewport
  • Theme-aware CSS (assets/css/calendar.css) β€” all colours reference the active theme's CSS custom properties (--titlebar-bg, --titlebar-bg-end, --titlebar-text, --accent-color, --content-bg, --window-bg, --border-light, --border-mid, --border-dark, --link-color, --table-header-bg, --table-row-alt, --flash-info-bg); toolbar uses the same gradient as admin titlebars; fully responsive at 600 px and 400 px breakpoints
  • Feed caching β€” parsed events cached as JSON in data/cal_cache/<slug>.json; TTL configurable per calendar (default 3600 s); cache file mtime used for freshness check; data/ directory .htaccess denial covers the cache subdirectory automatically
  • CSS and JS lazy-loading β€” CalendarPlugin::render() emits <link> and <script defer> tags for calendar.css and calendar.js only on the first calendar rendered per page request; subsequent calendars on the same page reuse the already-emitted assets
  • calendars table β€” created via CREATE TABLE IF NOT EXISTS in CalendarPlugin::ensureTable() on first use (no change to dbinit()); columns: id, slug (unique), name, sourceurl, defaultview, cachettl, createdat, updatedat
  • Admin page (admin/calendars.php, editor role required):
  • - Add / edit calendars: slug (auto-generated from name via JS), display name, iCal feed URL, default view selector, cache TTL - Test button β€” clears cache, fetches live feed, reports event count or error message - Clear Cache button β€” deletes the cached JSON for an immediate re-fetch on next page load - Delete β€” removes calendar and its cache file; JS confirm() dialog before submit - Usage hint panel with copy-ready shortcode examples
  • Admin nav β€” "Calendars" link added to the Content section of the admin sidebar (admin/header.php)
  • Markdown integration β€” includes/markdown.php now require_onces calendar.php; shortcode detected in processLines() with regex /^\cal=['"'"]\s(?:view=['"['"])?\s\]$/i before the paragraph collector
  • Markdown β€” Single Line Break Rendering

  • Single newlines now render as <br> β€” Previously, a single newline within a paragraph was collapsed into whitespace by the browser; content typed as multiple lines appeared as one run-on line
  • Fix: the line-break regex in Markdown::inline() changed from / \n/ (two trailing spaces required) to /\n/ (any newline); applies only within paragraph text passed to inline() β€” headings, list items, and table cells are single lines and are unaffected
  • A blank line between two blocks still produces separate <p> paragraphs as before; the two-trailing-spaces convention is now a subset of the general newline rule
  • ---

    [5.00] β€” 2026-05-06

    Three New Built-in Themes

  • The Matrix (assets/css/matrix.css) β€” Phosphor-green-on-black (#000000 desktop, #00FF41 text); Courier New monospace; green glow on interactive elements; images tinted via filter: sepia(1) hue-rotate(80deg) saturate(2.5); fingerprint string "There is no spoon" used for DB resync detection
  • Terminator (assets/css/terminator.css) β€” Near-black desktop (#080808), crimson gradient titlebars (#5C0000 β†’ #AA0000), #FF3333 link colour, uppercase nav and section headers; images tinted via filter: sepia(1) hue-rotate(320deg) saturate(2); fingerprint "I'll be back"
  • Mr. Robot (assets/css/mrrobot.css) β€” Cold slate desktop (#0C0C14), #00BCD4 cyan edge colour, #8B949E body text; font stack: JetBrains Mono / Fira Code / Cascadia Code / Courier New; images via filter: grayscale(0.4) brightness(0.7); fingerprint "Hello, friend"
  • All three themes seeded and auto-resynced in db_init() via a reusable $seedTheme closure that compares a per-theme fingerprint string against the stored CSS
  • #taskbar-logo in every theme file explicitly overrides the global <a> button style (border:none, box-shadow:none, text-decoration:none, border-radius:0) with a clean :hover rule to prevent the logo area inheriting bevelled/glowing button appearance
  • Navigation Improvements

  • Logo as home link β€” #taskbar-logo element changed from <div> to <a href="..."> pointing to the site root; the redundant hardcoded "Home" text link removed from the nav
  • Landing page skip β€” getnavpages() loop in header.php skips the built-in landing page (slug='landing') so "Home" no longer appears as a duplicate nav text link
  • Search always visible on homepage β€” Keyword / topic / audience filter form extracted from the collapsible document index titlebar into a standalone <section class="search-section"> rendered above the topic grid at all times; .search-section rule added to all five theme CSS files
  • Nav dropdown overflow fix β€” #taskbar-links in os2.css and modern-sleek.css changed from overflow-x:auto to overflow:visible (with flex-wrap:wrap); overflow-x:auto creates a block formatting context that clips absolutely-positioned dropdown sub-menus
  • Sub-pages for Custom Pages

  • parent_id INTEGER DEFAULT NULL column added to pages table via ALTER TABLE migration
  • getpageby_id(int $id) β€” cached lookup by ID; used for breadcrumb and sub-page listing
  • get_subpages(int $parentId, bool $allStatuses = false) β€” returns enabled sub-pages by default; $allStatuses=true returns all (used in admin list)
  • getnavpages() updated to exclude sub-pages (parentid IS NULL OR parentid = 0) from the top-level nav
  • includes/header.php β€” nav page loop now loads sub-pages via getsubpages() and adds them to the dropdown alongside any topic nav links; only showin_nav=1 sub-pages appear in the dropdown
  • page.php β€” breadcrumb shows full parent chain (Home β€Ί Parent β€Ί Page); all enabled sub-pages listed at the bottom of the parent page regardless of showinnav
  • admin/pages.php β€” page list renders hierarchically (children indented with ↳ arrow under their parent; Parent column added); edit form adds a "Parent Page" selector (hidden for built-in pages); INSERT and UPDATE queries include parent_id; self-reference guard prevents a page from being its own parent
  • Unified Navigation Order (Topics + Pages)

  • nav_position INTEGER DEFAULT NULL column added to both topics and pages tables via ALTER TABLE migrations
  • getnavitems() in functions.php β€” merges all top-level topics and nav-visible top-level pages into a single array sorted by navposition (nulls sort last, falling back to sortorder); each item carries an item_type key ('topic' or 'page')
  • includes/header.php β€” the two separate topic and page nav loops replaced with one unified loop over getnavitems(); renders topic dropdowns (sub-topics) and page dropdowns (sub-pages + topic nav links) correctly for each item type
  • admin/navorder.php (new) β€” drag-and-drop ordering page; HTML5 Drag and Drop API with no external dependencies; submits a JSON array of "type:id" strings; saves sequential navposition values; shows a secondary table of pages currently excluded from the nav with direct edit links
  • "Nav Order" link added to the admin sidebar Config section
  • Home Page Root Topic

  • topicindexstartid setting (default '0') seeded in dbinit()
  • When set to a topic ID, the homepage Topic Index shows that topic's sub-topics (via get_subtopics()) instead of the full root-level list; falls back to full root list if the chosen topic has no children
  • Admin β†’ Settings β†’ Home Page Display: dropdown now lists all topics (with depth indentation); label and description updated to explain the sub-topic drill-down behaviour
  • Bug Fix β€” Settings Form Save

  • The Send Test Email card contained its own <form> tag nested inside the main settings <form>; HTML5 parsers ignore nested <form> opening tags but honour the inner </form> as the outer form's closing tag, leaving the colour palette, Home Page Display card, and Save button outside any form (button click had no effect)
  • Fixed by moving the test email card to after the main form's </form> closing tag; it is now a proper independent form
  • Contributor Workflow

  • New Contributor role: submissions are saved as drafts automatically; editors and admins publish to approve
  • Contributors see only the document editor β€” no bulk document management or admin tools
  • Document editor validates that contributors cannot bypass draft status on save
  • Topic Restrictions for Contributors

  • New contributortopicrestrictions table: per-user, per-topic permission rows (empty = all topics allowed)
  • getcontributortopicids(), setcontributortopicids(), contributorcanposttotopic() helper functions in functions.php
  • Admin β†’ Users: per-user Topics button expands a checkbox list of all topics; saves restrictions inline
  • Document editor topic selector is filtered to the contributor's allowed topics; server-side validation blocks attempts to post outside allowed topics
  • Navigation Sub-menus

  • Topics with sub-topics render as hover dropdown menus in the site nav
  • Custom page nav items can expose a selected subset of topics as a hover sub-menu
  • Mobile: tap on a parent nav item opens/closes its sub-menu (JS dd-open class toggle; prevents navigation to parent on mobile)
  • Dropdown CSS (position:absolute, z-index:200, hover trigger) added to includes/header.php
  • Topic Landing Pages

  • landingcontent (TEXT) and landingenabled (INTEGER) columns added to topics table via ALTER TABLE migration
  • Admin β†’ Topics edit form: Markdown textarea for landing content and enable/disable checkbox
  • Landing page renders above documents on the topic page when content is present and enabled (or viewer is editor/admin)
  • Editors see an "Edit Landing" link in the window titlebar; an "Add landing page" prompt shown when no content exists yet
  • Collapsible Document Index

  • Homepage document index section is hidden by default (display:none)
  • Click on the section titlebar to expand or collapse; sessionStorage remembers state across navigation
  • Arrow indicator (β–Ί/β–Ό) in titlebar reflects current state
  • Auto-expands when a keyword, tag, or topic filter is active in the URL
  • Search at Top of Topic Pages

  • Keyword and tag/audience filter form moved to the very top of the topic page body, above the topic description, landing page, and sub-topic cards
  • Custom Pages

  • pages table gains navtopicids TEXT DEFAULT '' column (comma-separated topic IDs for sub-menu)
  • Admin β†’ Pages: list view of all pages with edit/delete actions; delete blocked on built-in slugs (landing, bibliography)
  • "New Custom Page" button for admins; slug auto-generated from title with JS
  • Edit form includes nav label, show-in-nav toggle, sort order, content (Markdown), and topic sub-menu checkbox list
  • page.php renders custom pages with the shared header/footer and Markdown body
  • navtopicids parsed in includes/header.php to render topic dropdowns on custom page nav items
  • Site Backup (admin/backup.php)

  • New admin-only page (linked under Admin β†’ Data β†’ Backup)
  • Download Full Backup (ZIP): ZipArchive bundles the SQLite database (data/) and all uploaded media (uploads/) into a timestamped archive using RecursiveIteratorIterator
  • Export Database (SQL): streams all table rows as INSERT statements β€” plain-text SQL dump
  • Both actions protected by CSRF token in the query string (verifycsrfget())
  • Page shows current database size, uploads size, and total before download
  • "Data" nav section added to admin sidebar (admin role only)
  • Email & Subscriber Notifications (includes/mail.php)

  • New igsendmail() β€” lightweight SMTP client using streamsocketclient; supports STARTTLS (port 587), SSL/TLS (port 465), and plain (port 25); AUTH LOGIN; multipart text/plain + text/html messages; PHP mail() fallback when transport is set to php
  • New notifynewsubscriber() β€” queries all active admin/editor users with notify_subscriber = 1 and sends a new-subscriber alert email
  • 10 new settings defaults seeded in db.php: mailenabled, mailtransport, mailfromemail, mailfromname, mailsmtphost, mailsmtpport, mailsmtpuser, mailsmtppass, mailsmtpencryption, mailnotifynew_subscriber
  • notify_subscriber INTEGER DEFAULT 0 column added to users table via ALTER TABLE migration
  • Admin β†’ Settings: new Email & Notifications card β€” transport selector, from name/email, SMTP host/port/encryption, username, password (blank = keep existing), global notify toggle
  • Admin β†’ Settings: Send Test Email mini-form (separate POST action test_email) to verify SMTP credentials
  • Admin β†’ Users: Notify ON/OFF toggle button shown for admin and editor users; green when active; clicking flips notify_subscriber flag
  • subscribe.php: calls notifynewsubscriber() after successful subscription with subscriber's display name
  • CSS β€” Topic Headings Enlarged & Centred (both themes)

  • OS/2 Warp 3.0: .section-titlebar h2 14 px β†’ 17 px + text-align:center; .topic-card-name 13 px β†’ 15 px + centred; .topic-card-body centred; .topic-icon centred; .topic-rss changed from float:right to block; .topic-window .win-titlebar 18 px, centred, with increased padding; .topic-card-link overrides global button style for card headings
  • Modern Sleek: matching changes applied β€” .section-titlebar h2 centred; .topic-card-name 15 px + centred; .topic-card-body centred; .topic-icon centred; .topic-card-link overrides; .topic-window .win-titlebar 18 px, 800 weight, centred
  • Both built-in themes trigger a DB resync on boot if .topic-card-link or .topic-window .win-titlebar is absent from the stored CSS
  • ---

    [2.00] β€” 2026-03-21

    Search Indexing (FTS5)

  • SQLite FTS5 full-text search index (search_index virtual table) created automatically on first boot when the SQLite build supports FTS5
  • Index covers document title, meta_description, and content body for fast whole-word and prefix matching across any dataset size
  • Index is updated on every document save and create (updatesearchindex()); removed on document delete (deletefromsearch_index())
  • Existing documents are indexed automatically when the FTS5 table is first created (migration-safe)
  • rebuildsearchindex() helper available for manual full-index rebuilds
  • Search queries fall back transparently to LIKE on installations where FTS5 is not compiled in (fts5_enabled setting)
  • Regular B-tree indexes added to documents on status, topicid, and updatedat for fast filtering
  • Audience Tags β†’ "Audience"

  • "Audience Tags" renamed to "Audience" throughout the admin UI (admin/tags.php page title, nav item, card titles)
  • Document editor panel renamed from "Audience Tags" to "Audience"
  • Audience tag filter labels on public pages unchanged β€” functionally still labelled "Audience" in topic view
  • Generic Tags

  • New generictags and documentgeneric_tags database tables for flat, colour-free tagging of content
  • New admin page admin/generic-tags.php β€” CRUD for generic tags (name + slug, auto-slug from name)
  • Generic Tags nav link added to admin sidebar Content section
  • Generic tags panel added to the document editor (checked list of all generic tags)
  • Generic tags displayed as grey badges on document cards on homepage and topic pages
  • Generic tags always visible regardless of the Audience Tags toggle
  • Audience Tags Control Panel Toggle

  • audiencetagsenabled setting (default 1 β€” on) controls whether audience tags appear on public-facing pages
  • Admin β†’ Settings β†’ Audience Tags section with enable/disable checkbox
  • When disabled: audience tag filter dropdowns, badge rows, and document-card audience badges are hidden from public view; admin editor still shows the Audience panel
  • Setting handled cleanly alongside existing checkbox settings in the POST handler
  • RSS Feed Importer (admin/rss-import.php)

  • New admin tool for importing content from any RSS 2.0 or Atom feed
  • Step 1: Enter feed URL β†’ feed is fetched and all items shown as a reviewable checklist
  • Step 2: Select items, choose target topic, choose draft/published status, and optionally enable media localization
  • Step 3: Result table shows per-item import outcome with Edit and View links
  • Media localization β€” <img> tags in content are detected and the images downloaded to uploads/images/ with URLs rewritten in-place; PDF hyperlinks similarly downloaded to uploads/pdf/; enclosure attachments (audio, image, PDF) downloaded and appended as Markdown media embeds
  • HTML β†’ Markdown conversion β€” Feed content (HTML) is converted to Markdown before storage; handles headings, blockquotes, code blocks, bold/italic/strikethrough, links, images, ordered/unordered lists, paragraphs; complex HTML passes through as-is (compatible with the Markdown renderer)
  • Enclosure support β€” RSS <enclosure> tags (podcasts, image attachments) downloaded and embedded as audio, or [pdf]() Markdown at the end of the imported document
  • Duplicate slug guard β€” If a slug already exists in the target topic a random 5-char suffix is appended
  • Attribution footer β€” Every imported document appends Originally published at host below a horizontal rule
  • Search index β€” updatesearchindex() called immediately after each import so new documents are searchable instantly
  • SSRF protection β€” All remote URLs validated as public/non-private before fetching; http:// and https:// only
  • Substack compatibility β€” Reads content:encoded namespace (full post HTML) used by Substack, WordPress, and Ghost; feed URL pattern documented in the UI (https://YOURNAME.substack.com/feed)
  • Substack migration notes panel β€” Explains what migrates (public posts, images, audio, attribution), what does not (paywalled posts, comments, tags, view counts), and the workaround (Settings β†’ Exports ZIP for paywalled content)
  • Preview Fix

  • Markdown preview AJAX request (?preview_md=1) now checked before the main POST / CSRF handler to prevent spurious CSRF errors when clicking the Preview button
  • ---

    [1.00] β€” 2026

    Initial Release

    #### Core System
  • PHP 7.4+ / SQLite 3 / vanilla JavaScript β€” no framework, no Composer, no Node
  • First-run setup wizard (setup.php) β€” two-step: site settings then admin account
  • data/installed flag prevents re-running setup after completion
  • config.php with ROOTPATH, AUTOBASEURL, SITEVERSION, MAX*SIZE constants
  • Clean URL rewriting via .htaccess (mod_rewrite)
  • data/ directory blocked from direct web access via .htaccess
  • #### Database (includes/db.php)
  • SQLite schema with tables: settings, users, invites, topics, documents, documentrevisions, documenttags, tags, themes, page_views
  • Safe ALTER TABLE migrations via PRAGMA table_info β€” schema upgrades run on every boot without breaking existing data
  • parent_id column added to topics for 3-level hierarchy
  • pageviews table with indexes on docid and viewed_date
  • Auto-sync of built-in OS/2 theme from assets/css/os2.css when DB copy is stale
  • Default settings seeded on first install (site title, OG fields, palette colours)
  • #### Authentication (includes/auth.php)
  • Session-based login with passwordhash() / passwordverify()
  • Three roles: Contributor, Editor, Admin
  • CSRF tokens on all state-changing forms
  • Flash message system (success / error / info)
  • Login (login.php), logout (logout.php), invite registration (register.php)
  • #### Users & Invites (admin/users.php, admin/invites.php)
  • Role-scoped invite links with optional email restriction, expiry date, and max-use count
  • bin2hex(random_bytes(16)) tokens for invite links
  • Invite usage tracking (usecount, usedby, used_at)
  • #### Topic Hierarchy (admin/topics.php, topic.php)
  • 3-level hierarchy: Topics β†’ Sub-topics β†’ Sub-sub-topics via parent_id
  • gettopicdepth() enforces maximum depth of 3 levels
  • gettopicancestors() returns ancestor chain for breadcrumb trails
  • Sub-topic cards displayed on topic pages with document counts
  • Ancestor breadcrumb navigation on all topic and document pages
  • sort_order column for manual ordering; falls back to alphabetical
  • #### Documents (admin/document-edit.php, admin/documents.php, document.php)
  • Markdown editor with full toolbar (bold, italic, headings, blockquotes, lists, code, links, images, tables, horizontal rules)
  • Draft / Published status
  • Revision history β€” every save creates a snapshot; editors can review past versions
  • OG image, meta description, and access control per document
  • Three access types: Public, Password-protected, Link-only
  • Link-only access via accesstoken (bin2hex(randombytes(16)))
  • Password documents: session-unlocked after verification; raw password never stored
  • Click-to-clipboard share button for link-only documents
  • #### Audience Tags (admin/tags.php)
  • Colour-coded tags assignable to documents
  • Tag filter on homepage, topic pages, and document sidebar
  • Tag badges link back to filtered view
  • #### Media Uploads
  • Images: JPEG, PNG, GIF, WebP, SVG up to 10 MB β€” inserted via Markdown toolbar
  • Audio: MP3, OGG, WAV up to 50 MB β€” rendered as <audio> player
  • PDF: upload or external URL β€” resizable iframe with page / tall / fullscreen modes, download and open-in-tab controls
  • Video: YouTube, Vimeo, Rumble, Odysee, BitChute, PeerTube, TikTok URL β†’ correct embed
  • #### Analytics (includes/functions.php, admin/index.php)
  • Human-only hit tracking: 30+ bot UA patterns filtered at record time
  • Privacy-safe unique tracking: SHA-256 hash of IP + date β€” no raw IP stored
  • Per-document total and unique daily hit counts
  • Site-wide aggregate totals on admin dashboard
  • Document rankings table with gold / silver / bronze rank colouring
  • #### Sharing & Discovery
  • Open Graph meta tags: og:title, og:description, og:image, og:url, og:type, og:site_name
  • Twitter / X Card meta with dynamic summary vs summarylargeimage type
  • Logo used as site-wide OG image fallback when no per-page image is set
  • Correct og:url canonical per page β€” auto-detected from REQUEST_URI; explicit override for document pages
  • RSS 2.0 feeds: master feed and one per topic; updated items marked [Updated]; auto-discovered by browsers
  • Print view: 8.5 Γ— 11 letter layout, @page CSS, PDF embeds shown as filenames, Ctrl+P shortcut
  • Auto table of contents from h2/h3 headings when 3 or more are present
  • #### Theme System (admin/themes.php, theme.css.php)
  • OS/2 Warp 3.0 aesthetic: deep indigo desktop, rose-purple-to-indigo gradient titlebars, bevelled 3D borders
  • Theme CSS stored in database; served dynamically via theme.css.php
  • Full CSS editor in admin with live preview iframe
  • Colour variable injector toolbar for find-and-replace of CSS variable values
  • Save / Activate / Duplicate / Delete themes
  • "Sync File" button reloads built-in theme from assets/css/os2.css
  • Quick colour palette: 10 CSS variable pickers in Settings β€” overrides appended after theme CSS (correct cascade order)
  • ETag-based cache invalidation β€” changes visible within 60 seconds without stale browser caching
  • --titlebar-bg-end variable for gradient end colour
  • #### Document Index Cards (index.php, topic.php)
  • Responsive multi-column CSS Grid cards (auto-fill minmax(260px, 1fr))
  • OG image displayed top-right on each card
  • Title, description excerpt (3-line clamp), audience tag badges, update date
  • Tag badges link to filtered view; topic link on homepage cards
  • Keyword search filtering on title and meta description
  • Combined keyword + tag + topic filters on homepage
  • Combined keyword + tag filters on topic pages
  • Sub-topic cards with thumbnail, description, and document count
  • #### Design
  • Global OS/2 bevelled button style for all <a> elements
  • Surgical CSS exceptions restore natural link style in Markdown body, topic cards, titlebars, tag badges, nav
  • Fully responsive: CSS Grid cards, hamburger nav, collapsible admin sidebar
  • Tested at 900 / 700 / 400 px breakpoints
  • Empty states rendered in windowed boxes β€” visible on all backgrounds
  • #### Security
  • All user output HTML-escaped with htmlspecialchars() β€” single encoding only in templates
  • CSRF tokens on every state-changing form
  • data/ directory blocked by .htaccess
  • bin2hex(random_bytes(16)) for all security tokens
  • Passwords hashed with PASSWORD_DEFAULT
  • No raw IP addresses stored anywhere
  • ---

    Post-Release Additions β€” 2026-03-21

    #### Print View
  • Removed site name / attribution header from print output
  • Removed featured (OG) image from print output
  • Removed footer attribution text (footer_text setting) from print output
  • Print now shows only: document title, topic / author / date meta, audience tags, content body, source URL
  • #### Subscribe Widget
  • New public subscription form at /subscribe/
  • Admin-configurable: enable/disable toggle, page title, call-to-action description
  • Email address always required; optional fields selectable per-site: first name, last name, zip/postal code, phone number, comments (textarea), plus up to 3 admin-labelled custom fields
  • Duplicate email check prevents re-submission
  • IP hash stored for abuse reference (no raw IP)
  • Admin / Editor: view all subscribers at Admin β†’ Subscribers with per-field column display
  • CSV download of full subscriber list with one click
  • Single-subscriber delete and delete-all (with confirmation)
  • Subscribe link appears in site nav and footer when enabled
  • #### Custom External Nav Links
  • Admin β†’ Nav Links: add/edit/delete external links with label, URL, and sort order
  • Links appear in the site nav bar and footer alongside internal links
  • All custom nav links open in a new tab (target="_blank" rel="noopener noreferrer")
  • URL validation enforces http:// or https:// prefix
  • Sort order field controls display sequence
  • #### External Links
  • All external links (any domain different from the site host) automatically open in a new tab via app.js at page load
  • rel="noopener noreferrer" applied automatically for security
  • #### Admin Navigation
  • New Audience section in admin sidebar with Subscribers link (visible to Editors and Admins)
  • New Nav Links link in admin sidebar Config section (Admin only)
  • New Subscribe configuration section in Settings with field-checkbox UI and custom label inputs
  • ---

    Bug Fixes Applied During Build

  • Login/logout 404 β€” Missing .htaccess rewrite rules for login and logout routes; added before the generic RewriteCond block
  • RSS downloading as file β€” Content-Type: application/rss+xml caused browsers to download; changed to text/xml with Content-Disposition: inline and obstart()/obend_clean() to prevent headers-already-sent errors
  • Theme palette not applying β€” theme.css.php prepended overrides before theme CSS; since both define :root {}, theme always won. Fixed by appending overrides after theme CSS
  • Double HTML encoding in OG meta β€” topic.php and document.php called h() before buildmeta(); header.php called h() again. Fixed by removing h() from all buildmeta() call sites
  • og:url always showing homepage β€” buildmeta() defaulted ogurl to baseurl(); fixed to use empty string with auto-detection from $SERVER['REQUEST_URI'] in header.php
  • Empty state text invisible β€” .empty-state had no background, rendering dark text on teal desktop. Fixed with background: var(--window-bg) and OS/2 bevel border
  • getdocsby_hits() malformed query β€” Initial implementation used a malformed conditional expression inside a ternary; rewritten as a straightforward prepared statement
  • Stale theme in DB β€” Initial DB seed had old CSS without --titlebar-bg-end; auto-migration in db.php detects and reloads from file on boot