码桶

发现社区成员的开源项目

飞扬 / LB_Down 公开
main
LB_Down/search.php
search.php1.9 KB
<?php
if (!defined('__TYPECHO_ROOT_DIR__')) exit;

$pageSize = intval($this->options->pageSize ?: 20);
$this->parameter->setDefault(['pageSize' => $pageSize]);

$this->need('header.php');
?>

<div class="content-area">
    <div class="archive-header">
        <h1 class="archive-title">
            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                <circle cx="11" cy="11" r="8"/>
                <line x1="21" y1="21" x2="16.65" y2="16.65"/>
            </svg>
            搜索: <?php $this->archiveTitle('', '', '', true); ?>
        </h1>
    </div>

    <div class="resource-list">
        <?php $listIndex = 0; ?>
        <?php if ($this->have()): ?>
            <?php while ($this->next()): ?>
                <?php lb_resource_card($this, $listIndex++); ?>
            <?php endwhile; ?>
        <?php else: ?>
            <div class="no-results">
                <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                    <circle cx="11" cy="11" r="8"/>
                    <line x1="21" y1="21" x2="16.65" y2="16.65"/>
                </svg>
                <p>没有找到相关资源,请尝试其他关键词</p>
            </div>
        <?php endif; ?>
    </div>

    <?php if ($this->have()): ?>
        <nav class="pagination" aria-label="分页导航">
            <?php $this->pageNav('上一页', '下一页', 3, '...', [
                'wrapTag' => 'div',
                'wrapClass' => 'pagination-inner',
                'itemTag' => 'a',
                'textTag' => 'span',
                'currentClass' => 'current',
                'prevClass' => 'prev',
                'nextClass' => 'next'
            ]); ?>
        </nav>
    <?php endif; ?>
</div>

<?php $this->need('sidebar.php'); ?>

<?php $this->need('footer.php'); ?>