文件: /modules/article/admin/collectset.php

  • 1.将文件最后的这段代码
if ($updateconfig) {
    jieqi_setconfigs('collectsite', 'jieqiCollectsite', $jieqiCollectsite, JIEQI_MODULE_NAME);
    if (file_exists(JIEQI_ROOT_PATH . '/configs/article/site_' . $_REQUEST['config'] . '.php')) {
        jieqi_delfile(JIEQI_ROOT_PATH . '/configs/article/site_' . $_REQUEST['config'] . '.php');
    }
}
  • 2.放到这里来
if (isset($_POST['act']) && $_POST['act'] == 'del' && !empty($_REQUEST['config']) && preg_match('/^\\w+$/', $_REQUEST['config'])) {
    jieqi_checkpost();
    foreach ($jieqiCollectsite as $k => $v) {
        if ($v['config'] == $_REQUEST['config']) {
            unset($jieqiCollectsite[$k]);
            $updateconfig = true;
            break;
        }
    }

//代码插入的位置 17-18 行附近

    jieqi_jumppage($jieqiModules['article']['url'] . '/admin/collectset.php', '', '', true);
}
  • 3.完成状态
if (isset($_POST['act']) && $_POST['act'] == 'del' && !empty($_REQUEST['config']) && preg_match('/^\\w+$/', $_REQUEST['config'])) {
    jieqi_checkpost();
    foreach ($jieqiCollectsite as $k => $v) {
        if ($v['config'] == $_REQUEST['config']) {
            unset($jieqiCollectsite[$k]);
            $updateconfig = true;
            break;
        }
    }

//插入代码开始
if ($updateconfig) {
    jieqi_setconfigs('collectsite', 'jieqiCollectsite', $jieqiCollectsite, JIEQI_MODULE_NAME);
    if (file_exists(JIEQI_ROOT_PATH . '/configs/article/site_' . $_REQUEST['config'] . '.php')) {
        jieqi_delfile(JIEQI_ROOT_PATH . '/configs/article/site_' . $_REQUEST['config'] . '.php');
    }
}
//插入代码结束

    jieqi_jumppage($jieqiModules['article']['url'] . '/admin/collectset.php', '', '', true);
}

  本站所有文章如未特殊注明均为原创。本文由 逆水行舟 原创,未经同意请勿转载、引用。