out.php
资源名称:BBWPS.rar [点击查看]
上传用户:yttaitong
上传日期:2009-05-10
资源大小:128k
文件大小:2k
源码类别:
WEB源码(ASP,PHP,...)
开发平台:
PHP
- <?PHP
- /*
- [BBWPS!] (C)2006-2010 小蜜蜂版权所有.
- This is NOT a freeware, use is subject to license terms
- 时间:2007年12月
- 描述:促销模块---API_OUT
- */
- error_reporting(0);
- require_once("../class/mysql_class.php");
- require_once("../class/out_class.php");
- require_once("../config.php");
- require_once("../function/checkModuleSession.php");
- require_once("../function/function.php");
- require_once("../config/baseCheckCode.php");
- $db =new DB($hostname,$username,$password,$database);
- $check = $_GET['check'];
- $checkNum = substr($check,-1);
- $check = substr($check,0,-1);
- $nowCheck = MakeMd5($baseCheckCode,$checkNum);
- $action =$_GET["type"];
- $catid =$_GET['catid'];
- $limit =$_GET["number"];
- if($catid){
- $sql = "select * from {$prefix}sort where sparent='{$catid}'";
- $result=$db->query($sql,1);
- while($row = $db->fetch_array($result)){
- $tmp_cat[]=$row["sid"];
- }
- if(count($tmp_cat)>0){
- $cat="sid in ({$catid}";
- for($i=0;$i<count($tmp_cat);$i++){
- $sql = "select * from {$prefix}sort where sid='{$tmp_cat[$i]}'";
- $result = $db->query($sql,1);
- $rs = $db->fetch_array($result);
- $cat.=",".$rs["sid"];
- }
- $cat.=")";
- }
- else{
- $cat="sid='{$catid}'";
- }
- }
- else{
- $cat="";
- }
- if($limit){$limitString="limit 0,$limit";} else{$limitString="limit 0,10";}
- if(!$action){$action="btime";}
- switch ($action){
- case "btime":
- $order="order by btime desc";break;
- case "hits":
- $order="order by hits desc";break;
- default:
- $order="order by nprice desc";break;
- }
- $sql="select * from ".$prefix."message where etime>'".time()."' and $cat $order $limitString";
- $rts=$db->query($sql,true);
- $out=new OUTFeed("1.0");
- while ($rs = $db->fetch_array($rts)){
- $itemArray=array();
- $itemArray["title"] =$rs["title"];
- $itemArray["sid"] =$rs["sid"];
- $itemArray["oprice"] =$rs["oprice"];
- $itemArray["nprice"] =$rs["nprice"];
- $itemArray["link"] ="http://".$host.$installPath."/?f-showmessage--mid-".$rs["mid"]."--cid-".$rs["cid"]."--sid-".$rs["sid"].".html";
- $itemArray["pubtime"]=date("m-d",$rs["bdate"]);
- $out->addFeedItem($itemArray);
- }
- $out->releaseFeed();
- ?>