<?php



declare(strict_types=1);



/** @var int|null $fatePageHitCount */

/** @var bool|null $fatePageStatsDbOk */

/** @var string $fateCounterFooterVariant */



$variant = isset($fateCounterFooterVariant) && $fateCounterFooterVariant === 'light' ? 'light' : 'dark';

$layout = $variant === 'light' ? 'minimal' : 'default';

$hits = $fatePageHitCount ?? null;



require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'fate_page_counter.php';

$online = fate_page_stats_online_count();



$forumUrl = 'https://spa.novice.tw/s_discussions.php?category_id=4';

$ccDeedUrl = 'https://creativecommons.org/licenses/by/4.0/';

$ccLegalUrl = 'https://creativecommons.org/licenses/by/4.0/legalcode';

?>

    <footer class="fate-site-footer fate-site-footer--<?= htmlspecialchars($variant, ENT_QUOTES, 'UTF-8') ?> fate-site-footer--layout-<?= htmlspecialchars($layout, ENT_QUOTES, 'UTF-8') ?>" role="contentinfo">

        <p class="fate-site-footer__line" lang="en">

            <strong>XSpa 1.0</strong>

            <span aria-hidden="true"> · </span>

            by

            <a href="<?= htmlspecialchars($forumUrl, ENT_QUOTES, 'UTF-8') ?>" target="_blank" rel="noopener noreferrer">SPA新手村</a>.

        </p>

        <p class="fate-site-footer__line fate-site-footer__cc" lang="en">

            Except where otherwise noted, site content is licensed under

            <a href="<?= htmlspecialchars($ccDeedUrl, ENT_QUOTES, 'UTF-8') ?>" target="_blank" rel="noopener noreferrer license">Creative Commons Attribution 4.0 International</a>

            (<abbr title="Creative Commons">CC</abbr> BY 4.0).

            <a href="<?= htmlspecialchars($ccLegalUrl, ENT_QUOTES, 'UTF-8') ?>" target="_blank" rel="noopener noreferrer">Legal code</a>.

        </p>

        <?php if ($hits !== null): ?>

            <p class="fate-site-footer__stats">

                本頁瀏覽 <span class="fate-site-footer__stats-num"><?= number_format((int) $hits) ?></span> 次

                <?php if ($online !== null): ?>

                    <span aria-hidden="true"> · </span>

                    在線 <span class="fate-site-footer__stats-num fate-site-footer__stats-online"><?= number_format((int) $online) ?></span> 人

                <?php endif; ?>

            </p>

        <?php elseif ($online !== null): ?>

            <p class="fate-site-footer__stats">

                在線 <span class="fate-site-footer__stats-num fate-site-footer__stats-online"><?= number_format((int) $online) ?></span> 人

            </p>

        <?php else: ?>

            <p class="fate-site-footer__stats fate-site-footer__stats--muted">瀏覽統計未連線</p>

        <?php endif; ?>

    </footer>

