function DelArc($aid,$onlyfile=false,$channelid=0) { global $dsql; if(!is_object($dsql)) $dsql = new DedeSql(false); $tables = GetChannelTable($dsql,$aid,'arc'); //读取文档信息 $arctitle = ""; $arcurl = ""; $arcQuery = " Select a.ID,a.title,a.typeid, a.ismake,a.senddate,a.arcrank,c.addtable, a.money,t.typedir,t.typename,a.adminID, t.namerule,t.namerule2,t.ispart, t.moresite,t.siteurl,t.siterefer,t.sitepath from `{$tables['maintable']}` a left join `#@__arctype` t on a.typeid=t.ID left join `#@__channeltype` c on c.ID=a.channel where a.ID='$aid' "; $arcRow = $dsql->GetOne($arcQuery); if(!is_array($arcRow)) return false; //删除数据库的内容 $rs = $dsql->ExecuteNoneQuery("Delete From `{$tables['maintable']}` where ID='$aid'"); if($rs){ $dsql->ExecuteNoneQuery("Delete From `#@__full_search` where aid='$aid'"); if($arcRow['addtable']!=""){ $dsql->ExecuteNoneQuery("Delete From `{$tables['addtable']}` where aid='$aid'"); } $dsql->ExecuteNoneQuery("Delete From `#@__feedback` where aid='$aid'"); $dsql->ExecuteNoneQuery("Delete From `#@__memberstow` where arcid='$aid'"); } //删除HTML if($arcRow['ismake']==-1||$arcRow['arcrank']!=0 ||$arcRow['typeid']==0||$arcRow['money']>0){ return true; } $arcurl = GetFileUrl($arcRow['ID'],$arcRow['typeid'],$arcRow['senddate'],$arcRow['title'],$arcRow['ismake'], $arcRow['arcrank'],$arcRow['namerule'],$arcRow['typedir'],$arcRow['money'],false,''); if(!ereg("\?",$arcurl)){ $truedir = GetTruePath($arcRow['siterefer'],$arcRow['sitepath']); $htmlfile = $truedir.$arcurl; if(file_exists($htmlfile) && !is_dir($htmlfile)) unlink($htmlfile); $arcurls = explode(".",$arcurl); $sname = $arcurls[count($arcurls)-1]; $fname = ereg_replace("(\.$sname)$","",$arcurl); for($i=2;$i<=100;$i++){ $htmlfile = $truedir.$fname."_$i".".".$sname; if(file_exists($htmlfile) && !is_dir($htmlfile)) unlink($htmlfile); else break; } } //删除文本文件 $ipath = $GLOBALS['cfg_cmspath']."/data/textdata/".(ceil($aid/5000))."/"; $filename = $GLOBALS['cfg_basedir'].$ipath."{$aid}.txt"; if(is_file($filename)) unlink($filename); return true; }
} $sp->Clear(); unset($sp); $keywords = preg_replace("/#p#|#e#/","",$keywords); $keywords = addslashes($keywords); } //自动获取缩略图 if($autolitpic==1 && $litpic==''){ $litpic = GetDDImgFromBody($body); } $message = addslashes($body); $dsql = new DedeSql(false); $cts = GetChannelTable($dsql,$channelid); //更新数据库的SQL语句 //---------------------------------- $inQuery = " update `{$cts['maintable']}` set typeid=$typeid, smalltypeid=$smalltypeid, areaid=$areaid, areaid2=$areaid2, sectorid=$sectorid, sectorid2=$sectorid2, sortrank=$sortrank, pubdate=$pubdate, endtime=$endtime, title='$title',
ShowMsg("参数错误!","-1"); $dsql->Close(); exit(); } if($typeInfos['ispart']!=0){ ShowMsg("文档保存的栏目必须为最终列表栏目!","-1"); $dsql->Close(); exit(); } $arcids = explode('`',$qstr); $arc = ""; $j = 0; $okids = Array(); foreach($arcids as $arcid){ $arcid = ereg_replace('[^0-9]','',$arcid); $tables = GetChannelTable($dsql,$arcid,'arc'); if($tables['channelid']==$typeInfos['channeltype']) { $dsql->ExecuteNoneQuery("Update `{$tables['maintable']}` Set typeid='$targetTypeid' where ID='$arcid' "); $dsql->ExecuteNoneQuery("Update `{$tables['addtable']}` Set typeid='$targetTypeid' where aid='$arcid' "); $dsql->ExecuteNoneQuery("Update `#@__full_search` Set typeid='$targetTypeid' where aid='$arcid' "); $okids[] = $arcid; $j++; } } //更新HTML require_once(DEDEADMIN."/../include/inc_archives_view.php"); foreach($okids as $aid){ $arc = new Archives($aid); $arc->MakeHtml(); }
}else { $adminid = $cuserLogin->getUserID(); } require_once(dirname(__FILE__)."/../include/inc_typelink.php"); require_once(dirname(__FILE__)."/../include/pub_datalist_dm.php"); require_once(dirname(__FILE__)."/inc/inc_list_functions.php"); setcookie("ENV_GOBACK_URL",$dedeNowurl,time()+3600,"/"); //初始化频道信息 //------------------------------------ $seltypeids = 0; //if(empty($cid) && empty($channelid)) $channelid = 1; $tl = new TypeLink($cid); if($cid>0) $channelid = $tl->TypeInfos['channeltype']; $tables = GetChannelTable($tl->dsql,$channelid,'channel'); if($cid>0){ $positionname = str_replace($cfg_list_symbol,">",$tl->GetPositionName()).">"; $seltypeids = $tl->dsql->GetOne("Select ID,typename,channeltype From #@__arctype where ID='$cid' ",MYSQL_ASSOC); } else if($channelid>0){ $row = $tl->dsql->GetOne(" Select typename From #@__channeltype where ID='$channelid' "); $positionname = '所有'.$row[0].">"; }else{ $positionname = ''; } //--------------------------------------- $opall=1; if(is_array($seltypeids)){ $optionarr = GetTypeidSel('form3','cid','selbt1',0,$seltypeids['ID'],$seltypeids['typename']);
*/ $cart->clearItem(); ShowMsg("购物车中商品已全部清空!", "car.php"); exit; } elseif ($do == 'update') { /* function updateItem(); update car products number! */ if (isset($ids) && is_array($ids)) { foreach ($ids as $id) { $id = intval($id); $rs = $dsql->GetOne("SELECT id,channel,title FROM #@__archives WHERE id='{$id}'"); if (!is_array($rs)) { continue; } $cts = GetChannelTable($rs['channel']); $rows = $dsql->GetOne("SELECT aid as id,trueprice as price,units FROM `{$cts['addtable']}` WHERE aid='{$id}'"); if (!is_array($rows)) { continue; } $rows['buynum'] = intval(${'buynum' . $id}); if ($rows['buynum'] < 1) { //如果设单位数量小于1个时更新,则移出购物车 $cart->delItem($id); continue; } $rows['title'] = $rs['title']; $cart->addItem($id, $rows); } } ShowMsg("购物车中商品已全部更新!", "car.php");
$shorttitle = cn_substr($shorttitle,36); $color = cn_substr($color,10); $writer = cn_substr($writer,30); $source = cn_substr($source,50); $description = cn_substr($description,250); if($keywords!="") $keywords = trim(cn_substr($keywords,60))." "; if(!TestPurview('a_Check,a_AccCheck,a_MyCheck')){ $arcrank = -1; } //处理上传的缩略图 if(empty($ddisremote)) $ddisremote = 0; $litpic = GetDDImage('none',$picname,$ddisremote); $adminID = $cuserLogin->getUserID(); $dsql = new DedeSql(false); $tables = GetChannelTable($dsql,$ID,'arc'); //更新数据库的SQL语句 //---------------------------------- $inQuery = " update `{$tables['maintable']}` set typeid='$typeid', typeid2='$typeid2', sortrank='$sortrank', iscommend='$iscommend', redirecturl='$redirecturl', ismake='$ismake', arcrank='$arcrank', money='$money', title='$title', color='$color',
require_once(dirname(__FILE__)."/include/inc_digglist_view.php"); $typeid = (empty($typeid) ? 0 : intval($typeid)); $sorttype = (empty($sorttype) ? 'time' : preg_replace('/[^a-z]/isU','',$sorttype)); $dlist = new DiggList($typeid,$sorttype); $dlist->Display(); exit(); } else if($action=='digg') { $aid = preg_replace('/[^0-9]/sU','',$aid); if(empty($aid)) exit(); header("Pragma:no-cache"); header("Cache-Control:no-cache"); header("Expires:0"); header("Content-Type: text/html; charset=utf-8"); $dsql = new DedeSql(false); $tbs = GetChannelTable($dsql,$aid,'arc'); $dsql->ExecuteNoneQuery("Update `#@__full_search` set digg=digg+1,diggtime=".time()." where aid='$aid' "); $dsql->ExecuteNoneQuery("Update `{$tbs['maintable']}` set digg=digg+1,diggtime=".time()." where ID='$aid' "); $row = $dsql->GetOne("Select digg From `{$tbs['maintable']}` where ID='$aid' "); echo "<div class='diggNum'>{$row['digg']}</div>\r\n"; echo "<div class='diggLink'><a href='".$cfg_cmspath."/digg.php'>浏览</a></div>"; $dsql->Close(); exit(); } exit(); ?>