Add Social Scheduler — global social media post scheduling

- New /social page with left/right layout (form + post list)
- Social topbar link
- Tables: social_posts, social_targets (project-agnostic posts, per-target project refs)
- CRUD: create, edit, duplicate, delete, retry
- Image upload (JPEG/PNG/GIF/WebP, 10MB max) stored in data/social-uploads/
- Per-platform image toggle (Discord multipart, Mastodon /api/v2/media, LinkedIn Assets API)
- bin/dispatch-social.php cron dispatcher (every minute via /etc/cron.d)
- Settings: eligible projects section to enable bot projects as social account sources
- Platforms: Discord (webhook), Mastodon, LinkedIn personal profile

Cron setup:
  * * * * * www-data /usr/bin/php /opt/hackmancms/bin/dispatch-social.php >> /var/log/hackman_social.log 2>&1

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Bashy 2026-06-03 17:01:03 +03:00
parent 45b9e15152
commit ac5c262bfb
9 changed files with 1081 additions and 0 deletions

View file

@ -71,6 +71,25 @@ $scan_paths = $db->query('SELECT * FROM scan_paths ORDER BY path')->fetchAll();
</div>
</div>
<div class="row g-4 mt-0">
<div class="col-md-6">
<div class="card">
<div class="card-header d-flex align-items-center gap-2">
<i class="bi bi-calendar-week text-primary"></i> Social scheduler — eligible projects
</div>
<div class="card-body">
<p class="text-muted small mb-3">
Projects enabled here appear as platform sources in the Social Scheduler.
Only Discord Bot projects with configured social accounts are useful here.
</p>
<div id="socialProjectsList"><div class="text-muted small">Loading…</div></div>
<button class="btn btn-sm btn-primary mt-3" id="saveSocialProjectsBtn">Save</button>
<span class="text-muted small ms-2 d-none" id="socialProjectsSaved">Saved</span>
</div>
</div>
</div>
</div>
<div id="scanResults" class="mt-4 d-none">
<div class="d-flex justify-content-between align-items-center mb-3">
<h5 class="mb-0">Scan results</h5>