Siteβ―Builder
Editing:
index11111111111111111111111111111.php
writable 0666
<?php /************************************************************************* * Generic microsite / landingβpage template * ---------------------------------------- * β’ zero external CSS / JS * β’ no helpers.php β pathβdetection is builtβin *************************************************************************/ /* ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ * 1. Detect whether weβre in /social/<slug>/β¦ or /ph/<digits> * ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ */ require_once $_SERVER['DOCUMENT_ROOT'] . '/pages/lib/helpers.php'; /* ---------- constants ---------- */ define('MOD_ROOT', $_SERVER['DOCUMENT_ROOT'].'/pages/modules'); define('GLOBAL_CFG', MOD_ROOT.'/modules.json'); define('LOCAL_CFG', __DIR__ .'/config.json'); /* ---------- profile + local site config ---------- */ $profile = get_profile(); // β now loaded from /social/β¦ or /ph/β¦ $local = json_safe(LOCAL_CFG); $site = [ 'name' => $local['site_name'] ?? ($profile['display_name'] ?? 'BestDealOn microsite'), 'tier' => ($local['tier'] ?? 'free') === 'premium' ? 'premium' : 'free', 'hero' => $local['hero'] ?? [ 'heading' => $profile['display_name'] ?? 'Welcome!', 'sub' => $profile['slogan'] ?? 'Powered by BestDealOn', 'bg' => '#5c3bff', 'fg' => '#ffffff' ] ]; /* ---------- meta tags ---------- */ $metaTitle = trim( ($profile['display_name'] ?? 'Profile') . (isset($profile['slogan']) ? ' | '.$profile['slogan'] : '') ); $metaDesc = substr(strip_tags($profile['description'] ?? ''), 0, 160); $metaKeywords = implode(', ', array_slice( array_merge($profile['tags'] ?? [], $profile['location_tags'] ?? []), 0, 20)); /* ---------- module list ---------- */ $global = json_safe(GLOBAL_CFG); // registry $localMods = $local['modules'] ?? []; $ordered = []; foreach ($localMods as $m) $ordered[$m['name']] = $m; // local wins foreach ($global as $g) if (!isset($ordered[$g['name']])) $ordered[$g['name']] = $g; $modules = []; foreach ($ordered as $m){ if (($m['active'] ?? false) !== true) continue; if (($m['tier'] ?? 'free') === 'premium' && $site['tier']!=='premium') continue; $modules[] = $m; } ?> <!doctype html><html lang="en"><head> <meta charset="utf-8"> <title><?= htmlspecialchars($metaTitle ?: $site['name']) ?></title> <meta name="viewport" content="width=device-width,initial-scale=1"> <!--ββ Canonical & basic crawling hints ββ--> <link rel="canonical" href="<?= 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ?>"> <meta name="robots" content="index,follow,max-snippet:-1,max-image-preview:large"> <meta name="referrer" content="strict-origin-when-cross-origin"> <!--ββ Primary description / keywords βΒ fall back to title if empty ββ--> <?php if ($metaDesc): ?> <meta name="description" content="<?= htmlspecialchars($metaDesc) ?>"> <?php endif; ?> <?php if ($metaKeywords): ?> <meta name="keywords" content="<?= htmlspecialchars($metaKeywords) ?>"> <?php endif; ?> <!--ββ Geography (only adds tags if coords are present) ββ--> <?php if (!empty($profile['lat']) && !empty($profile['lon'])): ?> <meta name="geo.position" content="<?= $profile['lat'] ?>;<?= $profile['lon'] ?>"> <meta name="ICBM" content="<?= $profile['lat'] ?>, <?= $profile['lon'] ?>"> <?php endif; ?> <?php if (!empty($profile['city']) || !empty($profile['state'])): ?> <meta name="geo.placename" content="<?= htmlspecialchars(trim(($profile['city']??'').', '.($profile['state']??''), ' ,')) ?>"> <?php endif; ?> <!--ββ OpenΒ Graph (no images) ββ--> <meta property="og:type" content="website"> <meta property="og:url" content="<?= 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ?>"> <meta property="og:title" content="<?= htmlspecialchars($metaTitle) ?>"> <meta property="og:description" content="<?= htmlspecialchars($metaDesc) ?>"> <meta property="og:locale" content="en_US"> <!--ββ TwitterΒ Card (summaryβonly) ββ--> <meta name="twitter:card" content="summary"> <meta name="twitter:title" content="<?= htmlspecialchars($metaTitle) ?>"> <meta name="twitter:description" content="<?= htmlspecialchars($metaDesc) ?>"> <!--ββ Contact & identity (optional βΒ added only when present) ββ--> <?php if (!empty($profile['email'])): ?> <meta name="reply-to" content="<?= htmlspecialchars($profile['email']) ?>"> <?php endif; ?> <?php if (!empty($profile['phone'])): ?> <meta name="telephone" content="<?= htmlspecialchars($profile['phone']) ?>"> <?php endif; ?> <?php if (!empty($profile['website'])): ?> <meta name="url" content="<?= htmlspecialchars($profile['website']) ?>"> <?php endif; ?> <!--ββ Colour & PWA niceties (safe defaults) ββ--> <meta name="theme-color" content="#5c3bff"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="mobile-web-app-capable" content="yes"> <link rel="modulepreload" href="/socialPromptinator.js"> <style> :root{ --violet1:#5c3bff;--violet2:#3b1ecf;--gold:#ffb63b;--fg-ribbon:#fff; font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif; } body{margin:0;background:#f9fbff;color:#111;line-height:1.4;} main{max-width:960px;margin:2rem auto;padding:0 1rem;display:grid;gap:2rem} .mod-error{padding:1rem;border:2px dashed #c00;color:#c00;background:#fff5f5} /* -------- HERO -------- */ .hero{ position:relative;text-align:center;color:var(--fg-ribbon); padding:3.0rem 1rem 2.2rem; background: url("data:image/svg+xml,%3Csvg viewBox='0 0 120 6' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='6' cy='3' r='1.2' fill='%23ffffff22'/%3E%3C/svg%3E") center/6px repeat, linear-gradient(120deg,var(--violet1) 0%,var(--violet2) 100%); background-blend-mode:screen; } .hero h1{ margin:.05em 0 .25em;font-size:2.4rem;font-weight:900; background:linear-gradient(90deg,#ffffff 0%,#e9e6ff 90%); -webkit-background-clip:text;-webkit-text-fill-color:transparent; } .hero p{margin:.4em auto 0;font-size:1.15rem;font-weight:600;max-width:620px} .hero p::after{ content:'';display:block;margin:.55rem auto 0;width:50%;height:.12rem; background:#ffe480;border-radius:2px;opacity:.8; } .hero::after{ content:'';position:absolute;inset:0; background:linear-gradient(to bottom,transparent 72%,rgba(0,0,0,.06)); pointer-events:none; } /* logo */ .logo{ position:absolute;top:18px;left:22px;font-weight:900;letter-spacing:-.5px; text-decoration:none;font-size:1.35rem;line-height:1;z-index:3} .logo .b{color:#fff}.logo .d{color:#28d764}.logo .o{color:#ff3737} /* tier badge */ .badge{ position:absolute;top:18px;right:22px;padding:.48em 1.2em; border-radius:999px;font-size:.83rem;font-weight:800;z-index:3; display:flex;align-items:center;gap:.45em;text-transform:uppercase } .badge-prem{background:linear-gradient(90deg,#ffd54d 0%,#ffea96 100%);color:#473400} .badge-free{background:#ffe0e0;color:#7d0000} /* responsive tweaks */ @media(max-width:480px){ .logo{left:14px;font-size:1.2rem} .badge{right:14px;font-size:.74rem;padding:.42em 1em} .hero{padding-top:90px} } /* shared card scaffold */ .card{ background:#fff;border:3px solid var(--gold);border-radius:27px; box-shadow:0 8px 26px rgba(0,0,0,.06); } .card-pad{padding:1.8rem 1.6rem} main{ gap:1.25rem !important; /* default was 2rem β adjust to taste */ } </style> </head><body> <header class="hero"> <a class="logo" href="/" aria-label="Best Deal On"> <span class="b">BEST </span><span class="d">DEAL </span><span class="o">ON</span> </a> <?php if ($site['tier'] === 'premium'): ?> <div class="badge badge-prem">β Β Premium</div> <?php else: ?> <div class="badge badge-free">Free</div> <?php endif; ?> <h1><?= htmlspecialchars($site['hero']['heading']) ?></h1> <p><?= htmlspecialchars($site['hero']['sub']) ?></p> </header> <main> <?php /* ---------- include modules ---------- */ foreach ($modules as $m){ $abs = MOD_ROOT.'/'.$m['relative_path']; if (is_file($abs)) { try { include $abs; } catch (Throwable $e){ error_log($e); echo '<div class="mod-error">Module β'.htmlspecialchars($m['name']).'β failed.</div>'; } } else { echo '<div class="mod-error">Missing module '.htmlspecialchars($m['name']).'</div>'; } } ?> </main> </body></html>
Save changes
Create folder
writable 0777
Create
Cancel