From 6275348098baa21523f31d8c228cd7fa0dd64b2d Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 24 Mar 2001 16:36:13 +0000 Subject: - the "faq module" and the "documentation module" are going to be bundled into a much more powerful and easier to maintain "book module": each "page" in the big "drop.org/drupal book" is a node and everyone with a user account can suggest new pages or updates of existing pages. --- modules/faq.module | 127 ----------------------------------------------------- 1 file changed, 127 deletions(-) delete mode 100644 modules/faq.module (limited to 'modules/faq.module') diff --git a/modules/faq.module b/modules/faq.module deleted file mode 100644 index 88e59ed6e..000000000 --- a/modules/faq.module +++ /dev/null @@ -1,127 +0,0 @@ - "faq_page", - "admin" => "faq_admin"); - - -function faq_page() { - global $theme; - - $result = db_query("SELECT * FROM faqs ORDER BY weight"); - - while ($faq = db_fetch_object($result)) { - $header .= "
  • id\">". check_output($faq->question) ."
  • \n"; - $output .= "
    id\">". check_output($faq->question) ."
    \n"; - $output .= "
    ". check_output($faq->answer, 1) ."

    \n"; - } - $output = "

    $output
    "; - - $theme->header(); - $theme->box(t("Frequently Asked Questions"), $header); - $theme->box(t("Frequently Asked Questions"), $output); - $theme->footer(); -} - -function faq_add() { - global $allowed_html; - - $output .= "
    \n"; - - $output .= "Question:
    \n"; - $output .= "
    \n"; - - $output .= "Answer:
    \n"; - $output .= "
    \n"; - $output .= "Allowed HTML tags: ". htmlspecialchars($allowed_html) .".

    \n"; - - $output .= "Weight:
    \n"; - for ($count = 0; $count < 20; $count++) $weight .= "\n"; - $output .= "

    \n"; - - $output .= "\n"; - $output .= "

    \n"; - - print $output; -} - -function faq_add_save($edit) { - db_query("INSERT INTO faqs (question, answer, weight) VALUES ('". check_input($edit[question]) ."', '". check_input($edit[answer]) ."', '". check_input($edit[weight]) ."')"); - watchdog("message", "faq: added '$edit[question]'"); -} - -function faq_delete($id) { - db_query("DELETE FROM faqs WHERE id = '$id'"); -} - -function faq_edit($id) { - global $allowed_html; - - $result = db_query("SELECT * FROM faqs WHERE id = '$id'"); - $faq = db_fetch_object($result); - - $output .= "
    \n"; - - $output .= "Question:
    \n"; - $output .= "question) ."\">

    \n"; - - $output .= "Answer:
    \n"; - $output .= "
    \n"; - $output .= "Allowed HTML tags: ". htmlspecialchars($allowed_html) .".

    \n"; - - $output .= "Weight:
    \n"; - for ($count = 0; $count < 20; $count++) $weight .= "\n"; - $output .= "

    \n"; - - $output .= "\n"; - $output .= "

    \n"; - - print $output; -} - -function faq_edit_save($id, $edit) { - db_query("UPDATE faqs SET question = '". check_input($edit[question]) ."', answer = '". check_input($edit[answer]) ."', weight = '". check_input($edit[weight]) ."' WHERE id = '$id'"); - watchdog("message", "faq: modified `$edit[question]'"); -} - -function faq_display() { - $result = db_query("SELECT * FROM faqs ORDER BY weight"); - - $output .= "\n"; - $output .= " \n"; - while ($faq = db_fetch_object($result)) { - $output .= " \n"; - } - $output .= "
    questionweightoperations
    ". check_output($faq->question) ."$faq->weightid\">editid\">delete
    \n"; - - print $output; -} - -function faq_admin() { - global $op, $id, $edit; - - print "add new faq | overview
    \n"; - - switch ($op) { - case "add": - faq_add(); - break; - case "delete": - faq_delete(check_input($id)); - faq_display(); - break; - case "edit": - faq_edit(check_input($id)); - break; - case "Add FAQ": - faq_add_save($edit); - faq_display(); - break; - case "Save FAQ": - faq_edit_save(check_input($id), $edit); - // fall through: - default: - faq_display(); - } -} - -?> -- cgit v1.2.3