Site Builder
Editing:
profile-index.php
writable 0666
<?php $bizFile = __DIR__ . '/new-business.json'; if (is_readable(__DIR__.'/business.json')) { $bizFile = __DIR__.'/business.json'; // paid member } $biz = is_readable($bizFile) ? json_decode(file_get_contents($bizFile), true) : []; $name = $biz['name'] ?? 'Business'; $email = $biz['email'] ?? ''; $slogan = $biz['slogan'] ?? ''; $desc = $biz['description'] ?? ''; $addr = $biz['address'] ?? ''; $city = $biz['city'] ?? ''; $state = $biz['state'] ?? ''; $zip = $biz['zip'] ?? ''; $phone = $biz['phone'] ?? ''; $website = $biz['website'] ?? ''; $tags = $biz['tags'] ?? []; $location_tags = $biz['location_tags'] ?? []; $lat = $biz['lat'] ?? ''; $lon = $biz['lon'] ?? ''; $twitter = $biz['twitter'] ?? ''; $facebook = $biz['facebook'] ?? ''; $instagram = $biz['instagram'] ?? ''; $tiktok = $biz['tiktok'] ?? ''; $linkedin = $biz['linkedin'] ?? ''; $youtube = $biz['youtube'] ?? ''; $isPaid = is_readable(__DIR__.'/business.json'); // NEW: directory links $yelp = $biz['yelp'] ?? ''; $angi = $biz['angi'] ?? ''; $bbb = $biz['bbb'] ?? ''; $nextdoor = $biz['nextdoor'] ?? ''; $citystate = trim($city ? "$city, $state" : $state); $title = $name . ($citystate ? " in $citystate" : "") . " | BestDealOn"; $descMeta = $desc ?: ($slogan ? "$name: $slogan" : $name) . ($citystate ? " in $citystate" : ""); $keywords = array_unique(array_merge([$name, $city, $state, $zip], $tags, $location_tags)); $metaKeywords = implode(', ', array_filter($keywords)); $url = "https://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $country = "USA"; // --- Coupon data (for premium) $coupon = []; if ($isPaid && is_readable(__DIR__.'/coupon.json')) { $coupon = json_decode(file_get_contents(__DIR__.'/coupon.json'), true) ?: []; } // --- Social Helper function social_url($platform, $handle) { $handle = trim($handle); if (!$handle) return ''; if (preg_match('~^https?://~', $handle)) return $handle; $handle = ltrim($handle, '@'); switch(strtolower($platform)) { case 'twitter': return "https://twitter.com/$handle"; case 'facebook': return "https://facebook.com/$handle"; case 'instagram': return "https://instagram.com/$handle"; case 'tiktok': return "https://tiktok.com/@" . $handle; case 'linkedin': return "https://linkedin.com/in/$handle"; case 'youtube': return "https://youtube.com/@" . $handle; default: return $handle; } } // Slug helpers function h($s){ return htmlspecialchars($s, ENT_QUOTES, 'UTF-8'); } function tag_slug($str) { return strtolower(trim(preg_replace('/[^a-z0-9]+/i', '-', $str), '-')); } function city_folder($city) { $slug = strtolower(str_replace(' ', '-', $city)); return ucfirst($slug); } function format_phone($n) { $n = preg_replace('/\D/', '', $n); if(strlen($n)===10) return "(".substr($n,0,3).") ".substr($n,3,3)."‑".substr($n,6); return $n; } $cityslug = city_folder($city); $stateslug = strtoupper($state); // --- Social links (fixed) $socialLinks = []; if ($twitter) $socialLinks[] = ['Twitter/X', social_url('twitter', $twitter), '🐦']; if ($facebook) $socialLinks[] = ['Facebook', social_url('facebook', $facebook), '📘']; if ($instagram) $socialLinks[] = ['Instagram', social_url('instagram', $instagram), '📸']; if ($tiktok) $socialLinks[] = ['TikTok', social_url('tiktok', $tiktok), '🎵']; if ($linkedin) $socialLinks[] = ['LinkedIn', social_url('linkedin', $linkedin), '💼']; if ($youtube) $socialLinks[] = ['YouTube', social_url('youtube', $youtube), '▶️']; if ($yelp) $socialLinks[] = ['Yelp', $yelp, '⭐️']; if ($angi) $socialLinks[] = ['Angi', $angi, '🟠']; if ($bbb) $socialLinks[] = ['BBB', $bbb, '🏛️']; if ($nextdoor) $socialLinks[] = ['Nextdoor', $nextdoor, '🏡']; ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title><?= h($title) ?></title> <meta name="viewport" content="width=device-width,initial-scale=1"> <link rel="icon" href="/bestdealon.svg" type="image/svg+xml"> <meta name="description" content="<?= h($descMeta) ?>"> <meta name="keywords" content="<?= h($metaKeywords) ?>"> <link rel="canonical" href="<?= h($url) ?>"> <meta property="og:title" content="<?= h($title) ?>"> <meta property="og:description" content="<?= h($descMeta) ?>"> <meta property="og:type" content="website"> <meta property="og:url" content="<?= h($url) ?>"> <meta property="og:site_name" content="BestDealOn"> <?php if($lat && $lon): ?> <meta name="geo.position" content="<?= h("$lat;$lon") ?>"> <meta name="ICBM" content="<?= h("$lat, $lon") ?>"> <meta property="og:latitude" content="<?= h($lat) ?>"> <meta property="og:longitude" content="<?= h($lon) ?>"> <?php endif; ?> <meta name="geo.placename" content="<?= h($citystate) ?>"> <meta name="geo.region" content="US-<?= h($stateslug) ?>"> <link rel="modulepreload" href="/businessPromptinator.js"> <style> body {background:#f5f8fb;font-family:system-ui,Arial,sans-serif;margin:0;color:#1b334a;} .top-bar{display:flex;justify-content:space-between;align-items:center;background:#eee;padding:.6rem 1rem;} .logo{font-weight:900;letter-spacing:-.5px;text-decoration:none;line-height:1;} .logo .b{color:#2357d7;} .logo .d{color:#2357d7;} .logo .o{color:#2357d7;} nav.breadcrumb a{color:#0366d6;text-decoration:none;} nav.breadcrumb span{margin:0 .25rem;} .biz-card {max-width: 470px; margin:2.2em auto 1.7em auto; background:#fff; border-radius:20px; box-shadow:0 2px 16px #dde3fa26; padding:2.2em 1.4em 1.3em 1.4em;} .biz-card h1 { color:#2c61d7; font-size:1.49em; margin:0 0 .32em 0;} .slogan { font-style:italic; color:#2e6eb0; margin-bottom:.2em; font-size:1.08em;} .desc { color:#364868; font-size:1.07em; margin-bottom:1.05em; } .fieldblock { margin-bottom:1.12em;} .fieldrow { display:flex; gap:1.25em; flex-wrap:wrap;} .flabel { font-weight:600; color:#23487b; width:95px; min-width:65px; } .fval { color:#364868; } .tags { margin:.7em 0 0 0; } .tag, .tags a.tag { display:inline-block; background:#e5f0fd; color:#0d3e7e; border-radius:15px; padding:.2em .95em; margin:0 .15em .18em 0; font-size:.98em; text-decoration:none; transition:.14s;} .tags a.tag:hover { background:#0d3e7e; color:#fff; } .show-more-link {margin-left:.4em;font-size:.99em;text-decoration:underline;color:#2585b4;cursor:pointer;} .social-block { max-width:470px; margin:2.2em auto 0 auto; background:#fafdfe; border-radius:15px; box-shadow:0 1.5px 10px #c0d0ff15; padding:1.35em 1em .8em 1em; border:1.5px solid #e2eefd; text-align:center; } .social-block-title { font-size:1.13em; font-weight:700; color:#234c96; margin-bottom:.8em;} .social-links { display:flex; gap:1em; justify-content:center; flex-wrap:wrap;} .social-links a {display:inline-flex;align-items:center;gap:.3em;text-decoration:none;font-size:1.09em;background:#f1f4fc;color:#2967bc;padding:.43em 1.1em;border-radius:10px;font-weight:600;} .social-links a:hover {background:#c9dfff;} .paid-block, .free-block { max-width:470px; margin:2.2em auto 1.6em auto; background:#fffbe6; border:1.6px solid #f3e5b7; border-radius:13px; padding:1.55em 1.25em; text-align:center; } .paid-block { background:#e9f7eb; border-color:#b4e8b4; } .paid-block-title { font-size:1.15em; color:#2357d7; font-weight:700; margin-bottom:.5em;} .free-block-title { font-size:1.15em; color:#b48b12; font-weight:700; margin-bottom:.5em;} /* Coupon block styles */ .coupon-business-block {max-width:470px; margin:2.5em auto 0 auto;} .coupon-demo-msg {text-align:center; margin-bottom:1.1em; font-size:1.11em; font-weight:700; color:#a75608;} .coupon-demo-desc {text-align:center; margin-bottom:1em; color:#56411e;} .coupon-demo-desc span { background:#fffbe6; padding:.7em 1em; border-radius:11px; display:inline-block; } .coupon-preview { background:#fff; border:3.5px solid #ffb63b; border-radius:27px; max-width:500px; margin:auto; padding:2.2em 2em 1.5em 2em; box-shadow:0 10px 38px #c59e6933, 0 2.5px 17px #fae1a1; position:relative; overflow:hidden; transition: max-width .25s; } .coupon-preview h2 {margin:0 0 .46em 0;color:#df6200;font-size:1.29em;} .coupon-preview .desc {font-size:1.11em;color:#56411e;margin-bottom:1.18em;line-height:1.5;} .coupon-preview .row {display:flex;justify-content:space-between;align-items:center;margin-bottom:.3em;} .coupon-preview .label {font-weight:700;color:#ab2d00;font-size:1.05em;} .coupon-preview .code { background:#ffefc1;border-radius:9px;display:inline-block;padding:.37em 2.1em;font-size:1.09em;color:#a95600;font-family:monospace;font-weight:700; letter-spacing:.08em;box-shadow:0 1px 8px #ffbe4e42; } .coupon-preview .expiry {font-size:1.06em;color:#a75608;font-weight:600;} .coupon-demo-fade {opacity:0.77;} @media(max-width:600px){ .biz-card,.coupon-business-block,.social-block,.paid-block,.free-block{padding:1.2em .15em 1em .15em; max-width:99vw;} .fieldrow { flex-direction:column; gap:.1em;} .flabel{width:auto; min-width:0;} } /* ---------- 2025‑07‑08: mobile polish (non‑breaking override) ---------- */ @media (max-width:600px){ /* 1) neat margin so text doesn’t touch the glass */ body{padding-left:1rem;padding-right:1rem;} /* 2) header – logo on top, links underneath, all centred */ .top-bar{ flex-direction:column; align-items:center; text-align:center; gap:.4rem; /* little breathing‑room */ } nav.breadcrumb{white-space:normal;} /* allow wrap */ /* 3) business‑card fields – one item per row */ .biz-card .fieldrow{display:block;margin-bottom:.65rem;} .biz-card .flabel {display:block;width:auto;margin-bottom:2px;} .biz-card .fval {display:block;} } /* Base link color */ a:link, a:visited { color: #003366; /* dark navy-blue */ text-decoration: underline; /* keeps an underline for clarity */ transition: color 0.2s ease; /* smooth color fade */ } /* Hover & focus state */ a:hover, a:focus { color: #001f4d; /* even darker on hover */ text-decoration: none; /* removes underline on hover for contrast */ } </style> </head> <body> <div class="top-bar"> <a class="logo" href="/"><span class="b">BEST </span><span class="d">DEAL </span><span class="o">ON</span></a> <nav class="breadcrumb" aria-label="Breadcrumb"> <a href="/">Index</a><span>/</span> <a href="/geo/<?= h($country) ?>/<?= h($stateslug) ?>/"><?= h($stateslug) ?></a><span>/</span> <?php if($cityslug): ?><a href="/geo/<?= h($country) ?>/<?= h($stateslug) ?>/<?= h($cityslug) ?>/"><?= h($city) ?></a><span>/</span><?php endif; ?> <span><?= h($name) ?></span> </nav> </div> <div class='biz-card'> <h1><?= h($name) ?></h1> <?php if($slogan): ?><div class='slogan'><?= h($slogan) ?></div><?php endif; ?> <?php if($desc): ?><div class='desc'><?= h($desc) ?></div><?php endif; ?> <div class='fieldblock'> <!-- compact “post‑card” address --> <?php if($addr || $city || $state || $zip): ?> <address class="biz-address"> <!-- compact address that still lines up on desktop --> <div class="fieldrow address-row"> <span class="flabel">Address:</span> <span class="fval"> <?php if($addr) echo h($addr).'<br>'; ?> <?php // City, ST ZIP (handles any missing parts gracefully) echo h( trim( ($city ?: '') . ($city && $state ? ', ' : '') . ($state ?: '') . ($zip ? ' '.$zip : '') ) ); ?> </span> </div> </address> <?php endif; ?> <?php if($phone): ?> <div class="fieldrow"><span class='flabel'>Phone:</span> <span class='fval'><b><?= h(format_phone($phone)) ?></b></span></div> <?php endif; ?> <?php if($website): ?> <div class="fieldrow"><span class='flabel'>Website:</span> <span class='fval'><a href="<?= h($website) ?>"><?= h($website) ?></a></span></div> <?php endif; ?> </div> <!-- === ADD MY tags BLOCK: APPEARS UNDER BIZ CARD, MATCHES THEME === --> <div class='tags' id="tags-block"> <?php $tagLimit = 2; // Service tags $countTags = is_array($tags) ? count($tags) : 0; if($countTags) { echo "<span class='bold'>Service Tags:</span> "; foreach($tags as $i => $t) { $slug = tag_slug($t); $isHidden = $i >= $tagLimit ? 'style="display:none"' : ''; if ($isPaid) echo "<a class='tag service-tag' $isHidden href='/geo/$country/$stateslug/$cityslug/business.php?type=" . urlencode($slug) . "' title='See all " . h($t) . " businesses in " . h($city) . ", $stateslug'>" . h($t) . "</a>"; else echo "<span class='tag service-tag' $isHidden>" . h($t) . "</span>"; } if ($countTags > $tagLimit) { echo '<button type="button" class="show-more-link" data-type="service" onclick="showMoreTags(this)" style="background:none;border:none;padding:0;margin-left:.5em;color:#2574bc;font-size:.99em;text-decoration:underline;cursor:pointer;">Show more</button>'; } } // Location tags $countLocTags = is_array($location_tags) ? count($location_tags) : 0; if($countLocTags) { echo "<br><span class='bold'>Location Tags:</span> "; foreach($location_tags as $i => $t) { $locCitySlug = ucfirst(strtolower(str_replace(' ', '-', $t))); $isHidden = $i >= $tagLimit ? 'style="display:none"' : ''; if ($isPaid) echo "<a class='tag location-tag' $isHidden href='/geo/$country/$stateslug/$locCitySlug/' title='See all businesses in " . h($t) . ", $stateslug'>" . h($t) . "</a>"; else echo "<span class='tag location-tag' $isHidden>" . h($t) . "</span>"; } if ($countLocTags > $tagLimit) { echo '<button type="button" class="show-more-link" data-type="location" onclick="showMoreTags(this)" style="background:none;border:none;padding:0;margin-left:.5em;color:#2574bc;font-size:.99em;text-decoration:underline;cursor:pointer;">Show more</button>'; } } ?> </div> <div class='footer'>User Generated Business Page by BestDealOn.com</div> </div> <!-- === ADD MY LIST BLOCK: APPEARS UNDER BIZ CARD, MATCHES THEME === --> <?php $phoneDigits = preg_replace('/\D/', '', $phone); $mylistCookie = $_COOKIE['mybizlist'] ?? ''; $mylistArr = array_filter(explode('-', $mylistCookie), function($n){ return preg_match('/^\d{10}$/', $n); }); $inList = in_array($phoneDigits, $mylistArr); ?> <?php if($phoneDigits): ?> <div id="add-to-my-list-block" style="max-width:470px;margin:2em auto 0 auto;text-align:center;"> <button id="myListBtn" style="display:inline-block;background:<?= $inList ? '#2357d7' : '#2357d7' ?>;color:#fff;font-size:1.09em;font-weight:700;padding:.68em 2.2em;border-radius:11px;text-decoration:none;box-shadow:0 2px 10px #41b6da23;transition:.2s;cursor:pointer;border:none;" onclick="toggleMyList('<?= $phoneDigits ?>')"> <?= $inList ? "Remove from My List" : "Add to My List" ?> </button> <?php if($inList): ?> <div style="margin-top:.7em;"> <a href="/my-list/" style="font-size:1.04em;color:#2357d7;text-decoration:underline;">View My List</a> </div> <?php endif; ?> </div> <?php endif; ?> <?php /* =============================================================== * RECOMMENDED LINKS BLOCK – card‑aligned version * ============================================================= */ $baseDir = $dir ?? $bizdir ?? dirname(__FILE__); $linksFile = $baseDir.'/links.json'; $links = is_readable($linksFile) ? json_decode(file_get_contents($linksFile),true,512,JSON_THROW_ON_ERROR) : []; if (!is_array($links)) $links = []; /* helper */ $esc = fn($s)=>htmlspecialchars($s??'',ENT_QUOTES,'UTF-8'); ?> <?php if ($links): ?> <section class="section" style="padding-top:2.2rem"> <!-- top gap --> <div style=" background:#fffbe6;border:2px solid #ffd973;border-radius:18px; padding:2.1rem 1.8rem;box-shadow:0 4px 20px #f5db9c3c; max-width:450px;margin:0 auto 2.4rem;"> <!-- bottom gap --> <h2 style="display:flex;align-items:center;gap:.55em;margin-top:0"> <span style="font-size:1.3em">🔗</span> <span style="font-size:1.27rem;color:#263238;font-weight:700">Recommended Links</span> </h2> <style> /* scoped list styling */ .link-list{max-width:450px;margin:0 auto;padding:0;list-style:none} .link-list li{margin:1.1em 0} .link-list a{font-size:1.04rem;color:#1a0dab;text-decoration:none} .link-list a:hover{text-decoration:underline} .link-list .url{font-size:.83rem;color:#006621;margin-top:.1em} .link-list .excerpt{font-size:.9rem;color:#545454;margin-top:.25em;line-height:1.35} </style> <ul class="link-list"> <?php foreach (array_slice($links,0,5) as $l): if (empty($l['title'])||empty($l['url'])) continue; $uDisp = preg_replace('#^https?://#i','',$l['url']); ?> <li itemscope itemtype="https://schema.org/CreativeWork"> <a href="<?= $esc($l['url']) ?>" target="_blank" rel="noopener" itemprop="url"> <span itemprop="headline"><?= $esc($l['title']) ?></span> </a> <div class="url"><?= $esc($uDisp) ?></div> <?php if(!empty($l['excerpt'])): ?> <div class="excerpt" itemprop="description"><?= $esc($l['excerpt']) ?></div> <?php endif; ?> </li> <?php endforeach; ?> </ul> </div> </section> <?php elseif (!empty($isPaid)): /* premium user, no links yet */ ?> <section class="section" style="padding-top:2.2rem"> <div style=" background:#fffbe6;border:2px solid #ffd973;border-radius:18px; padding:1.6rem 1.8rem;box-shadow:0 4px 20px #f5db9c3c; max-width:450px;margin:0 auto 2.4rem;text-align:center"> <h2 style="display:flex;justify-content:center;align-items:center;gap:.55em;margin-top:0"> <span style="font-size:1.3em">🔗</span> <span style="font-size:1.27rem;color:#263238;font-weight:700">Recommended Links</span> </h2> <p style="font-size:.94rem;color:#555;margin:.4em 0 0"> No links added yet. Use your <b>Links Editor</b> to showcase articles, sponsors or resources here. </p> </div> </section> <?php else: /* free listing – gentle upsell */ ?> <section class="section" style="padding-top:2.2rem"> <div style=" background:#fffbe6;border:2px solid #ffd973;border-radius:18px; padding:1.6rem 1.8rem;box-shadow:0 4px 20px #f5db9c3c; max-width:450px;margin:0 auto 2.4rem;text-align:center"> <h2 style="display:flex;justify-content:center;align-items:center;gap:.55em;margin-top:0"> <span style="font-size:1.3em">🔗</span> <span style="font-size:1.27rem;color:#263238;font-weight:700">Recommended Links</span> </h2> <p style="font-size:.94rem;color:#555;margin:.4em 0 0"> Upgrade to a verified creator / premium listing to display your favourite links right on your profile. </p> </div> </section> <?php endif; ?> <!-- /Recommended Links block --> <?php /* ================================================================ * UNIVERSAL COUPON VIEW * – Handles single coupon or an array of coupons. * ================================================================ */ /* ---------- 0. Helper values ---------- */ $descLimit = 160; $businessHeading = h($name) . ' Coupon'; /* Format phone once */ $formattedPhone = ''; if (!empty($phone)) { $digits = preg_replace('/\D/', '', $phone); $formattedPhone = (strlen($digits) === 10) ? '(' . substr($digits, 0, 3) . ') ' . substr($digits, 3, 3) . '‑' . substr($digits, 6) : h($phone); } /* ---------- 1. Normalise $coupon ---------- */ $couponList = []; if ($isPaid && !empty($coupon)) { $couponList = (isset($coupon[0]) && is_array($coupon[0])) ? $coupon : [$coupon]; } ?> <style> @media print{ .coupon-toolbar,.coupon-btn{display:none!important} .desc-screen,#readMoreLink,#showLessLink{display:none!important} .desc-print{display:block!important} } .desc-print{display:none} /* flash when opened via #hash link */ .coupon-highlight{ animation:flashBorder 2s linear 1; } @keyframes flashBorder{ 0%,100%{box-shadow:0 10px 38px #f5db9c3c,0 0 0 4px #ffb63b} 50% {box-shadow:0 14px 48px #fcd78b,0 0 0 6px #ffd16d} } </style> <?php if ($isPaid && $couponList): ?> <?php foreach ($couponList as $i => $cp): /* ---------- 2. Per‑coupon variables ---------- */ if (empty($cp['title'])) continue; // skip blanks $title = $cp['title'] ?? ''; $code = $cp['code'] ?? ''; $expiry = $cp['expiry'] ?? ''; $descRaw = trim($cp['desc'] ?? ''); $descFull = nl2br(h($descRaw)); $descShort = nl2br(h(mb_substr($descRaw, 0, $descLimit, 'UTF-8'))); $hasMore = mb_strlen($descRaw, 'UTF-8') > $descLimit; /* IDs */ $codeClean = preg_replace('/\W+/', '', $code) ?: 'nocode'; $cardID = "coupon-{$codeClean}-{$i}"; // hash fragment / element id $uid = "cp{$i}"; // internal unique base ?> <style> /* Print rules must reference the unique IDs for this card */ @media print{ #<?= $cardID ?> .coupon-toolbar, #<?= $cardID ?> .coupon-btn{display:none!important} #<?= $cardID ?> .desc-screen{display:none!important} #<?= $cardID ?> .desc-print{display:block!important} } #<?= $cardID ?> .desc-print{display:none} </style> <div style="max-width:470px;margin:2.5em auto"> <div id="<?= $cardID ?>" class="coupon-preview" itemscope itemtype="https://schema.org/Offer" style="background:#fff;border:3.5px solid #ffb63b;border-radius:27px;max-width:500px;margin:auto;padding:2.2em 2em 1.5em;box-shadow:0 10px 38px #f5db9c3c;position:relative;overflow:hidden"> <div style="text-align:center;font-weight:800;font-size:1.12em;letter-spacing:.01em;color:#194285;border-bottom:1px solid #ef8f13;padding-bottom:.13em;margin-bottom:1em"> <?= $businessHeading ?> </div> <div class="coupon-title" style="font-size:1.18em;font-weight:800;color:#df6200;margin-bottom:.12em"> <?= h($title) ?> </div> <!-- DESCRIPTION (event‑delegated read/less) --> <div id="desc-<?= $uid ?>" class="desc desc-screen" style="font-size:1.07em;color:#3a3232;margin-bottom:1.25em;line-height:1.5;min-width:100%"> <?php if ($hasMore): ?> <?= $descShort ?> <button id="read-<?= $uid ?>" type="button" style="background:none;border:none;padding:0;margin-left:.27em;color:#2574bc;font-size:.98em;text-decoration:underline;cursor:pointer"> Read More </button> <?php else: ?> <?= $descFull ?> <?php endif; ?> </div> <!-- PRINT‑ONLY --> <div class="desc desc-print" style="font-size:1.07em;color:#3a3232;margin-bottom:1.25em;line-height:1.5"> <?= $descFull ?> </div> <!-- CODE / EXPIRY --> <div style="display:flex;gap:2.1em;align-items:center;margin-bottom:.4em"> <span style="font-weight:700;color:#ab2d00;font-size:1.05em">Coupon Code:</span> <span style="background:#ffefc1;border-radius:9px;display:inline-block;padding:.34em 1.8em;font-size:1.1em;color:#a95600;font-family:monospace;font-weight:700;letter-spacing:.09em;box-shadow:0 1px 8px #ffbe4e42"> <?= h($code) ?> </span> </div> <div style="display:flex;gap:2.1em;align-items:center;margin-bottom:.4em"> <span style="font-weight:700;color:#ab2d00;font-size:1.05em">Expires:</span> <span style="font-size:1.08em;color:#a75608;font-weight:600"><?= h($expiry ?: 'No Expiry') ?></span> </div> <!-- PHONE (optional) --> <?php if ($formattedPhone): ?> <div style="text-align:center;margin:.65em 0 0"> <a href="tel:<?= preg_replace('/\D/','',$phone) ?>" style="font-size:1.08em;color:#1565c0;background:#f6fafd;border-radius:7px;padding:.41em 1.35em;display:inline-block;font-weight:700;text-decoration:none;letter-spacing:.02em;box-shadow:0 1px 4px #e3eefd"> 📞 <?= $formattedPhone ?> </a> </div> <?php endif; ?> <!-- TOOLBAR --> <div class="coupon-toolbar" style="display:flex;justify-content:center;gap:1.3em;margin:1.15em 0 0"> <button id="print-<?= $uid ?>" class="coupon-btn" style="padding:.67em 1.75em;border-radius:11px;font-size:1.09em;font-weight:700;border:none;cursor:pointer;box-shadow:0 1px 5px #ffeebb50;background:#ffeebb;color:#000000;display:flex;align-items:center;gap:.6em"> 🖨️ Print </button> <button id="share-<?= $uid ?>" class="coupon-btn" style="padding:.67em 1.75em;border-radius:11px;font-size:1.09em;font-weight:700;border:none;cursor:pointer;box-shadow:0 1px 5px #ffeebb50;background:#ffeebb;color:#000000;display:flex;align-items:center;gap:.6em"> 📤 Share </button> </div> </div> </div> <script> (() => { /* Cached strings so we don’t keep php vars around */ const uid = '<?= $uid ?>'; const cardID = '<?= $cardID ?>'; const hasMore = <?= $hasMore ? 'true' : 'false' ?>; const descFull = <?= json_encode($descFull) ?>; const descShort = <?= json_encode($descShort) ?>; const titleText = <?= json_encode($title) ?>; const codeText = <?= json_encode($code) ?>; /* ---------- A. READ‑MORE / SHOW‑LESS (event delegation) ---------- */ const descDiv = document.getElementById('desc-' + uid); if (hasMore && descDiv) { descDiv.addEventListener('click', e => { const id = e.target.id || ''; if (id === 'read-' + uid) { /* Expand */ descDiv.innerHTML = descFull + '<button id="less-'+uid+'" type="button" style="background:none;border:none;padding:0;margin-left:.4em;color:#2574bc;font-size:.98em;text-decoration:underline;cursor:pointer">Show Less</button>'; } else if (id === 'less-' + uid) { /* Collapse */ descDiv.innerHTML = descShort + '<button id="read-'+uid+'" type="button" style="background:none;border:none;padding:0;margin-left:.27em;color:#2574bc;font-size:.98em;text-decoration:underline;cursor:pointer">Read More</button>'; } }); } /* ---------- B. PRINT ---------- */ const printBtn = document.getElementById('print-' + uid); if (printBtn) { printBtn.addEventListener('click', () => { const html = document.getElementById(cardID).outerHTML; const w = window.open('', '', 'width=600,height=800'); w.document.write( '<html><title>Print Coupon</title><body style="margin:0;background:#f5f8fb;font-family:system-ui,Arial,sans-serif;">' + html + '</body></html>'); w.document.close(); setTimeout(() => { w.print(); w.close(); }, 250); }); } /* ---------- C. SHARE (deep‑link) ---------- */ const shareBtn = document.getElementById('share-' + uid); if (shareBtn) { shareBtn.addEventListener('click', async e => { const url = location.href.split('#')[0] + '#' + cardID; const shareData = { title: titleText, text: `${titleText} – use code ${codeText}`, url }; try { if (navigator.share) { await navigator.share(shareData); } else { await navigator.clipboard.writeText(url); shareBtn.textContent = '✅ Copied!'; setTimeout(() => (shareBtn.textContent = '📤 Share'), 1500); } } catch { /* user cancelled – ignore */ } }); } })(); </script> <?php endforeach; ?> <!-- ---------- D. Bring card into view when opened with #fragment ---------- --> <script> window.addEventListener('DOMContentLoaded', () => { const id = location.hash ? location.hash.substring(1) : ''; const el = id && document.getElementById(id); if (el) { el.classList.add('coupon-highlight'); el.scrollIntoView({behavior: 'smooth', block: 'center'}); } }); </script> <?php else: ?> <!-- DEMO / NON‑PAID BLOCK – leave your existing markup here --> <?php endif; ?> <!-- === ADD MY Phone Contacts BLOCK: APPEARS UNDER BIZ CARD, MATCHES THEME === --> <?php if($isPaid && $phone): ?> <div class="add-contact-block" style="max-width:470px; margin:2.2em auto 0 auto; background:#e5f7fa; border-radius:18px; box-shadow:0 1.5px 10px #54d3ef2a; padding:1.45em 1.2em 1.1em 1.2em; text-align:center;"> <div style="font-size:1.2em; font-weight:700; color:#2357d7; margin-bottom:1.1em;"> 📇 Add This Business To Your Phone Contacts </div> <a href="/ph/generate-vcf.php?ph=<?= h(preg_replace('/\D/', '', $phone)) ?>" class="add-contact-btn" style="display:inline-block; background:#2357d7; color:#fff; font-size:1.13em; font-weight:700; padding:.83em 2.6em; border-radius:12px; text-decoration:none; box-shadow:0 2px 10px #41b6da23; transition:.2s;"> 👉 Click Here To Save Contact </a> <div style="color:#2357d7; font-size:.99em; margin-top:.7em;"> Tap to instantly add our info to your phone’s address book. </div> </div> <?php endif; ?> <!-- QR CODE LINKS BLOCK (with deferred fetch) --> <?php $qrName = h($name . ' -BestDealOn'); $qrPhone = preg_replace('/\D/','', $phone); $qrUrl = "https://bestdealon.com/" . $qrPhone; $qrVcard = "BEGIN:VCARD\nVERSION:3.0\nFN:$qrName\nTEL;TYPE=WORK,VOICE:$phone\nURL:$qrUrl\nEND:VCARD"; // URL-encode for QR generator: $qrVcardUrl = urlencode($qrVcard); $qrImgUrl = "https://api.qrserver.com/v1/create-qr-code/?size=170x170&data=$qrVcardUrl"; ?> <div id="qr-container" style=" display: flex; flex-direction: column; align-items: center; margin: 1.4em 0 0; gap: .7em; "> <!-- spinner placeholder --> <div id="qr-spinner" style=" width: 170px; height: 170px; display: flex; align-items: center; justify-content: center; border-radius: 14px; background: #f0f0f0; "> <div style=" width: 24px; height: 24px; border: 4px solid rgba(0,0,0,0.1); border-top-color: #0041A5; border-radius: 50%; animation: spin .8s linear infinite; "></div> </div> <!-- hidden QR image --> <img id="qr-img" alt="Save business contact QR for <?= htmlspecialchars($name, ENT_QUOTES, 'UTF-8') ?>" style=" display: none; width: 170px; height: 170px; border-radius: 14px; box-shadow: 0 1.5px 10px #e3eefd; " /> <div style=" font-size: 1.09em; color: #2b4f8c; font-weight: 700; "> Scan to Save Contact </div> </div> <style> @keyframes spin { to { transform: rotate(360deg); } } </style> <script> document.addEventListener('DOMContentLoaded', () => { const spinner = document.getElementById('qr-spinner'); const img = document.getElementById('qr-img'); const url = '<?= $qrImgUrl ?>'; fetch(url) .then(res => { if (!res.ok) throw new Error(`QR fetch failed: ${res.status}`); return res.blob(); }) .then(blob => { img.src = URL.createObjectURL(blob); img.onload = () => { spinner.style.display = 'none'; img.style.display = 'block'; }; }) .catch(err => { console.error(err); spinner.textContent = '❌'; }); }); </script> <!-- SOCIAL LINKS BLOCK --> <?php if($socialLinks): ?> <div class="social-block"> <div class="social-block-title">Follow <?= h($name) ?> on Social Media</div> <div class="social-links"> <?php foreach($socialLinks as list($label,$url,$icon)): ?> <a href="<?= h($url) ?>" target="_blank" rel="noopener"><?= $icon ?> <?= h($label) ?></a> <?php endforeach; ?> </div> </div> <?php else: ?> <div class="social-block"> <div class="social-block-title">Follow <?= h($name) ?> on Social Media</div> <div style="color:#8e94a9;font-size:1.01em;">No social profiles added yet.</div> </div> <?php endif; ?> <!-- PAID/AI BLOCK --> <?php if($isPaid): ?> <div class="paid-block"> <div class="paid-block-title">AI Business Tools & Member Control Panel <span style="font-size:1.1em;">🤖</span></div> <div> Welcome, premium member! Soon you'll unlock advanced AI tools for reputation monitoring, B2B research, review aggregation, competitor analysis, and more—right from your business dashboard.<br><br> <b>Coming Soon:</b> Manage your business details, see AI-powered insights, connect with new customers, and control your BestDealOn profile here. </div> </div> <?php else: ?> <div class="free-block"> <div class="free-block-title">Become a Premium Member & Unlock AI Power!</div> <div> <b>Upgrade today</b> to add links, highlight your business, and unlock exclusive AI-driven features!<br><br> <ul style="text-align:left;max-width:420px;margin:1em auto 0 auto;line-height:1.6;"> <li>AI-powered review summaries and competitor tracking</li> <li>Automated lead and reputation management</li> <li>Rich business analytics & B2B research</li> <li>Priority customer support and more!</li> </ul> <a href="/advertise.php?geo=<?= h(strtolower($cityslug).'-'.$stateslug.'-advertising') ?>" style="background:#ef8f13;color:#fff;padding:.65em 2.3em;border-radius:9px;font-weight:700;text-decoration:none;display:inline-block;margin-top:.7em;font-size:1.06em;">Become a Member</a> </div> </div> <?php endif; ?> <?php /* ---------- “Book a Show / Ask a Question” contact form ---------- */ /* ─ renders only for premium profiles that have a valid e-mail ─ */ $email = $biz['email'] ?? ''; if ($isPaid && filter_var($email, FILTER_VALIDATE_EMAIL)): $businessName = $name ?: 'Your Business'; ?> <!-- scoped styles for form --> <!-- scoped styles for form --> <style> .scf-container { max-width: 470px; margin: 2.4rem auto; font-family: system-ui, Arial, sans-serif; } .scf-form { background: #fff; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); overflow: hidden; } .scf-header { background: #9C27B0; /* Purple 500 */ color: #fff; /* white text */ padding: 1em; text-align: center; font-weight: 700; font-size: 1.25rem; line-height: 1.2; } .scf-header span { display: block; font-size: .875rem; font-weight: 600; opacity: .9; margin-top: .25em; color: #fff; } .scf-body { padding: 1em; color: #000; } .scf-group { display: flex; flex-wrap: wrap; gap: 1em; margin-top: 1em; } .scf-group:first-of-type { margin-top: 0; } .scf-group > div { flex: 1 1 150px; min-width: 120px; } .scf-label { display: block; font-weight: 600; color: #000; margin-bottom: .5em; font-size: .95rem; } .scf-input, .scf-select, .scf-textarea { width: 100%; padding: .6em .8em; border: 1px solid #CCC; border-radius: 6px; font-size: 1rem; color: #000; background: #F9F9F9; transition: border-color .2s, background .2s; } .scf-input:focus, .scf-select:focus, .scf-textarea:focus { border-color: #64B5F6; background: #FFF; outline: none; } .scf-toggle { display: block; text-align: right; font-size: .9rem; color: #000; font-weight: 600; text-decoration: none; margin-top: 1em; } .scf-toggle:hover { text-decoration: underline; } .scf-extra { display: none; margin-top: .75em; } .scf-button-container { text-align: right; margin-top: 1.5em; } .scf-button { background: #9C27B0; /* Purple 500 */ color: #fff; /* white text */ font-weight: 700; padding: .7em 2em; border: none; border-radius: 6px; box-shadow: 0 2px 6px rgba(0,0,0,0.1); font-size: 1rem; cursor: pointer; transition: background .2s; } .scf-button:hover { background: #7B1FA2; /* Purple 700 on hover */ } </style> <div class="scf-container"> <form id="scfForm" class="scf-form" onsubmit="return scfSend(event);"> <!-- header ribbon --> <div class="scf-header"> Get Quote / Ask a Question <span>Contact <?= htmlspecialchars($handle) ?></span> </div> <div class="scf-body"> <!-- name --> <div class="scf-group"> <div> <label for="scfFirst" class="scf-label">First:</label> <input id="scfFirst" name="first" type="text" maxlength="32" required class="scf-input"> </div> <div> <label for="scfLast" class="scf-label">Last:</label> <input id="scfLast" name="last" type="text" maxlength="32" required class="scf-input"> </div> </div> <!-- email / phone --> <div class="scf-group"> <div> <label for="scfEmail" class="scf-label">Your E-mail:</label> <input id="scfEmail" name="email" type="email" maxlength="60" required class="scf-input"> </div> <div> <label for="scfPhone" class="scf-label">Your Phone:</label> <input id="scfPhone" name="phone" type="text" maxlength="18" class="scf-input"> </div> </div> <!-- call-time / zone --> <div class="scf-group"> <div> <label for="scfWhen" class="scf-label">Call When:</label> <select id="scfWhen" name="when" class="scf-select"> <option value="" selected>–</option> <option>Anytime</option> <option>Morning</option> <option>Afternoon</option> <option>Evening</option> </select> </div> <div> <label for="scfZone" class="scf-label">Zone:</label> <select id="scfZone" name="zone" class="scf-select"> <option value="" selected>–</option> <option>ET</option> <option>CT</option> <option>MT</option> <option>PT</option> </select> </div> </div> <!-- extra info toggle --> <a id="scfToggle" href="#" class="scf-toggle">+ Additional Information</a> <div id="scfExtra" class="scf-extra"> <label for="scfAddl" class="scf-label">Details / Additional Info:</label> <textarea id="scfAddl" name="details" rows="3" class="scf-textarea"></textarea> </div> <!-- send --> <div class="scf-button-container"> <button type="submit" class="scf-button">SEND</button> </div> </div> </form> </div> <script> // toggle extra textarea document.getElementById('scfToggle').onclick = e => { e.preventDefault(); const box = document.getElementById('scfExtra'); const open = box.style.display === 'block'; box.style.display = open ? 'none' : 'block'; e.target.textContent = open ? '+ Additional Information' : '− Hide Additional Information'; }; // mailto builder function scfSend(ev) { ev.preventDefault(); const v = id => document.getElementById(id).value.trim(); const rows = [ `Name: ${v('scfFirst')} ${v('scfLast')}`, `E-mail: ${v('scfEmail') || '—'}`, v('scfPhone') ? `Phone: ${v('scfPhone')}` : '', v('scfWhen') ? `Call When: ${v('scfWhen')}` : '', v('scfZone') ? `Zone: ${v('scfZone')}` : '' ].filter(Boolean); if (v('scfAddl')) rows.push('', 'Additional Information:', v('scfAddl')); const body = encodeURIComponent(rows.join('\n')); const subject = encodeURIComponent('Contact <?= addslashes($handle) ?>'); location.href = `mailto:<?= rawurlencode($email) ?>?subject=${subject}&body=${body}`; return false; } </script> <?php endif; ?> <script>window.businessData = <?= json_encode($biz, JSON_UNESCAPED_SLASHES) ?>;</script> <?php /* ───────────────────────────────────────────────────────── * PROMPT SELECTOR + PREVIEW CARD (v3 – centred + token‑blue) * ───────────────────────────────────────────────────────── */ /* 1️⃣ find phone folder from ?ph, /ph/##########/, or parent dir */ $ph = $_GET['ph'] ?? ''; if (!$ph && preg_match('#/ph/(\d{10,15})(?:/|$)#', strtok($_SERVER['REQUEST_URI'],'?'), $m)) $ph = $m[1]; if (!$ph) { $p = basename(dirname(__DIR__)); if (preg_match('/^\d{10,15}$/', $p)) $ph = $p; } /* 2️⃣ load prompts */ $promptFile = $_SERVER['DOCUMENT_ROOT']."/ph/$ph/prompts.json"; $promptArr = is_readable($promptFile) ? json_decode(file_get_contents($promptFile), true) : []; $prompts = array_values(array_filter($promptArr, fn($p)=>!empty($p['prompt']))); if (!$prompts) return; function label(string $txt,int $n=4):string{ $w=preg_split('/\s+/',trim($txt)); return implode(' ',array_slice($w,0,$n)).(count($w)>$n?'…':''); } ?> <style> /* ========================================================================== Promptinator Popup Styles — fully scoped under dialog .popup-body ========================================================================== */ /* 1) Outer white card */ dialog .popup-body { background: #fff; border: 1px solid #e0e0e0; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.05); padding: 1.5rem 1.6rem; display: inline-block; max-width: 100%; } /* 2) Stack labels above single controls */ dialog .popup-body > label { display: block; margin-bottom: 0.5rem; font-weight: 500; color: #333; } /* 3) Full-width selects, text inputs, textareas */ dialog .popup-body > label + select, dialog .popup-body > label + input[type="text"], dialog .popup-body > label + textarea { display: block; width: 100%; padding: 0.75rem; border: 1px solid #ccd; border-radius: 6px; font-size: 1rem; line-height: 1.4; box-sizing: border-box; margin-bottom: 1.5rem; background: #fff; } /* 4) Checkbox & radio groups in floating-legend fieldsets */ dialog .popup-body fieldset { position: relative; padding: 1.5rem 1rem 1rem; margin-bottom: 1rem; border: 1px solid #ccd; border-radius: 8px; background: #fff; } /* 4a) Floating legend atop each fieldset */ dialog .popup-body fieldset legend { position: absolute; top: 0; left: 1rem; transform: translateY(-50%); padding: 0 0.5rem; background: #fff; white-space: nowrap; font-weight: 500; color: #333; line-height: 1; } /* 4b) Space out the children below the legend */ dialog .popup-body fieldset > *:not(legend) { margin-top: 0.5rem; } /* 4c) Inline checkbox/radio labels */ dialog .popup-body fieldset label { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; } /* 5) Promptinator tokens in RF-Safe purple */ dialog .popup-body .token { color: #5c3bff; font-weight: 600; cursor: pointer; } dialog .popup-body .token:hover { color: #4a26b2; } /* 6) Action buttons (“Done” / “Use site”) */ dialog .popup-body .ai-buttons { text-align: center; margin-top: 1.5rem; } dialog .popup-body .ai-buttons > button { background-color: #5c3bff; color: #fff; border: none; border-radius: 8px; padding: 0.75rem 1.5rem; min-width: 140px; font-weight: 600; cursor: pointer; transition: background-color 0.2s ease; margin: 0 0.5rem; } dialog .popup-body .ai-buttons > button:hover { background-color: #4a26b2; } /* 1) Stack only the direct <label> wrappers (for textarea, dropdown, text input) */ .popup-body > label { display: flex !important; flex-direction: column !important; align-items: flex-start !important; gap: 0.5rem !important; } /* 2) Make the controls inside those labels fill their container */ .popup-body > label > select, .popup-body > label > input, .popup-body > label > textarea { width: 100% !important; box-sizing: border-box !important; } /* 3) Style only the direct <button> children (Done, Use site) purple */ .popup-body > button, .popup-body > .ai-buttons > button { background-color: #5c3bff !important; color: #fff !important; border: none !important; border-radius: 8px !important; padding: 0.75rem 1.5rem !important; font-weight: 600 !important; cursor: pointer !important; margin-top: 1rem !important; } /* 4) Hover state for those buttons */ .popup-body > button:hover, .popup-body > .ai-buttons > button:hover { background-color: #4a26b2 !important; } /* Make Promptinator “tokens” (the little clickable bits) show up in blue */ .Promptinator .token { color: #007bff; /* your blue of choice */ cursor: pointer; } /* Optional: darker blue on hover for affordance */ .Promptinator .token:hover { color: #0056b3; text-decoration: underline; } /* promptinator.css */ .e-btn { background:#0d99ff; border:none; color:#fff; padding:.35em 1.1em; border-radius:6px; cursor:pointer; font-weight:600; } /* === Promptinator “E”‑token buttons ===================== */ .e-btn { display:inline-block; background:#1e88ff; /* primary brand blue */ color:#fff !important; /* override theme link color */ font-weight:600; padding:.4em 1.2em; border:none; border-radius:7px; cursor:pointer; text-decoration:none; line-height:1.2; box-shadow:0 2px 4px rgba(0,0,0,.12); transition:background .15s; } .e-btn:hover, .e-btn:focus { background:#156fd9; } .e-btn:active { background:#0f5fc2; } /* Promptinator – force white text on all generated buttons & links */ .Promptinator .ai-btn, .Promptinator .ai-btn:visited, .Promptinator .token.e-btn { color: #fff !important; /* white words */ text-decoration: none; /* keep them looking like buttons */ } /* optional: make sure focus / hover also stay white */ .Promptinator .ai-btn:hover, .Promptinator .ai-btn:focus, .Promptinator .token.e-btn:hover, .Promptinator .token.e-btn:focus { color: #fff !important; } /* ==== Promptinator AI button bar ==== */ .ai-buttons { flex-wrap: wrap !important; } /* enable wrapping */ .ai-buttons > a { flex: 1 1 130px; /* let them share rows */ text-align: center; } /* 2‑per‑row on very small screens */ @media (max-width: 440px){ .ai-buttons > a { flex: 1 1 calc(50% - .6em); } } /* 1‑per‑row on ultra‑narrow screens */ @media (max-width: 320px){ .ai-buttons > a { flex: 1 1 100%; } } /* hide AI buttons when blank */ .Promptinator.promptinator--empty .ai-buttons { display:none !important; } /* yellow helper banner */ .promptinator-helper{ margin-top:1em; font-size:.9em; color:#555; background:#fff9c4; text-align:center; padding:.5em .8em; border-radius:5px; } </style> <!-- ───────────── card ───────────── --> <section class="prompt-card" style=" margin:2.5em auto;max-width:450px;background:#fff; border:3px solid #ffb63b;border-radius:22px;box-shadow:0 8px 26px #f5db9c3c; padding:1.6rem 1.4rem;"> <label for="promptSelect" style="font-weight:700;color:#0d4ca2;display:block;margin-bottom:.55rem;"> Choose a prompt: </label> <select id="promptSelect" style=" width:100%;padding:.55rem .8rem;font-size:1rem;border:1px solid #ccd; border-radius:9px;background:#fcfdff;cursor:pointer;"> <?php foreach($prompts as $i=>$p): ?> <option value="<?=$i?>"><?=htmlspecialchars(label($p['prompt']))?></option> <?php endforeach; ?> </select> <div id="promptHolder" style="margin-top:1.35rem;"></div> </section> <!-- additional styles --> <style> .prompt-card a { color:#176edc!important; text-decoration:underline; } .prompt-card .token { color:#176edc; text-decoration:underline; cursor:pointer; } .prompt-card select { appearance:none; } @media (max-width:500px){ .prompt-card{width:90%;} } </style> <script> (() => { const prompts = <?=json_encode(array_column($prompts,'prompt'),JSON_HEX_TAG|JSON_HEX_APOS|JSON_HEX_QUOT|JSON_HEX_AMP)?>; const sel=document.getElementById('promptSelect'); const holder=document.getElementById('promptHolder'); function render(i=0){ holder.innerHTML=`<div class="Promptinator" edit="1" think="1" style="margin-bottom:1em;" data-prompt>${prompts[i]||''}</div>`; const boot=P=>P.init({mount:holder.firstElementChild}); if(window.Promptinator?.init){boot(window.Promptinator);} else{import('/businessPromptinator.js').then(m=>boot(m.default||m.Promptinator));} } render(+sel.value); sel.addEventListener('change',()=>render(+sel.value)); })(); </script> <!-- end promptinator --> <!-- START SCRIPTS --> <script> function toggleMyList(phone) { // Get list from cookie var cookie = document.cookie.match(/mybizlist=([^;]+)/); var list = []; if(cookie) list = cookie[1].split('-').filter(function(n){ return /^\d{10}$/.test(n); }); var inList = list.indexOf(phone) !== -1; if(!inList) { list.push(phone); document.cookie = "mybizlist=" + list.join('-') + ";path=/;max-age=" + (60*60*24*30); location.reload(); } else { list = list.filter(function(n){ return n !== phone; }); document.cookie = "mybizlist=" + list.join('-') + ";path=/;max-age=" + (60*60*24*30); location.reload(); } } function showMoreTags(link) { var type = link.getAttribute('data-type'); var tagSelector = '.tag.' + (type === 'location' ? 'location-tag' : 'service-tag'); var parent = link.parentNode; var allTags = Array.from(parent.querySelectorAll(tagSelector)); var isShowingMore = link.textContent.toLowerCase().includes('less'); if (isShowingMore) { allTags.forEach(function(tag, i) { tag.style.display = (i < 2) ? '' : 'none'; }); link.textContent = "Show more"; } else { allTags.forEach(function(tag) { tag.style.display = ''; }); link.textContent = "Show less"; } } </script> </body> </html>
Save changes
Create folder
writable 0777
Create
Cancel