<?php
/**
 * 芋头CMS
 * ============================================================================
 * 版权所有 2016-2028 沅陵县乌托邦网络服务有限公司，并保留所有权利。
 * 网站地址: http://www.yutoucms.cn
 * ----------------------------------------------------------------------------
 * 如果商业用途务必到官方购买正版授权, 以免引起不必要的法律纠纷。
 * ============================================================================
 * Author: 芋头 <mxgsf@qq.com>
 * Date: 2026-6-2
 */
if (!defined('ROOT_PATH')) exit;
$kw = isset($_GET['keyword']) ? trim($_GET['keyword']) : '';
$list = array();
if ($kw !== '') {
  $like = '%'.$kw.'%';
  $list = $db->fetchAll("SELECT id,title,content,create_time FROM {$db->table('article')} WHERE status=1 AND title LIKE ? ORDER BY create_time DESC LIMIT 20", array($like));
}
?><!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" /><title>搜索结果-<?php echo htmlspecialchars($site['site_name']); ?></title><link href="<?php echo $site['template_dir']; ?>css/style.css" rel="stylesheet" type="text/css" /><link href="<?php echo $site['template_dir']; ?>css/bootstrap.min.css" rel="stylesheet" type="text/css"><script src="<?php echo $site['template_dir']; ?>js/jquery-1.8.3.min.js"></script></head><body><?php include dirname(__FILE__).'/_header.php'; ?><div class="banner_n" style="background:url(https://picsum.photos/1600/500?random=66) no-repeat top center;background-size:cover;"><div class="capitalize"><div class="ad-tit">搜索结果</div><div class="ad-line"></div></div></div><div class="mbanner"><img src="https://picsum.photos/1200/400?random=66" width="100%" /></div><div class="post"><div class="postcon clearfix"><div class="col-md-8 col-sm-12 col-xs-12 nabout_menu"><ul></ul></div><div class="col-md-4 col-sm-12 col-xs-12 position hidden-s"><img src="<?php echo $site['template_dir']; ?>images/tb6.png" alt="当前位置" /> <a href="<?php echo getUrl('home'); ?>">首页</a> >> 搜索结果</div></div></div><div class="news"><div class="cont"><form method="get" action="/public/index.php" style="margin-bottom:30px;"><input type="hidden" name="m" value="search"><input type="text" name="keyword" value="<?php echo htmlspecialchars($kw); ?>" placeholder="请输入关键词" style="width:70%;height:46px;border:1px solid #ddd;padding:0 15px;"><button type="submit" style="height:46px;padding:0 20px;background:linear-gradient(to right,#0068b4,#0da12b);color:#fff;">搜索</button></form></div><?php foreach($list as $n){ $ts = is_numeric($n['create_time']) ? intval($n['create_time']) : strtotime($n['create_time']); ?><div class="newslist"><div class="cont"><a href="<?php echo getUrl('article', intval($n['id'])); ?>"><div class="newsdate"><p><?php echo date('m-d',$ts); ?></p><span><?php echo date('Y',$ts); ?></span></div><div class="newscon"><div class="newsbt"><?php echo htmlspecialchars($n['title']); ?></div><div class="newsms"><?php echo htmlspecialchars(msubstr(strip_tags($n['content']),0,100)); ?></div></div></a></div></div><?php } if(empty($list)){ ?><div class="cont text-secondary">暂无搜索结果</div><?php } ?></div><?php include dirname(__FILE__).'/_footer.php'; ?></body></html>
