Siteβ―Builder
Editing:
profile-indeww.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'; $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"> <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) ?>"> <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:#551A8B;} .logo .d{color:#00c853;} .logo .o{color:#ff1744;} 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:#23ad6a; 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;} } </style> </head> <body> <div class="top-bar"> <a class="logo" href="/geo/"><span class="b">BEST </span><span class="d">DEAL </span><span class="o">ON</span></a> <nav class="breadcrumb" aria-label="Breadcrumb"> <a href="/geo/">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'> <?php if($addr): ?> <div class="fieldrow"><span class='flabel'>Address:</span> <span class='fval'><?= h($addr) ?></span></div> <?php endif; ?> <div class="fieldrow"><span class='flabel'>City/State:</span> <span class='fval'><?= h($city) ?>, <?= h($state) ?></span></div> <?php if($zip): ?> <div class="fieldrow"><span class='flabel'>ZIP:</span> <span class='fval'><?= h($zip) ?></span></div> <?php endif; ?> <?php if($phone): ?> <div class="fieldrow"><span class='flabel'>Phone:</span> <span class='fval'><?= h(format_phone($phone)) ?></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 ? '#ff5e5e' : '#21b1d2' ?>;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:#1c90f3;text-decoration:underline;">View My List</a> </div> <?php endif; ?> </div> <?php endif; ?> <?php $descLimit = 160; $businessHeading = h($name) . " Coupon"; $formattedPhone = ''; if (!empty($phone)) { $phoneDigits = preg_replace('/\D/', '', $phone); if (strlen($phoneDigits) === 10) $formattedPhone = "(".substr($phoneDigits,0,3).") ".substr($phoneDigits,3,3)."β".substr($phoneDigits,6); else $formattedPhone = h($phone); } ?> <style> @media print { .coupon-toolbar, .coupon-btn, #printCouponBtn, #shareCouponBtn { display:none !important; } .desc-screen, #readMoreLink, #showLessLink { display:none !important; } .desc-print { display:block !important; } } .desc-print { display:none; } </style> <?php if ($isPaid && !empty($coupon) && !empty($coupon['title'])): ?> <?php $descRaw = trim($coupon['desc']); $descFull = nl2br(h($descRaw)); $descShort = nl2br(h(mb_substr($descRaw, 0, $descLimit, 'UTF-8'))); $hasMore = mb_strlen($descRaw, 'UTF-8') > $descLimit; ?> <div style="max-width:470px; margin:2.5em auto 0 auto;"> <div id="couponPreview" 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 2em;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 style="font-size:1.18em;font-weight:800;color:#df6200;margin-bottom:.12em;"> <?= h($coupon['title']) ?> </div> <!-- Truncated with toggle (screen only) --> <div class="desc desc-screen" id="couponDesc" itemprop="description" style="font-size:1.07em;color:#3a3232;margin-bottom:1.25em;line-height:1.5;display:inline-block;min-width:100%;"> <?php if ($hasMore): ?> <?= $descShort ?> <button type="button" id="readMoreLink" style="background:none;border:none;padding:0;margin-left:.27em;color:#2574bc;font-size:.98em;text-decoration:underline;cursor:pointer;display:inline;"> Read More </button> <?php else: ?> <?= $descFull ?> <?php endif; ?> </div> <!-- Full for print only --> <div class="desc desc-print" style="font-size:1.07em;color:#3a3232;margin-bottom:1.25em;line-height:1.5;"> <?= $descFull ?> </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;">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($coupon['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($coupon['expiry'] ?: 'No Expiry') ?></span> </div> <?php if ($formattedPhone): ?> <div style="text-align:center;margin:.65em 0 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;"> <span style="font-size:1.07em;">π</span> <?= $formattedPhone ?> </a> </div> <?php endif; ?> <div class="coupon-toolbar" style="display:flex;justify-content:center;gap:1.3em;margin:1.15em 0 0 0;"> <button id="printCouponBtn" class="coupon-btn" title="Print only the coupon" 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;transition:background .17s,color .17s;color:#b25a00;display:flex;align-items:center;gap:.6em;"> <span style="font-size:1.24em;vertical-align:middle;">π¨οΈ</span> Print Coupon </button> <button id="shareCouponBtn" class="coupon-btn" title="Share this coupon" 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;transition:background .17s,color .17s;color:#0e7f45;display:flex;align-items:center;gap:.6em;"> <span style="font-size:1.24em;vertical-align:middle;">π€</span> <span style="font-weight:700;">Share Coupon</span> </button> </div> </div> </div> <?php else: ?> <?php $demoDesc = "Example: Save 10% on any service or product at " . h($name ?: 'Acme Inc.') . ". Offer your best deal and attract more local customers!"; $demoFull = h($demoDesc); $demoShort = h(mb_substr($demoDesc, 0, $descLimit, 'UTF-8')); $demoMore = mb_strlen($demoDesc, 'UTF-8') > $descLimit; ?> <div style="max-width:470px; margin:2.5em auto 0 auto;"> <div style="text-align:center; margin-bottom:1.1em; font-size:1.11em; font-weight:700; color:#a75608;"> Feature Your Best Deal Here! </div> <div style="text-align:center; margin-bottom:1em; color:#56411e;"> <span style="background:#fffbe6; padding:.7em 1em; border-radius:11px; display:inline-block;"> <b>Upgrade to Premium Membership</b> to showcase your best offer on BestDealOn.<br> Attract more customers by displaying your businessβs top deal right here! </span> </div> <div id="couponPreview" aria-hidden="true" style="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;opacity:0.77;"> <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 style="font-size:1.12em;font-weight:800;color:#df6200;margin-bottom:.12em;"> 10% Off Any Service! </div> <div class="desc desc-screen" id="couponDescDemo" style="font-size:1.07em;color:#3a3232;margin-bottom:1.25em;line-height:1.5;display:inline-block;min-width:100%;"> <?php if ($demoMore): ?> <?= $demoShort ?> <button type="button" id="readMoreDemo" style="background:none;border:none;padding:0;margin-left:.27em;color:#2574bc;font-size:.98em;text-decoration:underline;cursor:pointer;display:inline;"> Read More </button> <?php else: ?> <?= $demoFull ?> <?php endif; ?> </div> <div class="desc desc-print" style="font-size:1.07em;color:#3a3232;margin-bottom:1.25em;line-height:1.5;"> <?= $demoFull ?> </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;">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;">BESTDEALON</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;">Example only, not valid</span> </div> <?php if ($formattedPhone): ?> <div style="text-align:center;margin:.65em 0 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;"> <span style="font-size:1.07em;">π</span> <?= $formattedPhone ?> </a> </div> <?php endif; ?> <div class="coupon-toolbar" style="display:flex;justify-content:center;gap:1.3em;margin:1.15em 0 0 0;"> <button id="printCouponBtn" class="coupon-btn" title="Print only the coupon" 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;transition:background .17s,color .17s;color:#b25a00;display:flex;align-items:center;gap:.6em;"> <span style="font-size:1.24em;vertical-align:middle;">π¨οΈ</span> Print Coupon </button> <button id="shareCouponBtn" class="coupon-btn" title="Share this coupon" 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;transition:background .17s,color .17s;color:#0e7f45;display:flex;align-items:center;gap:.6em;"> <span style="font-size:1.24em;vertical-align:middle;">π€</span> <span style="font-weight:700;">Share Coupon</span> </button> </div> </div> <div style="text-align:center; margin-top:1.1em;"> <a href="/advertise.php?geo=<?= h(strtolower($cityslug).'-'.$stateslug.'-advertising') ?>" style="display:inline-block;background:#ef8f13;color:#fff;padding:.65em 2.3em;border-radius:9px;font-weight:700;text-decoration:none;font-size:1.13em;">Upgrade Now & Add Your Coupon</a> </div> </div> <?php endif; ?> <script> (function() { // Read More/Show Less logic for paid var readMore = document.getElementById('readMoreLink'); var descDiv = document.getElementById('couponDesc'); <?php if ($isPaid && !empty($coupon) && !empty($coupon['title']) && $hasMore): ?> var fullDesc = <?= json_encode($descFull) ?>; var shortDesc = <?= json_encode($descShort . '<button type="button" id="readMoreLink" style="background:none;border:none;padding:0;margin-left:.27em;color:#2574bc;font-size:.98em;text-decoration:underline;cursor:pointer;display:inline;">Read More</button>') ?>; if (readMore && descDiv) { readMore.onclick = function(e) { e.preventDefault(); descDiv.innerHTML = fullDesc + '<button type="button" id="showLessLink" style="background:none;border:none;padding:0;margin-left:.4em;color:#2574bc;font-size:.98em;text-decoration:underline;cursor:pointer;display:inline;">Show Less</button>'; var showLess = document.getElementById('showLessLink'); showLess.onclick = function(e2) { e2.preventDefault(); descDiv.innerHTML = shortDesc; document.getElementById('readMoreLink').onclick = readMore.onclick; }; }; } <?php endif; ?> // Read More/Show Less logic for demo var readMoreDemo = document.getElementById('readMoreDemo'); var descDivDemo = document.getElementById('couponDescDemo'); <?php if (!$isPaid || empty($coupon) || empty($coupon['title'])): ?> var fullDescDemo = <?= json_encode($demoFull) ?>; var shortDescDemo = <?= json_encode($demoShort . '<button type="button" id="readMoreDemo" style="background:none;border:none;padding:0;margin-left:.27em;color:#2574bc;font-size:.98em;text-decoration:underline;cursor:pointer;display:inline;">Read More</button>') ?>; if (readMoreDemo && descDivDemo) { readMoreDemo.onclick = function(e) { e.preventDefault(); descDivDemo.innerHTML = fullDescDemo + '<button type="button" id="showLessDemo" style="background:none;border:none;padding:0;margin-left:.4em;color:#2574bc;font-size:.98em;text-decoration:underline;cursor:pointer;display:inline;">Show Less</button>'; var showLessDemo = document.getElementById('showLessDemo'); showLessDemo.onclick = function(e2) { e2.preventDefault(); descDivDemo.innerHTML = shortDescDemo; document.getElementById('readMoreDemo').onclick = readMoreDemo.onclick; }; }; } <?php endif; ?> // Print/Share logic (unchanged) var printBtn = document.getElementById('printCouponBtn'); var shareBtn = document.getElementById('shareCouponBtn'); var couponCard = document.getElementById('couponPreview'); if (printBtn && shareBtn && couponCard) { printBtn.onclick = function() { var couponHtml = couponCard.outerHTML; var printWindow = window.open('', '', 'width=600,height=800'); printWindow.document.write( '<html><head><title>Print Coupon</title>' + '<style>body{background:#f5f8fb;font-family:system-ui,Arial,sans-serif;margin:0;}' + '.coupon-preview{max-width:500px;margin:2em auto;padding:2em;border:3.5px solid #ffb63b;border-radius:27px;background:#fff;box-shadow:0 10px 38px #ffb63b33,0 2.5px 17px #fae1a1;}' + '.coupon-preview h2{margin:0 0 .46em 0;color:#df6200;font-size:1.49em;}' + '.coupon-preview .desc{font-size:1.15em;color:#56411e;margin-bottom:1.31em;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.22em;color:#a95600;font-family:monospace;font-weight:700;letter-spacing:.08em;box-shadow:0 1px 8px #ffbe4e42;}' + '.coupon-preview .expiry{font-size:1.09em;color:#a75608;font-weight:600;}</style>' + '</head><body>' + couponHtml + '</body></html>' ); printWindow.document.close(); setTimeout(function() { printWindow.print(); printWindow.close(); }, 200); }; shareBtn.onclick = function() { var url = window.location.href; var title = couponCard.querySelector('h2')?.innerText || 'Your Coupon Headline Here'; var descEl = couponCard.querySelector('.desc'); var desc = descEl ? (descEl.innerText || descEl.textContent) : ''; if (navigator.share) { navigator.share({ title: title, text: desc, url: url }); } else { navigator.clipboard.writeText(url); shareBtn.textContent = "β Link Copied!"; setTimeout(function(){ shareBtn.textContent = "Share Coupon"; }, 1700); } }; } })(); </script> <!-- === 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:#1997a5; 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:#21b1d2; 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:#298196; 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 --> <?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 style="text-align:center;margin:1.4em 0 0 0;"> <img src="<?= $qrImgUrl ?>" alt="Save business contact QR" style="width:170px;height:170px;border-radius:14px;box-shadow:0 1.5px 10px #e3eefd;"> <div style="margin-top:.7em;font-size:1.09em;color:#2b4f8c;font-weight:700;"> Scan to Save Contact </div> </div> <!-- 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; ?> <!-- COMPACT CONTACT FORM BLOCK --> <?php if ($isPaid): ?> <div style="max-width:470px;margin:2em auto 0 auto;font-family:system-ui,Arial,sans-serif;"> <form id="bizContactForm" method="post" action="/contact-handler.php" style="background:#fff;border:2px solid #ef8f13;border-radius:14px;box-shadow:0 2px 13px #ffcc7044;overflow:hidden;"> <div style="background:#e62a19;color:#fff;font-weight:900;font-size:1.17em;padding:.76em 1.2em;text-align:center;letter-spacing:.01em;border-bottom:2.5px solid #ffdd9c;"> <?= h($name) ?> Contact Request </div> <div style="padding:1.1em .9em .9em .9em;"> <div style="display:flex;flex-wrap:wrap;gap:.8em;"> <div style="flex:1 1 145px;min-width:120px;"> <label for="cfFirst" style="font-weight:600;color:#de5200;display:block;">First:</label> <input type="text" name="first" id="cfFirst" maxlength="32" required style="width:100%;font-size:1em;padding:.41em .7em;margin-top:.15em;border-radius:7px;border:1.2px solid #ffe4b2;"> </div> <div style="flex:1 1 145px;min-width:120px;"> <label for="cfLast" style="font-weight:600;color:#de5200;display:block;">Last:</label> <input type="text" name="last" id="cfLast" maxlength="32" required style="width:100%;font-size:1em;padding:.41em .7em;margin-top:.15em;border-radius:7px;border:1.2px solid #ffe4b2;"> </div> </div> <div style="display:flex;flex-wrap:wrap;gap:.8em;margin-top:.7em;"> <div style="flex:1 1 200px;min-width:150px;"> <label for="cfEmail" style="font-weight:600;color:#de5200;display:block;">Your Email:</label> <input type="email" name="email" id="cfEmail" maxlength="60" required style="width:100%;font-size:1em;padding:.41em .7em;margin-top:.15em;border-radius:7px;border:1.2px solid #ffe4b2;"> </div> <div style="flex:1 1 170px;min-width:130px;"> <label for="cfPhone" style="font-weight:600;color:#de5200;display:block;">Your Phone:</label> <input type="text" name="phone" id="cfPhone" maxlength="18" required style="width:100%;font-size:1em;padding:.41em .7em;margin-top:.15em;border-radius:7px;border:1.2px solid #ffe4b2;"> </div> </div> <div style="display:flex;flex-wrap:wrap;gap:.8em;margin-top:.7em;"> <div style="flex:1 1 150px;min-width:120px;"> <label for="cfCallWhen" style="font-weight:600;color:#de5200;display:block;">Call When:</label> <select name="call_when" id="cfCallWhen" style="width:100%;font-size:1em;padding:.41em .5em;margin-top:.15em;border-radius:7px;border:1.2px solid #ffe4b2;"> <option value="" disabled selected>Call When</option> <option value="Anytime">Anytime</option> <option value="Morning">Morning</option> <option value="Afternoon">Afternoon</option> <option value="Evening">Evening</option> </select> </div> <div style="flex:1 1 110px;min-width:95px;"> <label for="cfZone" style="font-weight:600;color:#de5200;display:block;">Zone:</label> <select name="zone" id="cfZone" style="width:100%;font-size:1em;padding:.41em .5em;margin-top:.15em;border-radius:7px;border:1.2px solid #ffe4b2;"> <option value="" disabled selected>Zone</option> <option value="ET">ET</option> <option value="CT">CT</option> <option value="MT">MT</option> <option value="PT">PT</option> </select> </div> </div> <!-- ADDITIONAL INFO TOGGLE --> <div style="margin-top:1.05em;text-align:right;"> <a href="#" id="showAddlLink" style="font-size:.98em;color:#1567b2;text-decoration:underline;cursor:pointer;font-weight:600;">+ Additional Information</a> </div> <div id="addlFields" style="display:none;margin-top:.9em;"> <label for="cfAddl" style="font-weight:600;color:#de5200;display:block;">Details/Additional Info:</label> <textarea name="additional" id="cfAddl" rows="3" style="width:100%;font-size:1em;padding:.5em;margin-top:.15em;border-radius:7px;border:1.2px solid #ffe4b2;resize:vertical;"></textarea> </div> <div style="margin-top:1.3em;text-align:right;"> <button type="submit" style="background:#ef8f13;color:#fff;font-weight:800;font-size:1.09em;padding:.63em 2.25em;border-radius:9px;border:none;box-shadow:0 1px 7px #ffeebb7a;cursor:pointer;transition:.13s;"> SUBMIT </button> </div> </div> </form> </div> <script> // Additional info expand/collapse logic document.getElementById('showAddlLink').onclick = function(e){ e.preventDefault(); var addl = document.getElementById('addlFields'); if(addl.style.display === "none" || addl.style.display === "") { addl.style.display = "block"; this.textContent = "β Hide Additional Information"; } else { addl.style.display = "none"; this.textContent = "+ Additional Information"; } }; </script> <?php endif; ?> <!-- 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