FAQ Management actions
| > Written by avataru
| > Date started: 1/7/2005
|
+--------------------------------------------------------------------------
*/
require "../include/bittorrent.php";
dbconn();
loggedinorreturn();
if (get_user_class() < UC_ADMINISTRATOR) {
stderr("Error","Only Administrators and above can modify the FAQ, sorry.");
}
//stdhead("FAQ Management");
// ACTION: reorder - reorder sections and items
if (isset($_GET['action']) && $_GET['action'] == "reorder") {
foreach($_POST[order] as $id => $position) sql_query("UPDATE `faq` SET `order`=".sqlesc($position)." WHERE id=".sqlesc($id)) or sqlerr();
header("Location: " . get_protocol_prefix() . "$BASEURL/faqmanage.php");
die;
}
// ACTION: edit - edit a section or item
elseif (isset($_GET['action']) && $_GET['action'] == "edit" && isset($_GET['id'])) {
stdhead("FAQ Management");
begin_main_frame();
print("
Edit Section or Item
");
$res = sql_query("SELECT * FROM faq WHERE id=".sqlesc($_GET['id'])." LIMIT 1");
while ($arr = mysql_fetch_array($res, MYSQLI_BOTH)) {
$arr['question'] = htmlspecialchars($arr['question']);
$arr['answer'] = htmlspecialchars($arr['answer']);
if ($arr['type'] == "item") {
$lang_id = $arr['lang_id'];
print("");
end_main_frame();
stdfoot();
}
// ACTION: addsection - add a new section
elseif (isset($_GET['action']) && $_GET['action'] == "addsection") {
stdhead("FAQ Management");
begin_main_frame();
print("Add Section
");
print("