[分享]v3為拍賣增加檢索功能

版主: 涅魂, 簫哥

51cjh
 

[分享]v3為拍賣增加檢索功能

文章51cjh » 2006-06-30 12:31 pm

拍賣區裏邊的東西越來越多,無法檢索是不是很苦惱?

增加檢索功能方法如下:


脩改文件:
wog_act_bid.php

找到function bid_view()

==========

找到
代碼: 選擇全部
global $DB_site,$_GET,$a_id,$wog_arry,$wog_item_tool;


脩改為
代碼: 選擇全部
      global $DB_site,$_GET,$a_id,$wog_arry,$wog_item_tool,$HTTP_COOKIE_VARS;

      $qKey = $_GET["qKey"];
      if($qKey!="s")
      {
         $HTTP_COOKIE_VARS["wog_qStr"] = "";
         setcookie("wog_qStr","");
      }      
      $qStr = $_GET["qStr"];
      if($qStr!="")
      {
         setcookie("wog_qStr",$qStr);
         $qKey = "s";
      }
      if(!empty($HTTP_COOKIE_VARS["wog_qStr"]))
      {
         $qStr = $HTTP_COOKIE_VARS["wog_qStr"];
      }


=========

找到
代碼: 選擇全部
$sale_total=$DB_site->query_first("select count(a.s_id) ... in (".$d_type.")");


改為
代碼: 選擇全部
$sale_total=$DB_site->query_first("select count(a.s_id) ... in (".$d_type.") and c.d_name LIKE '%$qStr%'");


===============

找到
代碼: 選擇全部
$sale_total=$DB_site->query_first("select count(a.pe_id) ... and a.pe_st=1");


改為
代碼: 選擇全部
$sale_total=$DB_site->query_first("select count(a.pe_id) ... and a.pe_st=1 and a.pe_name LIKE '%$qStr%'");


========

找到
代碼: 選擇全部
$sale=$DB_site->query("select b.p_name,c.d_name,c.d_at,... in (".$d_type.") ORDER BY a.s_money,a.dateline LIMIT ".$spage.",8 ");


改為
代碼: 選擇全部
$sale=$DB_site->query("select b.p_name,c.d_name,c.d_at,... in (".$d_type.") and c.d_name LIKE '%$qStr%' ORDER BY a.s_money,a.dateline LIMIT ".$spage.",8 ");


=======

找到
代碼: 選擇全部
$sale=$DB_site->query("select b.p_name,a.pe_id,a.pe_name,... and a.pe_st=1 ORDER BY a.pe_money,a.pe_s_dateline desc LIMIT ".$spage.",8 ");


改為
代碼: 選擇全部
$sale=$DB_site->query("select b.p_name,a.pe_id,a.pe_name,... and a.pe_st=1 and a.pe_name LIKE '%$qStr%' ORDER BY a.pe_money,a.pe_s_dateline desc LIMIT ".$spage.",8 ");


==========

找到
代碼: 選擇全部
showscript("parent.sale_view($sale_total[0],".$_GET["page"].",'$temp_s',".$_GET["type"].")");


改為
代碼: 選擇全部
showscript("parent.sale_view($sale_total[0],".$_GET["page"].",'$temp_s',".$_GET["type"].",'$qKey')");



==============================


新建文件:
./wog_sale_search.htm

內容:
代碼: 選擇全部
<html>
<head>
<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=big5">
<STYLE type="text/css">
body,tr,td,th { font-size: 9pt; font-family: verdana }
</STYLE>
</head>
<body bgcolor="#000000">
<form action="wog_etc.php" method="get" name="pageform" target="mission">
<input type="hidden" name="page" value="1">
<input type="hidden" name="f" value="sale">
<input type="hidden" name="act" value="view">
<table width="97%" align="center">
   <TR height="50">
      <TD></TD>
      <TD></TD>
      <TD></TD>
   </TR>
   <TR>
      <TD></TD>
      <TD align="center"><FONT COLOR="#FFFFFF">請輸入商品名稱:</FONT>&nbsp;<INPUT TYPE="text" size="18" NAME="qStr">&nbsp;&nbsp;<INPUT TYPE="submit" value="檢索"></TD>
      <TD></TD>
   </TR>
   <TR>
      <TD></TD>
      <TD></TD>
      <TD></TD>
   </TR>
   </TABLE>
</FORM>
</body>
</html>

================================

脩改文件:
wog.js

找到

代碼: 選擇全部
function sale_view(saletotal,page,s,type)


脩改為

代碼: 選擇全部
function sale_view(saletotal,page,s,type,qkey)


==============

找到

代碼: 選擇全部
f.write('<input type="hidden" name="act" value="view">');


在后邊追加:
代碼: 選擇全部
f.write('<input type="hidden" name="qKey"  value="'+qkey+'"><CENTER><input type="button" value=" 檢索商品 " onclick="top.wog_view.location.replace(\'wog_sale_search.htm\');"></CENTER>');


==============


OK 商品拍賣 添加檢索功能完畢

本想將檢索功能集成到拍賣區的頁麵中,可惜存在比較痲煩的UTF8編碼問題。為暸不額外增加轉換編碼的代碼,因此使用一個新的頁麵 wog_sale_search.htm 來輸入檢索條件並用Cookies記住檢索條件,以便解決編碼問題。



51cjh
 

文章51cjh » 2006-06-30 2:46 pm

可以的话 请管理员看一下我的申请
http://www.et99.org/viewtopic.php?p=3858713#3858713




涅魂
 
文章: 4463
註冊時間: 2004-01-04 11:17 am
來自: Taiwan
性別: 男生

文章涅魂 » 2006-06-30 10:59 pm

不錯,接下GP吧~

而您的申請不符合申請格式,請自行修改後再通知



51cjh
 

文章51cjh » 2006-07-01 1:52 am

管理员 申请格式已经修改好了

http://www.et99.org/viewtopic.php?p=3858713#3858713




涅魂
 
文章: 4463
註冊時間: 2004-01-04 11:17 am
來自: Taiwan
性別: 男生

文章涅魂 » 2006-07-01 7:26 am

嗯,已經幫您加上去囉 :o




回到 外掛區

誰在線上

正在瀏覽這個版面的使用者:沒有註冊會員 和 1 位訪客

cron