Files
MyKeyser/admin/admin_header.php
T
Ty Clifford 354bb4255d - Rebuilt the CLI importer to use the official Facebook Graph API instead of HTML scraping.
Main changes:
Replaced 
[scripts/facebook-events-import.php](/Users/tyemeclifford/Documents/GH/MyKeyser/scripts/facebook-events-import.php) 
with a Graph API client.
It now supports --page-id, --pages-file, --event-id, --events-file, and 
optional area discovery via --discover-pages --center=LAT,LNG 
--query=....
Uses FACEBOOK_GRAPH_ACCESS_TOKEN or --access-token.
Pulls Graph fields for title, description, start/end time, 
place/location, ticket URI, and cover.source for the main photo.
Keeps the existing staged review/import workflow in 
/admin/event_imports.php.

- Implemented event detail pages and clickable event cards.
What changed:
Added [event.php](/Users/tyemeclifford/Documents/GH/MyKeyser/event.php) 
for individual event pages.
Made event cards clickable from 
[events.php](/Users/tyemeclifford/Documents/GH/MyKeyser/events.php), 
[index.php](/Users/tyemeclifford/Documents/GH/MyKeyser/index.php), and 
legacy 
[2index.php](/Users/tyemeclifford/Documents/GH/MyKeyser/2index.php).
Added large event photo display plus lightbox enlargement in 
[assets/css/style.css](/Users/tyemeclifford/Documents/GH/MyKeyser/assets/css/style.css) 
and 
[assets/js/app.js](/Users/tyemeclifford/Documents/GH/MyKeyser/assets/js/app.js).
Added eventUrl() and externalHref() helpers in 
[includes/functions.php](/Users/tyemeclifford/Documents/GH/MyKeyser/includes/functions.php).
Added copy-event-link support on event detail pages.
Updated README to list the new route.
2026-06-19 18:07:45 -04:00

59 lines
3.3 KiB
PHP

<?php
// Admin header — included by all admin pages after setting $adminTitle
require_once dirname(__DIR__).'/includes/boot.php';
requireAdmin();
$pageTitle = ($adminTitle ?? 'Admin') . ' — Keyser WV Admin';
include dirname(__DIR__).'/includes/header.php';
// Pending owner edit count for badge
$_pendingEdits = (int)qval("SELECT COUNT(*) FROM business_edit_requests WHERE status='pending'");
$_pendingClaims = (int)qval("SELECT COUNT(*) FROM business_claim_requests WHERE status='pending'");
$_pendingEventImports = (int)qval("SELECT COUNT(*) FROM event_imports WHERE status='staged'");
?>
<div class="admin-wrap">
<aside class="admin-side">
<div class="admin-side-title">ADMIN PANEL</div>
<a class="asl" href="/admin/">📊 Dashboard</a>
<div class="admin-side-title" style="margin-top:1rem">DIRECTORY</div>
<a class="asl" href="/admin/businesses.php">🏢 Businesses</a>
<a class="asl" href="/admin/categories.php">🏷️ Categories</a>
<a class="asl" href="/admin/menus.php">🍽️ Menus</a>
<a class="asl" href="/admin/reviews.php">⭐ Reviews</a>
<a class="asl" href="/admin/alerts.php">📢 Alerts</a>
<a class="asl" href="/admin/biz_edits.php" style="display:flex;align-items:center;justify-content:space-between">
<span>✏️ Owner Edits</span>
<?php if ($_pendingEdits): ?>
<span style="background:var(--gold);color:var(--bg0);font-family:'Oswald',sans-serif;font-size:.65rem;padding:.1rem .42rem;border-radius:10px;font-weight:600"><?=$_pendingEdits?></span>
<?php endif; ?>
</a>
<div class="admin-side-title" style="margin-top:1rem">COMMUNITY</div>
<a class="asl" href="/admin/forum.php">💬 Forum</a>
<a class="asl" href="/admin/events.php">📅 Events</a>
<a class="asl" href="/admin/event_imports.php" style="display:flex;align-items:center;justify-content:space-between">
<span>Event Imports</span>
<?php if ($_pendingEventImports): ?>
<span style="background:var(--gold);color:var(--bg0);font-family:'Oswald',sans-serif;font-size:.65rem;padding:.1rem .42rem;border-radius:10px;font-weight:600"><?=$_pendingEventImports?></span>
<?php endif; ?>
</a>
<a class="asl" href="/admin/attractions.php">🗺️ Attractions</a>
<a class="asl" href="/admin/reports.php">🚩 Reports</a>
<div class="admin-side-title" style="margin-top:1rem">USERS</div>
<a class="asl" href="/admin/users.php">👥 Users</a>
<a class="asl" href="/admin/owners.php" style="display:flex;align-items:center;justify-content:space-between">
<span>🔑 Assign Owners</span>
<?php if ($_pendingClaims): ?>
<span style="background:var(--gold);color:var(--bg0);font-family:'Oswald',sans-serif;font-size:.65rem;padding:.1rem .42rem;border-radius:10px;font-weight:600"><?=$_pendingClaims?></span>
<?php endif; ?>
</a>
<div class="admin-side-title" style="margin-top:1rem">SETTINGS</div>
<a class="asl" href="/admin/settings.php">⚙️ Site Settings</a>
<hr style="border-color:var(--bdr);margin:1rem 0">
<a class="asl" href="/index.php">🏠 View Site</a>
<a class="asl" href="/logout.php">🚪 Sign Out</a>
</aside>
<div class="admin-main">
<?php
function adminTitle(string $t, string $sub=''): void {
echo '<div class="admin-sec-title">'.e($t).'</div>';
if($sub) echo '<p style="color:var(--text-m);font-size:.88rem;margin-top:-.5rem;margin-bottom:1rem">'.e($sub).'</p>';
}