📄 cateatc.php
字号:
} if ($value['comments']) { $updatesql .= ($updatesql ? ',' : '')."comments=comments-'$value[comments]'"; } if (!empty($typesdb)) { foreach ($typesdb as $v) { if ($value[$v]) { $updatesql .= ($updatesql ? ',' : '')."$v=$v-'$value[$v]'"; } } } $updatesql && $db->update("UPDATE pw_user SET $updatesql WHERE uid='$key'"); } $db->update("DELETE FROM pw_carticle WHERE itemid{$tids}"); $db->update("DELETE FROM pw_collections WHERE itemid{$tids}"); $db->update("DELETE FROM pw_comment WHERE itemid{$tids}"); $db->update("DELETE FROM pw_footprint WHERE itemid{$tids}"); $db->update("DELETE FROM pw_items WHERE itemid{$tids}"); $db->update("DELETE FROM pw_taginfo WHERE itemid{$tids}"); $db->update("DELETE FROM pw_tblog WHERE itemid{$tids}"); $db->update("DELETE FROM pw_upload WHERE itemid{$tids}"); updatecache_cate($job); } else { $query = $db->query("SELECT uid FROM pw_gbook WHERE id{$tids}"); while ($rt = $db->fetch_array($query)) { $userdb[$rt['uid']]['msgs']++; } $db->free_result($query); foreach ($userdb as $key => $value) { $db->update("UPDATE pw_user SET msgs=msgs-'$value[msgs]' WHERE uid='$key'"); } $db->update("DELETE FROM pw_gbook WHERE id{$tids}"); } } elseif ($type == 'allowcheck') { $itemids = ''; $catedb = $userdb = $typedb = $typesdb = array(); $query = $db->query("SELECT itemid,cid,uid,type,ifcheck FROM pw_items WHERE itemid{$tids}"); while ($rt = $db->fetch_array($query)) { if (!$rt['ifcheck']) { $catedb[$rt['cid']]['num']++; $userdb[$rt['uid']]['items']++; $itemids .= ($itemids ? ',' : '')."'$rt[itemid]'"; $typedb[$rt['type']][] = array($rt['uid'],$rt['itemid']); } } if ($itemids) { $itemids = strpos($itemids,',')===false ? "=$itemids" : " IN ($itemids)"; $query = $db->query("SELECT uid FROM pw_comment WHERE ifcheck='1' AND itemid{$itemids}"); while ($rt = $db->fetch_array($query)) { $userdb[$rt['uid']]['comments']++; } $query = $db->query("SELECT tagid,tagtype,COUNT(*) AS tagnum FROM pw_taginfo WHERE itemid{$itemids} GROUP BY tagid"); while ($rt = $db->fetch_array($query)) { if ($rt['tagid'] && $rt['tagtype']) { $tagnum = "{$rt[tagtype]}num"; $db->update("UPDATE pw_tags SET allnum=allnum+$rt[tagnum],$tagnum=$tagnum+$rt[tagnum] WHERE tagid='$rt[tagid]'"); } } } $db->free_result($query); foreach ($catedb as $key => $value) { $db->update("UPDATE pw_categories SET counts=counts+'$value[num]' WHERE cid='$key'"); } foreach ($typedb as $key => $value) { foreach ($value as $k => $v) { $userdb[$v[0]][$key.'s']++; } !in_array($key.'s',$typesdb) && $typesdb[] = $key.'s'; } foreach ($userdb as $key => $value) { $updatesql = ''; if ($value['items']) { $updatesql .= ($updatesql ? ',' : '')."items=items+'$value[items]'"; } if ($value['comments']) { $updatesql .= ($updatesql ? ',' : '')."comments=comments+'$value[comments]'"; } if (!empty($typesdb)) { foreach ($typesdb as $v) { if ($value[$v]) { $updatesql .= ($updatesql ? ',' : '')."$v=$v+'$value[$v]'"; } } } $updatesql && $db->update("UPDATE pw_user SET $updatesql WHERE uid='$key'"); } $db->update("UPDATE pw_items SET ifcheck='1' WHERE itemid{$itemids}"); updatecache_cate($job); } elseif ($type == 'setdigest') { $db->update("UPDATE pw_items SET digest='".(int)$digest."' WHERE itemid{$tids}"); } elseif ($type == 'setcid') { $itemids = ''; $catedb = array(); $query = $db->query("SELECT itemid,cid,ifcheck FROM pw_items WHERE itemid{$tids}"); while ($rt = $db->fetch_array($query)) { if ($rt['ifcheck'] && $rt['cid'] != $atccid) { $catedb[$rt['cid']]++; $itemids .= ($itemids ? ',' : '')."'$rt[itemid]'"; } } $db->free_result($query); if ($itemids) { $itemids = strpos($itemids,',')===false ? "=$itemids" : " IN ($itemids)"; foreach ($catedb as $key => $value) { $db->update("UPDATE pw_categories SET counts=counts-'$value' WHERE cid='$key'"); } $db->update("UPDATE pw_items SET cid='".(int)$atccid."' WHERE itemid{$itemids}"); updatecache_cate($job); } } adminmsg('operate_success'); } elseif ($_POST['step']==2) { require_once(R_P.'mod/windcode.php'); require_once(R_P.'mod/upload_mod.php'); InitGP(array('atc_cid','atc_oldcid','atc_dirid','atc_iconid','atc_allowreply','atc_ifhide','atc_tagdb'),'P'); $attachdb = $_POST['attachdb']; list($atc_title,$atc_content) = ConCheck($_POST['atc_title'],$_POST['atc_content']); $atc_usesign = $_POST['atc_ifsign'] ? 1 : 0; ($_GROUP['htmlcode'] && $_POST['atc_htmlcode']) && $atc_usesign += 2; $atc_content = Atc_cv($atc_content,$atc_usesign); $ifconvert = ($atc_content==convert($atc_content,$db_post)) ? 0 : 1; $updatefeile = ''; if ($job == 'photo') { $absurldb = GetGP('absurldb','P'); $absoluteurl = array(); !is_array($absurldb) && $absurldb = array(); foreach ($absurldb as $key => $value) { (int)$key > -1 && $value && !is_array($value) && $absoluteurl[$key] = $value; } unset($absurldb); if (!empty($absoluteurl)) { Strip_S($absoluteurl); $absoluteurl = addslashes(serialize($absoluteurl)); } else { $updatefeile = ''; } $updatefeile = ",absoluteurl='$absoluteurl'"; } elseif ($job == 'music') { InitGP(array('singer','songname','songurl'),'P'); $songurldb = array(); !is_array($songname) && $songname = array(); !is_array($songurl) && $songurl = array(); foreach ($songname as $key => $value) { (int)$key > -1 && $value && !is_array($value) && $songurldb[$key]['name'] = $value; } foreach ($songurl as $key => $value) { (int)$key > -1 && $value && !is_array($value) && $songurldb[$key]['url'] = $value; } unset($songname,$songurl); if (!empty($songurldb)) { Strip_S($songurldb); $songurldb = addslashes(serialize($songurldb)); } else { $songurldb = ''; } $updatefeile = ",singer='$singer',musicurl='$songurldb'"; } elseif ($job == 'goods') { InitGP(array('quality','price','feemode','maillfee','expressfee','emsfee','province','city','alipay','paypal','pay99bill'),'P'); $price = (int)$price; $feemode = (int)$feemode; $maillfee = (int)$maillfee; $expressfee = (int)$expressfee; $emsfee = (int)$emsfee; $updatefeile = ",quality='$quality',price='$price',feemode='$feemode',maillfee='$maillfee',expressfee='$expressfee',emsfee='$emsfee',province='$province',city='$city',alipay='$alipay',paypal='$paypal',pay99bill='$pay99bill'"; } elseif ($job == 'file') { InitGP(array('filesize','unit','version','updatetime','language','filetype','os','level','publish','publishlink','manner','filename','fileurl'),'P'); $fileurldb = $osdb = array(); !is_array($filename) && $filename = array(); !is_array($fileurl) && $fileurl = array(); !is_array($os) && $os = array(); $filesize = (int)$filesize; foreach ($filename as $key => $value) { (int)$key > -1 && $value && !is_array($value) && $fileurldb[$key]['name'] = $value; } foreach ($fileurl as $key => $value) { (int)$key > -1 && $value && !is_array($value) && $fileurldb[$key]['url'] = $value; } unset($filename,$fileurl); if (!empty($fileurldb)) { Strip_S($fileurldb); $fileurldb = addslashes(serialize($fileurldb)); } else { $fileurldb = ''; } foreach ($os as $key => $value) { (int)$key > -1 && $value && !is_array($value) && $osdb[$key] = $value; } $os = ''; if (!empty($osdb)) { $os = implode(',',$osdb); empty($os) && $os = ''; } $updatefeile = ",absoluteurl='$fileurldb',size='$filesize',unit='$unit',version='$version',updatetime='$updatetime',language='$language',type='$filetype',os='$os',level='$level',publish='$publish',publishlink='$publishlink',manner='$manner'"; } elseif ($job == 'bookmark') { $bookmarkurl = GetGP('bookmarkurl','P'); (empty($bookmarkurl) || !ereg("^http|mms",$bookmarkurl)) && adminmsg('operate_error'); $updatefeile = ",bookmarkurl='$bookmarkurl'"; } $job != 'blog' && !$updatefeile && adminmsg('undefined_action'); $atc_cid = (int)$atc_cid; $atc_oldcid = (int)$atc_oldcid; $atc_iconid = (int)$atc_iconid; $atc_allowreply = (int)$atc_allowreply; $atc_ifhide = (int)$atc_ifhide; !is_array($atc_tagdb) && $atc_tagdb = array(); $tagdb = array(); if ($atc_oldcid != $atc_cid && $atc['ifcheck']) { $db->update("UPDATE pw_categories SET counts=counts-1 WHERE cid='$atc_oldcid'"); $db->update("UPDATE pw_categories SET counts=counts+1 WHERE cid='$atc_cid'"); updatecache_cate($job); } $db->update("UPDATE pw_items SET cid='$atc_cid',dirid='$atc_dirid',icon='$atc_iconid',subject='$atc_title',allowreply='$atc_allowreply',ifhide='$atc_ifhide' WHERE itemid='$itemid'"); foreach ($atc_tagdb as $key => $value) { (int)$key > -1 && $value && !is_array($value) && $tagdb[$key] = $value; } unset($atc_tagdb); !empty($tagdb) && $atc_tagdb = implode(',',array_unique($tagdb)); $db->update("UPDATE pw_$job SET tags='$atc_tagdb',ifsign='$atc_usesign'{$updatefeile},ifconvert='$ifconvert',content='$atc_content' WHERE itemid='$itemid'"); UploadSQL($atc['uid'],$itemid,$atc_cid,$job); } adminmsg('operate_success');} else { $postdate1 = '2004-01-01'; $postdate2 = get_date($timestamp+24*3600,'Y-m-d');}include PrintEot('cateatc');footer();function PwStrtoTime($date){ global $db_timedf; return function_exists('date_default_timezone_set') ? strtotime($date) - $db_timedf*3600 : strtotime($date);}function getitemtype($type,$uid = null){ global $db,$winduid; empty($uid) && $uid = $winduid; $items = array(); $query = $db->query("SELECT typeid,name,vieworder FROM pw_itemtype WHERE uid='$uid' AND type='$type' ORDER BY vieworder ASC"); while ($rt = $db->fetch_array($query)) { $rt['name'] = preg_replace('/\<(.+?)\>/is','',$rt['name']); $rt['vieworder'] = (int)$rt['vieworder']; $items[] = $rt; } return $items;}?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -