<?php
/* Written by Gerben Schmidt, http://scripts.zomp.nl */
ob_start();
include_once("functions.php");
include('config.php');
include("session.php");
include("header.php");
$user = loadUser($_SESSION['login'],$link,$table_users);
if(!$_SESSION["loggedIn"] || !$user['admin']){ echo "You don't have enough privileges to view this page."; exit; }
else
{
if($_POST['Submit']){
// upload script
include("upload.php");
if(empty($messages)) {
$query="UPDATE $table_settings SET search = '$_POST[search]', archive = '$_POST[archive]', categories = '$_POST[categories]', pages = '$_POST[pages]', authors = '$_POST[authors]', meta = '$_POST[meta]', powered = '$_POST[powered]', customfield = '$_POST[customfield]', about = '$_POST[about]', latestentries = '$_POST[latestentries]', latestcomments = '$_POST[latestcomments]', login = '$_POST[login]', use_join = '$_POST[use_join]', teasers = '$_POST[teasers]', nr_entries = '$_POST[nr_entries]', nr_comments = '$_POST[nr_comments]'";
$result=mysql_query($query, $link) or die("Died inserting data into db. Error returned if any: ".mysql_error());
header("Location: settings_menu.php?message=5");
ob_end_flush();
}
}
?>
<div id="submenu"><a href="settings.php" class="sub"><?php echo "$lang_settings"; ?></a> | <a href="settings_menu.php" class="sub"><?php echo "$lang_menu_settings"; ?></a></div>
<div id="side">
<div class="title"> </div>
<div class="box"><?php
if(!empty($messages)){
displayErrors($messages);
}
elseif($_GET[message] && empty($messages)){
displayMessage($_GET[message]);
}
else{
echo "$lang_message010";
}
?>
</div></div>
<div id="main">
<form name="myform" method="post" enctype="multipart/form-data">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="text">
<tr>
<td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><h1><?php echo "$lang_menu_settings"; ?></h1></td>
<td><input type="submit" name="Submit" value="<?php echo "$lang_submit"; ?>" id="button" /></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2"><fieldset id="titlediv">
<legend><?php echo "$lang_menu_settings"; ?></legend> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="text">
<tr>
<td width="50%"> </td>
<td width="73%"> </td>
</tr>
<tr>
<td width="50%"><?php if($settings[search]){
?>
<input name="search" type="checkbox" value="1" checked="checked" />
<?php
}
else
{
?>
<input name="search" type="checkbox" value="1" />
<?php
}
?>
<?php echo "$lang_search"; ?></td>
<td> </td>
</tr>
<tr>
<td width="50%"><?php if($settings[teasers]){
?>
<input name="teasers" type="checkbox" value="1" checked="checked" />
<?php
}
else
{
?>
<input name="teasers" type="checkbox" value="1" />
<?php
}
?>
<?php echo "$lang_teasers"; ?></td>
<td> </td>
</tr>
<tr>
<td width="50%"><?php if($settings[archive]){
?>
<input name="archive" type="checkbox" value="1" checked="checked" />
<?php
}
else
{
?>
<input name="archive" type="checkbox" value="1" />
<?php
}
?>
<?php echo "$lang_archive"; ?></td>
<td> </td>
</tr>
<tr>
<td width="50%"><?php if($settings[latestentries]){
?>
<input name="latestentries" type="checkbox" value="1" checked="checked" />
<?php
}
else
{
?>
<input name="latestentries" type="checkbox" value="1" />
<?php
}
?>
<?php echo "$lang_latest_entries"; ?></td>
<td><?php echo "$lang_number"; ?>
<select id="nr_entries" name="nr_entries">
<option value="<?php echo "$settings[nr_entries]"; ?>" selected="selected"><?php echo "$settings[nr_entries]"; ?></option>
<option value=1>1</option>
<option value=2>2</option>
<option value=3>3</option>
<option value=4>4</option>
<option value=5>5</option>
<option value=6>6</option>
<option value=7>7</option>
<option value=8>8</option>
<option value=9>9</option>
<option value=10>10</option>
</select>
</td>
</tr>
<tr>
<td width="50%"><?php if($settings[latestcomments]){
?>
<input name="latestcomments" type="checkbox" value="1" checked="checked" />
<?php
}
else
{
?>
<input name="latestcomments" type="checkbox" value="1" />
<?php
}
?>
<?php echo "$lang_latest_comments"; ?> </td>
<td><?php echo "$lang_number"; ?>
<select id="nr_comments" name="nr_comments">
<option value="<?php echo "$settings[nr_comments]"; ?>" selected="selected"><?php echo "$settings[nr_comments]"; ?></option>
<option value=1>1</option>
<option value=2>2</option>
<option value=3>3</option>
<option value=4>4</option>
<option value=5>5</option>
<option value=6>6</option>
<option value=7>7</option>
<option value=8>8</option>
<option value=9>9</option>
<option value=10>10</option>
</select>
</td>
</tr>
<tr>
<td width="50%"><?php if($settings[categories]){
?>
<input name="categories" type="checkbox" id="categories" value="1" checked="checked" />
<?php
}
else
{
?>
<input name="categories" type="checkbox" id="categories" value="1" />
<?php
}
?>
<?php echo "$lang_categories"; ?></td>
<td> </td>
</tr>
<tr>
<td width="50%"><?php if($settings[authors]){
?>
<input name="authors" type="checkbox" value="1" checked="checked" />
<?php
}
else
{
?>
<input name="authors" type="checkbox" value="1" />
<?php
}
?>
<?php echo "$lang_authors"; ?></td>
<td> </td>
</tr>
<tr>
<td width="50%"><?php if($settings[pages]){
?>
<input name="pages" type="checkbox" value="1" checked="checked" />
<?php
}
else
{
?>
<input name="pages" type="checkbox" value="1" />
<?php
}
?>
<?php echo "$lang_pages"; ?></td>
<td> </td>
</tr>
<tr>
<td width="50%"><?php if($settings[meta]){
?>
<input name="meta" type="checkbox" value="1" checked="checked" />
<?php
}
else
{
?>
<input name="meta" type="checkbox" value="1" />
<?php
}
?>
<?php echo "$lang_meta"; ?></td>
<td> </td>
</tr>
<tr>
<td width="50%"><?php if($settings[login]){
?>
<input name="login" type="checkbox" value="1" checked="checked" />
<?php
}
else
{
?>
<input name="login" type="checkbox" value="1" />
<?php
}
?>
<?php echo "$lang_login"; ?></td>
<td> </td>
</tr>
<tr>
<td width="50%"><?php if($settings[use_join]){
?>
<input name="use_join" type="checkbox" id="use_join" value="1" checked="checked" />
<?php
}
else
{
?>
<input name="use_join" type="checkbox" id="use_join" value="1" />
<?php
}
?>
<?php echo "$lang_allow_register"; ?></td>
<td> </td>
</tr>
<tr>
<td width="50%"><?php if($settings[powered]){
?>
<input name="powered" type="checkbox" value="1" checked="checked" />
<?php
}
else
{
?>
<input name="powered" type="checkbox" value="1" />
<?php
}
?>
<?php echo "$lang_powered"; ?></td>
<td> </td>
</tr>
<tr>
<td width="50%"> </td>
<td> </td>
</tr>
<tr>
<td width="50%"><?php echo "$lang_about_blog"; ?></td>
<td> </td>
</tr>
<tr>
<td colspan="2"><textarea name="about" cols="55" rows="7" id="about"><?php echo "$settings[about]" ?></textarea></td>
</tr>
<tr>
<td width="50%"> </td>
<td> </td>
</tr>
<tr>
<td width="50%"><?php echo "$lang_custom_text"; ?></td>
<td> </td>
</tr>
<tr>
<td colspan="2"><textarea name="customfield" cols="55" rows="7"><?php echo "$settings[customfield]" ?></textarea></td>
</tr>
</table>
</fieldset></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="2"><input type="submit" name="Submit" value="<?php echo "$lang_submit"; ?>" id="submit"></td>
</tr>
</table>
</form>
</div>
<?php
}
include('footer.php');
?>