Example #1
0
            unlink($strOldFile);
        }
        $_POST['UploadFile'] = $objWebInit->uploadInfoImage($_FILES['Filedata'], $objWebInit->arrGPic['FileSourPicSize'], $_POST['id']);
    } else {
        $_POST['UploadFile'] = $_POST['savefilename'];
    }
    //取得图片链接的文件类型
    if (!empty($_POST['UploadFile'])) {
        if ($_POST['UploadFile'] != '') {
            $_POST['FileExt'] = strrchr($_POST['UploadFile'], ".");
        } else {
            $_POST['FileExt'] = strrchr($_POST['weblogo'], ".");
        }
        $_POST['picflag'] = 1;
    }
    unset($_POST['savefilename']);
    unset($_POST['okgo']);
    $objWebInit->saveInfo($_POST, 1);
    echo "<script>" . check::WindowLocation('index.php', 'page=' . $_GET['page']) . "</script>";
    exit;
}
// 取得文章信息
$arrInfo = $objWebInit->getInfo($_GET['id']);
// 输出到模板
$arrMOutput["template_file"] = "admin.html";
$arrMOutput["smarty_assign"]['arrType'] = $arrMType;
$arrMOutput["smarty_assign"]['FileCallPath'] = $arrGPic['FileCallPath'];
$arrMOutput["smarty_assign"]['arrData'] = $arrInfo;
$arrMOutput["smarty_assign"]['action_type'] = "save";
$arrMOutput["smarty_assign"]['MAIN'] = $arrGSmarty['admin_main_dir'] . 'submit.htm';
$objWebInit->output($arrMOutput);