/**
*更新栏目级别
**/
function mod_sort_class($table, $class, $fid)
{
    global $db;
    $db->query("UPDATE {$table} SET class='{$class}'+1  WHERE fup='{$fid}' ");
    $query = $db->query("SELECT * FROM {$table} WHERE fup='{$fid}'");
    while (@extract($db->fetch_array($query))) {
        mod_sort_class($table, $class, $fid);
    }
}
Exemple #2
0
    cache_area();
    refreshto("{$FROMURL}", "修改成功");
} elseif ($action == "delete") {
    $db->query(" DELETE FROM `{$pre}area` WHERE fid='{$fid}' ");
    mod_sort_class("{$pre}area", 0, 0);
    //更新class
    mod_sort_sons("{$pre}area", 0);
    //更新sons
    /*更新导航缓存*/
    cache_area();
    refreshto($FROMURL, "删除成功");
} elseif ($action == "editlist") {
    foreach ($order as $key => $value) {
        $db->query("UPDATE {$pre}area SET list='{$value}' WHERE fid='{$key}' ");
    }
    mod_sort_class("{$pre}area", 0, 0);
    //更新class
    mod_sort_sons("{$pre}area", 0);
    //更新sons
    /*更新导航缓存*/
    cache_area();
    refreshto("{$FROMURL}", "修改成功", 1);
}
/**
*更新缓存
**/
function cache_area()
{
    global $db, $pre;
    $show = "<?php\r\n";
    $query = $db->query("SELECT fid,fup,name FROM {$pre}area LIMIT 500");
Exemple #3
0
/**
*更新栏目级别
**/
function mod_sort_class($table, $class, $fid)
{
    global $db, $webdb, $pre;
    if ($table == "{$pre}sort" && $webdb[sortNUM] > 500) {
        return;
    }
    $db->query("UPDATE {$table} SET class='{$class}'+1  WHERE fup='{$fid}' ");
    $query = $db->query("SELECT * FROM {$table} WHERE fup='{$fid}'");
    while (@extract($db->fetch_array($query))) {
        mod_sort_class($table, $class, $fid);
    }
}
Exemple #4
0
    require dirname(__FILE__) . "/" . "foot.php";
} elseif ($action == 'toget' && $Apower[fu_sort_power]) {
    if (!$ofid) {
        showmsg("请选择一个源栏目");
    } elseif (!$nfid) {
        showmsg("请选择一个目标栏目");
    }
    if ($ofid == $nfid) {
        showmsg("出错了,栏目本身不能合并为自己,请选择合并到其他栏目去吧");
    }
    $erp = $Fid_db[iftable][$ofid];
    $db->query("UPDATE {$pre}article{$erp} SET fid='{$nfid}',fname='{$Fid_db[name][$nfid]}' WHERE fid='{$ofid}'");
    $db->query("UPDATE {$pre}reply{$erp} SET fid='{$nfid}' WHERE fid='{$ofid}'");
    $db->query("UPDATE {$pre}comment SET fid='{$nfid}' WHERE fid='{$ofid}'");
    $db->query("DELETE FROM {$pre}fu_sort WHERE fid='{$ofid}'");
    mod_sort_class("{$pre}fu_sort", 0, 0);
    //更新class
    mod_sort_sons("{$pre}fu_sort", 0);
    //更新sons
    /*更新导航缓存*/
    cache_guide();
    jump("操作完毕", "{$FROMURL}", 1);
}
/*
elseif($job=="config"&&$Apower[sort_config])
{
	$webdb[viewNoPassArticle]==='0' || $webdb[viewNoPassArticle]=1;
	$viewNoPassArticle[$webdb[viewNoPassArticle]]=" checked ";

	$webdb[ifContribute]==='0' || $webdb[ifContribute]=1;
	$ifContribute[$webdb[ifContribute]]=" checked ";
Exemple #5
0
    //更新sons
    module_fid_cache();
    jump("修改成功", "{$FROMURL}");
} elseif ($action == "delete") {
    $db->query(" DELETE FROM `{$_pre}sort` WHERE fid='{$fid}' ");
    mod_sort_class("{$_pre}sort", 0, 0);
    //更新class
    mod_sort_sons("{$_pre}sort", 0);
    //更新sons
    module_fid_cache();
    jump("删除成功", $FROMURL);
} elseif ($action == "editlist") {
    foreach ($order as $key => $value) {
        $db->query("UPDATE {$_pre}sort SET list='{$value}' WHERE fid='{$key}' ");
    }
    mod_sort_class("{$_pre}sort", 0, 0);
    //更新class
    mod_sort_sons("{$_pre}sort", 0);
    //更新sons
    module_fid_cache();
    jump("修改成功", "{$FROMURL}", 1);
}
//后台栏目管理用
function module_list_all_sort($fid, $Class)
{
    global $db, $_pre, $listdb;
    $Class++;
    $query = $db->query("SELECT S.* FROM {$_pre}sort S WHERE S.fup='{$fid}' ORDER BY S.list DESC");
    while ($rs = $db->fetch_array($query)) {
        $icon = "";
        for ($i = 1; $i < $Class; $i++) {
Exemple #6
0
    /*更新导航缓存*/
    cache_guide();
    jump("修改成功", "{$FROMURL}", 1);
} elseif ($job == 'save' && $Apower[spsort_listsort]) {
    $errsort = sort_error("{$pre}spsort", 'fid');
    $sort_fup = $Guidedb->Select("{$pre}spsort", "fup", $rsdb[fup]);
    require dirname(__FILE__) . "/" . "head.php";
    require dirname(__FILE__) . "/" . "template/spsort/menu.htm";
    require dirname(__FILE__) . "/" . "template/spsort/save.htm";
    require dirname(__FILE__) . "/" . "foot.php";
} elseif ($action == 'save' && $Apower[spsort_listsort]) {
    if (!$fid) {
        showmsg("请选择一个栏目");
    }
    $db->query("UPDATE {$pre}spsort SET fid='{$fup}' WHERE fid='{$fid}' ");
    mod_sort_class("{$pre}spsort", 0, 0);
    //更新class
    mod_sort_sons("{$pre}spsort", 0);
    //更新sons
    /*更新导航缓存*/
    cache_guide();
    jump("本栏目修正成功", "{$FROMURL}", 1);
}
/**
*更新导航缓存
**/
function cache_guide()
{
    global $Guidedb, $pre;
    //$Guidedb->FidSonCache("{$pre}spsort","../data/guideSP_fid.php",1);
    $Guidedb->GuideFidCache("{$pre}spsort", "../data/guideSP_fid.php", 1);