帝国cms搜索表单制作语法

帝国cms搜索表单制作语法,第1张

概述搜索表单制作语法帝国网站管理系统4.7提供强大的搜索功能。搜索表单变量说明


搜索表单制作语法:帝国网站管理系统4.7提供强大的搜索功能。


搜索表单变量说明


变量名说明例子
搜索表单提交地址POST方式:/e/search/index.PHP<form name="searchform" method="post" action="/e/search/index.PHP">
GET方式:/e/search/?searchget=1/e/search/?searchget=1&keyboard=帝国&show=Title
keyboard搜索关键字变量<input name="keyboard" type="text">
show搜索字段变量(多个字段用","格开。搜索字段必须是后台模型开启搜索的字段)<input type="hIDden" name="show" value="Title,newstext">
classID搜索栏目ID(不设置为不限,多个栏目可用","格开,设置父栏目会搜索所有子栏目)<input type="hIDden" name="classID" value="1">
ztID搜索专题ID(不设置为不限,多个专题可用","格开)<input type="hIDden" name="ztID" value="1">
tbname按数据表搜索(需与搜索模板ID结合)<input type="hIDden" name="tbname" value="news">
tempID所用搜索模板ID(一般跟按表搜索结合使用)<input type="hIDden" name="tempID" value="1">
starttime与endtime分别为搜索发布起始时间与结束时间的信息(不填为不限.格式:2008-02-27)<input name="starttime" type="text" value="0000-00-00" size="12">
<input name="endtime" type="text" value="0000-00-00" size="12">
startprice与endprice分别为商品价格的起始价格与结束价格(不填为不限)<input name="startprice" type="text" value="0" size="6">
<input name="endprice" type="text" value="0" size="6">
搜索特殊字段ID : 按信息ID搜索
keyboard : 按关键字搜索(可实现按Tags列出信息)
userID : 按发布者用户ID搜索
username : 按发布者用户名搜索
<input type="hIDden" name="show" value="keyboard">
member值为0则不限制
值为1则为只搜索会员投稿的信息
值为2则为只搜索管理员增加的信息
<input type="hIDden" name="member" value="1">
orderby排序字段:
0:按发布日期(默认)
1:按ID
2:按评论数
3:按浏览人气
4:按下载数
<input type="hIDden" name="orderby" value="1">
myorder排序方式:
0:倒序排列(默认)
1:顺序排列
<input type="hIDden" name="myorder" value="1">
andor设置多条件查询之间关联关系,有两种:
or : 或者的关系(默认)
and : 并且的关系
<input type="hIDden" name="andor" value="and">
hh逻辑运算联结符变量:
LT : 小于
GT : 大于
EQ : 等于
LE : 小于等于
GE : 大于等于
NE : 不等于
IN : 包含(搜索关键字用空格隔开每个值)
BT : 范围,两个值之间(搜索关键字用空格隔开两个值)
LK : 模糊查询(默认)
<input type="hIDden" name="hh" value="LK">


单条件搜索表单制作范例


一、表单范例1:
1、用Dreamweaver制作好表单:
设计视图:
代码模式下的表单代码
<table wIDth="320" border="0" cellspacing="1" cellpadding="3"><form name="searchform" method="post" action="/e/search/index.PHP"><tr> <td>关键字:<input name="keyboard" type="text" size="10"></td> <td>范围: <select name="show"> <option value="Title">标题</option> <option value="smalltext">简介</option> <option value="newstext">内容</option> <option value="writer">作者</option> <option value="Title,smalltext,newstext,writer">搜索全部</option> </select></td></tr><tr> <td>栏 目: <select name="classID"> <option value="0">搜索全部</option> <option value="1">新闻中心</option> <option value="4">技术文档</option> <option value="22">下载中心</option> </select> </td> <td><input type="submit" name="submit" value="搜索"></td></tr></form></table>


搜索表单多条件并列搜索语法说明


多字段、多逻辑运算联结符并列搜索
(一)、多字段并列搜索:有“字符串”与“数组”两种传递方式
1、字符串传递为例子:
<input type="hIDden" name="hh" value="LK">
<input type="hIDden" name="show" value="Title,writer">
<input type="hIDden" name="keyboard" value="标题,作者">
(说明:上面为模糊查询Title字段包含“标题”字符或者writer字段包含“作者”的信息)
2、数组传递为例子:
<input type="hIDden" name="hh" value="LK">
<input type="hIDden" name="show[]" value="Title">
<input type="hIDden" name="keyboard[]" value="标题">
<input type="hIDden" name="show[]" value="writer">
<input type="hIDden" name="keyboard[]" value="作者">
(说明:上面为模糊查询Title字段包含“标题”字符或者writer字段包含“作者”的信息)
(二)、多逻辑运算联结符并列搜索
1、字符串传递为例子:
<input type="hIDden" name="hh" value="LK,EQ">
<input type="hIDden" name="show" value="Title,作者">
(说明:上面为模糊查询Title字段包含“标题”字符或者writer字段等于“作者”的信息)
2、字符串传递为例子:
<input type="hIDden" name="show[]" value="Title">
<input type="hIDden" name="hh[]" value="LK">
<input type="hIDden" name="keyboard[]" value="标题">
<input type="hIDden" name="show[]" value="writer">
<input type="hIDden" name="hh[]" value="EQ">
<input type="hIDden" name="keyboard[]" value="作者">
(说明:上面为模糊查询Title字段包含“标题”字符或者writer字段等于“作者”的信息)


多条件并列搜索的表单制作范例


二、表单范例2:实现按标题、作者、录入者与信息ID同时搜索的表单
1、用Dreamweaver制作好表单:

代码模式下的表单代码


上面例子HTML代码
<form name="searchform" method="post" action="/e/search/index.PHP"> <table wIDth="550" border="0" align="center" cellpadding="3" cellspacing="1" ><input type="hIDden" name="tbname" value="news"><input type="hIDden" name="tempID" value="1"><input type="hIDden" name="andor" value="and"><tr > <td colspan="2">新闻搜索</td></tr><tr bgcolor="#FFFFFF"> <td wIDth="97">标题:</td> <td wIDth="388"> <input type="hIDden" name="show[]" value="Title"> <input type="hIDden" name="hh[]" value="LK"> <input name="keyboard[]" type="text"> </td></tr><tr bgcolor="#FFFFFF"> <td>作者:</td> <td> <input type="hIDden" name="show[]" value="writer"> <input type="hIDden" name="hh[]" value="LK"> <input name="keyboard[]" type="text"> </td></tr><tr bgcolor="#FFFFFF"> <td>录入者:</td> <td> <input type="hIDden" name="show[]" value="username"> <input type="hIDden" name="hh[]" value="EQ"> <input name="keyboard[]" type="text"> </td></tr><tr bgcolor="#FFFFFF"> <td>信息ID范围:</td> <td> <input type="hIDden" name="show[]" value="ID"> <input type="hIDden" name="hh[]" value="BT"> <input name="keyboard[]" type="text"> <Font color="#666666">(例:“1 6”表示1到6之间) </Font> </td></tr><tr bgcolor="#FFFFFF"> <td>&nbsp;</td> <td> <input type="submit" name="submit" value="马上搜索"> <Font color="#666666">(不设置为不限)</Font> </td></tr> </table></form>


总结

以上是内存溢出为你收集整理的帝国cms搜索表单制作语法全部内容,希望文章能够帮你解决帝国cms搜索表单制作语法所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zz/1007541.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-22
下一篇 2022-05-22

发表评论

登录后才能评论

评论列表(0条)

保存