Siteβ―Builder
Editing:
index.php
writable 0666
<?php // Path to business info (by phone) and questions feed $ph = isset($_GET['ph']) ? preg_replace('/[^\d]/','',$_GET['ph']) : ''; $bizFile = $_SERVER['DOCUMENT_ROOT'] . "/ph/$ph/business.json"; $biz = (is_readable($bizFile) ? json_decode(file_get_contents($bizFile), true) : []); $name = $biz['name'] ?? 'Business'; $slogan = $biz['slogan'] ?? ''; $desc = $biz['description'] ?? ''; $addr = $biz['address'] ?? ''; $city = $biz['city'] ?? ''; $state = $biz['state'] ?? ''; $zip = $biz['zip'] ?? ''; $tags = isset($biz['tags']) ? implode(', ', $biz['tags']) : ''; $displayBiz = "$name" . ($slogan ? " Β· $slogan" : ''); $qjsonFile = __DIR__ . "/ai-questions.json"; $qData = (is_readable($qjsonFile) ? json_decode(file_get_contents($qjsonFile), true) : []); $categories = array_keys($qData); $cat = (isset($_GET['cat']) && in_array($_GET['cat'],$categories)) ? $_GET['cat'] : $categories[0] ?? ''; $questions = $qData[$cat] ?? []; function makePrompt($q, $biz) { return "Business: {$biz['name']}\n" . ($biz['city'] && $biz['state'] ? "Location: {$biz['city']}, {$biz['state']}\n" : "") . "\nQuestion: $q"; } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>AI Business Research | <?= htmlspecialchars($name) ?></title> <meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="robots" content="noindex,follow"> <style> body { background:#f6f8fb; font-family:system-ui,Arial,sans-serif; margin:0; color:#22344d;} .header { padding:1.25em 0 .65em 0; background:#fff; text-align:center; border-bottom:1px solid #e3e7f4;} .logo { font-weight:900; font-size:1.24em; color:#5016A8; } .logo .d { color:#00c853; } .logo .o{ color:#ff1744; } h1 { font-size:1.16em; color:#176edc; margin:.2em 0 .3em 0;} .wrap { max-width:600px; margin:1.8em auto; background:#fff; border-radius:18px; box-shadow:0 2px 16px #bfcdfd23; padding:1.6em 1.4em 1.3em;} .bizcard { background:#f4f6ff; border-radius:10px; padding:.88em 1em .6em 1em; margin-bottom:1.35em; } .bizinfo { font-size:.97em; color:#356199; margin-bottom:.12em;} .slogan { color:#4c65b7; font-size:1.04em; font-weight:600; } .desc { color:#3d5469; font-size:.98em; margin-bottom:.32em;} .catnav { margin:1.3em 0 1.3em 0; } .catnav label { font-size:1.08em; color:#3d4e8e; font-weight:700; margin-right:.6em; } .catnav select { font-size:1.07em; padding:.35em 1.2em; border-radius:8px; border:1px solid #dde4f2; background:#f5faff;} .qsearch-list { margin:0; padding:0; } .qitem { list-style:none; margin:0 0 1.2em 0; padding:.97em 1em; background:#fff; border-radius:9px; border:1.5px solid #e6eaf3; box-shadow:0 1.5px 7px #dde3fd33; } .qtext { font-size:1.09em; margin-bottom:.6em; color:#2d416d; font-weight:500; } .ai-btns { display:flex; gap:.7em; margin-top:.15em; } .ai-btns a { display:inline-block; font-weight:600; font-size:.97em; color:#fff; text-decoration:none; border-radius:6px; padding:.37em 1.1em; background:#6c48ff; box-shadow:0 2px 11px #5b36ff11; transition:.16s; } .ai-btns a.perplexity { background:#1ca7ec; } .ai-btns a.copilot { background:#00c853; color:#173E22; } .ai-btns a:hover { filter:brightness(1.18);} @media (max-width:600px) { .wrap{padding:.53em .09em 1em .09em; max-width:99vw;} .qitem{padding:.77em .5em;} } .footer-note { font-size:.93em; color:#8f9ebc; text-align:center; margin:2.1em 0 .4em 0; letter-spacing:.02em; } .token{color:#5c3bff;font-weight:600;cursor:pointer} .popup-body{background:#fff;padding:1.25rem 1.5rem;border-radius:12px; box-shadow:0 4px 26px #0002;font-family:system-ui,Arial,sans-serif} iframe{border:1px solid #ccd;width:100%;min-height:340px;margin-top:.6rem} </style> </head> <body> <div class="header"> <span class="logo">BEST <span class="d">DEAL</span> <span class="o">ON</span></span> <span style="color:#8ea3b9;font-size:.97em;font-weight:400;margin-left:.7em;">AI Business Research</span> </div> <div class="wrap"> <h1><?= htmlspecialchars($displayBiz) ?></h1> <div class="bizcard"> <?php if($desc): ?><div class="desc"><?= htmlspecialchars($desc) ?></div><?php endif; ?> <div class="bizinfo"> <?= htmlspecialchars($addr) ?><?= $addr?', ':'' ?><?= htmlspecialchars($city) ?><?= $city?', ':'' ?><?= htmlspecialchars($state) ?> <?= htmlspecialchars($zip) ?> <?= $ph ? "<br><b>Phone:</b> ".htmlspecialchars($ph):"" ?> <?= $tags ? "<br><b>Tags:</b> ".htmlspecialchars($tags):"" ?> </div> </div> <?php if($categories): ?> <form class="catnav" method="get" action=""> <input type="hidden" name="ph" value="<?= htmlspecialchars($ph) ?>"> <label for="cat">Research Area:</label> <select name="cat" id="cat" onchange="this.form.submit()"> <?php foreach($categories as $c): ?> <option value="<?= htmlspecialchars($c) ?>"<?= $c==$cat?' selected':'' ?>><?= htmlspecialchars($c) ?></option> <?php endforeach; ?> </select> </form> <?php endif; ?> <ul class="qsearch-list"> <?php foreach ($questions as $qi => $q): // 1. This is the raw question (with shortcodes) for visible text: $q_visible = str_replace("\\n", "\n", $q); // 2. This is the full prompt (includes business info) sent to AI: $tpl = makePrompt($q_visible, $biz); ?> <li class="qitem" data-melanie-prompt="<?= htmlspecialchars($tpl, ENT_QUOTES) ?>"> <div class="qtext" data-m-output><?= htmlspecialchars($q_visible) ?></div> <div class="ai-btns"> <a href="#" class="chatgpt" data-m-ai="https://chatgpt.com/?prompt=">π§ ChatGPT</a> <a href="#" class="perplexity" data-m-ai="https://www.perplexity.ai/search?q=">π Perplexity</a> <a href="#" class="copilot" data-m-ai="https://copilot.microsoft.com/?q=">π€ Copilot</a> </div> </li> <?php endforeach; ?> </ul> </div> <div class="footer-note"> <span>π No data is sent to us. You use AI platforms direct. Prompts may be visible to 3rd parties. Always double-check answers.</span> </div> <!-- Melanie Promptinator loader --> <script src="/js/melanie-prompts.js"></script> </body> </html>
Save changes
Create folder
writable 0777
Create
Cancel