-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.php
44 lines (42 loc) · 1.54 KB
/
options.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?PHP
// Some Chess, a PHP multi-player chess server.
// Copyright (C) 2007 Jon Link
require_once('loginon.php');
if($_SESSION['power']>3 && is_writable('config.php')){
include_once('languages/'.$lang.'_options.php');
$optQuery = 'SELECT * FROM '.dbPre.'options WHERE id>0 ORDER BY id';
$optResult = mysql_query($optQuery)or die('<div class="error">'.errorDBStr.' (op-1)</div>');
$optCount = mysql_num_rows($optResult);
echo '
<div class="display-box options">
<form action="menu.php" method="post" class="option-form">
<h2>',$adminStr[16],'</h2>
<div id="optlist">';
for($p=0;$p<$optCount;++$p){
unset($check,$excp,$value);
$optName = mysql_result($optResult,$p,'optionName');
if(mysql_result($optResult,$p,'type') == 'checkbox'){
if(mysql_result($optResult,$p,'optionValue') == 1) $check = ' checked="checked"';
$value = '1';
}else{
$value = mysql_result($optResult,$p,'optionValue');
}
if(mysql_result($optResult,$p,'type') == 'checkbox') $excp = ' style="width:auto"';
echo '
<p>'.str_replace('_',' ',$optName).' <input type="'.mysql_result($optResult,$p,'type').'" name="'.$optName.'" value="'.$value.'"'.$excp.$check.' /></p>';
$help .= '
<p>'.$opStr[$p].'</p>';
}
echo '
</div><!--optlist-->
<div id="help">',$help,'
</div><!--help-->
<p><input type="hidden" name="do" value="updateOpt" />
<input type="submit" value="',$opStr['a'],'" class="butt" /></p>
</form>
</div><!--options-->
';
}elseif(!is_writable('config.php')){
echo '<div class="error">',$adminStr[19],'</div>';
}
?>