业务经理

微信扫描以上二维码

028-61286886

技术咨询

怎么做全站搜索呢

迅睿框架 更新 2020-12-07 09:46:17 master888

怎么做全站搜索呢,不想要模板那样的选择内容模型那样,直接全站搜索,代码怎么写

image.png

还有,按照模板文件写的,在单页搜索是出现APP目录不存在: APPSPATH/Share/ 这个错误的,如果要内容模型,这个怎么改

方案

  • master888 #1 · 2019-05-29 10:21:41
    <form class="search-form" action="/index.php" method="get"> <input type="hidden" name="s" value="api"> <input type="hidden" name="c" value="api"> <input type="hidden" name="m" value="search"> <input type="hidden" name="dir" id="dr_search_module_dir" > <div class="input-group"> <div class="input-group-btn btn-group"> <button id="dr_search_module_name" type="button" class="btn default dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> <i class="fa fa-angle-down"></i> </button> <ul class="dropdown-menu"> <!--这是来列出全部可以搜索的内容模块--> {php $top_search=[];} {cache name=module-content} {if $t.search} {php !$top_search && $top_search=$t;} <li><a href="javascript:dr_search_module_select('{$t.dirname}', '{$t.name}');"> {$t.name} </a></li> {/if} {/cache} </ul> </div> <input type="text" placeholder="搜索内容..." name="keyword" class="fc-search-keyword form-control"> <div class="input-group-btn"> <button class="btn default" type="submit"> <i class="fa fa-search"></i> </button> </div> </div> <script> // 这段js是用来执行搜索的 function dr_search_module_select(dir, name) { $("#dr_search_module_dir").val(dir); $("#dr_search_module_name").html(name+' <i class="fa fa-angle-down"></i>'); } dr_search_module_select('{php echo defined('MOD_DIR') ? MOD_DIR : $top_search.dirname}', '{php echo defined('MOD_DIR') ? MODULE_NAME : $top_search.name}'); </script> </form>这是最初的搜索表单,应该怎么改呢
  • 胡金海 #2 · 2019-05-29 10:24:59
    默认模板有木有这个问题???
  • master888 #3 · 2019-05-29 10:32:14
    胡金海这就是默认模板的问题
  • 坤哥 #4 · 2019-05-29 10:53:17
    你不要内容模块你去搜索哪个???搜索是依赖内容模块的
  • master888 #5 · 2019-05-29 11:02:18
    坤哥按关键词全站搜索可以吗,一定要加上内容模块吗,可以隐藏掉吧,但是隐藏掉后就无法选择模块了
  • 张律 #6 · 2019-06-20 11:16:59
    这个问题怎么解决呢
  • 轩影888 #7 · 2019-06-20 11:18:00
    求帮忙
  • #8 · 2020-04-30 21:39:00
    一样的问题
  • 王小五 #9 · 2020-04-30 21:55:52
    有全站搜索插件
  • 小黄人 18html.com #10 · 2020-05-01 16:28:17
    你全站只使用一个模块,不就全站搜索了咯
  • 风之传奇 #11 · 2020-05-01 20:34:42
    全站都只用news 模块,那么这个问题就很容易解决了。
  • #12 · 2020-05-02 15:32:06
    满意答案
    官方全站搜索插件需要设置三步:伪静态设置,这样设置好了是第一步
    image
    第二步是修改rewrite.php
    // 全模块搜索分页
    "so-(.+).html" => "so/home/index/rewrite/$1",
    // 全模块搜索
    "so.html" => "so/home/index",
    第三步就是上传代码,和搜索框代码了,可以直接用下面这个;会跳转到solist.html
    <>
        </>
        </>
        </>
        <>
            <>
                <><><></>
            </>
        </>
    </>
  • #13 · 2020-05-02 15:32:38

    image
  • master888 #14 · 2020-12-07 09:46:17
    @刘:完美解决问题,谢谢

迅睿系统漏洞

独立站群系统
独立站群系统(2026-09-14)
子站独立部署时修复同步附件失败问题
在线客服
在线客服(2026-09-13)
修复删除会话报错问题 删除会话时联动删除聊天图片
在线考试竞赛系统
在线考试竞赛系统(2026-09-12)
增加投票功能 考试功能拓展 注意:更新后需要执行系统更新,更新数...
网上信箱
网上信箱(2026-09-12)
修复新版本兼容问题
GeoSeo收录宝
GeoSeo收录宝(2026-09-12)
1 优化Update.php文件,解决版本在线升级不完整问题 2 ...
GeoSeo工具箱
GeoSeo工具箱(2026-09-11)
修正历史记录推送
微信系统
微信系统(2026-09-11)
增加数据统计总览界面 账号管理增加服务和公众号的区别 菜单管理支持更...
答题系统
答题系统(2026-09-11)
一站式在线答题系统,支持真题考试、题库练习和错题本,适合培训、考证、...
阿里云滑动验证码
阿里云滑动验证码(2026-09-10)
采用阿里云验证码替换迅睿系统自带的图片验证码和滑动验证码。后台设置方...
下载Plus
下载Plus(2026-09-09)
为网站附件下载加上“计数、限次、统计、防护”四重能力:按用户组控制下...