$selected = $cat1['catid'] == $catid ? "selected=\"selected\"" : NULL; $catselect .= "<option value=\"" . $cat1['catid'] . ("\" " . $selected . ">{$cat1['catname']}</option>\n"); foreach ($novelcats as $cat2) { if ($cat2['upid'] > 0 && $cat2['upid'] == $cat1['catid']) { $selected = $cat2['catid'] == $catid ? "selected=\"selected\"" : NULL; $catselect .= "<option value=\"" . $cat2['catid'] . ("\" " . $selected . "> > {$cat2['catname']}</option>\n"); } } } } } $catselect .= "</select>"; showhiddenfields(array("siteid" => $_G['gp_siteid'], "fromid" => $_G['gp_fromid'], "novelid" => $novelid)); showsetting("pdnovel_collect_catname", "", "", $catselect); showsetting("pdnovel_collect_name", "name", $name, "text"); showsetting("pdnovel_collect_initial", "initial", get_initial($name), "text"); showsetting("pdnovel_collect_author", "author", $author, "text"); showsetting("pdnovel_collect_cover", "cover", $cover, "text"); showsetting("pdnovel_collect_full", "", "", show_input($full, "full")); showsetting("pdnovel_collect_permission", "", "", show_input($permission, "permission")); showsetting("pdnovel_collect_first", "", "", show_input($first, "first")); showsetting("pdnovel_collect_keyword", "keyword", $keyword, "text"); showsetting("pdnovel_collect_notice", "notice", $notice, "text"); showsetting("pdnovel_collect_intro", "intro", $intro, "textarea"); showsubmit("collectsubmit"); } } else { if ($do == "collect") { if ($_G['gp_novelid']) { $novel_data = array("catid" => $_G['gp_catid'], "name" => addslashes($_G['gp_name']), "initial" => $_G['gp_initial'], "lastupdate" => $_G['timestamp'], "keyword" => addslashes($_G['gp_keyword']), "notice" => addslashes($_G['gp_notice']), "cover" => $_G['gp_cover'], "full" => $_G['gp_full'], "permission" => $_G['gp_permission'], "first" => $_G['gp_first'], "intro" => addslashes($_G['gp_intro'])); $novelid = $_G['gp_novelid'];
$_G['gp_cover'] = $_G['gp_oldcover']; } else { if ($_G['gp_cover'] && !$_G['gp_oldcover']) { $subnovelid = floor($novelid / 1000); $_G['gp_oldcover'] = $subnovelid . "/" . $novelid . "-" . rand(100, 999) . ".jpg"; dmkdir($coverpath . $subnovelid); @rename($_G['gp_cover'], $coverpath . $_G['gp_oldcover']); $_G['gp_cover'] = $_G['gp_oldcover']; } else { if (!$_G['gp_cover'] && $_G['gp_oldcover']) { @unlink($coverpath . $_G['gp_oldcover']); } } } } $updatearr = array("catid" => $_G['gp_catid'], "name" => addslashes($_G['gp_name']), "initial" => get_initial($_G['gp_name']), "keyword" => addslashes($_G['gp_keyword']), "author" => $author, "authorid" => $authorid, "poster" => $_G['username'], "posterid" => $_G['uid'], "admin" => $_G['username'], "adminid" => $_G['uid'], "cover" => addslashes($_G['gp_cover']), "full" => intval($_G['gp_full']), "permission" => intval($_G['gp_permission']), "first" => intval($_G['gp_first']), "notice" => addslashes($_G['gp_notice']), "vip" => intval($_G['gp_vip']), "intro" => addslashes($_G['gp_intro']), "type" => intval($_G['gp_type'])); DB::update("pdnovel_view", $updatearr, "novelid=" . $novelid); showmessage("do_success", "pdnovel.php?mod=home&do=manage&novelid=" . $novelid); } } else { if ($ac == "del") { $novelid = $_G['gp_novelid']; $novel = DB::fetch_first("SELECT * FROM " . DB::table("pdnovel_view") . (" WHERE novelid=" . $novelid)); if (!$novel) { showmessage("小说ID出错"); } if (!checkperm("pdnovelmanage")) { showmessage("group_nopermission", NULL, array("grouptitle" => $_G['group']['grouptitle']), array("login" => 1)); } if (submitcheck("postsubmit")) { if (!empty($novel['cover'])) {
} if (!submitcheck("postsubmit")) { $query1 = DB::query("SELECT catid,upid,catname FROM " . DB::table("novel_category") . " WHERE upid=0 ORDER BY displayorder ASC"); $selectcat = "<option value=\"\">" . $pdlang['post_cat'] . "</option>"; while ($upcat = DB::fetch($query1)) { $selectcat .= "<option value=\"" . $upcat['catid'] . "\" disabled=\"disabled\"> " . $upcat['catname'] . "</option>"; $query2 = DB::query("SELECT catid,upid,catname FROM " . DB::table("novel_category") . (" WHERE upid=" . $upcat['catid'] . " ORDER BY displayorder ASC")); while ($cat = DB::fetch($query2)) { $selectcat .= "<option value=\"" . $cat['catid'] . "\"" . ($cat['catid'] == $novel['catid'] ? " selected=\"selected\"" : "") . "> >" . $cat['catname'] . "</option>"; } } } else { if ($_G['gp_cover'] != $novel['cover']) { rename($_G['gp_cover'], $novel['cover']); } $novel_data = array("catid" => $_G['gp_catid'], "name" => addslashes($_G['gp_name']), "initial" => get_initial($_G['gp_name']), "keyword" => addslashes($_G['gp_keyword']), "author" => addslashes($_G['gp_author']), "poster" => $_G['username'], "posterid" => $_G['uid'], "admin" => $_G['username'], "adminid" => $_G['uid'], "cover" => $_G['gp_cover'], "full" => $_G['gp_full'], "permission" => $_G['gp_permission'], "first" => $_G['gp_first'], "intro" => addslashes($_G['gp_intro'])); DB::update("novel_novel", $novel_data, "novelid=" . $novelid . " LIMIT 1"); showmessage("do_success", "pdnovel.php?mod=view&novelid=" . $novelid); } } else { if ($ac == "newchapter") { $novelid = $_G['gp_novelid']; $novel = DB::fetch_first("SELECT * FROM " . DB::table("novel_novel") . (" WHERE novelid=" . $novelid . " AND display=0 LIMIT 1")); if ($_G['uid'] != $novel['adminid'] && $_G['uid'] != $novel['postid'] && !checkperm("allowmanagenovel")) { showmessage("group_nopermission", NULL, array("grouptitle" => $_G['group']['grouptitle']), array("login" => 1)); } if (submitcheck("submit")) { $chapterorder = $novel['chapters'] + 1; $content = $_G['gp_chaptercontent']; exit($content); }