这是在做一个模板时改的,并不代表这是一个美化或者优化,只是特殊情况下的需要。
只有一个搜索框,默认帖子搜索,无搜索按钮,输入内容直接回车搜索。

<!--{if $_G['setting']['search']}-->
<!--{eval $slist = array();}-->
<!--{block slist[user]}--><li><a href="javascript:;" rel="user">{lang users}</a></li><!--{/block}-->
<!--{/if}-->
<!--{if $_G['setting']['search'] && $slist}-->
<div id="" class="{if $_G['setting']['srchhotkeywords'] && count($_G['setting']['srchhotkeywords']) > 5}scbar_narrow {/if}cl">
<form id="scbar_form" method="{if $_G[fid] && !empty($searchparams[url])}get{else}post{/if}" autocomplete="off" onsubmit="searchFocus($('scbar_txt'))" action="{if $_G[fid] && !empty($searchparams[url])}$searchparams[url]{else}search.php?searchsubmit=yes{/if}" target="_blank"">
<input type="hidden" name="mod" id="scbar_mod" value="forum" />
<input type="hidden" name="formhash" value="{FORMHASH}" />
<input type="hidden" name="srchtype" value="title" />
<input type="hidden" name="srhfid" value="$_G[fid]" />
<input type="hidden" name="srhlocality" value="$_G['basescript']::{CURMODULE}" />
<!--{if !empty($searchparams[params])}-->
<!--{loop $searchparams[params] $key $value}-->
<!--{eval $srchotquery .= '&' . $key . '=' . rawurlencode($value);}-->
<input type="hidden" name="$key" value="$value" />
<!--{/loop}-->
<input type="hidden" name="source" value="discuz" />
<input type="hidden" name="fId" id="srchFId" value="$_G[fid]" />
<input type="hidden" name="q" id="cloudsearchquery" value="" />
<!--{/if}-->
<div class="form-group">
<input type="text" name="srchtxt" id="s" autocomplete="off" x-webkit-speech speech placeholder="搜索…" class="form-control"/>
</div>
</form>
</div>
<!--{/if}-->

  

discuz x3.2简化的搜索框代码的更多相关文章

  1. WPF自定义搜索框代码分享

    首先下载搜索图标: 控件中的搜索图标下载地址:http://www.easyicon.net/1183666-Search_icon.html 搜索框设计过程比较简单: 1.先定义一个Rectangl ...

  2. 微信小程序搜索框代码组件

    search.wxml <view class="header"> <view class="search"> <icon typ ...

  3. discuz X3.1 源代码阅读,记录代码片段

    require_once libfile('function/post'); // /source/function/function_post.php require_once libfile('p ...

  4. extjs在窗体中添加搜索框

    在extjs中添加搜索框,搜索框代码如下: this.searchField = new Ext.ux.form.SearchField({            store : this.store ...

  5. 【代码笔记】iOS-点击搜索按钮,或放大镜后都会弹出搜索框

    一, 效果图. 二,工程图. 三,代码. RootViewController.h #import <UIKit/UIKit.h> #import "CLHSearchBar.h ...

  6. Discuz! x3.1的插件/utility/convert/index.php代码执行漏洞

    漏洞版本: Discuz! x3.1及以下版本 漏洞描述: Discuz! x3.1的插件/utility/convert/index.php存在代码执行漏洞,如果用户在使用完之后不删除,会导致网站容 ...

  7. bootStrap-table服务器端后台分页的使用,以及自定义搜索框的实现,前端代码到数据查询超详细讲解

    关于分页,之前一直纯手写js代码来实现,最近又需要用到分页,找了好多最终确定bootstrap-table,正好前端页面用的是bootstrap. 首先下载BootStrap-table的js和CSS ...

  8. Android开发 ---代码创建选项菜单、隐藏菜单项、菜单的生命周期,菜单按钮图标设置、搜索框、xml中设置子菜单

    1.activity_main.xml 描述: 定义了一个按钮 <?xml version="1.0" encoding="utf-8"?> < ...

  9. 将代码设置的剪切板内容通过输入法软件粘贴入app搜索框

    #进入app搜索框位置--双击#等待输入法软件弹出#将代码设置的剪切板内容通过输入法软件粘贴入app搜索框#搜索 import win32apiimport timeimport win32clipb ...

随机推荐

  1. [LeetCode] 152. Binary Tree Upside Down 二叉树的上下颠倒

    Given a binary tree where all the right nodes are either leaf nodes with a sibling (a left node that ...

  2. GreenPlum 大数据平台--segment 失效问题恢复

    1,问题检查 [gpadmin@greenplum01 conf]$ psql -c "select * from gp_segment_configuration where status ...

  3. spring( 二 ) DispatcherServlet

    参考文档: https://blog.csdn.net/sjjsh2/article/details/53054203 https://blog.csdn.net/w214019153/article ...

  4. C++ 类中的3种访问权限和继承方式

    访问权限:public 可以被任意实体访问,protected 只允许子类(无论什么继承方式)及本类的成员函数访问,private 只允许本类的成员函数访问.三种继承方式分别是 public 继承,p ...

  5. 多年老项目添加cocoapod管理之后的各种问题解决方案

    整个组件化过程中遇到的问题及解决方案原文出处 hehuoya.com pod install 报警告(debug.release..) 解决方案:other link flags : $(inheri ...

  6. Unsafe例子

    Java和C++语言的一个重要区别就是Java中我们无法直接操作一块内存区域,不能像C++中那样可以自己申请内存和释放内存.Java中的Unsafe类为我们提供了类似C++手动管理内存的能力,不建议使 ...

  7. Mysql load data infile 导入数据出现:Data truncated for column

    [1]Mysql load data infile 导入数据出现:Data truncated for column .... 可能原因分析: (1)数据库表对应字段类型长度不够或修改为其他数据类型( ...

  8. java poi 读取有密码加密的Excel文件

    String excelPath = "Excel文件路徑"; String password = "Excel文件密碼"; Workbook workbook ...

  9. pytest_demo_实战2_fixture应用

    1.py文件所在文件夹下创建 __init__.py 文件 2.文件夹目录下:创建conftest.py import pytest # @pytest.fixture() 里面没有参数,那么默认sc ...

  10. spring-session(二)与spring-boot整合实战

    前两篇介绍了spring-session的原理,这篇在理论的基础上再实战. spring-boot整合spring-session的自动配置可谓是开箱即用,极其简洁和方便.这篇文章即介绍spring- ...