".$locale['401']."
\n".$locale['402']."\nviewpage.php?page_id=$pid\n"; } elseif ($status == "sn") { $title = $locale['405']; $message = "".$locale['406']."
\n".$locale['402']."\nviewpage.php?page_id=$pid\n"; } elseif ($status == "del") { $title = $locale['407']; $message = "".$locale['408'].""; } opentable($title); echo "
".$message."
\n"; closetable(); tablebreak(); } if (isset($_POST['save'])) { $page_title = stripinput($_POST['page_title']); $page_access = isNum($_POST['page_access']) ? $_POST['page_access'] : "0"; $page_content = addslash($_POST['page_content']); $comments = isset($_POST['page_comments']) ? "1" : "0"; $ratings = isset($_POST['page_ratings']) ? "1" : "0"; if (isset($page_id)) { $result = dbquery("UPDATE ".$db_prefix."custom_pages SET page_title='$page_title', page_access='$page_access', page_content='$page_content', page_allow_comments='$comments', page_allow_ratings='$ratings' WHERE page_id='$page_id'"); redirect(FUSION_SELF.$aidlink."&status=su&pid=$page_id"); } else { $result = dbquery("INSERT INTO ".$db_prefix."custom_pages (page_title, page_access, page_content, page_allow_comments, page_allow_ratings) VALUES ('$page_title', '$page_access', '$page_content', '$comments', '$ratings')"); $page_id = mysql_insert_id(); if (isset($_POST['add_link'])) { $result = dbquery("SELECT * FROM ".$db_prefix."site_links ORDER BY link_order DESC LIMIT 1"); $data = dbarray($result); $link_order = $data['link_order'] + 1; $result = dbquery("INSERT INTO ".$db_prefix."site_links (link_name, link_url, link_visibility, link_position, link_window, link_order) VALUES ('$page_title', 'viewpage.php?page_id=$page_id', '$page_access', '1', '0', '$link_order')"); } redirect(FUSION_SELF.$aidlink."&status=sn&pid=$page_id"); } } else if (isset($_POST['delete'])) { $result = dbquery("DELETE FROM ".$db_prefix."custom_pages WHERE page_id='$page_id'"); $result = dbquery("DELETE FROM ".$db_prefix."site_links WHERE link_url='viewpage.php?page_id=$page_id'"); redirect(FUSION_SELF.$aidlink."&status=del"); } else { if (isset($_POST['preview'])) { $addlink = isset($_POST['add_link']) ? " checked" : ""; $page_title = stripinput($_POST['page_title']); $page_access = $_POST['page_access']; $page_content = $_POST['page_content']; $page_content = stripslash($page_content); $comments = isset($_POST['page_comments']) ? " checked" : ""; $ratings = ($_POST['page_ratings']) ? " checked" : ""; opentable($page_title); eval("?>".$page_content."".$data['page_title']."\n"; } } opentable($locale['420']); echo "
\n"; closetable(); tablebreak(); if (isset($_POST['edit'])) { $result = dbquery("SELECT * FROM ".$db_prefix."custom_pages WHERE page_id='$page_id'"); if (dbrows($result) != 0) { $data = dbarray($result); $page_title = $data['page_title']; $page_access = $data['page_access']; //$page_content = stripinput((QUOTES_GPC ? $data['page_content'] : stripslashes($data['page_content']))); $page_content = phpentities(stripslashes($data['page_content'])); $comments = ($data['page_allow_comments'] == "1" ? " checked" : ""); $ratings = ($data['page_allow_ratings'] == "1" ? " checked" : ""); $addlink = ""; } } if (isset($page_id)) { $action = FUSION_SELF.$aidlink."&page_id=$page_id"; opentable($locale['400']); } else { if (!isset($_POST['preview'])) { $page_title = ""; $page_access = ""; $page_content = ""; $comments = " checked"; $ratings = " checked"; $addlink = ""; } $action = FUSION_SELF.$aidlink; opentable($locale['405']); } $user_groups = getusergroups(); $access_opts = ""; $sel = ""; while(list($key, $user_group) = each($user_groups)){ $sel = ($page_access == $user_group['0'] ? " selected" : ""); $access_opts .= "\n"; } echo "
".$locale['430']."  ".$locale['431']."
".$locale['432']."
');\"> ');\"> ');\"> ', '');\"> ', '');\"> ', '');\"> Link');\"> ');\"> ', '');\"> ', '');\"> ', '');\"> ', '');\">

\n"; if (!isset($page_id)) echo " ".$locale['433']."
\n"; echo " ".$locale['434']."
".$locale['435']."

\n"; closetable(); echo "\n"; } echo "\n"; require_once BASEDIR."footer.php"; ?>