Site Builder
Editing:
tools-about.php
writable 0666
<?php /************************************************************************** * ABOUT MODULE – v4 “identity strip” (gold card, no external assets) **************************************************************************/ /* 1) Get data (cached helper or one‑off JSON) */ if (!isset($profile) || !is_array($profile)) { $json = dirname(__DIR__, 2) . '/profile.json'; $profile = is_readable($json) ? json_decode(file_get_contents($json), true) : []; } /* 2) Convenience vars */ $name = $profile['display_name'] ?? $profile['handle'] ?? 'Profile'; $handle = ltrim($profile['handle'] ?? '', '@'); $descr = trim($profile['description'] ?? ''); $website = $profile['website'] ?? ''; $phone = $profile['phone'] ?? ''; $addr1 = trim(($profile['address'] ?? '').' '.($profile['address_2'] ?? '')); $city = $profile['city'] ?? ''; $st = $profile['state'] ?? ''; $zip = $profile['zip'] ?? ''; $loc = trim("$city, $st $zip", ' ,'); /* phone pretty‑print */ if ($phone) { $digits = preg_replace('/\D/','',$phone); $phoneFmt = strlen($digits)===10 ? '('.substr($digits,0,3).') '.substr($digits,3,3).'-'.substr($digits,6) : $phone; } /* nothing to show → abort */ if ($descr==='' && !$website && !$phone && !$loc) return; ?> <!-- ===== ABOUT (gold card) ===== --> <section class="ab-shell"> <div class="ab-card"> <?php if ($descr): ?> <h2>About <?= htmlspecialchars($name) ?></h2> <p><?= nl2br(htmlspecialchars($descr)) ?></p> <?php endif; ?> <div class="ab-idstrip"> <?php if ($handle): ?> <div class="item">👤 @<?= htmlspecialchars($handle) ?></div> <?php endif; ?> <?php if ($website): ?> <div class="item">🌐 <a href="<?= htmlspecialchars($website) ?>" target="_blank" rel="noopener"> <?= preg_replace('#^https?://#','', htmlspecialchars($website)) ?> </a> </div> <?php endif; ?> <?php if ($phone): ?> <div class="item">📞 <a href="tel:<?= htmlspecialchars($digits ?? $phone) ?>"> <?= htmlspecialchars($phoneFmt) ?> </a> </div> <?php endif; ?> <?php if ($loc || $addr1): ?> <div class="item">📍 <?= htmlspecialchars($addr1 ?: $loc) ?></div> <?php endif; ?> </div> </div> </section> <style> /* wrapper + card */ .ab-shell{margin:2.6rem auto;max-width:clamp(480px,70vw,720px);width:100%; font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif} .ab-card{background:#fff;padding:1.8rem 1.6rem;border:3.5px solid #ffb63b; border-radius:27px;box-shadow:0 8px 26px rgba(0,0,0,.06);text-align:left} .ab-card h2{margin:0 0 .75rem;font-size:1.4rem;font-weight:700;color:#102a66} .ab-card p {margin:0 0 1.3rem;font-size:1.06rem;line-height:1.55;color:#333} /* identity strip */ .ab-idstrip{display:flex;flex-wrap:wrap;gap:.9em 1.4em} .item{display:flex;align-items:center;font-size:.96rem;color:#333;gap:.4em} .item a{color:#0066ff;text-decoration:none} .item a:hover{text-decoration:underline} @media(max-width:480px){ .ab-idstrip{flex-direction:column;align-items:flex-start} } </style>
Save changes
Create folder
writable 0777
Create
Cancel