Files
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

6.9 KiB

My Keyser — Tourism Website

PHP/SQLite City Tourism Site for Keyser, West Virginia


QUICK START

  1. Extract this zip to your web server's document root (or any folder)
  2. Make the data/ directory writable:
    chmod 777 data/
    
  3. Visit the site — the database is created automatically on first load
  4. Admin login:
    • URL: /admin/
    • Username: administrator
    • Password: password123 ⚠️ Change the admin password immediately via Admin → Settings

REQUIREMENTS

  • PHP 8.0 or higher
  • PDO SQLite extension (enabled by default on most hosts)
  • Web server: Apache, Nginx, or php -S for local dev

Local Development (no web server needed):

cd /path/to/keyser-wv
php -S localhost:8080
# Then visit: http://localhost:8080

Apache / cPanel / Shared Hosting:

  • Upload all files to public_html/ or your domain folder
  • Ensure data/ directory has write permission (chmod 777 or 755)
  • No .htaccess needed — plain PHP files

FEATURES

Public Site

  • 🏠 Homepage — hero banner, business stats, alerts feed, featured listings, upcoming events
  • 📋 Business Directory — searchable/filterable grid of 60+ real Keyser WV businesses
  • 🏢 Business Detail Pages — full info, hours, menus, reviews, alerts, Google Maps link
  • Reviews — star ratings and written reviews (login required)
  • 🍽️ Menus — full menu display with sections, items, descriptions, prices
  • 📢 Alerts/News — business owners can post announcements
  • 🗺️ Attractions — 15+ attractions in Keyser & Mineral County
  • 📅 Events Calendar — community event submission and display
  • 📖 About Page — rich Keyser WV history, timeline, famous people, geography
  • 🚩 Report Button — logged-in users can report listing errors

User Accounts

  • Sign up with username & password
  • Login / Logout
  • Account settings (email, password)
  • Owner dashboard to manage assigned businesses
  • Submit events

Admin Panel (/admin/)

  • Dashboard — stats, pending events, open reports
  • Businesses — full CRUD: add/edit/delete, toggle active/featured, set hours
  • Categories — manage business categories with emoji icons
  • Menus — manage menu sections and items with prices for any business
  • Reviews — approve, hide, or delete any review
  • Alerts — post/manage business announcements
  • Attractions — full CRUD for attractions
  • Events — approve/reject submissions, add events, feature events
  • Event Imports — review Facebook event candidates staged by the CLI importer
  • Users — add/edit/delete users, reset passwords, suspend accounts
  • Assign Owners — link users to businesses for self-management
  • Reports — review and close user-submitted listing corrections
  • Settings — toggle registration on/off, event approval, change admin password

Facebook Event Import Workflow

Stage Facebook event candidates from the official Facebook Graph API, then review and import them from Admin -> Event Imports:

FACEBOOK_GRAPH_ACCESS_TOKEN=... php scripts/facebook-events-import.php --area="Keyser, WV" --page-id=123456789 --limit=20
php scripts/facebook-events-import.php --access-token=... --event-id=123456789012345
php scripts/facebook-events-import.php --access-token=... --area="Keyser, WV" --center=39.4364,-78.9762 --distance=25000 --query="Keyser" --discover-pages

The importer does not scrape Facebook, log in, or bypass access controls. Your Meta app/token must have permission to read the requested Page/Event data through Graph API.


FILE STRUCTURE

keyser-wv/
├── index.php              # Homepage
├── directory.php          # Business directory + search
├── business.php           # Business detail page
├── menu.php               # Owner menu manager
├── attractions.php        # Attractions page
├── events.php             # Events calendar + submission
├── event.php              # Event detail page
├── about.php              # About Keyser WV history
├── login.php              # Login
├── register.php           # Registration
├── logout.php             # Logout
├── account.php            # Account settings
├── dashboard.php          # User/owner dashboard
├── includes/
│   ├── boot.php           # Bootstrap (session + DB init)
│   ├── db.php             # Database, schema, seed data
│   ├── facebook_event_importer.php # Facebook event parser/import helpers
│   ├── functions.php      # Auth, helpers, CSRF, stars
│   ├── header.php         # HTML header + navbar
│   └── footer.php         # Footer + JS
├── admin/
│   ├── index.php          # Admin dashboard
│   ├── businesses.php     # Manage businesses
│   ├── categories.php     # Manage categories
│   ├── menus.php          # Manage all menus
│   ├── reviews.php        # Manage reviews
│   ├── alerts.php         # Manage alerts
│   ├── attractions.php    # Manage attractions
│   ├── events.php         # Manage events
│   ├── event_imports.php  # Review staged Facebook event imports
│   ├── users.php          # Manage users
│   ├── owners.php         # Assign owners to businesses
│   ├── reports.php        # Handle listing reports
│   └── settings.php       # Site settings + password
├── scripts/
│   └── facebook-events-import.php # CLI Facebook event stager
├── assets/
│   ├── css/style.css      # Complete dark WV theme
│   └── js/app.js          # Nav, dropdowns, confirm dialogs
└── data/
    └── keyser.db          # SQLite database (auto-created)

PRE-LOADED DATA

The database is seeded on first run with real Keyser WV data:

  • 60+ businesses across 13 categories (dining, retail, healthcare, education, etc.)
  • Full menus for Castiglia's Italian Eatery, The Candlewyck Inn, and Queens Point Coffee
  • 6 sample alerts from real local businesses
  • 15 attractions in Keyser & Mineral County
  • 7 events including Mineral County Fair, Christmas Parade, PSC Athletics
  • 1 admin account (administrator / password123)

DESIGN

  • Dark theme with West Virginia colors: Gold (#c9a84c) + Navy (#1a3a5c) on near-black
  • Fonts: Playfair Display (headings), Oswald (labels), Source Sans 3 (body)
  • Fully responsive — mobile, tablet, desktop
  • Animated hero with mountain silhouette and wind turbines
  • No external dependencies — pure PHP, SQLite, vanilla CSS/JS

SECURITY

  • CSRF tokens on all POST forms
  • Password hashing with bcrypt
  • HTML output escaped with htmlspecialchars()
  • Admin pages require is_admin = 1
  • Session regeneration on login/logout
  • Prepared statements everywhere (SQL injection prevention)

Built for Keyser, West Virginia — The Friendliest City in the U.S.A.