Add standalone /publiser admin application
Implement a minimal, dependency-free publishing tool to manage news and articles. The app includes: - A Markdown-based block editor with rich-text capabilities. - Image upload and resizing using GD. - Support for drafts, scheduled publishing, and a trash system. - Integrated Basic Auth protection via PHP and .htpasswd. - A global plugin for automatic execution of scheduled posts. The tool reuses core site logic in custom/plugins/publiser-lib.php to ensure consistency between the editor and the live site.
This commit is contained in:
parent
c7ec163a36
commit
b609c8596c
15 changed files with 2301 additions and 8 deletions
24
custom/plugins/global/scheduled-publisher.php
Normal file
24
custom/plugins/global/scheduled-publisher.php
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
/**
|
||||
* Scheduled Publisher Plugin
|
||||
*
|
||||
* Publishes due scheduled posts created via /publiser. Runs on every page
|
||||
* request (piggybacking on normal site traffic) instead of relying on a
|
||||
* cron job - there's nothing to configure on the host, and with regular
|
||||
* traffic a scheduled post goes live within moments of its scheduled time.
|
||||
*
|
||||
* Usage: add to custom/config.ini:
|
||||
* [plugins]
|
||||
* enabled = "languages, scheduled-publisher"
|
||||
*/
|
||||
|
||||
require_once __DIR__ . '/../publiser-lib.php';
|
||||
|
||||
Hooks::add(Hook::CONTEXT_READY, function (Context $ctx, array $config) {
|
||||
try {
|
||||
publiserPublishDueScheduledItems();
|
||||
} catch (Throwable $e) {
|
||||
error_log('scheduled-publisher: ' . $e->getMessage());
|
||||
}
|
||||
return $ctx;
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue