Location: PHPKode > projects > SiteX > admin/preferences.php
<?PHP
ob_start();
session_start();
include("../includes/globals.php.inc");
include("../includes/functions.php");
include("../lang/English.php");
if(strtolower($sxSetup['Language']) != 'english') include("../lang/".$sxSetup['Language'].".php");
include("../themes/$THEME_FOLDER/config.php.inc");
if(!userAdmin()) loginError($sxLang['LoginRequired']);

if($Submit)
{

	$query = "UPDATE $DB_Setup SET setup_value='$edit_url' WHERE setup_key='Url'";
	$result = mysql_query($query, $Link) or queryError("55", mysql_error());
	
	$query = "UPDATE $DB_Setup SET setup_value='$edit_admin_email' WHERE setup_key='AdminEmail'";
	$result = mysql_query($query, $Link) or queryError("55", mysql_error());
	
	$query = "UPDATE $DB_Setup SET setup_value='$edit_meta_title_ext' WHERE setup_key='METATitleExt'";
	$result = mysql_query($query, $Link) or queryError("55", mysql_error());	

	$query = "UPDATE $DB_Setup SET setup_value='$edit_meta_description' WHERE setup_key='MetaDescription'";
	$result = mysql_query($query, $Link) or queryError("55", mysql_error());
	
	$query = "UPDATE $DB_Setup SET setup_value='$edit_meta_keywords' WHERE setup_key='MetaKeywords'";
	$result = mysql_query($query, $Link) or queryError("55", mysql_error());	
		
	$query = "UPDATE $DB_Setup SET setup_value='$edit_journals_per_page' WHERE setup_key='JournalsPerPage'";
	$result = mysql_query($query, $Link) or queryError("55", mysql_error());
	
	$query = "UPDATE $DB_Setup SET setup_value='$edit_search_results_per_page' WHERE setup_key='SearchResultsPerPage'";
	$result = mysql_query($query, $Link) or queryError("55", mysql_error());
	
	$query = "UPDATE $DB_Setup SET setup_value='$edit_forum_topics_per_page' WHERE setup_key='ForumTopicsPerPage'";
	$result = mysql_query($query, $Link) or queryError("55", mysql_error());
	
	$query = "UPDATE $DB_Setup SET setup_value='$edit_forum_posts_per_page' WHERE setup_key='ForumPostsPerPage'";
	$result = mysql_query($query, $Link) or queryError("55", mysql_error());
	
	$query = "UPDATE $DB_Setup SET setup_value='$edit_link_truncation_length' WHERE setup_key='LinkTruncationLength'";
	$result = mysql_query($query, $Link) or queryError("55", mysql_error());
	
	if($edit_form_security != 1) $edit_form_security = 0;
	$query = "UPDATE $DB_Setup SET setup_value='$edit_form_security' WHERE setup_key='FormSecurity'";
	$result = mysql_query($query, $Link) or queryError("55", mysql_error());
	
	if($edit_link_truncation != 1) $edit_link_truncation = 0;
	$query = "UPDATE $DB_Setup SET setup_value='$edit_link_truncation' WHERE setup_key='LinkTruncation'";
	$result = mysql_query($query, $Link) or queryError("55", mysql_error());
	
	$query = "UPDATE $DB_Setup SET setup_value='$edit_date_format' WHERE setup_key='DateFormat'";
	$result = mysql_query($query, $Link) or queryError("55", mysql_error());
	
	$query = "UPDATE $DB_Setup SET setup_value='$edit_imaging_mode' WHERE setup_key='ImagingMode'";
	$result = mysql_query($query, $Link) or queryError("55", mysql_error());

	if($edit_meta_sitewide != 1) $edit_meta_sitewide = 0;
	$query = "UPDATE $DB_Setup SET setup_value='$edit_meta_sitewide' WHERE setup_key='MetaSitewide'";
	$result = mysql_query($query, $Link) or queryError("55", mysql_error());
	
	if($edit_comments_approval != 1) $edit_comments_approval = 0;
	$query = "UPDATE $DB_Setup SET setup_value='$edit_comments_approval' WHERE setup_key='CommentsApproval'";
	$result = mysql_query($query, $Link) or queryError("55", mysql_error());
	
	if($edit_guestbook_approval != 1) $edit_guestbook_approval = 0;
	$query = "UPDATE $DB_Setup SET setup_value='$edit_guestbook_approval' WHERE setup_key='GuestbookApproval'";
	$result = mysql_query($query, $Link) or queryError("55", mysql_error());
	
	$query = "UPDATE $DB_Setup SET setup_value='$edit_server_timezone' WHERE setup_key='ServerTimezone'";
	$result = mysql_query($query, $Link) or queryError("55", mysql_error());
	
	$query = "UPDATE $DB_Setup SET setup_value='$edit_language' WHERE setup_key='Language'";
	$result = mysql_query($query, $Link) or queryError("55", mysql_error());

	$query = "UPDATE $DB_Setup SET setup_value='$edit_wysiwyg' WHERE setup_key='WYSIWYG'";
	$result = mysql_query($query, $Link) or queryError("55", mysql_error());
	
	$query = "UPDATE $DB_Setup SET setup_value='$edit_firstdayofweek' WHERE setup_key='FirstDayOfWeek'";
	$result = mysql_query($query, $Link) or queryError("55", mysql_error());	

	$query = "UPDATE $DB_Setup SET setup_value='$edit_google_analytics' WHERE setup_key='GoogleAnalytics'";
	$result = mysql_query($query, $Link) or queryError("55", mysql_error());

	$query = "UPDATE $DB_Setup SET setup_value='$edit_sitemap' WHERE setup_key='Sitemap'";
	$result = mysql_query($query, $Link) or queryError("55", mysql_error());
	
	$query = "UPDATE $DB_Setup SET setup_value='$edit_memberfiles' WHERE setup_key='MemberFiles'";
	$result = mysql_query($query, $Link) or queryError("55", mysql_error());
	
	$query = "UPDATE $DB_Setup SET setup_value='$edit_htmlemail' WHERE setup_key='HTMLEmail'";
	$result = mysql_query($query, $Link) or queryError("55", mysql_error());
	
	writeRSSXML();
	
	header("Location:$PHP_SELF?message=".$sxLang['PreferencesUpdated']);
	die();
}

$sxTitleAddendum = $sxLang['AdminHeading'] . ' - ' .$sxLang['PreferencesHeading'];
include("../themes/$THEME_FOLDER/header.php");
?>
<script language="JavaScript" type="text/JavaScript">
<!--
function protectTruncation(){
	if(document.sxForm1.edit_link_truncation.checked == true){
		document.sxForm1.edit_link_truncation_length.disabled=false;
	}else{
		document.sxForm1.edit_link_truncation_length.value = "";
		document.sxForm1.edit_link_truncation_length.disabled=true;
	}
}
function submitIt(myForm){
	if(document.sxForm1.edit_link_truncation.checked == true){
		if(document.sxForm1.edit_link_truncation_length.value == ""){
			alert("<?PHP echo $sxLang['PreferencesJSTrunc']; ?>");
			document.sxForm1.edit_link_truncation_length.select();
			return false;
		}
	}
}
//-->
</script>
<div class="bodyWrapper">
   <h1 class="sxAdminHeading"><?PHP echo $sxLang['PreferencesHeading']; ?></h1>
   <div class="sxAdminBreadcrumbs"><?PHP if(userAdmin()) { ?><a href="index.php"><?PHP echo $sxLang['AdminBreadcrumb']; ?><?PHP }?><?PHP if(userEditor()) { ?><a href="editor_index.php"><?PHP echo $sxLang['EditorBreadcrumb']; ?><?PHP }?></a> > <?PHP echo $sxLang['PreferencesHeading']; ?></div>   
   <?PHP echoMessage($message); ?>
	<form name="sxForm1" method="post" action="<?PHP echo $PHP_SELF; ?>" onSubmit="return submitIt(this)">
	  <div class="sxSection"><?PHP echo $sxLang['PreferencesSectionInfo']; ?></div>
	  <table border="0" cellspacing="2" cellpadding="5">
		<tr> 
		  <td class="sxTdItem"><?PHP echo $sxLang['PreferencesItemSiteURL']; ?></td>
		  <td><input type="text" name="edit_url" style="width: 200px;" value="<?PHP echo $sxSetup['Url']; ?>" />
			  </td>
		</tr>
		<tr> 
		  <td class="sxTdItem"><?PHP echo $sxLang['PreferencesItemAdminEmail']; ?></td>
		  <td><input type="text" name="edit_admin_email" style="width: 200px;" value="<?PHP echo $sxSetup['AdminEmail']; ?>" />
			  </td>
		</tr>
		<tr> 
		  <td class="sxTdItem"><?PHP echo $sxLang['PreferencesItemDateFormat']; ?></td>
		  <td><select name="edit_date_format">
				<option value="mm/dd/yy"<?PHP if($sxSetup['DateFormat'] == 'mm/dd/yy') echo ' selected="selected"'; ?>><?PHP echo $sxLang['DateFormatMDY']; ?></option>
				<option value="dd/mm/yy"<?PHP if($sxSetup['DateFormat'] == 'dd/mm/yy') echo ' selected="selected"'; ?>><?PHP echo $sxLang['DateFormatDMY']; ?></option>
			  </select>
			  
		  </td>
		</tr>
		<tr> 
		  <td class="sxTdItem"><?PHP echo $sxLang['PreferencesItemImagingMode']; ?></td>
		  <td><select name="edit_imaging_mode">
				<option value="auto"<?PHP if($sxSetup['ImagingMode'] == 'auto') echo ' selected="selected"'; ?>><?PHP echo $sxLang['PreferencesImgAuto']; ?></option>
				<option value="GD1"<?PHP if($sxSetup['ImagingMode'] == 'GD1') echo ' selected="selected"'; ?>><?PHP echo $sxLang['PreferencesImgGD1']; ?></option>
				<option value="GD2"<?PHP if($sxSetup['ImagingMode'] == 'GD2') echo ' selected="selected"'; ?>><?PHP echo $sxLang['PreferencesImgGD2']; ?></option>
			  </select>
			  
		  </td>
		</tr>
		<tr> 
			<td class="sxTdItem"><?PHP echo $sxLang['PreferencesItemTimezone']; ?></td>
			<td><select name="edit_server_timezone">
				<?PHP
				for($i = -24; $i <= 24; $i++){
					echo '<option value="' . $i . '"';
					if($i == $sxSetup['ServerTimezone']) echo ' selected="selected"';
					echo '>';
					if($i > 0) echo '+ ';
					echo $i . '</option>';
				}
				?>
				</select> <span class="sxSmallText"><?PHP echo $sxLang['PreferencesHoursFrom']; ?>
				<br />
				(<?PHP echo $sxLang['CurrentTime']; ?>: <?PHP echo fetchDate($NOW, 99, 1); ?>)</span>
			</td>
		  </tr>
		  <tr> 
		  <td class="sxTdItem"><?PHP echo $sxLang['PreferencesItemLanguage']; ?></td>
		  <td><select name="edit_language"><?PHP
		  foreach(getLanguages("../") as $sxLangVal){
			if($sxLangVal == $sxSetup['Language']) $selected = ' selected="selected"';
			else $selected = '';
			echo '<option value="' . $sxLangVal . '"' . $selected . '>' . $sxLangVal . '</option>';
		  }
		  ?></select> 
		  </td>
		</tr>
	  </table>
		<div class="sxSection"><?PHP echo $sxLang['PreferencesSectionMeta']; ?></div>
		<table border="0" cellspacing="0" cellpadding="5">
		<tr> 
		  <td class="sxTdItem"><?PHP echo $sxLang['GeneralItemMETATitleExt']; ?>
		  <br /></td>
		  <td><input name="edit_meta_title_ext" style="width:400px;" maxlength="255" value="<?PHP echo $sxSetup['METATitleExt']; ?>"></td>
		</tr>
		<tr> 
		  <td class="sxTdItem"><?PHP echo $sxLang['PreferencesItemDescription']; ?>
		  <br /></td>
		  <td><textarea name="edit_meta_description" style="width:300px;height:100px;"><?PHP echo $sxSetup['MetaDescription']; ?></textarea></td>
		</tr>
		<tr> 
		  <td class="sxTdItem"><?PHP echo $sxLang['PreferencesItemKeywords']; ?><br />
		  </td>
		  <td><textarea name="edit_meta_keywords" style="width:300px;height:100px;"><?PHP echo $sxSetup['MetaKeywords']; ?></textarea></td>
		</tr>
		<tr> 
		  <td class="sxTdItem"><?PHP echo $sxLang['PreferencesItemSWMeta']; ?></td>
		  <td><input name="edit_meta_sitewide" type="checkbox" value="1"<?PHP if($sxSetup['MetaSitewide']) echo ' checked="checked"'; ?> />
		  </td>
		</tr>
		</table>
		<div class="sxSection"><?PHP echo $sxLang['PreferencesSectionLimits']; ?></div>
		<table border="0" cellspacing="0" cellpadding="5">
		</tr>
		<tr> 
		  <td class="sxTdItem" width="170"><?PHP echo $sxLang['PreferencesItemJEPP']; ?></td>
		  <td><input name="edit_journals_per_page" type="text" size="3" maxlength="3" value="<?PHP echo $sxSetup['JournalsPerPage']; ?>" />
		  </td>
		</tr>
		<tr> 
		  <td class="sxTdItem" width="170"><?PHP echo $sxLang['PreferencesItemSRPP']; ?></td>
		  <td><input name="edit_search_results_per_page" type="text" size="3" maxlength="3" value="<?PHP echo $sxSetup['SearchResultsPerPage']; ?>" />
		  </td>
		</tr>
		<tr> 
		  <td class="sxTdItem" width="170"><?PHP echo $sxLang['ForumItemTopicsPP']; ?></td>
		  <td><input name="edit_forum_topics_per_page" type="text" size="3" maxlength="3" value="<?PHP echo $sxSetup['ForumTopicsPerPage']; ?>" />
		  </td>
		</tr>
		<tr> 
		  <td class="sxTdItem" width="170"><?PHP echo $sxLang['ForumItemPostsPP']; ?></td>
		  <td><input name="edit_forum_posts_per_page" type="text" size="3" maxlength="3" value="<?PHP echo $sxSetup['ForumPostsPerPage']; ?>" />
		  </td>
		</tr>
		<tr> 
		  <td class="sxTdItem" width="170"><?PHP echo $sxLang['PreferencesItemTrunc']; ?></td>
		  <td>
		  <input name="edit_link_truncation" type="checkbox" value="1"<?PHP if($sxSetup['LinkTruncation']) echo ' checked="checked"'; ?> onclick="protectTruncation()" />
		  <input name="edit_link_truncation_length" type="text" size="3" maxlength="3" value="<?PHP echo $sxSetup['LinkTruncationLength']; ?>" <?PHP if(!$sxSetup['LinkTruncation']) echo 'disabled="disabled"'; ?> />
		  </td>
		</tr>
	  </table>
		<div class="sxSection"><?PHP echo $sxLang['PreferencesSectionAddOp']; ?></div>
		<table border="0" cellspacing="0" cellpadding="5">
		  <tr> 
		    <td class="sxTdItem"><?PHP echo $sxLang['PreferencesItemWYSIWYG']; ?></td>
		    <td><select name="edit_wysiwyg">
					<option value="fck"<?PHP if($sxSetup['WYSIWYG'] == 'fck') echo ' selected="selected"'; ?>>FCK</option>
					<option value="htmlarea"<?PHP if($sxSetup['WYSIWYG'] == 'htmlarea') echo ' selected="selected"'; ?>>htmlArea</option>
					<option value="tinymce"<?PHP if($sxSetup['WYSIWYG'] == 'tinymce') echo ' selected="selected"'; ?>>tinymce</option>
			    </select>
		  </tr>
		  <tr> 
		    <td class="sxTdItem"><?PHP echo $sxLang['PreferencesItemFirstDayOfWeek']; ?></td>
		    <td><select name="edit_firstdayofweek">
					<option value="0"<?PHP if($sxSetup['FirstDayOfWeek'] == '0') echo ' selected="selected"'; ?>><?PHP echo $sxDays['Sunday'] ;?></option>
					<option value="1"<?PHP if($sxSetup['FirstDayOfWeek'] == '1') echo ' selected="selected"'; ?>><?PHP echo $sxDays['Monday'] ;?></option>
			    </select>
		  </tr>
		  <tr> 
		    <td class="sxTdItem"><?PHP echo $sxLang['PreferencesItemFormSecurity']; ?></td>
		    <td><input type="checkbox" name="edit_form_security" value="1"<?PHP if($sxSetup['FormSecurity'] == 1) echo ' checked="checked"'; ?> /></td>
		  </tr>
		  <tr>
			<td class="sxTdItem" width="170"><?PHP echo $sxLang['PreferencesItemReqAppComments']; ?></td>
			<td><input name="edit_comments_approval" type="checkbox" value="1"<?PHP if($sxSetup['CommentsApproval']) echo ' checked="checked"'; ?> />
			</td>
		  </tr>
		  <tr> 
			<td class="sxTdItem" width="170"><?PHP echo $sxLang['PreferencesItemReqAppGuestbook']; ?></td>
			<td><input name="edit_guestbook_approval" type="checkbox" value="1"<?PHP if($sxSetup['GuestbookApproval']) echo ' checked="checked"'; ?> />
			</td>
		  </tr>
		  <tr> 
			<td class="sxTdItem" width="170"><?PHP echo $sxLang['PreferencesItemSitemap']; ?></td>
			<td><input name="edit_sitemap" type="checkbox" value="1"<?PHP if($sxSetup['Sitemap']) echo ' checked="checked"'; ?> />
			</td>
		  </tr>
		  <tr> 
			<td class="sxTdItem" width="170"><?PHP echo $sxLang['PreferencesItemMemberFiles']; ?></td>
			<td><input name="edit_memberfiles" type="checkbox" value="1"<?PHP if($sxSetup['MemberFiles']) echo ' checked="checked"'; ?> />
			</td>
		  </tr>		  
		  <tr> 
			<td class="sxTdItem" width="170"><?PHP echo $sxLang['PreferencesItemEmailHTML']; ?></td>
			<td><input name="edit_htmlemail" type="checkbox" value="1"<?PHP if($sxSetup['HTMLEmail']) echo ' checked="checked"'; ?> /> <?PHP echo $sxLang['PreferencesItemEmailHTMLWarn']; ?>
			</td>
		  </tr>			  
		  <tr> 
		  <td class="sxTdItem"><a href="https://www.google.com/support/googleanalytics/bin/answer.py?answer=113500&hl=en_US" target="_blank"><?PHP echo $sxLang['PreferencesGoogleAnalytics']; ?></a><br />
		  <?PHP echo $sxLang['PreferencesGoogleAnalyticsID']; ?>:
		  </td>
		  <td><input type="text" name="edit_google_analytics" style="width:150px;" value="<?PHP echo $sxSetup['GoogleAnalytics']; ?>"></td>
		</tr>
	  </table>
	  <p align="center"><input type="submit" name="Submit" value="<?PHP echo $sxLang['PreferencesButtonUpdate']; ?>" class="sxButton" /></p>
	</form>
	</div>
<?PHP
include("../themes/$THEME_FOLDER/footer.php");
ob_end_flush();
?>
Return current item: SiteX