/** * set the option and return the old one. * if the old one is not exists, return false * @param string $key The key of the option's name * @param object $value The value of the option * @return object the old value of the key * @example set_ojinfo('title', 'Ecust Online Judge'); * @example set_ojinfo('hightlight'); */ function set_ojinfo($key, $value = true) { global $oj_options_cache; $oldValue = get_ojinfo($key); $key = 'oj_option_' . trim($key); $oj_options_cache[$key] = $value; return $oldValue; }
<title><?php echo get_ojinfo('title'); ?> </title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link href="style/style.css" rel="stylesheet" type="text/css" /> <link title="Default" rel="oj_theme stylesheet" type="text/css" /> <script type="text/javascript" src="libs/jQuery/jquery.cookie.js"></script> <script type="text/javascript" src="libs/oj.core.js"></script> <?php include_once 'multi_theme.php'; if (get_ojinfo('highlight')) { include_once 'codehighlight.php'; } if (get_ojinfo('attachhead')) { echo get_ojinfo('attachhead'); } ?> </head> <body> <div class="header"> <div class="wapper"> <h1 style="display: inline;">Ecust Online Judge</h1> <span style="float: right; display: inline;">Theme: <a href="javascript:oj.theme('Default')">Default</a> <a href="javascript:oj.theme('Green(simple)')">Green(simple)</a> <a href="javascript:oj.theme('Blue(simple)')">Blue(simple)</a> <a href="javascript:oj.theme('Purple(simple)')">Purple(simple)</a> </span> </div> <table border=1 class="table_list"> <tr> <th width=20%>Online Judge</th> <th width=20%>Problem Set</th> <th width=20%>Authors</th>