📄 index.php3
字号:
<?php// Simon's Rock Web Calendar// Copyright (C) 1999-2000 Ryan Krebs and Simon's Rock College of Bard// Please read the accompanying files "COPYING" and "COPYRIGHT"// for more informationinclude( 'includes/config.inc' );//include( 'box.php3' );include( 'login-box.php3' );include( 'calendar-box.php3' );include( 'search-box.php3' );include( 'submit-box.php3' );include( 'approve-box.php3' );include( 'delete-box.php3' );include( 'modify-box.php3' );include( 'help-box.php3' );include( '../auth/session.php3' );// color is for alternating box backgrounds$color = 0;$action_url = basename(__FILE__);if( isSet( $timestamp ) ) { $action_suffix = "&timestamp=$timestamp";}// Do a little testing for cookies$action_suffix .= "&test_cookies=1";if( $test_cookies ) { if( !$cookie_test ) { $cookies_enabled = 0; SetCookie( "cookie_test", 1, mktime() + 60*60*24*365, "/" ); } else { $cookies_enabled = 1; }} else { SetCookie( "cookie_test", 1, mktime() + 60*60*24*365, "/" );// Give them the benefit of the doubt, we'll catch it in time $cookies_enabled = 1;}$session_var = "session";$session = new SRCSession();if( isSet( $SRCSessionKey ) ) { $session->loadSession( $SRCSessionKey );}// determine whether we're on campus or notif( substr( (gethostbyaddr(trim(getenv( "REMOTE_ADDR" )))), -(strlen($config_internaldomain)+1) ) != "." . $config_internaldomain ) { $oc_remote_host = 1;} else { $oc_remote_host = 0;}// Initialize the boxes//$boxes["box"] = new SRCBox( "$action_url?action=box$action_suffix", $session_var );$boxes["calendar"] = new SRCCalendarBox( "$action_url?action=calendar", $session_var );$boxes["help"] = new SRCHelpBox( "$action_url?action=help$action_suffix", $session_var );$boxes["submit"] = new SRCSubmitBox( "$action_url?action=submit$action_suffix", $session_var, 1 );$boxes["approve"] = new SRCApproveBox( "$action_url?action=approve$action_suffix", $session_var, 1 );$boxes["delete"] = new SRCDeleteBox( "$action_url?action=delete$action_suffix", $session_var, 1 );$boxes["modify"] = new SRCModifyBox( "$action_url?action=modify$action_suffix", $session_var, 1 );$boxes["search"] = new SRCSearchBox( "$action_url?action=search$action_suffix", $session_var );$boxes["login"] = new SRCLoginBox( "$action_url?action=login$action_suffix", $session_var );// default actionif( !isSet( $action ) ) { $action = "calendar";}// if we need to use headers (setcookie) do stuff before we output htmlif( isSet( $boxes[$action] ) && $boxes[$action]->uses_headers ) { $boxes[$action]->parseBox();}include( 'includes/header.inc' );?> <TABLE WIDTH=640> <TR VALIGN=top> <TD WIDTH=260> <TABLE CELLPADDING=10><?php// go through each box, output (checking login reqs) for( ;$current_box = each( $boxes ); ) { if( (!$current_box["value"]->login_required) || (isSet( $SRCSessionKey ) && $current_box["value"]->verifyPermissions()) ) { echo( " <TR>\n" ); echo( " <TD BGCOLOR=\"" . (($color++ % 2) ? "#FFFFFF" : "#9999CC" ) . "\">\n" ); $current_box["value"]->outputBox(); echo( " </TD>\n" ); echo( " </TR>\n" ); } }?> </TABLE> </TD> <TD WIDTH=380 BGCOLOR="#FFFFFF" VALIGN="top"><?php// do box stuff in the results section if( $action && isSet( $boxes[$action] ) ) { if( $boxes[$action]->error ) { reportError( $boxes[$action]->error, $boxes[$action]->during ); } $boxes[$action]->outputResults(); } elseif( $action ) { reportError( "\"$action\" is not a valid action.", "while parsing the URL" ); }?> </TD> </TR> </TABLE><?php include( 'includes/footer.inc' ) ?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -