コード例 #1
0
    die('Stop!!!');
}
$id = $nv_Request->get_int('id', 'get', 0);
if ($id == 0) {
    $page_title = $lang_module['add_album'];
} else {
    $page_title = $lang_module['edit_album'];
}
$xtpl = new XTemplate("add.tpl", NV_ROOTDIR . "/themes/" . $global_config['module_theme'] . "/modules/" . $module_name);
$add = 0;
$error = "";
$data = array();
$data['active'] = "1";
$adb = new albumdb();
if ($id != 0) {
    $result = $adb->getAllAlbumCotent($id);
    $data = $db->sql_fetchrow($result);
    if (!empty($data['path_img']) and file_exists(NV_UPLOADS_REAL_DIR . "/" . $module_name . $data['path_img'])) {
        $data['path_img'] = NV_BASE_SITEURL . NV_UPLOADS_DIR . "/" . $module_name . $data['path_img'];
    }
}
if ($nv_Request->get_int('add', 'post') == 1) {
    $data['name'] = filter_text_input('name', 'post', '', 1);
    $alias = change_alias($data['name']);
    $data['description'] = filter_text_textarea('description', '', NV_ALLOWED_HTML_TAGS);
    $data['path_img'] = filter_text_input('pic_path', 'post', '', 0);
    $data['active'] = filter_text_input('active', 'post', '0', 0);
    if (!nv_is_url($data['path_img']) and is_file(NV_DOCUMENT_ROOT . $data['path_img'])) {
        $lu = nv_strlen(NV_BASE_SITEURL . NV_UPLOADS_DIR . "/" . $module_name);
        $data['path_img'] = substr($data['path_img'], $lu);
    } elseif (!empty($data['path_img']) and !nv_is_url($data['path_img'])) {