Exemple #1
0
                unlink($strOldFile);
            }
            $_POST['video'][$num]['videopic'] = $objWebInit->uploadInfoImage($_FILES['pFiledata' . $num], $num, 0, $objWebInit->arrGPic['FileSourPicSize'], $_POST['id']);
        }
    }
    if ($_POST['summary'] == '') {
        $_POST['summary'] = check::csubstr(trim(str_replace(" ", " ", str_replace("\r\n", "", strip_tags($_POST['intro'])))), 0, $arrGWeb['db_summary_len']);
    }
    if (is_array($_POST['photo'])) {
        $_POST['thumbnail'] = $_POST['photo'][0]['photo'];
    } else {
        $_POST['thumbnail'] = $_POST['photo'];
    }
    $_POST = array_merge($arrInfo, $_POST);
    //print_r($_POST);exit;
    $objWebInit->saveInfo($_POST, 1);
    if ($arrGWeb['file_static']) {
        //生成静态页面
        $intID = $_POST['id'];
        $strDir = ceil($intID / $arrGCache['cache_filenum']);
        $objCache = new cache($arrGCache['cache_root'] . '-' . $strDir . '/' . $intID . $arrGWeb['file_suffix'], $arrGCache['cache_time']);
        $objCache->cache_start();
        $strContents = @file_get_contents('http://' . $_SERVER["HTTP_HOST"] . '/' . $arrGWeb['module_id'] . '/detail.php?id=' . $intID);
        if ($strContents) {
            echo $strContents;
        }
        $objCache->cache_end(false);
        @unlink($arrGCache['cache_root'] . '-' . $strDir . '/' . $intID . 'tw' . $arrGWeb['file_suffix']);
    }
    check::WindowLocation('index.php', 'page=' . $_GET['page']);
}