Последнии сообщения форума
Three related cleanups applied system-wide. Legacy function names replaced with camelCase equivalents matching project naming conventions. search_color (marked # OLD DELETE) deleted and replaced by an optimised filterTextHighlight. filterTextHighlight rewritten for performance: single combined regex instead of one pass per word, batch str_replace for tag extraction/restoration.
Core changes:
- Helper function renames (core/system.php + 24 call sites):
- defconst() → getConst()
- deflmconst() → getModuleName() (strtr replaced by array lookup $map[$k] ?? $k)
deflang() → getLangName() (same) Callers updated in: core/admin.php, core/user.php, admin/modules/,
blocks/block-{languages,modules}.php, templates/*/index.php,
modules/{account,search,voting/admin}/index.php
- filterTextHighlight() rewrite (core/system.php:1674):
- array_unique + sort words by length desc before building pattern
- preg_quote per word; all words joined into one alternation regex
- Tag placeholders switched to \x00TAGn\x00 (no risk of HTML collision)
- Batch str_replace(array, array) for tag extraction and restoration
- search_color() removed (core/system.php):
- Was marked # OLD DELETE; fully superseded by filterTextHighlight()
All 18 call sites migrated: modules/{content,forum,files,faq,search, auto_links,links,jokes,shop,pages,media,help,news}/index.php, modules/shop/admin/index.php
Benefits: - Consistent camelCase naming across all helper functions - filterTextHighlight: O(1) regex passes regardless of word count - No dead code (search_color deleted) - Safer tag placeholder avoids numeric pseudo-tags <1>, <2>
Split changelog language constants into user/admin scopes — user files now contain only what index.php needs, admin-only constants moved to the admin/language layer. Adds page title to setHead() in changelog/index.php. Removes two redundant require_once calls for config files already loaded automatically by getConfig() via glob in core/system.php.
Core changes:
- Language constants (modules/changelog/language/*.php):
Removed 19 admin-only constants from user language files (all 6 locales) * Kept: filter/search UI, date labels, error messages * Removed: source config, export, cache TTL, stats, GitHub API fields
- Admin language files (modules/changelog/admin/language/*.php):
- Added as new tracked files (were untracked)
- Removed one dead constant (_CHLOG_ERR_GH_API_JSON) unused anywhere
- Module entry point (modules/changelog/index.php):
- setHead() now receives ['title' => _CHANGELOG]
- System entry point (index.php):
- Removed require_once CONFIG_DIR.'/shop.php' (go==2 block)
- Removed require_once CONFIG_DIR.'/uploads.php' (go==4 block)
- Both configs are already merged by getConfig() on startup
Benefits: - Admin-only constants no longer loaded for regular users - No dead constants in language files - Page title set correctly in changelog module - Cleaner index.php without redundant file loads
This commit completes the current legacy text refactor by renaming the old replacement helper to filterReplaceText, migrating bb_decode call sites to filterMarkdown(..., false), and removing redundant wrapper experiments. It also includes the monitor fix, client archive flow updates, template style updates, and rule documentation needed to keep future refactors consistent.
Core changes:
- Legacy text pipeline (core/system.php):
- Renamed search_replace() to filterReplaceText()
- Migrated bb_decode()-based output paths to filterMarkdown(..., false)
- Removed redundant wrapper indirection and kept direct behavior-preserving calls
- Frontend and admin modules (modules/, admin/modules/, blocks/*):
- Updated legacy content rendering call sites to the new helper/parser naming
- Switched client archive generation away from PclZip to the core compression flow
- Fixed monitor database size handling to stop undefined array key warnings
- Project guidance and templates (.rules/, .agents/, templates/*):
- Added explicit migration guidance for rename-vs-wrapper decisions
- Synced architecture notes for parser and replacement helper migrations
- Adjusted template system styles alongside the current refactor batch
Benefits: - Lower maintenance cost by reducing legacy naming drift and wrapper noise - Better reliability through the monitor fix and centralized archive handling - Clearer project rules for future refactors with minimal behavior change
Technical notes: - Legacy content still uses filterMarkdown(..., false) where raw HTML passthrough is required - filterReplaceText() is now the canonical replacement helper name in the codebase - Backward compatibility is preserved at runtime, but old helper names were intentionally removed from the code
Normalize optional profile birthday values before passing them into the legacy datetime helper and apply a safe fallback for the account style class. This prevents runtime warnings and type errors on profile-related screens without changing user-visible behavior.
Core changes:
- Account profile form (modules/account/index.php):
Normalized
user_birthdayto a validated string before rendering the date picker * Empty and invalid values now fall back safely instead of reachingdatetime()asnull- Added a safe
sl_accountfallback when$conf['style']is missing or empty - User messaging view (core/user.php):
- Replaced direct
$conf['style']access with a guarded fallback - Preserved the existing account style default for account-context rendering
Benefits:
- Prevents datetime(): Argument #3 ($time) must be of type string, null given
- Removes Undefined array key "style" warnings in account flows
- Keeps legacy helpers working without widening the change scope
Technical notes:
- The legacy datetime() helper signature was not changed
- No database schema, routing, or template contracts were modified
Move all _CHLOG_* constants to module-local changelog language files and remove the duplicated global definitions. This eliminates repeated constant redefinition warnings while preserving public and admin changelog translations.
Core changes:
- Changelog module languages (modules/changelog/language/*.php):
Added the full
_CHLOG_*constant set required by both frontend and admin changelog screens * Included export, source, GitHub, cache, stats, and token-related strings * Kept module-local translations as the single source of truth- Preserved existing localized wording where available
- Global languages (language/*.php):
- Removed duplicated
_CHLOG_*constants from the shared language files - Prevented global language loading from colliding with module language loading
Benefits: - Eliminates changelog constant redefinition warnings in PHP logs - Reduces translation duplication across the codebase - Keeps changelog localization scoped to the module that owns it
Technical notes: - No routing or template behavior was changed - Backward compatibility is preserved for changelog pages and admin screens
Harden the admin monitor module output and refresh paths while bringing the file closer to the local SLAED coding rules. Also add repository text-format defaults so editors and Git keep UTF-8 and LF consistently.
Core changes:
- Monitor admin module (admin/modules/monitor.php):
Harden request, server, and database diagnostic output before it reaches the admin template * Keep inline HTML escaping at the output boundary * Replace SHOW TABLE STATUS with an information_schema query
Reduce refresh overhead and align the file with local style rules * Add short-lived caching for expensive monitor probes * Remove unnecessary Linux shell fallbacks and normalize comments, guards, and names
- Repository text settings (.editorconfig, .gitignore):
- Add shared UTF-8 and LF defaults for editor saves
- Stop ignoring tracked project meta files that must stay under version control
Benefits: - Improves admin-side XSS resistance for diagnostic values - Reduces monitor refresh cost on repeated polling - Aligns the module and repository text handling with project rules
Technical notes: - Existing monitor routes and template structure are preserved - Line ending policy is now enforced through repository metadata - Backward compatibility is preserved for the current admin workflow
Restore .gitmessage as a persistent commit message template instead of a
concrete commit message file. This keeps the Git workflow aligned with the
current SLAED rules and prevents the template from being overwritten again.
Core changes:
- Git workflow template (
.gitmessage): - Restore the placeholder-based permanent commit template
- Remove the previous concrete commit content from the template file
Benefits: - Keeps commit preparation consistent across future tasks - Prevents accidental reuse of an old concrete commit message - Aligns repository workflow with the current SLAED Git rules
Technical notes: - No code behavior changes - No API or routing changes - Backward compatibility is unchanged
Consolidate changelog loading, rendering, localization, and export behavior across public and admin code paths. Modernize monitor and editor admin modules to align them with the current SLAED routing and input rules.
Core changes:
- Changelog module (
modules/changelog/*.php,templates/admin/basic-changelog*.html): Introduce shared changelog core logic in
modules/changelog/common.php* Unify GitHub/local source loading, cache handling, pagination, and export helpers * Remove active GraphQL usage and count available commits from loaded data- Refactor admin and public changelog handlers to use shared loaders and render helpers
- Localize admin changelog UI and refresh related module language files
- Admin tools (
admin/modules/monitor.php,admin/modules/editor.php): Simplify monitor controller flow and centralize runtime snapshot handling * Reduce duplicated disk/runtime logic and remove external admin template dependency
- Refactor editor input handling to use shared helpers and SLAED raw input access
- Language and template alignment (
language/*.php,templates/admin/*.html): - Add missing monitor and changelog language constants across six languages
- Update admin templates to match the new changelog and monitor behavior
Benefits: - Better maintainability through shared changelog logic and reduced duplication - Cleaner admin behavior aligned with current SLAED rules for input and routing - More consistent localization and admin rendering across modules
Technical notes:
- modules/changelog/common.php is a new shared module file
- Commit counting now reflects available loaded/cached commits instead of GraphQL totals
- Backward compatibility is preserved for existing changelog routes and admin operations
Adds the HTMX client library to admin assets and updates the monitor admin template markup. This commit groups the remaining UI-side changes into one atomic delivery for deployment.
Core changes:
- Monitor template (templates/admin/basic-monitor.html):
- Updated monitor admin layout and template blocks
- Improved partial rendering markup for monitor panels
- Frontend dependency (templates/admin/js/htmx.min.js):
- Added bundled HTMX minified script for admin monitor interactions
Benefits: - Enables template-driven interactive monitor updates - Keeps monitor frontend assets versioned in repository - Delivers remaining workspace changes as one deployable unit
Technical notes: - No backend PHP logic changes in this commit - No database/schema changes - Backward compatibility is preserved at template level





