Location: PHPKode > projects > SiteX > admin/user_options.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((!userEditor())AND(!userAdmin()))  loginError($sxLang['LoginRequired']);
if((userEditor())AND(!$sxSetup['EditorRightsUserOptions']))  loginError($sxLang['LoginRequired']);

if($EditOptions)
{
	if($edit_show_login != 1) $edit_show_login = 0;
	$query = "UPDATE $DB_Setup SET setup_value='$edit_show_login' WHERE setup_key='ShowLogin'";
	$result = mysql_query($query, $Link) or queryError("701", mysql_error());
	
	if($edit_allow_signup != 1) $edit_allow_signup = 0;
	$query = "UPDATE $DB_Setup SET setup_value='$edit_allow_signup' WHERE setup_key='AllowSignup'";
	$result = mysql_query($query, $Link) or queryError("702", mysql_error());
	
	if($edit_user_signature != 1) $edit_user_signature = 0;
	$query = "UPDATE $DB_Setup SET setup_value='$edit_user_signature' WHERE setup_key='UserSignature'";
	$result = mysql_query($query, $Link) or queryError("703", mysql_error());

	if($edit_user_skype != 1) $edit_user_skype = 0;
	$query = "UPDATE $DB_Setup SET setup_value='$edit_user_skype' WHERE setup_key='UserSkype'";
	$result = mysql_query($query, $Link) or queryError("712", mysql_error());

	if($edit_user_msn != 1) $edit_user_msn = 0;
	$query = "UPDATE $DB_Setup SET setup_value='$edit_user_msn' WHERE setup_key='UserMSN'";
	$result = mysql_query($query, $Link) or queryError("713", mysql_error());

	if($edit_user_bio != 1) $edit_user_bio = 0;
	$query = "UPDATE $DB_Setup SET setup_value='$edit_user_bio' WHERE setup_key='UserBio'";
	$result = mysql_query($query, $Link) or queryError("713", mysql_error());		
	
	if($edit_user_avatar != 1) $edit_user_avatar = 0;
	$query = "UPDATE $DB_Setup SET setup_value='$edit_user_avatar' WHERE setup_key='UserAvatar'";
	$result = mysql_query($query, $Link) or queryError("704", mysql_error());
	
	if(($edit_user_cleaner == 1)AND
	   (is_numeric($edit_user_cleaner_warn))AND
	   ($edit_user_cleaner_warn > 0)AND
	   (is_numeric($edit_user_cleaner_delete))AND
	   ($edit_user_cleaner_delete > 0)
	  ){
		$query = "UPDATE $DB_Setup SET setup_value='$edit_user_cleaner' WHERE setup_key='UserCleaner'";
		$result = mysql_query($query, $Link) or queryError("705", mysql_error());
	}else{
		$query = "UPDATE $DB_Setup SET setup_value='0' WHERE setup_key='UserCleaner'";
		$result = mysql_query($query, $Link) or queryError("705", mysql_error());
	}
	
	if((is_numeric($edit_user_cleaner_warn))AND($edit_user_cleaner_warn > 0)){
	$query = "UPDATE $DB_Setup SET setup_value='$edit_user_cleaner_warn' WHERE setup_key='UserCleanerWarn'";
	$result = mysql_query($query, $Link) or queryError("706", mysql_error());
	}
	
	if((is_numeric($edit_user_cleaner_delete))AND($edit_user_cleaner_delete > 0)){
	$query = "UPDATE $DB_Setup SET setup_value='$edit_user_cleaner_delete' WHERE setup_key='UserCleanerDelete'";
	$result = mysql_query($query, $Link) or queryError("707", mysql_error());
	}
	
	$query = "UPDATE $DB_Setup SET setup_value='$edit_user_avatar_max_width' WHERE setup_key='UserAvatarMaxWidth'";
	$result = mysql_query($query, $Link) or queryError("708", mysql_error());
	
	$query = "UPDATE $DB_Setup SET setup_value='$edit_user_avatar_max_height' WHERE setup_key='UserAvatarMaxHeight'";
	$result = mysql_query($query, $Link) or queryError("709", mysql_error());
	
	if($edit_user_approval != 1) $edit_user_approval = 0;
	$query = "UPDATE $DB_Setup SET setup_value='$edit_user_approval' WHERE setup_key='UserApproval'";
	$result = mysql_query($query, $Link) or queryError("710", mysql_error());
	
	if($edit_user_validation != 1) $edit_user_validation = 0;
	$query = "UPDATE $DB_Setup SET setup_value='$edit_user_validation' WHERE setup_key='UserValidation'";
	$result = mysql_query($query, $Link) or queryError("711", mysql_error());
	
	
	header("Location:$PHP_SELF?message=".str_replace(" ","_",$sxLang['MessageUserOptionsUpdated']));
	die();
}

$sxTitleAddendum = $sxLang['AdminHeading'];
include("../themes/$THEME_FOLDER/header.php");
?>
<script language="JavaScript" type="text/JavaScript">
<!--
function protectCleaner(){
	if(document.sxForm0.edit_user_cleaner.checked == true){
		if(document.sxForm0.edit_user_cleaner_warn.value == "")
		{
			document.sxForm0.edit_user_cleaner_warn.value = "8";
		}
		if(document.sxForm0.edit_user_cleaner_delete.value == "")
		{
			document.sxForm0.edit_user_cleaner_delete.value = "12";
		}
		document.sxForm0.edit_user_cleaner_warn.disabled=false;
		document.sxForm0.edit_user_cleaner_delete.disabled=false;
	}else{
		document.sxForm0.edit_user_cleaner_warn.value = "";
		document.sxForm0.edit_user_cleaner_delete.value = "";
		document.sxForm0.edit_user_cleaner_warn.disabled=true;
		document.sxForm0.edit_user_cleaner_delete.disabled=true;
	}
}
function protectAvatar(){
	if(document.sxForm0.edit_user_avatar.checked == true){
		if(document.sxForm0.edit_user_avatar_max_width.value == "")
		{
			document.sxForm0.edit_user_avatar_max_width.value = "125";
		}
		if(document.sxForm0.edit_user_avatar_max_height.value == "")
		{
			document.sxForm0.edit_user_avatar_max_height.value = "150";
		}
		document.sxForm0.edit_user_avatar_max_width.disabled=false;
		document.sxForm0.edit_user_avatar_max_height.disabled=false;
	}else{
		document.sxForm0.edit_user_avatar_max_width.value = "";
		document.sxForm0.edit_user_avatar_max_height.value = "";
		document.sxForm0.edit_user_avatar_max_width.disabled=true;
		document.sxForm0.edit_user_avatar_max_height.disabled=true;
	}
}
//-->
</script>     
<div class="bodyWrapper">
   <h1 class="sxAdminHeading"><?PHP echo $sxLang['UserHeadingOptions']; ?></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> > <a href="user_manager.php"><?PHP echo $sxLang['UserHeadingManager']; ?></a> > <?PHP echo $sxLang['UserHeadingOptions']; ?></div>
   <?PHP echoMessage($message); ?>
	<table border="0" cellspacing="2" cellpadding="5">
	  <form action="<?PHP echo $PHP_SELF; ?>" method="post" name="sxForm0">
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['UserOptionsItemShowLogin']; ?></td>
		<td><input name="edit_show_login" type="checkbox" value="1"<?PHP if($sxSetup['ShowLogin']) echo ' checked'; ?> />
			</td>
	  </tr>
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['UserOptionsItemAllowSignup']; ?></td>
		<td><input name="edit_allow_signup" type="checkbox" value="1"<?PHP if($sxSetup['AllowSignup']) echo ' checked'; ?> />
			</td>
	  </tr>
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['UserOptionsItemRequireValidation']; ?></td>
		<td><input name="edit_user_validation" type="checkbox" value="1"<?PHP if($sxSetup['UserValidation']) echo ' checked'; ?> />
			</td>
	  </tr>
	  <tr> 
		<td class="sxTdItem"><strong><?PHP echo $sxLang['UserOptionsItemRequireApproval']; ?></td>
		<td><input name="edit_user_approval" type="checkbox" value="1"<?PHP if($sxSetup['UserApproval']) echo ' checked'; ?> />
			</td>
	  </tr>
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['UserOptionsItemEnableSignature']; ?></td>
		<td><input name="edit_user_signature" type="checkbox" value="1"<?PHP if($sxSetup['UserSignature']) echo ' checked'; ?> />
			</td>
	  </tr>
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['UserOptionsItemEnableSkype']; ?></td>
		<td><input name="edit_user_skype" type="checkbox" value="1"<?PHP if($sxSetup['UserSkype']) echo ' checked'; ?> />
			</td>
	  </tr>
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['UserOptionsItemEnableMSN']; ?></td>
		<td><input name="edit_user_msn" type="checkbox" value="1"<?PHP if($sxSetup['UserMSN']) echo ' checked'; ?> />
			</td>
	  </tr>	
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['UserOptionsItemEnableBio']; ?></td>
		<td><input name="edit_user_bio" type="checkbox" value="1"<?PHP if($sxSetup['UserBio']) echo ' checked'; ?> />
			</td>
	  </tr>	  
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['UserOptionsItemEnableCleaner']; ?></td>
		<td><input name="edit_user_cleaner" type="checkbox" value="1"<?PHP if($sxSetup['UserCleaner']) echo ' checked'; ?> onclick="protectCleaner()" />
			<br />
		<span class="sxSmallText"><?PHP echo $sxLang['UserOptionsWarnUsersAfter']; ?> <input name="edit_user_cleaner_warn" type="text" <?PHP if(!$sxSetup['UserCleaner']) echo 'disabled="disabled"'; ?> value="<?PHP echo $sxSetup['UserCleanerWarn']; ?>" size="3" maxlength="5" /> <?PHP echo $sxLang['UserOptionsWeeksOfInactivity']; ?><br />
		<?PHP echo $sxLang['UserOptionsDeleteUsersAfter']; ?> <input name="edit_user_cleaner_delete" type="text" <?PHP if(!$sxSetup['UserCleaner']) echo 'disabled="disabled"'; ?> value="<?PHP echo $sxSetup['UserCleanerDelete']; ?>" size="3" maxlength="5" /> <?PHP echo $sxLang['UserOptionsWeeksOfInactivity']; ?></span></td>
	  </tr>
	  <tr>
		<td class="sxTdItem"><?PHP echo $sxLang['UserOptionsItemEnableAvatars']; ?></td>
		<td><input name="edit_user_avatar" type="checkbox" value="1"<?PHP if($sxSetup['UserAvatar']) echo ' checked'; ?> onclick="protectAvatar()" />
			<br />
		<span class="sxSmallText"><?PHP echo $sxLang['MaxWidth']; ?> <input name="edit_user_avatar_max_width" type="text" <?PHP if(!$sxSetup['UserAvatar']) echo 'disabled="disabled"'; ?> value="<?PHP echo $sxSetup['UserAvatarMaxWidth']; ?>" size="3" maxlength="5" /><br />
		<?PHP echo $sxLang['MaxHeight']; ?> <input name="edit_user_avatar_max_height" type="text" <?PHP if(!$sxSetup['UserAvatar']) echo 'disabled="disabled"'; ?> value="<?PHP echo $sxSetup['UserAvatarMaxHeight']; ?>" size="3" maxlength="5" /></span></td>
	  </tr>
	  <tr>
		<td colspan="2" align="right"><input name="EditOptions" type="submit" value="<?PHP echo $sxLang['ButtonEditOptions']; ?>" class="sxButton" /></td>
	  </tr>
	  </form>
	</table>
  </div>
<?PHP
include("../themes/$THEME_FOLDER/footer.php");
ob_end_flush();
?>
Return current item: SiteX