advanced();\n"; if (isset($status)) { if ($status == "su") { $title = $locale['500']; $message = "".$locale['501'].""; } elseif ($status == "sn") { $title = $locale['504']; $message = "".$locale['505'].""; } elseif ($status == "del") { $title = $locale['506']; $message = "".$locale['507'].""; } opentable($title); echo "
".$message."
\n"; closetable(); tablebreak(); } $result = dbquery("SELECT * FROM ".$db_prefix."article_cats"); if (dbrows($result) != 0) { if (isset($_POST['save'])) { $subject = stripinput($_POST['subject']); $body = addslash($_POST['body']); $body2 = addslash($_POST['body2']); if ($settings['tinymce_enabled'] != 1) { $breaks = isset($_POST['line_breaks']) ? "y" : "n"; } else { $breaks = "n"; } $comments = isset($_POST['article_comments']) ? "1" : "0"; $ratings = isset($_POST['article_ratings']) ? "1" : "0"; if (isset($article_id)) { $result = dbquery("UPDATE ".$db_prefix."articles SET article_cat='".$_POST['article_cat']."', article_subject='$subject', article_snippet='$body', article_article='$body2', article_breaks='$breaks', article_allow_comments='$comments', article_allow_ratings='$ratings' WHERE article_id='$article_id'"); redirect(FUSION_SELF.$aidlink."&status=su"); } else { $result = dbquery("INSERT INTO ".$db_prefix."articles (article_cat, article_subject, article_snippet, article_article, article_breaks, article_name, article_datestamp, article_reads, article_allow_comments, article_allow_ratings) VALUES ('".$_POST['article_cat']."', '$subject', '$body', '$body2', '$breaks', '".$userdata['user_id']."', '".time()."', '0', '$comments', '$ratings')"); redirect(FUSION_SELF.$aidlink."&status=sn"); } } else if (isset($_POST['delete'])) { $result = dbquery("DELETE FROM ".$db_prefix."articles WHERE article_id='$article_id'"); $result = dbquery("DELETE FROM ".$db_prefix."comments WHERE comment_item_id='$article_id' and comment_type='A'"); $result = dbquery("DELETE FROM ".$db_prefix."ratings WHERE rating_item_id='$article_id' and rating_type='A'"); redirect(FUSION_SELF.$aidlink."&status=del"); } else { if (isset($_POST['preview'])) { $article_cat = $_POST['article_cat']; $subject = stripinput($_POST['subject']); $body = phpentities(stripslash($_POST['body'])); $body2 = phpentities(stripslash($_POST['body2'])); $bodypreview = str_replace("src='".str_replace("../", "", IMAGES_A), "src='".IMAGES_A, stripslash($_POST['body'])); $body2preview = str_replace("src='".str_replace("../", "", IMAGES_A), "src='".IMAGES_A, stripslash($_POST['body2'])); if (isset($_POST['line_breaks'])) { $breaks = " checked"; $bodypreview = nl2br($bodypreview); $body2preview = nl2br($body2preview); } $comments = isset($_POST['article_comments']) ? " checked" : ""; $ratings = isset($_POST['article_ratings']) ? " checked" : ""; opentable($subject); echo "$bodypreview\n"; closetable(); tablebreak(); opentable($subject); echo "$body2preview\n"; closetable(); tablebreak(); } opentable($locale['508']); $editlist = ""; $sel = ""; $result = dbquery("SELECT * FROM ".$db_prefix."articles ORDER BY article_datestamp DESC"); if (dbrows($result) != 0) { while ($data = dbarray($result)) { if (isset($article_id)) $sel = ($article_id == $data['article_id'] ? " selected" : ""); $editlist .= "\n"; } } echo "
\n"; closetable(); tablebreak(); if (isset($_POST['edit'])) { $result = dbquery("SELECT * FROM ".$db_prefix."articles WHERE article_id='$article_id'"); if (dbrows($result) != 0) { $data = dbarray($result); $article_cat = $data['article_cat']; $subject = $data['article_subject']; $body = phpentities(stripslashes($data['article_snippet'])); $body2 = phpentities(stripslashes($data['article_article'])); $breaks = ($data['article_breaks'] == "y" ? " checked" : ""); $comments = ($data['article_allow_comments'] == "1" ? " checked" : ""); $ratings = ($data['article_allow_ratings'] == "1" ? " checked" : ""); } } if (isset($article_id)) { $action = FUSION_SELF.$aidlink."&article_id=$article_id"; opentable($locale['500']); } else { if (!isset($_POST['preview'])) { $subject = ""; $body = ""; $body2 = ""; $breaks = " checked"; $comments = " checked"; $ratings = " checked"; } $action = FUSION_SELF.$aidlink; opentable($locale['504']); } $result = dbquery("SELECT * FROM ".$db_prefix."article_cats ORDER BY article_cat_name DESC"); $catlist = ""; $sel = ""; while ($data = dbarray($result)) { if (isset($article_cat)) $sel = ($article_cat == $data['article_cat_id'] ? " selected" : ""); $catlist .= "\n"; } $image_files = makefilelist(IMAGES_A, ".|..|index.php", true); $image_list = makefileopts($image_files); echo "
\n"; if ($settings['tinymce_enabled'] != 1) { echo "\n\n\n"; } echo "\n\n"; if ($settings['tinymce_enabled'] != 1) { echo "\n\n"; } echo "
".$locale['511']."
".$locale['512']."
".$locale['513']."
', '');\"> ', '');\"> ', '');\"> Link');\"> ');\"> ', '');\"> ', '');\"> ', '');\"> ', '');\">
".$locale['514']."
', '');\"> ', '');\"> ', '');\"> Link');\"> ');\"> ', '');\"> ', '');\"> ', '');\"> ', '');\"> ');\">
"; if ($settings['tinymce_enabled'] != 1) echo " ".$locale['417']."
\n"; echo " ".$locale['423']."
".$locale['424']."

\n"; closetable(); echo "\n"; } } else { opentable($locale['517']); echo "
".$locale['518']."
\n".$locale['519']."
".$locale['520']."".$locale['521']."
\n"; closetable(); } echo "\n"; require_once BASEDIR."footer.php"; ?>