advanced();\n"; if (isset($status)) { if ($status == "su") { $title = $locale['400']; $message = "".$locale['401'].""; } elseif ($status == "sn") { $title = $locale['404']; $message = "".$locale['405'].""; } elseif ($status == "del") { $title = $locale['406']; $message = "".$locale['407'].""; } opentable($title); echo "
\s
$)", "", $_POST['body2'])); $news_start_date = 0; $news_end_date = 0; if ($_POST['news_start']['mday']!="--" && $_POST['news_start']['mon']!="--" && $_POST['news_start']['year']!="----") { $news_start_date = mktime($_POST['news_start']['hours'],$_POST['news_start']['minutes'],0,$_POST['news_start']['mon'],$_POST['news_start']['mday'],$_POST['news_start']['year']); } if ($_POST['news_end']['mday']!="--" && $_POST['news_end']['mon']!="--" && $_POST['news_end']['year']!="----") { $news_end_date = mktime($_POST['news_end']['hours'],$_POST['news_end']['minutes'],0,$_POST['news_end']['mon'],$_POST['news_end']['mday'],$_POST['news_end']['year']); } $news_visibility = isNum($_POST['news_visibility']) ? $_POST['news_visibility'] : "0"; $news_sticky = isset($_POST['news_sticky']) ? "1" : "0"; if ($settings['tinymce_enabled'] != 1) { $news_breaks = isset($_POST['line_breaks']) ? "y" : "n"; } else { $news_breaks = "n"; } $news_comments = isset($_POST['news_comments']) ? "1" : "0"; $news_ratings = isset($_POST['news_ratings']) ? "1" : "0"; if (isset($news_id)) { if ($news_sticky == "1") $result = dbquery("UPDATE ".$db_prefix."news SET news_sticky='0' WHERE news_sticky='1'"); $result = dbquery("UPDATE ".$db_prefix."news SET news_subject='$news_subject', news_cat='$news_cat', news_news='$body', news_extended='$body2', news_breaks='$news_breaks',".($news_start_date != 0 ? " news_datestamp='$news_start_date'," : "")." news_start='$news_start_date', news_end='$news_end_date', news_visibility='$news_visibility', news_sticky='$news_sticky', news_allow_comments='$news_comments', news_allow_ratings='$news_ratings' WHERE news_id='$news_id'"); redirect(FUSION_SELF.$aidlink."&status=su"); } else { if ($news_sticky == "1") $result = dbquery("UPDATE ".$db_prefix."news SET news_sticky='0' WHERE news_sticky='1'"); $result = dbquery("INSERT INTO ".$db_prefix."news (news_subject, news_cat, news_news, news_extended, news_breaks, news_name, news_datestamp, news_start, news_end, news_visibility, news_sticky, news_reads, news_allow_comments, news_allow_ratings) VALUES ('$news_subject', '$news_cat', '$body', '$body2', '$news_breaks', '".$userdata['user_id']."', '".($news_start_date != 0 ? $news_start_date : time())."', '$news_start_date', '$news_end_date', '$news_visibility', '$news_sticky', '0', '$news_comments', '$news_ratings')"); redirect(FUSION_SELF.$aidlink."&status=sn"); } } else if (isset($_POST['delete'])) { $result = dbquery("DELETE FROM ".$db_prefix."news WHERE news_id='$news_id'"); $result = dbquery("DELETE FROM ".$db_prefix."comments WHERE comment_item_id='$news_id' and comment_type='N'"); $result = dbquery("DELETE FROM ".$db_prefix."ratings WHERE rating_item_id='$news_id' and rating_type='N'"); redirect(FUSION_SELF.$aidlink."&status=del"); } else { if (isset($_POST['preview'])) { $news_subject = stripinput($_POST['news_subject']); $body = phpentities(stripslash($_POST['body'])); $bodypreview = str_replace("src='".str_replace("../", "", IMAGES_N), "src='".IMAGES_N, stripslash($_POST['body'])); if ($_POST['body2']) { $body2 = phpentities(stripslash($_POST['body2'])); $body2preview = str_replace("src='".str_replace("../", "", IMAGES_N), "src='".IMAGES_N, stripslash($_POST['body2'])); } if (isset($_POST['line_breaks'])) { $news_breaks = " checked"; $bodypreview = nl2br($bodypreview); if ($body2) $body2preview = nl2br($body2preview); } else { $news_breaks = ""; } $news_start = array( "mday" => isNum($_POST['news_start']['mday']) ? $_POST['news_start']['mday'] : "--", "mon" => isNum($_POST['news_start']['mon']) ? $_POST['news_start']['mon'] : "--", "year" => isNum($_POST['news_start']['year']) ? $_POST['news_start']['year'] : "----", "hours" => isNum($_POST['news_start']['hours']) ? $_POST['news_start']['hours'] : "0", "minutes" => isNum($_POST['news_start']['minutes']) ? $_POST['news_start']['minutes'] : "0", ); $news_end = array( "mday" => isNum($_POST['news_end']['mday']) ? $_POST['news_end']['mday'] : "--", "mon" => isNum($_POST['news_end']['mon']) ? $_POST['news_end']['mon'] : "--", "year" => isNum($_POST['news_end']['year']) ? $_POST['news_end']['year'] : "----", "hours" => isNum($_POST['news_end']['hours']) ? $_POST['news_end']['hours'] : "0", "minutes" => isNum($_POST['news_end']['minutes']) ? $_POST['news_end']['minutes'] : "0", ); $news_sticky = isset($_POST['news_sticky']) ? " checked" : ""; $news_comments = isset($_POST['news_comments']) ? " checked" : ""; $news_ratings = isset($_POST['news_ratings']) ? " checked" : ""; opentable($news_subject); echo "$bodypreview\n"; closetable(); if (isset($body2preview)) { tablebreak(); opentable($news_subject); echo "$body2preview\n"; closetable(); } tablebreak(); } $editlist = ""; $sel = ""; $result = dbquery("SELECT * FROM ".$db_prefix."news ORDER BY news_datestamp DESC"); if (dbrows($result) != 0) { while ($data = dbarray($result)) { if (isset($news_id)) $sel = ($news_id == $data['news_id'] ? " selected" : ""); $editlist .= "\n"; } } opentable($locale['408']); echo "\n"; closetable(); tablebreak(); if (isset($_POST['edit'])) { $result = dbquery("SELECT * FROM ".$db_prefix."news WHERE news_id='$news_id'"); if (dbrows($result) != 0) { $data = dbarray($result); $news_subject = $data['news_subject']; $news_cat = $data['news_cat']; $body = phpentities(stripslashes($data['news_news'])); $body2 = phpentities(stripslashes($data['news_extended'])); if ($data['news_start'] > 0) $news_start = getdate($data['news_start']); if ($data['news_end'] > 0) $news_end = getdate($data['news_end']); $news_breaks = $data['news_breaks'] == "y" ? " checked" : ""; $news_comments = $data['news_allow_comments'] == "1" ? " checked" : ""; $news_ratings = $data['news_allow_ratings'] == "1" ? " checked" : ""; $news_visibility = $data['news_visibility']; $news_sticky = $data['news_sticky'] == "1" ? " checked" : ""; } } if (isset($news_id)) { $action = FUSION_SELF.$aidlink."&news_id=$news_id"; opentable($locale['400']); } else { if (!isset($_POST['preview'])) { $news_subject = ""; $body = ""; $body2 = ""; $news_breaks = " checked"; $news_comments = " checked"; $news_ratings = " checked"; $news_visibility = 0; $news_sticky = ""; } $action = FUSION_SELF.$aidlink; opentable($locale['404']); } $image_files = makefilelist(IMAGES_N, ".|..|index.php", true); $image_list = makefileopts($image_files); $result = dbquery("SELECT * FROM ".$db_prefix."news_cats ORDER BY news_cat_name"); $news_cat_opts = ""; $sel = ""; if (dbrows($result)) { while ($data = dbarray($result)) { if (isset($news_cat)) $sel = ($news_cat == $data['news_cat_id'] ? " selected" : ""); $news_cat_opts .= "\n"; } } $visibility_opts = ""; $sel = ""; $user_groups = getusergroups(); while(list($key, $user_group) = each($user_groups)){ $sel = ($news_visibility == $user_group['0'] ? " selected" : ""); $visibility_opts .= "\n"; } echo "\n"; closetable(); echo "\n"; } echo "\n"; require_once BASEDIR."footer.php"; ?>