Siteβ―Builder
Editing:
inderrrrrrrrrrrrrrrrx.php
writable 0666
<?php /************************************************************************** * BUSINESS PROFILE INDEX β masonry edition β’ v4 (2025β07βXX) * β Removes outer white βwrapperβ background around each gold card * for a cleaner masonry flow. **************************************************************************/ declare(strict_types=1); require_once $_SERVER['DOCUMENT_ROOT'].'/pages/lib/helpers.php'; /* βββββ load profile βββββ */ $profile = get_profile(); /* βββββ helpers βββββ */ function h(string $s): string{ return htmlspecialchars($s,ENT_QUOTES,'UTF-8'); } function state_slug(string $st): string{ return strtoupper(trim($st)); } function city_slug(string $c): string { return strtolower(str_replace(' ','-',$c)); } function fmt_phone(string $n): string{ $d=preg_replace('/\D/','',$n); return strlen($d)===10 ? sprintf('(%s) %sβ%s',substr($d,0,3),substr($d,3,3),substr($d,6)) : $n; } /* βββββ pull profile fields βββββ */ $name =$profile['display_name']??'Business'; $slogan =$profile['slogan'] ??''; $desc =$profile['description'] ??''; $addr =$profile['address'] ??''; $city =$profile['city'] ??''; $state =$profile['state'] ??''; $zip =$profile['zip'] ??''; $phone =$profile['phone'] ??''; $site =$profile['website'] ??''; $slug =$profile['slug'] ??basename(__DIR__); $country='USA'; $stateslug=state_slug($state); $cityslug =city_slug($city); /* βββββ meta βββββ */ $metaTitle="$name in $city, $state | BestDealOn"; $metaDesc =$desc ?: ($slogan ?: $name); $canonical="https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; /* βββββ modules list βββββ */ $rootDir = $_SERVER['DOCUMENT_ROOT']; $modulesDir = "$rootDir/pages/modules"; $globalCfg = "$modulesDir/modules.json"; $localCfg = __DIR__.'/config.json'; $globalMods=is_readable($globalCfg)?json_decode(file_get_contents($globalCfg),true):[]; $localMods =is_readable($localCfg) ?json_decode(file_get_contents($localCfg), true):[]; $ordered=[]; foreach($localMods as $m) $ordered[$m['name']]=$m; // local overrides foreach($globalMods as $g) if(!isset($ordered[$g['name']])) $ordered[$g['name']]=$g; $modules =array_filter($ordered,fn($m)=>($m['active']??false)===true); ?> <!doctype html><html lang="en"><head> <meta charset="utf-8"> <title><?=h($metaTitle)?></title> <meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="description" content="<?=h($metaDesc)?>"> <link rel="canonical" href="<?=h($canonical)?>"> <style> :root{ --fg:#1b334a; --link:#2357d7; font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif; } body{margin:0;background:#f5f8fb;color:var(--fg);} /* header */ .top-bar{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap; gap:.45rem;padding:.55rem 1rem;background:#eee;text-align:center} .logo{font-weight:900;letter-spacing:-.5px;color:var(--link);text-decoration:none} .breadcrumb a{color:var(--link);text-decoration:none} .breadcrumb span{margin:0 .25rem} /* business card */ .biz-card{max-width:680px;margin:2rem auto;background:#fff;border-radius:20px; box-shadow:0 2px 16px #dde3fa26;padding:2rem 1.4rem;display:grid;gap:1rem; grid-template-columns:1fr 1fr} .biz-card h1{grid-column:1/-1;font-size:1.7rem;color:#2c61d7;margin:.1em 0} .biz-card .slogan{grid-column:1/-1;color:#2e6eb0;font-style:italic;font-size:1.1rem} .field{display:flex;gap:.6rem} .label{font-weight:600;min-width:95px;color:#23487b} .value{color:#364868} @media(max-width:600px){.biz-card{grid-template-columns:1fr}.field{flex-direction:column}} /* masonry columns */ .modules{column-width:340px;column-gap:1.6rem;max-width:960px;margin:0 auto 2.5rem;padding:0 1rem} @media(min-width:900px){.modules{column-gap:2.2rem}} @media(min-width:1100px){.modules{column-width:440px}} /* module wrapper βΒ now transparent & gapβonly */ .mod-card{ display:inline-block;width:100%;margin:0 0 1.8rem; padding:0;border-radius:0;background:transparent;box-shadow:none; break-inside:avoid; } </style> </head><body> <!-- header --> <div class="top-bar"> <a class="logo" href="/">BESTΒ DEALΒ ON</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($city): ?><a href="/geo/<?=h($country)?>/<?=h($stateslug)?>/<?=h($cityslug)?>/"><?=h($city)?></a><span>/</span><?php endif; ?> <span><?=h($name)?></span> </nav> </div> <!-- business card --> <section class="biz-card"> <h1><?=h($name)?></h1> <?php if($slogan): ?><div class="slogan"><?=h($slogan)?></div><?php endif; ?> <?php if($addr||$city||$state||$zip): ?> <div class="field"><span class="label">Address:</span><span class="value"> <?php if($addr) echo h($addr).'<br>'; ?> <?=h(trim(($city?$city.', ':'').$state.' '.$zip))?> </span></div> <?php endif; ?> <?php if($phone): ?> <div class="field"><span class="label">Phone:</span> <span class="value"><b><?=h(fmt_phone($phone))?></b></span></div> <?php endif; ?> <?php if($site): ?> <div class="field"><span class="label">Website:</span> <span class="value"><a href="<?=h($site)?>" target="_blank"><?=h($site)?></a></span></div> <?php endif; ?> <?php if($desc): ?> <div class="field" style="grid-column:1/-1"> <span class="value" style="line-height:1.4;"><?=h($desc)?></span> </div> <?php endif; ?> </section> <!-- modules --> <main class="modules"> <?php foreach($modules as $mod){ $abs=$modulesDir.'/'.$mod['relative_path']; if(!is_file($abs)) continue; echo "<section class='mod-card'>"; try{ include $abs; } catch(Throwable $e){ echo '<p style="color:#c00">Module β'.h($mod['name']).'β failed.</p>'; } echo '</section>'; } ?> </main> </body></html>
Save changes
Create folder
writable 0777
Create
Cancel