Site Builder
Editing:
modules-aboutookkk.php
writable 0666
<?php /************************************************************************** * ABOUT MODULE – v3 “identity strip” (gold‑card) **************************************************************************/ /* 1) Load profile.json if $profile isn’t set */ 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'] ?? ''; /* location lines */ $addr1 = trim(($profile['address'] ?? '') . ' ' . ($profile['address_2'] ?? '')); $city = $profile['city'] ?? ''; $st = $profile['state'] ?? ''; $zip = $profile['zip'] ?? ''; $loc = trim("$city, $st $zip", ' ,'); /* format phone */ 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? */ if ($descr === '' && !$website && !$phone && !$loc) { return; } ?> <!-- ===== ABOUT (gold‑outline 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"> <i class="fas fa-user"></i> <span>@<?= htmlspecialchars($handle) ?></span> </div> <?php endif; ?> <?php if ($website): ?> <div class="item"> <i class="fas fa-globe"></i> <a href="<?= htmlspecialchars($website) ?>" target="_blank" rel="noopener"> <?= preg_replace('#^https?://#','', htmlspecialchars($website)) ?> </a> </div> <?php endif; ?> <?php if ($phone): ?> <div class="item"> <i class="fas fa-phone"></i> <a href="tel:<?= htmlspecialchars($digits ?? $phone) ?>"> <?= htmlspecialchars($phoneFmt) ?> </a> </div> <?php endif; ?> <?php if ($loc || $addr1): ?> <div class="item"> <i class="fas fa-map-marker-alt"></i> <span><?= htmlspecialchars($addr1 ?: $loc) ?></span> </div> <?php endif; ?> </div> </div> </section> <style> /* outer wrapper + gold card */ .ab-shell{ margin:2.6rem auto; max-width:clamp(480px,70vw,720px); width:100%; font-family:system-ui,Arial,sans-serif; } .ab-card{ background:#fff; padding:1.8rem 1.6rem; border:3.5px solid #ffb63b; /* gold outline */ border-radius:27px; box-shadow:0 8px 26px rgba(0,0,0,.06); text-align:left; } /* headings & body text */ .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} .ab-idstrip .item{display:flex;align-items:center;gap:.46em;font-size:.96rem;color:#333} .ab-idstrip .item i{color:#0066ff;font-size:1.05rem} .ab-idstrip a{color:#0066ff;text-decoration:none} .ab-idstrip a:hover{text-decoration:underline} @media(max-width:480px){ .ab-idstrip{flex-direction:column;align-items:flex-start} } </style> <?php /* load FontAwesome once */ static $faLoaded = false; if (!$faLoaded){ echo '<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" media="all">'; $faLoaded = true; } ?>
Save changes
Create folder
writable 0777
Create
Cancel