destoon设置自定义搜索的方法
这篇文章主要介绍了destoon设置自定义搜索的方法,需要的朋友可以参考下
第一步:
在include/global.fun.php中加入两个函数
函数一:
function loseSpace($pcon){ $pcon = preg_replace("/ /","",$pcon); $pcon = preg_replace("/ /","",$pcon); $pcon = preg_replace("/ /","",$pcon); $pcon = preg_replace("/\r\n/","",$pcon); $pcon = str_replace(chr(13),"",$pcon); $pcon = str_replace(chr(10),"",$pcon); $pcon = str_replace(chr(9),"",$pcon); return $pcon; }
函数二:
function select_search($name,$tb,$fid){ global $db; $title=""; return $title; }
第一个函数的意思是过滤空格回车
第二个函数是根据 name(自定义字段) tb(所属模型) $fid(当前所选ID)生成下拉列表。
第二步:
在module/sell/search.inc.php中的$day = isset($day) ? intval($day) : 0;下插入
$chengse = isset($chengse)?intval($chengse):0;
在if($vip) $condition .= " AND vip>0";下加入
if($chengse) $condition .= " AND chengse=$chengse";
然后在模板文件中使用:
{select_search(chengse,sell,$chengse)}
,
Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

