一区二区三区欧美日韩-一区二区三区欧美-一区二区三区免费在线视频-一区二区三区免费在线观看-久久精品店-久久精品第一页

歡迎您光臨深圳塔燈網(wǎng)絡(luò)科技有限公司!
電話圖標(biāo) 余先生:13699882642

destoon7.0后臺(tái)欄目分類一鍵獲取所有欄目拼音目錄的修改

發(fā)表日期:2019-09 文章編輯:小燈 瀏覽次數(shù):3546

? ? ? ? 用于DESTOON7.0系統(tǒng)
? ? ? ?
? ? ? ?到admin 目錄替換 category.inc.php


刷新后臺(tái),然后每個(gè)模塊的欄目分類后面會(huì)多一個(gè)菜單-批量拼音目錄,點(diǎn)這個(gè)就菜單就可以了

代碼修改不陳述,直接上全部代碼

以下為category.inc.php代碼

<?phpdefined('DT_ADMIN') or exit('Access Denied');$mid or $mid = 4;$CATEGORY = cache_read('category-'.$mid.'.php');$MOD = cache_read('module-'.$mid.'.php');$NUM = count($CATEGORY);$catid = isset($catid) ? intval($catid) : 0;$do = new category($mid, $catid);$parentid = isset($parentid) ? intval($parentid) : 0;$table = $DT_PRE.'category';$menus = array (array('添加分類', '?file='.$file.'&action=add&mid='.$mid.'&parentid='.$parentid),array('管理分類', '?file='.$file.'&mid='.$mid),array('分類復(fù)制', '?file='.$file.'&action=copy&mid='.$mid),array('更新緩存', '?file='.$file.'&action=caches&mid='.$mid),array('更新地址', '?file='.$file.'&action=url&mid='.$mid),array('更新統(tǒng)計(jì)', '?file='.$file.'&action=count&mid='.$mid),array('批量索引', '?file='.$file.'&action=letters&mid='.$mid),array('批量拼音目錄', '?file='.$file.'&action=allletter&mid='.$mid), );if(strpos($forward, 'category') === false) $forward = '?file='.$file.'&mid='.$mid.'&parentid='.$parentid.'&kw='.urlencode($kw);switch($action) {case 'add':if($submit) {if(!$category['catname']) msg('分類名不能為空');$category['catname'] = trim($category['catname']);$childs = '';$catids = array();if(strpos($category['catname'], "\n") === false) {$category['catdir'] = $do->get_catdir($category['catdir']);$do->add($category);$childs .= ','.$do->catid;$catids[] = $do->catid;} else {$catnames = explode("\n", $category['catname']);foreach($catnames as $catname) {$catname = trim($catname);if(!$catname) continue;$category['catname'] = $catname;$category['catdir'] = '';$category['letter'] = '';$category['seo_title'] = '';$category['seo_keywords'] = '';$category['seo_description'] = '';$do->add($category);$childs .= ','.$do->catid;$catids[] = $do->catid;}}if($category['parentid']) {$parents = array();$cid = $category['parentid'];$parents[] = $cid;while(1) {if($CATEGORY[$cid]['parentid']) {$parents[] = $cid = $CATEGORY[$cid]['parentid'];} else {break;}}foreach($parents as $catid) {$arrchildid = $CATEGORY[$catid]['child'] ? $CATEGORY[$catid]['arrchildid'].$childs : $catid.$childs;$db->query("UPDATe {$table} SET child=1,arrchildid='$arrchildid' WHERe catid=$catid");}}foreach($catids as $catid) {$CATEGORY[$catid] = $db->get_one("SELECT * FROM {$table} WHERe catid=$catid");update_category($CATEGORY[$catid]);}$NUM > 500 ? $do->cache() : $do->repair();dmsg('添加成功', '?file='.$file.'&mid='.$mid.'&parentid='.$category['parentid']);} else {include tpl('category_add');}break;case 'edit':$catid or msg();if($submit) {if(!$category['catname']) msg('分類名不能為空');if($category['parentid'] == $catid) msg('上級(jí)分類不能與當(dāng)前分類相同');$do->edit($category);$category['catid'] = $catid;update_category($category);$NUM > 500 ? $do->cache() : $do->repair();dmsg('修改成功', '?file='.$file.'&mid='.$mid.'&parentid='.$category['parentid']);} else {extract($db->get_one("SELECT * FROM {$table} WHERe catid=$catid"));include tpl('category_edit');}break;case 'copy':if($submit) {if(!$fromid) msg('源模塊ID不能為空');if(!$save) $db->query("DELETe FROM {$table} WHERe moduleid=$mid");$result = $db->query("SELECt * FROM {$table} WHERe moduleid=$fromid ORDER BY catid");$O = $R = array();while($r = $db->fetch_array($result)) {$O[$r['catid']] = $r['catname'];$sqlk = $sqlv = '';$catid = $r['catid'];unset($r['catid']);$r['moduleid'] = $mid;$r['item'] = $r['property'] = 0;$r = daddslashes($r);foreach($r as $k=>$v) {$sqlk .= ','.$k; $sqlv .= ",'$v'";}$sqlk = substr($sqlk, 1);$sqlv = substr($sqlv, 1);$db->query("INSERT INTO {$table} ($sqlk) VALUES ($sqlv)");$R[$catid] = $db->insert_id();}$result = $db->query("SELECt * FROM {$table} WHERe moduleid='$mid' ORDER BY catid");while($r = $db->fetch_array($result)) {$catid = $r['catid'];$v = $r['parentid'];$parentid = isset($R[$v]) ? $R[$v] : $v;$arrparentid = explode(',', $r['arrparentid']);foreach($arrparentid as $k=>$v) {if(isset($R[$v])) $arrparentid[$k] = $R[$v];}$arrparentid = implode(',', $arrparentid);$arrchildid = explode(',', $r['arrchildid']);foreach($arrchildid as $k=>$v) {if(isset($R[$v])) $arrchildid[$k] = $R[$v];}$arrchildid = implode(',', $arrchildid);$db->query("UPDATe {$table} SET parentid='$parentid',arrparentid='$arrparentid',arrchildid='$arrchildid' WHERe catid=$catid");}$do->repair();msg('分類復(fù)制成功', '?file='.$file.'&action=url&&mid='.$mid.'&forward='.urlencode('?file='.$file.'&mid='.$mid));} else {include tpl('category_copy');}break;case 'caches':msg('開(kāi)始更新統(tǒng)計(jì)', "?file=$file&mid=$mid&action=count");break;case 'count':require DT_ROOT.'/include/module.func.php';$tb = get_table($mid);if($MODULE[$mid]['module'] == 'club') $tb = $DT_PRE.'club_group_'.$mid;if(!isset($num)) {$num = 50;}if(!isset($fid)) {$r = $db->get_one("SELECT MIN(catid) AS fid FROM {$table} WHERe moduleid=$mid");$fid = $r['fid'] ? $r['fid'] : 0;}isset($sid) or $sid = $fid;if(!isset($tid)) {$r = $db->get_one("SELECt MAX(catid) AS tid FROM {$table} WHERe moduleid=$mid");$tid = $r['tid'] ? $r['tid'] : 0;}if($fid <= $tid) {$result = $db->query("SELECt catid FROM {$table} WHERe moduleid=$mid AND catid>=$fid ORDER BY catid LIMIT 0,$num");if($db->affected_rows($result)) {while($r = $db->fetch_array($result)) {$catid = $r['catid'];if($mid == 4) {$condition = "groupid>5 and catids like '%,".$catid.",%'";} else {$condition = 'status=3';$condition .= $CATEGORY[$catid]['child'] ? " AND catid IN (".$CATEGORY[$catid]['arrchildid'].")" : " AND catid=$catid";}$item = $db->count($tb, $condition);$db->query("UPDATe {$table} SET item=$item WHERe catid=$catid");}$catid += 1;} else {$catid = $fid + $num;}} else {msg('統(tǒng)計(jì)更新成功', "?file=$file&mid=$mid&action=url");}msg('ID從'.$fid.'至'.($catid-1).'更新成功'.progress($sid, $fid, $tid), "?file=$file&mid=$mid&action=$action&sid=$sid&fid=$catid&tid=$tid&num=$num");break;case 'url':foreach($CATEGORY as $c) {update_category($c);}msg('地址更新成功', "?file=$file&mid=$mid&action=letters");break;case 'letters':$update = false;foreach($CATEGORY as $k=>$v) {if(strlen($v['letter']) != 1) {$letter = $do->get_letter($v['catname'], false);if($letter) {$update = true;$letter = substr($letter, 0, 1);$db->query("UPDATE {$table} SET letter='$letter' WHERe catid='$v[catid]'");}}}msg('索引修復(fù)成功', "?file=$file&mid=$mid&action=cache");break;case 'cache':$do->repair();dmsg('緩存更新成功', '?file='.$file.'&mid='.$mid);break;case 'delete':if($catid) $catids = $catid;$catids or msg('請(qǐng)選擇分類');$do->delete($catids);$NUM > 500 ? $do->cache() : $do->repair();dmsg('刪除成功', $forward);break;case 'update':if(!$category || !is_array($category)) msg();$do->update($category);foreach($category as $catid=>$v) {$CATEGORY[$catid] = $db->get_one("SELECT * FROM {$table} WHERe catid=$catid");update_category($CATEGORY[$catid]);}$NUM > 500 ? $do->cache() : $do->repair();dmsg('更新成功', '?file='.$file.'&mid='.$mid.'&parentid='.$parentid);break;case 'letter':isset($catname) or $catname = '';if(!$catname || strpos($catname, "\n") !== false) exit('');exit($do->get_letter($catname, false));break;case 'ckdir':if($do->get_catdir($catdir)) {dialog('目錄名可以使用');} else {dialog('目錄名不合法或者已經(jīng)被使用');}break;//20180603 Scase 'allletter':$q=$db->query("select * from{$table} where moduleid='$mid'");while($rs=$db->fetch_array($q)){$lets = $do->get_letter($rs['catname'],false);DB::query("UPDATe {$table} SET catdir='$lets' WHERe catid='$rs[catid]'"); } dmsg('拼音目錄修復(fù)成功', $forward);break; //20180603 Edefault:$total = 0;$DTCAT = array();$condition = "moduleid=$mid";$condition .= $keyword ? " AND catname LIKE '%$keyword%'" : " AND parentid=$parentid";$result = $db->query("SELECT * FROM {$table} WHERe $condition ORDER BY listorder,catid");while($r = $db->fetch_array($result)) {$r['childs'] = substr_count($r['arrchildid'], ',');$total += $r['item'];$DTCAT[$r['catid']] = $r;}if(!$DTCAT && !$parentid && !$keyword) msg('暫無(wú)分類,請(qǐng)先添加','?file='.$file.'&mid='.$mid.'&action=add&parentid='.$parentid);include tpl('category');break;}class category {var $moduleid;var $catid;var $category = array();var $table;function __construct($moduleid = 1, $catid = 0) {global $CATEGORY;$this->moduleid = $moduleid;$this->catid = $catid;if(!isset($CATEGORY)) $CATEGORY = cache_read('category-'.$this->moduleid.'.php');$this->category = $CATEGORY;$this->table = DT_PRE.'category';}function category($moduleid = 1, $catid = 0) {$this->__construct($moduleid, $catid);}function add($category){$category['moduleid'] = $this->moduleid;$category['letter'] = preg_match("/^[a-z]{1}+$/i", $category['letter']) ? strtolower($category['letter']) : '';foreach(array('group_list','group_show','group_add') as $v) {$category[$v] = isset($category[$v]) ? implode(',', $category[$v]) : '';}$sqlk = $sqlv = '';foreach($category as $k=>$v) {$sqlk .= ','.$k; $sqlv .= ",'$v'"; }$sqlk = substr($sqlk, 1);$sqlv = substr($sqlv, 1);DB::query("INSERT INTO {$this->table} ($sqlk) VALUES ($sqlv)");$this->catid = DB::insert_id();if($category['parentid']) {$category['catid'] = $this->catid;$this->category[$this->catid] = $category;$arrparentid = $this->get_arrparentid($this->catid, $this->category);} else {$arrparentid = 0;}$catdir = $category['catdir'] ? $category['catdir'] : $this->catid;DB::query("UPDATe {$this->table} SET listorder=$this->catid,catdir='$catdir',arrparentid='$arrparentid' WHERe catid=$this->catid");return true;}function edit($category) {$category['letter'] = preg_match("/^[a-z]{1}+$/i", $category['letter']) ? strtolower($category['letter']) : '';if($category['parentid']) {$category['catid'] = $this->catid;$this->category[$this->catid] = $category;$category['arrparentid'] = $this->get_arrparentid($this->catid, $this->category);} else {$category['arrparentid'] = 0;}foreach(array('group_list','group_show','group_add') as $v) {$category[$v] = isset($category[$v]) ? implode(',', $category[$v]) : '';}$category['linkurl'] = '';$sql = '';foreach($category as $k=>$v) {$sql .= ",$k='$v'";}$sql = substr($sql, 1);DB::query("UPDATE {$this->table} SET $sql WHERe catid=$this->catid");return true;}function delete($catids) {if(is_array($catids)) {foreach($catids as $catid) {if(isset($this->category[$catid])) $this->delete($catid);}} else {$catid = $catids;if(isset($this->category[$catid])) {DB::query("DELETE FROM {$this->table} WHERe catid=$catid");$arrchildid = $this->category[$catid]['arrchildid'] ? $this->category[$catid]['arrchildid'] : $catid;DB::query("DELETe FROM {$this->table} WHERe catid IN ($arrchildid)");if($this->moduleid > 4) DB::query("UPDATe ".get_table($this->moduleid)." SET status=0 WHERe catid IN (".$arrchildid.")");}}return true;}function update($category) {if(!is_array($category)) return false;foreach($category as $k=>$v) {if(!$v['catname']) continue;$v['parentid'] = intval($v['parentid']);if($k == $v['parentid']) continue;if($v['parentid'] > 0 && !isset($this->category[$v['parentid']])) continue;$v['listorder'] = intval($v['listorder']);$v['level'] = intval($v['level']);$v['letter'] = preg_match("/^[a-z0-9]{1}+$/i", $v['letter']) ? strtolower($v['letter']) : '';$v['catdir'] = $this->get_catdir($v['catdir'], $k);if(!$v['catdir']) $v['catdir'] = $k;DB::query("UPDATE {$this->table} SET catname='$v[catname]',parentid='$v[parentid]',listorder='$v[listorder]',style='$v[style]',level='$v[level]',letter='$v[letter]',catdir='$v[catdir]' WHERe catid=$k ");}return true;}function repair() {$query = DB::query("SELECT * FROM {$this->table} WHERe moduleid='$this->moduleid' ORDER BY listorder,catid");$CATEGORY = array();while($r = DB::fetch_array($query)) {$CATEGORY[$r['catid']] = $r;}$childs = array();foreach($CATEGORY as $catid => $category) {$CATEGORY[$catid]['arrparentid'] = $arrparentid = $this->get_arrparentid($catid, $CATEGORY);$CATEGORY[$catid]['catdir'] = $catdir = preg_match("/^[0-9a-z_\-\/]+$/i", $category['catdir']) ? $category['catdir'] : $catid;$sql = "catdir='$catdir',arrparentid='$arrparentid'";if(!$category['linkurl']) {$CATEGORY[$catid]['linkurl'] = listurl($category);$sql .= ",linkurl='$category[linkurl]'";}DB::query("UPDATe {$this->table} SET $sql WHERe catid=$catid");if($arrparentid) {$arr = explode(',', $arrparentid);foreach($arr as $a) {if($a == 0) continue;isset($childs[$a]) or $childs[$a] = '';$childs[$a] .= ','.$catid;}}}foreach($CATEGORY as $catid => $category) {if(isset($childs[$catid])) {$CATEGORY[$catid]['arrchildid'] = $arrchildid = $catid.$childs[$catid];$CATEGORY[$catid]['child'] = 1;DB::query("UPDATE {$this->table} SET arrchildid='$arrchildid',child=1 WHERe catid='$catid'");} else {$CATEGORY[$catid]['arrchildid'] = $catid;$CATEGORY[$catid]['child'] = 0;DB::query("UPDATE {$this->table} SET arrchildid='$catid',child=0 WHERe catid='$catid'");}}$this->cache($CATEGORY);return true;}function get_arrparentid($catid, $CATEGORY) {if($CATEGORY[$catid]['parentid'] && $CATEGORY[$catid]['parentid'] != $catid) {$parents = array();$cid = $catid;while($catid) {if($CATEGORY[$cid]['parentid']) {$parents[] = $cid = $CATEGORY[$cid]['parentid'];} else {break;}}$parents[] = 0;return implode(',', array_reverse($parents));} else {return '0';}}function get_arrchildid($catid, $CATEGORY) {$arrchildid = '';foreach($CATEGORY as $category) {if(strpos(','.$category['arrparentid'].',', ','.$catid.',') !== false) $arrchildid .= ','.$category['catid'];}return $arrchildid ? $catid.$arrchildid : $catid;}function get_catdir($catdir, $catid = 0) {if(preg_match("/^[0-9a-z_\-\/]+$/i", $catdir)) {$condition = "catdir='$catdir' AND moduleid='$this->moduleid'";if($catid) $condition .= " AND catid!=$catid";$r = DB::get_one("SELECT catid FROM {$this->table} WHERe $condition");if($r) {return '';} else {return $catdir;}} else {return '';}}function get_letter($catname, $letter = true) {return $letter ? strtolower(substr(gb2py($catname), 0, 1)) : str_replace(' ', '', gb2py($catname));}function cache($data = array()) {cache_category($this->moduleid, $data);}}?>



本頁(yè)內(nèi)容由塔燈網(wǎng)絡(luò)科技有限公司通過(guò)網(wǎng)絡(luò)收集編輯所得,所有資料僅供用戶參考了本站不擁有所有權(quán),如您認(rèn)為本網(wǎng)頁(yè)中由涉嫌抄襲的內(nèi)容,請(qǐng)及時(shí)與我們聯(lián)系,并提供相關(guān)證據(jù),工作人員會(huì)在5工作日內(nèi)聯(lián)系您,一經(jīng)查實(shí),本站立刻刪除侵權(quán)內(nèi)容。本文鏈接:http://www.junxiaosheng.cn/21635.html
相關(guān)cms文章
 八年  行業(yè)經(jīng)驗(yàn)

多一份參考,總有益處

聯(lián)系深圳網(wǎng)站公司塔燈網(wǎng)絡(luò),免費(fèi)獲得網(wǎng)站建設(shè)方案及報(bào)價(jià)

咨詢相關(guān)問(wèn)題或預(yù)約面談,可以通過(guò)以下方式與我們聯(lián)系

業(yè)務(wù)熱線:余經(jīng)理:13699882642

Copyright ? 2013-2018 Tadeng NetWork Technology Co., LTD. All Rights Reserved.    

主站蜘蛛池模板: 日日啪无需播放器| 亚州笫一色惰网站| 素人约啪第五季| 中文视频在线观看| 啊叫大点声欠CAO的SAO贷| 免费精品国产人妻国语麻豆| 伊人久在线观看视频| 成人影片大全| 免费被靠视频动漫| 亚洲精品婷婷无码成人A片在线| 中文字幕偷乱免费视频在线| 国产精品一区二区免费| 久久99精品国产99久久6男男 | 国产人妻XXXX精品HD电影| 欧美牲交A欧美牲交| 国产精品青青青高清在线密亚| 日韩一区二区天海翼| 久久re这里视频只有精品首页| WWW色视频片内射| 亚洲中文字幕手机版| 丝瓜涩涩屋黄瓜香蕉丝瓜| 久久中文电影| 国产呦精品一区二区三区下载| 99国产精品久久人妻无码| 熟女少妇内射日韩亚洲| 全彩无翼污之邪恶女教师| 久久综合色一综合色88| 国产在线观看99| 国产AV精品国语对白国产| 97人妻碰视频在线观看| 做暖免费观看日本| 在线观看免费亚洲| 中国午夜伦理片| 中文字幕一区二区视频| 伦理片免费秋霞e| 超碰最新网站| 亚洲精品乱码电影在线观看| 九色PORNY真实丨首页| AV无码国产精品午夜A片麻豆| 欧美人与动牲交A免费| 国产免费毛片在线观看|