在表单列表处右击 查看框架源代码
所以,在/dede/diy_list.php找到
打开diy_list.htm,在<div style='float:left'> <a href='diy_main.php'><b>自定义表单管理</b></a> > <b>内容列表</b></div>下方加下面代码
<!--加修改--> <div class="bodytitletxt" style="padding-left:10px;float: left;"> <form name='form1' action="diy_list.php"> <input type='hidden' name='action' value='list' /> <input type='hidden' name='diyid' value='<?php echo $diy->diyid; ?>' /> 关键字: <input type='text' name='keyword' size='20' value="<?php echo $keyword; ?>" /> <select name="field"> <?php foreach($fieldlist as $k=>$fielddata) { if($k==$field) { echo "<option value='{$k}' selected>{$fielddata[0]}</option>\r\n"; } else { echo "<option value='{$k}'>{$fielddata[0]}</option>\r\n"; } } ?> </select> <input type='submit' name='sb' value='确定' class="coolbg np" /> </form> </div> <!--加修改-->
然后在/dede/diy_list.php
找到
$query = "SELECT * FROM {$diy->table} ORDER BY id DESC";
改成
/*加修改*/ /*$query = "SELECT * FROM {$diy->table} ORDER BY id DESC";*/ if(empty($keyword)) { $keyword = ''; $addquery = ''; } else { $addquery = " WHERE {$field} LIKE '%".trim($keyword)."%' "; } $query = "SELECT * FROM {$diy->table} $addquery ORDER BY id DESC"; /*加修改*/
改成
扫描二维码关注公众号,回复:
2500587 查看本文章
![](/qrcode.jpg)
继续找到
$datalist->SetParameter('diyid', $diyid);
在它的下面加入
$datalist->SetParameter('keyword', $keyword); $datalist->SetParameter('field', $field);
效果为