################################################################################
# php #
# ~arnesom/wps.php #
# ---------------- #
# Web Publishing System #
# ---------------------------------------------------------------------- #
# Copyright (C) 2000-2004 Arne Sommer - arnesom@ifi.uio.no #
# ---------------------------------------------------------------------- #
# Last update: 20. August 2004. #
# #
################################################################################
require("common/common.php");
################################################################################
# #
# Command Line Arguments #
# ---------------------- #
# t=xxxx - Template. all modes. #
# f=xxxx - File (contents) File mode. #
# q=xxxx - Question file. Quiz mode, load 'common/quiz.php' and output code #
# with JavaScript! #
# Q=xxxx - Ditto, but in edit mode. #
# #
# (The files may be URL-specified, e.g. "f=http://www.where.is/the/file". #
# #
################################################################################
$Q = $q = $t = $f = $do_upload = $filter = $password = "";
$SCRIPT_NAME = $HTTP_SERVER_VARS["SCRIPT_NAME"];
if (array_key_exists("Q", $_GET)) { $Q = $_GET["Q"]; }
if (array_key_exists("q", $_GET)) { $q = $_GET["q"]; }
if (array_key_exists("t", $_GET)) { $t = $_GET["t"]; }
if (array_key_exists("f", $_GET)) { $f = $_GET["f"]; }
if (array_key_exists("do_upload", $_GET)) { $do_upload = $_GET["do_upload"]; }
if (array_key_exists("filter", $_POST)){ $filter = $_GET["filter"]; }
if (array_key_exists("password", $_POST)){ $password = $_GET["password"]; }
################################################################################
# #
# Template File Syntax #
# -------------------- #
# Whatever you would want, with 'XXXXX' placed where the contents should be #
# inserted. #
# #
################################################################################
$templates["Dn"] = "http://www.nrk.no/magasin/magi/newton/965782.html";
$templates["Dna"] = "http://www.nrk.no/programmer/tv/newton/arkiv/965782.html";
# $templates["Dm"] = "http://www.nrk.no/magasin/magi/965782.html";
$templates["DRn"] = "http://www.nrk.no/nyheter/965782.html";
$templates["DRs"] = "http://www.nrk.no/sport/965782.html";
$templates["DRt"] = "http://www.nrk.no/trafikk/965782.html";
$templates["DRk"] = "http://www.nrk.no/kultur/965782.html";
$templates["DRf"] = "http://www.nrk.no/film/965782.html";
################################################################################
# #
# Question File Syntax #
# -------------------- #
# See 'common/quiz.php'. #
# #
################################################################################
$template = $template_orig = "";
# global($Q);
$qfile = ""; # questions"; ## 'http://www.php.net'
$qfilter = 0; # Questions to witheld in interactive mode. #
$file = ""; #
$elem_colour = "#EEEEEE";
$commandline = "";
$replace = $replace_from = $replace_to = $replace_from_raw = array();
#" 'raw' er uten den innledende og avsluttende '|'.
$edit_quiz = 0;
$password_ok = 0;
require("common/quiz.php");
require("common/quiz-edit.php");
## Edit mode
while (list($var, $value) = each($HTTP_POST_VARS))
{
# echo "X: $var - $value
\n";
if ($var == "Q") { $Q = $value; }
elseif ($var == "create") { $create = $value; }
elseif ($var == "max_quest") { $max_quest = $value; }
elseif ($var == "max_replace") { $max_replace = $value; }
elseif ($var == "password") { $password = $value; }
elseif ($var == "do_upload") { $do_upload = $value; }
elseif ($var == "filter") { $filter = $value; }
}
if ($Q)
{
$q = $Q; $edit_quiz = 1;
}
if ($filter) { $qfilter = $filter; } ##!! POST/GET-wrapper.
if ($do_upload) # Upload a quiz.
{
# require("common/quiz.php");
# require("common/quiz-edit.php");
start_html("WPS Quiz Editor", "WPS Quiz Editor", "Quiz Upload Status");
# print "
"; } } else { echo "
See the manual for further information.
"; } stop_html("wps.php"); } ?>