Exemple #1
0
 function doUpdate()
 {
     include_once iPATH . 'include/forum.class.php';
     if ($_POST['forum']) {
         $forum = new forum();
         $forum->cache();
     }
     if ($_POST['adm']) {
         include_once iPATH . 'admin/advertise.mo.php';
         $rs = iCMS_DB::getArray("SELECT * FROM `#iCMS@__advertise`", OBJECT);
         $_count = count($rs);
         for ($i = 0; $i < $_count; $i++) {
             adm($rs[$i]);
         }
     }
     $_POST['tpl'] && $this->iCMS->clear_compiled_tpl();
     $_POST['iCMS_list'] && FS::rmdir(iPATH . 'cache/list');
     $_POST['iCMS_forum'] && FS::rmdir(iPATH . 'cache/forum');
     $_POST['iCMS_tag'] && FS::rmdir(iPATH . 'cache/tags');
     if ($_POST['iCMS_ALL']) {
         FS::rmdir(iPATH . 'cache/list');
         FS::rmdir(iPATH . 'cache/forum');
         FS::rmdir(iPATH . 'cache/tags');
     }
     $_POST['keywords'] && keywords_cache();
     $_POST['tags'] && tags_cache();
     if ($_POST['model']) {
         include iPATH . 'include/model.class.php';
         model::cache();
     }
     $_POST['field'] && field_cache();
     $_POST['config'] && CreateConfigFile();
     if ($_POST['Re-Article-Count']) {
         $rs = iCMS_DB::getArray("SELECT fid FROM `#iCMS@__forum`");
         $_count = count($rs);
         for ($i = 0; $i < $_count; $i++) {
             $c = iCMS_DB::getValue("SELECT count(*) FROM #iCMS@__article where `fid`='" . $rs[$i]['fid'] . "' LIMIT 1 ");
             iCMS_DB::query("UPDATE `#iCMS@__forum` SET `count` ='{$c}' WHERE `fid` ='" . $rs[$i]['fid'] . "' LIMIT 1 ");
         }
     }
     if ($_POST['Re-Tag-Count']) {
         include_once iPATH . 'include/forum.class.php';
         $rs = iCMS_DB::getArray("SELECT id FROM `#iCMS@__tags`");
         $_count = count($rs);
         for ($i = 0; $i < $_count; $i++) {
             $_count = iCMS_DB::getValue("SELECT count(*) FROM `#iCMS@__taglist` WHERE `tid`='" . $rs[$i]['id'] . "'");
             iCMS_DB::query("UPDATE `#iCMS@__tags` SET `count` = '{$_count}'  WHERE `id` ='" . $rs[$i]['id'] . "'");
             tags_cache($rs[$i]['id']);
         }
     }
     javascript::dialog("执行完毕!", 'url:1');
 }
Exemple #2
0
 function dosave()
 {
     $id = (int) $_POST['id'];
     $keyword = dhtmlspecialchars($_POST['keyword']);
     $replace = preg_replace("'<p>(.*?)<\\/p>'si", '\\1', $_POST['replace']);
     if (empty($id)) {
         iCMS_DB::query("INSERT IGNORE INTO `#iCMS@__keywords`(`keyword`,`replace`,`addtime`,`status`) values ('{$keyword}','{$replace}','" . time() . "','1')");
     } else {
         iCMS_DB::query("update `#iCMS@__keywords` set `keyword`='{$keyword}',`replace`='{$replace}' where id='{$id}'");
     }
     keywords_cache();
     javascript::dialog('操作完成!', 'url:' . __SELF__ . '?mo=keywords');
 }
Exemple #3
0
        _Header();
        break;
    case 'open':
        $id = (int) $_GET['id'];
        $id && $DreamCMS->db->query("UPDATE `#DC@__keywords` SET `visible` = '1'  WHERE `id` ='{$id}'");
        _Header();
        break;
    case 'post':
        if ($action == 'edit') {
            if (isset($_POST['delete'])) {
                foreach ($_POST['delete'] as $k => $id) {
                    $id && $DreamCMS->db->query("DELETE FROM `#DC@__keywords` WHERE `id` ='{$id}'");
                }
                keywords_cache();
                _Header();
            }
            foreach ($_POST['name'] as $id => $value) {
                $DreamCMS->db->query("update `#DC@__keywords` set `keyword`='{$value}',`replace`='" . $_POST['replace'][$id] . "' where `id`='{$id}'");
            }
            keywords_cache();
            _Header();
        }
        if ($action == 'add') {
            $keyword = htmlspecialchars($_POST['keyword']);
            $replace = $_POST['replace'];
            $DreamCMS->db->query("insert into `#DC@__keywords`(`keyword`,`replace`,`addtime`,`visible`) values ('{$keyword}','{$replace}','" . time() . "','0')");
            keywords_cache();
            _Header('admincp.php?do=keywords');
        }
        break;
}
Exemple #4
0
 * @package iCMS V3.1
 * @copyright 2007-2009, iDreamSoft
 * @license http://www.idreamsoft.cn iDreamSoft
 * @author coolmoo <idreamsoft@qq.com>
 */
!defined('iPATH') && exit('What are you doing?');
switch ($operation) {
    case 'post':
        if ($action == 'cache') {
            if ($_POST['catalog']) {
                include_once iPATH . 'include/catalog.class.php';
                $catalog = new catalog();
                $catalog->cache();
            }
            $_POST['tpl'] && $iCMS->clear_compiled_tpl();
            $_POST['keywords'] && keywords_cache();
            $_POST['tags'] && tags_cache();
            $_POST['model'] && model_cache();
            $_POST['field'] && field_cache();
            $_POST['config'] && CreateConfigFile();
            if ($_POST['Re-Statistics']) {
                $rs = $iCMS->db->getArray("SELECT id FROM `#iCMS@__catalog` ORDER BY `id` DESC");
                $_count = count($rs);
                for ($i = 0; $i < $_count; $i++) {
                    $c = $iCMS->db->getValue("SELECT count(*) FROM #iCMS@__article where `cid`='" . $rs[$i]['id'] . "' LIMIT 1 ");
                    $iCMS->db->query("UPDATE `#iCMS@__catalog` SET `count` ='{$c}' WHERE `id` ='" . $rs[$i]['id'] . "' LIMIT 1 ");
                }
            }
            redirect("执行完毕!", __SELF__ . '?do=cache');
        }
        break;