帝国cms分类信息有效期字段搜索多条件搜索教程Empire CMSclassification information validity field search multiconditional search tutorial
First, the validity of the set
Classification information, usually set the validity period,such as: this information remains N days. Wait。 And everyoneis looking for ways to make sure the expiration date dependson the actual number of days and expired. Now I' ll share thedetails (I' ll try my best to explain them in detail)
1, add new fields in the management field in the classifiedinformation model:
Field set to:
Field name: enddate (this is an example and can be customized)Field ID: Custom
Field type: small character length (TEXT) can be left blankThe input form of display elements: date (date) length can beleft blank
* other do not choose not to fill. Field order numbers. Yes,it is the association between adding information and submittingthe document before and after the show
2. Remember to re modify the "management system model" in the
classified information. (tick the "enter form template" and"front submission form template")
A: entry search item submission required item list templatecontent template can increase the hook (this can be modifiedaccording to their own requirements. If you want to collect thisitem, please tick it.
3, add the following code in the appropriate section of thecontent information content template page: (smart tag SQL canbe changed as required)
- - - - - - - - - - - - - - - - - - --
Term of validity
[e:loop={' select * from [ [db.pre, ]ecms_info, where, checked=1,order, by, newstime, DESC, ID, DESC, limit, 1' , 1,24,0} ])"PHP?
$enddate= explode ("-", "$bqr[enddate]") ; "//enddate" is thefield name. If there is any change, please change all. I'vepainted the blue.
$newstime = explode ("$bqr[newstime]") ; / / release time,format: Y-m-d H: i:s
$lt =mktime (0,0,0, $enddate[1], $enddate[2], $enddate[0] ) ;$st = mktime (0,0,0, $newstime[1], $newstime[2],
$newstime[0]) ;
$overtime=$lt - $st;
$days=$overtime /86400;
If ($days<0)
{
Echo "this information has expired"; / / suggestions can bechanged to the form of pictures
}
Else
{
Echo "this information with <b><font color=red>". $days."</font></b> day"; / / CSS custom
}
>?
[/e: loop]
- - - - - - - - - - - - - - -end - - --
4, refresh the classified information page.
Two, click field search
Search for classified information (such as custom fields) . Forexample, the classified information page shows that theenterprise type is: individual enterprise. Then click on theindividual enterprise to search all the information aboutpersonal enterprise in the classified information table.Is simple: <a href= "" --news.url--]e/action/ListInfo/!Classid=[?! --classid--]&ph=1&field name n! - field name * *">[ ! - field name --]</a>
OK, is that easy?.
Three, multiple conditional search:
Example: (take my demo)
<FORM name=,,
"/e/search/index.php", "target=", "_blank", action=
<b><font color= "#ff6600" > item query: </font></b>
<input type= "hidden" name= "TBNAME" value= "info" > < -- >--info is the name of the table!
<input type="hidden"name="tempid"value= "2" > <! --2 is thesearch template ID note that the template must be classifiedinformation model -- >
<input type=><select name= "CLassID" > <! --classid is the following textfor column field value -- >
<option value= "" > industry category </option>
<option value= "105" > clothing bags </option>
<option value= "106" > environmental protection and energysaving </option>
<option value= "107" > Food & Beverage </option>
<option value="108" >decorative building materials </option><option value= "109" > technology network </option>
<option value= "110" health care </option>
<option value= "111" fitness beauty </option>
<option value= "112" > Home Gift </option>
<option value=, "113" > industrial equipment </option><option, value=, "114" > farming, breeding, </option><option value= "115" > processing agent </option>
<option value=, "116" > Science, art and literature, </option>
</select>
<input type=, "hidden", "name=", "show[]", "value=", "qylx" <!--qylx is a field name for the following text field value -- ><input type= "hidden" name= "hh[]" value= "EQ" > <! -- EQ isthe definitionof the scope of the search, according to the needto change the life
<SELECT name=, "keyboard[]", "type=", "text" >
<option value= ' ' > enterprise type '</option>'
<option value= "independent individual" > individual sole</option>
<option value= "state-owned enterprise" > State-ownedEnterprise </option>
<option value= "foreign enterprise" > foreign enterprise</option>
<option value= collective enterprise > collective enterprise</option>
<option value=, Sino foreign joint venture >Sino foreign jointventure </option>
</select>
<input type=,><input type=, "hidden", "name=", "hh[]", "value=", "EQ" ><SELECT name=, "keyboard[]", "type=", "text" >
<option value= "" > Investment Zone </option>
<option value= "national" > National </option>
<option value=, "Beijing" > Beijing </option>
<option value=, "Shanghai" > Shanghai </option>
<option value=, "Tianjin" > Tianjin </option>
<option value=, "Chongqing" > Chongqing </option>
<option value=, "Hebei" > Hebei </option>
<opt ion value=, "Henan" > Henan </option>
<option value=, "Hubei" > Hubei </option>
<option value=, "Shandong" > Shandong </option>
<opt ion value=, "Guangdong" > Guangdong </opt ion>
<option value=, "Guangxi" > Guangxi </option>
<option value=, "Fujian" > Fujian </option>
<option value=, "Jiangsu" > Jiangsu </option>
<option value=, "Zhejiang" > Zhejiang </option>
<opt ion value=, "Hunan" > Hunan </option>
<option value=, "Jiangxi" > Jiangxi </option>
<option value=, "Jilin" > Jilin </option>
<option value=, "Heilongjiang" > Heilongjiang </option><option value=, "Guizhou" > Guizhou </option>
<option value=, "Sichuan" > Sichuan </option>
<option value=, "Qinghai" > Qinghai </option>
<option value=, "Anhui" > Anhui </option>
<option value=, "Gansu" > Gansu </option>
<option value=, "Ningxia" > Ningxia </option>
<option value=, "Inner Mongolia" > Inner Mongolia </option><option value=, "Liaoning" > Liaoning </option>
<option value=, "Shaanxi" > Shaanxi </option>
<option value=, "Yunnan" > Yunnan </option>
<option value=, "Shanxi" > Shanxi </option>
<option value=, "Hainan" > Hainan </option>
<option value=, "Xinjiang" > Xinjiang </option>
<option value=, "Tibet" > Tibet </option>
<option value=, "Hongkong" > Hongkong </option>
<option value=, "Macao" > Macao </option>
<option value=, "Taiwan" > Taiwan </option>
</select>
<input type=, "hidden", "name=", "show[]", "value=", "jmhy" ><input type=, "hidden", "name=", "hh[]", "value=", "EQ" ><SELECT name=, "keyboard[]", "type=", "text" >
<option value= "> join fee range </option>
<option value= "go into details" > discuss </option> in detail<option value= "free entry fee" > free entry fee </option>
近日CloudCone发布了最新的补货消息,针对此前新年闪购年付便宜VPS云服务器计划方案进行了少量补货,KVM虚拟架构,美国洛杉矶CN2 GT线路,1Gbps带宽,最低3TB流量,仅需14美元/年,有需要国外便宜美国洛杉矶VPS云服务器的朋友可以尝试一下。CloudCone怎么样?CloudCone服务器好不好?CloudCone值不值得购买?CloudCone是一家成立于2017年的美国服务器...
hostround怎么样?大硬盘服务器,高防服务器。hostround,美国商家,2017年成立,正规注册公司(Company File #6180543),提供虚拟主机、VPS云主机、美国服务器、荷兰服务器租用等。现在有1款特价大硬盘独服,位于达拉斯,配置还不错,本月订购时包括免费 500Gbps DDoS 保护,有兴趣的可以关注一下。点击直达:hostround官方网站地址美国\荷兰独立服务器...
新网好不好?新网域名便宜吗?新网怎么样?新网是国内老牌知名域名注册商,企业正规化运营,资质齐全,与阿里云万网和腾讯云DNSPOD同为国内服务商巨头。近日新网发布了最新的七月放价季优惠活动,主要针对域名、云主机、企业邮箱、SSL证书等多款云产品推送了超值的优惠,其中.com顶级域名仅19.9元/首年,.cn域名仅16元/首年,云主机1核心2G内存3Mbps带宽仅9.9元/月,企业邮箱更是免费送1年,...