\n";
+ return 0;
}
function print_detail_field() {
diff --git a/html/inc/gallery.inc b/html/inc/gallery.inc
index 2463d1dc07..cceb304289 100644
--- a/html/inc/gallery.inc
+++ b/html/inc/gallery.inc
@@ -9,6 +9,45 @@ require_once("../inc/uotd.inc");
$alphabet = array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','0','1','2','3','4','5','6','7','8','9');
+// Generates a standard set of links between associated multi-page documents.
+// All linked files must be of the form "$filename_.html".
+
+function write_page_links($filename, $currPageNum, $numPages) {
+ echo "
Jump to Page:\n";
+
+ // Make the individual page links (or a bold non-link for the current page).
+ //
+ for ($i = 1; $i <= $numPages; $i++) {
+ if ($i != $currPageNum) {
+ //fwrite($descriptor, "$i\n");
+ echo "$i\n";
+ } else {
+ //fwrite($descriptor, "$i\n");
+ echo "$i\n";
+ }
+ }
+
+}
+
// Generates the html files which comprise the photo gallery.
// $room: which gallery to generate (user, computer).
// $width: the width of the table of images.
diff --git a/html/inc/prefs.inc b/html/inc/prefs.inc
index 380a79fc1a..7637913590 100644
--- a/html/inc/prefs.inc
+++ b/html/inc/prefs.inc
@@ -97,6 +97,19 @@ global $top_parse_result;
global $in_project_specific;
global $venue_name;
+function check_venue($x) {
+ if ($x == "home") return;
+ if ($x == "work") return;
+ if ($x == "school") return;
+ error_page("bad venue: $x");
+}
+
+function check_subset($x) {
+ if ($x == "global") return;
+ if ($x == "project") return;
+ error_page("bad subset: $x");
+}
+
// functions to convert between max_bytes_sec_* as stored in the
// database and max_bytes_sec_* as displayed/entered on the web
// pages. Currently max_bytes_sec_* is stored in bytes and
diff --git a/html/inc/profile.inc b/html/inc/profile.inc
index b7be29638e..47048f954e 100644
--- a/html/inc/profile.inc
+++ b/html/inc/profile.inc
@@ -18,6 +18,32 @@ define('MAX_DESC_LENGTH', 90);
define('GALLERY_WIDTH', 7);
define('GALLERY_HEIGHT', 4);
+// output a select form item with the given name,
+// from a list of newline-delineated items from the text file.
+// If $selection is provided, and if it matches one of the entries in the file,
+// it will be selected by default.
+//
+function show_combo_box($name, $filename, $selection=null) {
+ if (!file_exists($filename)) {
+ echo "ERROR: $filename does not exist! Cannot create combo box. ";
+ exit();
+ }
+ echo "\n";
+ fclose($file);
+}
+
function get_profile($userid) {
$result = mysql_query("SELECT * FROM profile WHERE userid = $userid");
if (!$result) {
diff --git a/html/inc/util.inc b/html/inc/util.inc
index 1be17d9986..94ab054f82 100644
--- a/html/inc/util.inc
+++ b/html/inc/util.inc
@@ -65,6 +65,7 @@ function get_logged_in_user($must_be_logged_in=true) {
if (!$authenticator) {
$authenticator = $_COOKIE['auth'];
}
+ $authenticator = process_user_text($authenticator);
$user = get_user_from_auth($authenticator);
if ($must_be_logged_in) {
require_login($user);
@@ -81,32 +82,6 @@ function show_login($user) {
}
}
-// output a select form item with the given name,
-// from a list of newline-delineated items from the text file.
-// If $selection is provided, and if it matches one of the entries in the file,
-// it will be selected by default.
-//
-function show_combo_box($name, $filename, $selection=null) {
- if (!file_exists($filename)) {
- echo "ERROR: $filename does not exist! Cannot create combo box. ";
- exit();
- }
- echo "\n";
- fclose($file);
-}
-
function page_head($title, $java_onload="") {
$styleSheet = URL_BASE . STYLESHEET;
$rssname = PROJECT . " RSS 2.0";
@@ -201,36 +176,6 @@ function time_str($x) {
function pretty_time_str($x) {
return time_str($x);
}
-// Converts a mysql-Timestamp to a user readable format
-// @return String A user readable DateTime-String in UTC
-// @param Integer $x The mysql-Timestamp to convert
-function mysqltime_str($x) {
- if(strpos($x,"-")==4)
- {
- // Syntax of supplied mysql-timestamp is YYYY-MM-DD HH:MM:SS
- $year = substr($x,0,4);
- $month = substr($x,5,2);
- $day = substr($x,8,2);
- $hour = substr($x,11,2);
- $minute = substr($x,14,2);
- $second = substr($x,17,2);
- }
- else
- {
- // Syntax of supplied mysql-timestamp is YYYYMMDDHHMMSS
- $year = substr($x,0,4);
- $month = substr($x,4,2);
- $day = substr($x,6,2);
- $hour = substr($x,8,2);
- $minute = substr($x,10,2);
- $second = substr($x,12,2);
-
- }
- //make a Unix-Timestamp
- // echo "Time string is " . "$x";
- $time = mktime($hour,$minute,$second,$month,$day,$year);
- return time_str($time);
-}
function start_table($extra="width=100%") {
echo "
";
}
@@ -387,45 +332,6 @@ function no_cache() {
header ("Pragma: no-cache"); // HTTP/1.0
}
-// Generates a standard set of links between associated multi-page documents.
-// All linked files must be of the form "$filename_.html".
-
-function write_page_links($filename, $currPageNum, $numPages) {
- echo "