Location: PHPKode > projects > Admbook > admin/config.php
<?php
	session_start();
	include("../settings-data.php");
	include("../lib.php");
	include("../config-data.php");
	checkPermissions($login, $password);
	if (!isset($error))
		$error = "";
	if (!isset($style))
		$style = "";
?>
<html>
<head>
<title>admbook :: version <?=$constant['version']?></title>
<?php
	if ($constant['charset'] != "")
	{
?>
<meta http-equiv="Content-Type" content="text/html; charset=<?=$constant['charset']?>">
<?php
	}
?>
<script language="JavaScript" src="../script.js" type="text/javascript"></script>
<link href="../style.css" type="text/css" rel="stylesheet">
<style type="text/css">
<!--
input.field {
	width : 100%;
}

select {
	width: 200px;
}

#error {
	color : <?=$constant['error-color']?>
}

.text {
	font : 8pt "Verdana","Arial Cyr", "Arial","Tahoma","Helvetica", sans-serif;
	color : <?=$constant['text-color']?>
}

.link {
	font : 8pt "Verdana","Arial Cyr", "Arial","Tahoma","Helvetica", sans-serif;
	color : <?=$constant['link-color']?>
}

.messagetext {
	font : 8pt "Verdana","Arial Cyr", "Arial","Tahoma","Helvetica", sans-serif;
	color : <?=$constant['message-text-color']?>
}

.messagelink {
	font : 8pt "Verdana","Arial Cyr", "Arial","Tahoma","Helvetica", sans-serif;
	color : <?=$constant['message-link-color']?>
}

.admintext {
	font : 8pt "Verdana","Arial Cyr", "Arial","Tahoma","Helvetica", sans-serif;
	color : <?=$constant['admin-message-text-color']?>
}

.adminlink {
	font : 8pt "Verdana","Arial Cyr", "Arial","Tahoma","Helvetica", sans-serif;
	color : <?=$constant['admin-message-link-color']?>
}

.headertext {
	font : 8pt "Verdana","Arial Cyr", "Arial","Tahoma","Helvetica", sans-serif;
	color : <?=$constant['header-text-color']?>
}

.headerlink {
	font : 8pt "Verdana","Arial Cyr", "Arial","Tahoma","Helvetica", sans-serif;
	color : <?=$constant['header-link-color']?>
}

<?=$style?>
-->
</style>
<script>
function check(stat)
{
	var len = document.forms[0].elements.length;
	for( var i=0; i < len; i++ )
	{
		chbox = document.forms[0].elements[i];
		if(chbox.type == "checkbox")
			chbox.checked = stat;
	}
}
</script>
</head>
<body bgcolor="<?=$constant['background-color']?>" text="<?=$constant['text-color']?>" link="<?=$constant['link-color']?>" vlink="<?=$constant['link-color']?>" alink="<?=$constant['link-color']?>" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0">
<table width="760" border="0" cellpadding="0" cellspacing="0" align="center" height="100%">
<tr>
	<td valign="top" class="text" align="center">
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<form action="config-up.php" method="post">
		<input type="hidden" name="page" value="<?=$page?>">
		<tr>
			<td bgcolor="<?=$constant['border-color']?>">
				<table width="100%" border="0" cellpadding="2" cellspacing="1">
				<tr>
					<td bgcolor="<?=$constant['header-background-color']?>" class="headertext" id="book-title">Admbook versi0n <?=$constant['version']?></td>
				</tr>
				</table>
			</td>
		</tr>
		</table>
		<br/>
		<?php @include("../temp/top.inc"); ?>
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td bgcolor="<?=$constant['border-color']?>">
				<table width="100%" border="0" cellpadding="2" cellspacing="1">
				<tr>
					<td bgcolor="<?=$constant['header-background-color']?>" class="headertext" align="center"><b>Configuration</b></td>
				</tr>
				</table>
			</td>
		</tr>
		</table>
		<br/>
		<div align="right">
		<table border="0" cellpadding="0" cellspacing="0">
<?php
	if ($error != "")
	{
?>
		<tr>
			<td colspan="3" class="text">
				<b>Detect following errors:</b><br>
				<span id="error"><?=$error?></span>
				<br>
			</td>
		</tr>
<?php
		session_unregister("error");
		session_unregister("style");
	}
?>
		<tr>
			<td class="text"><span class="maxmessageslength">max messages length:</span></td>
			<td width="10"><spacer width="10" height="1" type="block"></td>
			<td>
<?php
	if (isset($maxLengthMessage))
	{
		session_unregister("maxLengthMessage");
	} else {
		$maxLengthMessage = $constant['max-length-message'];
	}
?>
				<select name="maxLengthMessage">
<?php
		while (list($key, $value) = each($config['max-length-message']))
		{
			$selected = false;
			if ($maxLengthMessage == $key)
				$selected = true;
?>					<option value="<?=$key?>"<?=$selected ? " selected" : ""?>><?=$value?></option>
<?php
		}
?>
				</select>
			</td>
		</tr>
		<tr>
			<td class="text"><span class="messagestopage">messages to page:</span></td>
			<td><spacer width="1" height="1" type="block"></td>
			<td>
<?php
	if (isset($messagesToPage))
	{
		session_unregister("messagesToPage");
	} else {
		$messagesToPage = $constant['messages-to-page'];
	}
?>
				<select name="messagesToPage">
<?php
		while (list($key, $value) = each($config['messages-to-page']))
		{
			$selected = false;
			if ($messagesToPage == $key)
				$selected = true;
?>					<option value="<?=$key?>"<?=$selected ? " selected" : ""?>><?=$value?></option>
<?php
		}
?>
				</select>
			</td>
		</tr>
		<tr>
			<td class="text"><span class="pageinline">page in navigation line:</span></td>
			<td><spacer width="1" height="1" type="block"></td>
			<td>
<?php
	if (isset($pageInLine))
	{
		session_unregister("pageInLine");
	} else {
		$pageInLine = $constant['page-in-line'];
	}
?>
				<select name="pageInLine">
<?php
		while (list($key, $value) = each($config['page-in-line']))
		{
			$selected = false;
			if ($pageInLine == $key)
				$selected = true;
?>					<option value="<?=$key?>"<?=$selected ? " selected" : ""?>><?=$value?></option>
<?php
		}
?>
				</select>
			</td>
		</tr>
		<tr>
			<td class="text"><span class="maxwordlength">max word length:</span></td>
			<td><spacer width="1" height="1" type="block"></td>
			<td>
<?php
	if (isset($maxWordLength))
	{
		session_unregister("maxWordLength");
	} else {
		$maxWordLength = $constant['max-word-length'];
	}
?>
				<select name="maxWordLength">
<?php
		while (list($key, $value) = each($config['max-word-length']))
		{
			$selected = false;
			if ($maxWordLength == $key)
				$selected = true;
?>					<option value="<?=$key?>"<?=$selected ? " selected" : ""?>><?=$value?></option>
<?php
		}
?>
				</select>
			</td>
		</tr>
		<tr>
			<td class="text"><span class="repeatsendtime">time for repeating send message:</span></td>
			<td><spacer width="1" height="1" type="block"></td>
			<td>
<?php
	if (isset($repeatSendTime))
	{
		session_unregister("repeatSendTime");
	} else {
		$repeatSendTime = $constant['repeat-send-time'];
	}
?>
				<select name="repeatSendTime">
<?php
		while (list($key, $value) = each($config['repeat-send-time']))
		{
			$selected = false;
			if ($repeatSendTime == $key)
				$selected = true;
?>					<option value="<?=$key?>"<?=$selected ? " selected" : ""?>><?=$value?></option>
<?php
		}
?>
				</select>
			</td>
		</tr>
		<tr>
			<td class="text">error message color: </td>
			<td><spacer width="1" height="1" type="block"></td>
			<td><input type="text" size="20" name="errColor" value="<?php if (isset($errColor)) { print stripslashes($errColor); session_unregister("errColor"); } else { print $constant['error-color']; }?>" maxlength="50" class="field"/>
			</td>
		</tr>
		<tr>
			<td class="text">border color: </td>
			<td><spacer width="1" height="1" type="block"></td>
			<td><input type="text" size="20" name="borderColor" value="<?php if (isset($borderColor)) { print stripslashes($borderColor); session_unregister("borderColor"); } else { print $constant['border-color']; }?>" maxlength="50" class="field"/></td>
		</tr>
		<tr>
			<td class="text">line color: </td>
			<td><spacer width="1" height="1" type="block"></td>
			<td><input type="text" size="20" name="lineColor" value="<?php if (isset($lineColor)) { print stripslashes($lineColor); session_unregister("lineColor"); } else { print $constant['line-color']; }?>" maxlength="50" class="field"/></td>
		</tr>
		<tr>
			<td class="text">admin line color: </td>
			<td><spacer width="1" height="1" type="block"></td>
			<td><input type="text" size="20" name="adminLineColor" value="<?php if (isset($adminLineColor)) { print stripslashes($adminLineColor); session_unregister("adminLineColor"); } else { print $constant['admin-line-color']; }?>" maxlength="50" class="field"/></td>
		</tr>
		<tr>
			<td class="text">background color: </td>
			<td><spacer width="1" height="1" type="block"></td>
			<td><input type="text" size="20" name="bgColor" value="<?php if (isset($bgColor)) { print stripslashes($bgColor); session_unregister("bgColor"); } else { print $constant['background-color']; }?>" maxlength="50" class="field"/></td>
		</tr>
		<tr>
			<td class="text">text color: </td>
			<td><spacer width="1" height="1" type="block"></td>
			<td><input type="text" size="20" name="textColor" value="<?php if (isset($textColor)) { print stripslashes($textColor); session_unregister("textColor"); } else { print $constant['text-color']; }?>" maxlength="50" class="field"/></td>
		</tr>
		<tr>
			<td class="text">link color: </td>
			<td><spacer width="1" height="1" type="block"></td>
			<td><input type="link" size="20" name="linkColor" value="<?php if (isset($linkColor)) { print stripslashes($linkColor); session_unregister("linkColor"); } else { print $constant['link-color']; }?>" maxlength="50" class="field"/></td>
		</tr>
		<tr>
			<td class="text">header background color: </td>
			<td><spacer width="1" height="1" type="block"></td>
			<td><input type="text" size="20" name="headerBgColor" value="<?php if (isset($headerBgColor)) { print stripslashes($headerBgColor); session_unregister("headerBgColor"); } else { print $constant['header-background-color']; }?>" maxlength="50" class="field"/></td>
		</tr>
		<tr>
			<td class="text">header text color: </td>
			<td><spacer width="1" height="1" type="block"></td>
			<td><input type="text" size="20" name="headerTextColor" value="<?php if (isset($headerTextColor)) { print stripslashes($headerTextColor); session_unregister("headerTextColor"); } else { print $constant['header-text-color']; }?>" maxlength="50" class="field"/></td>
		</tr>
		<tr>
			<td class="text">header link color: </td>
			<td><spacer width="1" height="1" type="block"></td>
			<td><input type="link" size="20" name="headerLinkColor" value="<?php if (isset($headerLinkColor)) { print stripslashes($headerLinkColor); session_unregister("headerLinkColor"); } else { print $constant['header-link-color']; }?>" maxlength="50" class="field"/></td>
		</tr>
		<tr>
			<td class="text">message background color: </td>
			<td><spacer width="1" height="1" type="block"></td>
			<td><input type="text" size="20" name="messageBgColor" value="<?php if (isset($messageBgColor)) { print stripslashes($messageBgColor); session_unregister("messageBgColor"); } else { print $constant['message-background-color']; }?>" maxlength="50" class="field"/></td>
		</tr>
		<tr>
			<td class="text">message text color: </td>
			<td><spacer width="1" height="1" type="block"></td>
			<td><input type="text" size="20" name="messageTextColor" value="<?php if (isset($messageTextColor)) { print stripslashes($messageTextColor); session_unregister("messageTextColor"); } else { print $constant['message-text-color']; }?>" maxlength="50" class="field"/></td>
		</tr>
		<tr>
			<td class="text">message link color: </td>
			<td><spacer width="1" height="1" type="block"></td>
			<td><input type="link" size="20" name="messageLinkColor" value="<?php if (isset($messageLinkColor)) { print stripslashes($messageLinkColor); session_unregister("messageLinkColor"); } else { print $constant['message-link-color']; }?>" maxlength="50" class="field"/></td>
		</tr>
		<tr>
			<td class="text">admin message background color: </td>
			<td><spacer width="1" height="1" type="block"></td>
			<td><input type="text" size="20" name="adminMessageBgColor" value="<?php if (isset($adminMessageBgColor)) { print stripslashes($adminMessageBgColor); session_unregister("adminMessageBgColor"); } else { print $constant['admin-message-background-color']; }?>" maxlength="50" class="field"/></td>
		</tr>
		<tr>
			<td class="text">admin message text color: </td>
			<td><spacer width="1" height="1" type="block"></td>
			<td><input type="text" size="20" name="adminMessageTextColor" value="<?php if (isset($adminMessageTextColor)) { print stripslashes($adminMessageTextColor); session_unregister("adminMessageTextColor"); } else { print $constant['admin-message-text-color']; }?>" maxlength="50" class="field"/></td>
		</tr>
		<tr>
			<td class="text">admin message link color: </td>
			<td><spacer width="1" height="1" type="block"></td>
			<td><input type="text" size="20" name="adminMessageLinkColor" value="<?php if (isset($adminMessageLinkColor)) { print stripslashes($adminMessageLinkColor); session_unregister("adminMessageLinkColor"); } else { print $constant['admin-message-link-color']; }?>" maxlength="50" class="field"/></td>
		</tr>
		<tr>
			<td class="text">charset: </td>
			<td><spacer width="1" height="1" type="block"></td>
			<td><input type="text" size="20" name="textCharset" value="<?php if (isset($textCharset)) { print stripslashes($textCharset); session_unregister("textCharset"); } else { print $constant['charset']; }?>" maxlength="50" class="field"/></td>
		</tr>
		<tr>
			<td class="text">locale: </td>
			<td><spacer width="1" height="1" type="block"></td>
			<td>
<?php
	if (isset($locale))
	{
?>
				<select name="locale">
<?php
					while (list($key, $value) = each($config['locale']))
					{
						$selected = false;
						if ($locale == $key)
							$selected = true;
?>					<option value="<?=$key?>"<?=$selected ? " selected" : ""?>><?=$value?></option>
<?php
					}
?>
				</select>
<?php
	}
	else
	{
?>
				<select name="locale">
<?php
					while (list($key, $value) = each($config['locale']))
					{
						$selected = false;
						if ($constant['locale'] == $key)
							$selected = true;
?>					<option value="<?=$key?>"<?=$selected ? " selected" : ""?>><?=$value?></option>
<?php
					}
?>
				</select>
<?php
	}
?>
			</td>
		</tr>
		<tr>
			<td class="text"><span class="adminname">admin name:</span></td>
			<td><spacer width="1" height="1" type="block"></td>
			<td><input type="text" size="20" name="adminName" value="<?php if (isset($adminName)) { print stripslashes($adminName); session_unregister("adminName"); } else { print $constant['admin-name']; }?>" maxlength="30" class="field"/></td>
		</tr>
		<tr>
			<td class="text"><span class="adminmail">admin e-mail:</span></td>
			<td><spacer width="1" height="1" type="block"></td>
			<td><input type="text" size="20" name="adminMail" value="<?php if (isset($adminMail)) { print stripslashes($adminMail); session_unregister("adminMail"); } else { print $constant['admin-mail']; }?>" maxlength="128" class="field"/></td>
		</tr>
		<tr>
			<td class="text"><span class="adminpassword">new password:</span></td>
			<td><spacer width="1" height="1" type="block"></td>
			<td><input type="password" size="20" name="newAdminPass" value="<?php if (isset($newAdminPass)) { print stripslashes($newAdminPass); session_unregister("newAdminPass"); }?>" maxlength="30" class="field"/></td>
		</tr>
		<tr>
			<td class="text"><span class="adminpassword">confirm new password:</span></td>
			<td><spacer width="1" height="1" type="block"></td>
			<td><input type="password" size="20" name="confirmAdminPass" value="<?php if (isset($confirmAdminPass)) { print stripslashes($confirmAdminPass); session_unregister("confirmAdminPass"); }?>" maxlength="30" class="field"/></td>
		</tr>
		<tr>
			<td class="text">&lt;b&gt;<b>here bold text</b>&lt;/b&gt;</td>
			<td><spacer width="1" height="1" type="block"></td>
			<td><input type="checkbox" name="bold" <?php if ($constant['bold-in-message']){?>value="1" checked<?} else { ?>value="0"<? }?>/></td>
		</tr>
		<tr>
			<td class="text">http://yourdomain.name as <a href="http://www.mycgiserver.com/~sample/" class="link">link</a></td>
			<td><spacer width="1" height="1" type="block"></td>
			<td><input type="checkbox" name="a" <?php if ($constant['link-in-message']){?>value="1" checked<?} else { ?>value="0"<? }?>/></td>
		</tr>
		<tr>
			<td class="text">&lt;i&gt;<i>here italic text</i>&lt;/i&gt;</td>
			<td><spacer width="1" height="1" type="block"></td>
			<td><input type="checkbox" name="i" <?php if ($constant['italic-in-message']){?>value="1" checked<?} else { ?>value="0"<? }?>/></td>
		</tr>
		<tr>
			<td class="text">convert smile to picture</td>
			<td><spacer width="1" height="1" type="block"></td>
			<td><input type="checkbox" name="smile" <?php if ($constant['smile-in-message']){?>value="1" checked<?} else { ?>value="0"<? }?>/></td>
		</tr>
		<tr>
			<td colspan="3" height="10"><spacer width="1" height="10" type="block"></td>
		</tr>
		<tr>
			<td colspan="3" height="1" bgcolor="<?=$constant['border-color']?>"><spacer width="1" height="1" type="block"></td>
		</tr>
		</table>
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td  height="5"><spacer width="1" height="5" type="block"></td>
		</tr>
		<tr>
			<td align="right"><input type="submit" value="update" class="button"/><br/><input type="button" value="back" class="halfbutton" onClick="javascript:window.location.href='index.php?page=<?=$page?>'"/><input type="button" value="logout" class="halfbutton" onClick="javascript:window.location.href='logout.php'"/></td>
		</tr>
		<tr>
			<td align="right"><br></td>
		</tr>
		</form>
		<form action="config-default.php" method="post">
		<input type="hidden" name="page" value="<?=$page?>">
		<tr>
			<td align="right"><input type="submit" value="reset to default" class="button"/></td>
		</tr>
		</table>
		</form>
		</div>
	</td>
</tr>
<tr>
	<td valign="bottom" colspan="3" align="right" height="1">
		<br/>
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td width="50%" bgcolor="<?=$constant['header-background-color']?>" class="headertext" align="center"><span class="text">&copy;&nbsp;</span>trent&nbsp;<a href="http://www.low.ru/dev/guestbook/" class="text" target="_top">Download this guestbook</a>&nbsp;</td>
			<td width="50%" bgcolor="<?=$constant['header-background-color']?>" class="headertext" align="center"><span class="text">&nbsp;&nbsp;&nbsp;</span><a href="http://www.mylov.ru" onclick="location.href='http://partner.mylov.ru/link.phtml?pid=10359084&lid=553';return false;" class="link" target="_top">Çíàêîìñòâà è îáùåíèå</a>&nbsp;</td>
		</tr>
		</table>
	</td>
</tr>
</table>
</body>
</html>
Return current item: Admbook