Location: PHPKode > projects > SiteX > admin/photo_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(!userAdmin())
	loginError($sxLang['LoginRequired']);

if($EditOptions)
{
	if($sxFormDataGalleryShowPhotoCount != 1) $sxFormDataGalleryShowPhotoCount = 0;
	$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataGalleryShowPhotoCount' WHERE setup_key='GalleryShowPhotoCount'";
	$result = mysql_query($query, $Link) or queryError("5001", mysql_error());
	
	if($sxFormDataGalleryShowDescription != 1) $sxFormDataGalleryShowDescription = 0;
	$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataGalleryShowDescription' WHERE setup_key='GalleryShowDescription'";
	$result = mysql_query($query, $Link) or queryError("5002", mysql_error());
	
	$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataGalleryDescriptionTrunc' WHERE setup_key='GalleryDescriptionTrunc'";
	$result = mysql_query($query, $Link) or queryError("5003", mysql_error());
	
	if($sxFormDataAlbumShowPhotoDescription != 1) $sxFormDataAlbumShowPhotoDescription = 0;
	$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataAlbumShowPhotoDescription' WHERE setup_key='AlbumShowPhotoDescription'";
	$result = mysql_query($query, $Link) or queryError("5004", mysql_error());

	$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataAlbumPhotoDescriptionTrunc' WHERE setup_key='AlbumPhotoDescriptionTrunc'";
	$result = mysql_query($query, $Link) or queryError("5005", mysql_error());
	
	if($sxFormDataGalleryShowCreated != 1) $sxFormDataGalleryShowCreated = 0;
	$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataGalleryShowCreated' WHERE setup_key='GalleryShowCreated'";
	$result = mysql_query($query, $Link) or queryError("5006", mysql_error());

	if($sxFormDataAlbumShowPhotoName != 1) $sxFormDataAlbumShowPhotoName = 0;
	$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataAlbumShowPhotoName' WHERE setup_key='AlbumShowPhotoName'";
	$result = mysql_query($query, $Link) or queryError("5007", mysql_error());
	
	if($sxFormDataAlbumShowPhotoCreated != 1) $sxFormDataAlbumShowPhotoCreated = 0;
	$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataAlbumShowPhotoCreated' WHERE setup_key='AlbumShowPhotoCreated'";
	$result = mysql_query($query, $Link) or queryError("5007", mysql_error());
	
	if($sxFormDataAlbumShowNumPhotos != 1) $sxFormDataAlbumShowNumPhotos = 0;
	$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataAlbumShowNumPhotos' WHERE setup_key='AlbumShowNumPhotos'";
	$result = mysql_query($query, $Link) or queryError("5008", mysql_error());

	$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataGalleryNumColumns' WHERE setup_key='GalleryNumColumns'";
	$result = mysql_query($query, $Link) or queryError("5009", mysql_error());
	
	$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataAlbumNumColumns' WHERE setup_key='AlbumNumColumns'";
	$result = mysql_query($query, $Link) or queryError("5010", mysql_error());
	
	$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataAlbumsPerPage' WHERE setup_key='AlbumsPerPage'";
	$result = mysql_query($query, $Link) or queryError("5011", mysql_error());
	
	$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataPicsPerPage' WHERE setup_key='PicsPerPage'";
	$result = mysql_query($query, $Link) or queryError("5012", mysql_error());
	
	$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataGalleryMaxDimensionThumb' WHERE setup_key='GalleryMaxDimensionThumb'";
	$result = mysql_query($query, $Link) or queryError("5013", mysql_error());
	
	$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataGalleryMaxDimensionPhoto' WHERE setup_key='GalleryMaxDimensionPhoto'";
	$result = mysql_query($query, $Link) or queryError("5014", mysql_error());
	
	$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataGalleryCompressionThumb' WHERE setup_key='GalleryCompressionThumb'";
	$result = mysql_query($query, $Link) or queryError("5015", mysql_error());
	
	$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataGalleryCompressionPhoto' WHERE setup_key='GalleryCompressionPhoto'";
	$result = mysql_query($query, $Link) or queryError("5016", mysql_error());
	
	/* Remove raw photos */
	if(($sxSetup['GalleryStoreFullsize'] == 1)AND($sxFormDataGalleryStoreFullsize == 0))
	{
		cleardir(realpath("../".$sxContentDir['PhotoFullsize']));
		
		$query = "SELECT * FROM $DB_Photos WHERE fullsize='1'";
		$result = mysql_query($query, $Link) or queryError("5050", mysql_error());
		while($ROW = mysql_fetch_object($result))
		{
			$query2 = "UPDATE $DB_Photos SET fullsize='0' WHERE id='$ROW->id'";
			$result2 = mysql_query($query2, $Link) or queryError("5051", mysql_error());
						
			// Update db width/height/filesize based on scaled image since raw is gone
			$sxImageInfo = sxGetImageInfo("../".$sxContentDir['PhotoScaled']."/".$ROW->filename);
			$query2 = "UPDATE $DB_Photos SET width='".$sxImageInfo['Width']."', height='".$sxImageInfo['Height']."', filesize='".$sxImageInfo['Filesize']."' WHERE id='$ROW->id'";
			$result2 = mysql_query($query2, $Link) or queryError("5052", mysql_error());
		}
	}
	
	if($sxFormDataGalleryStoreFullsize != 1) $sxFormDataGalleryStoreFullsize = 0;
	$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataGalleryStoreFullsize' WHERE setup_key='GalleryStoreFullsize'";
	$result = mysql_query($query, $Link) or queryError("5017", mysql_error());
	
	if($sxFormDataPhotoPurchase != 1) $sxFormDataPhotoPurchase = 0;
	$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataPhotoPurchase' WHERE setup_key='PhotoPurchase'";
	$result = mysql_query($query, $Link) or queryError("5019", mysql_error());
	
	if($sxFormDataGalleryUseKeywords != 1) $sxFormDataGalleryUseKeywords = 0;
	$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataGalleryUseKeywords' WHERE setup_key='GalleryUseKeywords'";
	$result = mysql_query($query, $Link) or queryError("5020", mysql_error());
	
	if($sxFormDataGallerySelectSize != 1) $sxFormDataGallerySelectSize = 0;
	$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataGallerySelectSize' WHERE setup_key='GallerySelectSize'";
	$result = mysql_query($query, $Link) or queryError("5021", mysql_error());
	
	if($sxFormDataHomepageRandomPhotos != 1) $sxFormDataHomepageRandomPhotos = 0;
	$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataHomepageRandomPhotos' WHERE setup_key='HomepageRandomPhotos'";
	$result = mysql_query($query, $Link) or queryError("5022", mysql_error());
	
	if($sxFormDataHomepageRandomPhotosVert != 1) $sxFormDataHomepageRandomPhotosVert = 0;
	$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataHomepageRandomPhotosVert' WHERE setup_key='HomepageRandomPhotosVert'";
	$result = mysql_query($query, $Link) or queryError("5023", mysql_error());
	
	if($sxFormDataHomepageRandomPhotosHoriz != 1) $sxFormDataHomepageRandomPhotosHoriz = 0;
	$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataHomepageRandomPhotosHoriz' WHERE setup_key='HomepageRandomPhotosHoriz'";
	$result = mysql_query($query, $Link) or queryError("5024", mysql_error());
	
	$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataHomepageRandomPhotosNum' WHERE setup_key='HomepageRandomPhotosNum'";
	$result = mysql_query($query, $Link) or queryError("5025", mysql_error());
	
	$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataHomepageRandomPhotosPerLine' WHERE setup_key='HomepageRandomPhotosPerLine'";
	$result = mysql_query($query, $Link) or queryError("5026", mysql_error());
	
	$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataAlbumUseLightbox' WHERE setup_key='AlbumUseLightbox'";
	$result = mysql_query($query, $Link) or queryError("5061", mysql_error());
	
	// Watermarking mode transformations
	if(($sxFormDataGalleryWatermarking >= 0)AND($sxFormDataGalleryWatermarking < 3))
	{
		// Update db mode
		$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataGalleryWatermarking' WHERE setup_key='GalleryWatermarking'";
		$result = mysql_query($query, $Link) or queryError("5027", mysql_error());
		
		// Manage access to fullsize/scaled images folder via .htaccess
		// ...add .htaccess if running in dynamic mode ONLY
		if(($sxSetup['GalleryWatermarking'] != 2)AND($sxFormDataGalleryWatermarking == 2))
		{
			$sxFileHandle = fopen("../".$sxContentDir['PhotoFullsize']."/.htaccess", "w");
			fwrite($sxFileHandle, "Deny from all");
			fclose($sxFileHandle);
			
			$sxFileHandle = fopen("../".$sxContentDir['PhotoScaled']."/.htaccess", "w");
			fwrite($sxFileHandle, "Deny from all");
			fclose($sxFileHandle);
		}
		elseif(($sxSetup['GalleryWatermarking'] == 2)AND($sxFormDataGalleryWatermarking != 2))
		{
			@unlink("../".$sxContentDir['PhotoFullsize']."/.htaccess");
			@unlink("../".$sxContentDir['PhotoScaled']."/.htaccess");
		}
	}
	
	if(($sxFormDataGalleryWatermarkingType == 'img')OR($sxFormDataGalleryWatermarkingType == 'txt')){
	$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataGalleryWatermarkingType' WHERE setup_key='GalleryWatermarkingType'";
	$result = mysql_query($query, $Link) or queryError("5029", mysql_error());
	}
	
	if(($sxFormDataGalleryWatermarkingPosition == 'center')OR($sxFormDataGalleryWatermarkingPosition == 'lowleft')OR($sxFormDataGalleryWatermarkingPosition == 'lowright')){
	$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataGalleryWatermarkingPosition' WHERE setup_key='GalleryWatermarkingPosition'";
	$result = mysql_query($query, $Link) or queryError("5030", mysql_error());
	}

	$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataGalleryWatermarkingText' WHERE setup_key='GalleryWatermarkingText'";
	$result = mysql_query($query, $Link) or queryError("5031", mysql_error());
	
	$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataGalleryWatermarkingTextSize' WHERE setup_key='GalleryWatermarkingTextSize'";
	$result = mysql_query($query, $Link) or queryError("5032", mysql_error());
	
	$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataGalleryWatermarkingTextColor' WHERE setup_key='GalleryWatermarkingTextColor'";
	$result = mysql_query($query, $Link) or queryError("5033", mysql_error());
	
	$query = "UPDATE $DB_Setup SET setup_value='$sxFormDataGalleryWatermarkingTextTrans' WHERE setup_key='GalleryWatermarkingTextTrans'";
	$result = mysql_query($query, $Link) or queryError("5034", mysql_error());
	
	// Upload watermarking image
	if(strlen($_FILES['sxFormDataGalleryWatermarkingImage']['name']) > 0)
	{
		if (eregi ("(.)+\\.(jp(e){0,1}g$|gif$|png$|bmp$)", strtolower($_FILES['sxFormDataGalleryWatermarkingImage']['name'])))
		{
			$sxFileNameParts = explode('.',$_FILES['sxFormDataGalleryWatermarkingImage']['name']);
			$sxFileName = 'watermark.'.$sxFileNameParts[1];
			
			@unlink("../".$sxContentDir['Root'].$sxSetup['GalleryWatermarkingImage']);
			
			if (@move_uploaded_file($_FILES['sxFormDataGalleryWatermarkingImage']['tmp_name'], "../".$sxContentDir['Root'].$sxFileName))
			{
				$query = "UPDATE $DB_Setup SET setup_value='$sxFileName' WHERE setup_key='GalleryWatermarkingImage'";
				$result = mysql_query($query, $Link) or queryError("5060", mysql_error());
			}
		}
	}

	header("Location:$PHP_SELF?message=".str_replace(" ","_",$sxLang['MessagePhotoOptionsUpdated']));
	die();
}

$sxTitleAddendum = $sxLang['AdminHeading'];
include("../themes/$THEME_FOLDER/header.php");
?>
<script language="JavaScript" type="text/JavaScript">
<!--
function sxWMImage()
{
	document.sxFormPhotoOptions.sxFormDataGalleryWatermarkingText.disabled=true;
	document.sxFormPhotoOptions.sxFormDataGalleryWatermarkingTextSize.disabled=true;
	document.sxFormPhotoOptions.sxFormDataGalleryWatermarkingTextTrans.disabled=true;
	document.sxFormPhotoOptions.sxFormDataGalleryWatermarkingTextColor.disabled=true;
	document.sxFormPhotoOptions.sxFormDataGalleryWatermarkingImage.disabled=false;	
}
function sxWMText()
{
	document.sxFormPhotoOptions.sxFormDataGalleryWatermarkingText.disabled=false;
	document.sxFormPhotoOptions.sxFormDataGalleryWatermarkingTextSize.disabled=false;
	document.sxFormPhotoOptions.sxFormDataGalleryWatermarkingTextTrans.disabled=false;
	document.sxFormPhotoOptions.sxFormDataGalleryWatermarkingTextColor.disabled=false;
	document.sxFormPhotoOptions.sxFormDataGalleryWatermarkingImage.disabled=true;	
}
//-->
</script>     
<div class="bodyWrapper">
   <h1 class="sxAdminHeading"><?PHP echo $sxLang['PhotoHeadingOptions']; ?></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['PhotoHeadingOptions']; ?></div>   
   <?PHP echoMessage($message); ?>
   <form action="<?PHP echo $PHP_SELF; ?>" name="sxFormPhotoOptions" enctype="multipart/form-data" method="post">
   <div class="sxSection"><?PHP echo $sxLang['PhotoOptionsSectionAppearance']; ?></div>
   <table border="0" cellspacing="2" cellpadding="5">
	<tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['PhotoOptionsItemUseLightbox']; ?></td>
		<td><input name="sxFormDataAlbumUseLightbox" type="checkbox" value="1"<?PHP if($sxSetup['AlbumUseLightbox']) echo ' checked'; ?> /></td>
	  </tr>
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['PhotoOptionsItemCounters']; ?></td>
		<td><input name="sxFormDataGalleryShowPhotoCount" type="checkbox" value="1"<?PHP if($sxSetup['GalleryShowPhotoCount'] == 1) echo ' checked'; ?> /></td>
	  </tr>
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['PhotoOptionsItemAlbumDesc']; ?></td>
		<td><input name="sxFormDataGalleryShowDescription" type="checkbox" value="1"<?PHP if($sxSetup['GalleryShowDescription'] == 1) echo ' checked'; ?> /></td>
	  </tr>
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['PhotoOptionsItemAlbumDescTrunc']; ?></td>
		<td><input type="text" name="sxFormDataGalleryDescriptionTrunc" value="<?PHP echo $sxSetup['GalleryDescriptionTrunc']; ?>" maxlength="10" style="width:30px;" /> <span class="sxSmallText"><?PHP echo $sxLang['Characters']; ?></span></td>
	  </tr>
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['PhotoOptionsItemPhotoDesc']; ?></td>
		<td><input name="sxFormDataAlbumShowPhotoDescription" type="checkbox" value="1"<?PHP if($sxSetup['AlbumShowPhotoDescription'] == 1) echo ' checked'; ?> /></td>
	  </tr>
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['PhotoOptionsItemPhotoDescTrunc']; ?></td>
		<td><input type="text" name="sxFormDataAlbumPhotoDescriptionTrunc" value="<?PHP echo $sxSetup['AlbumPhotoDescriptionTrunc']; ?>" maxlength="10" style="width:30px;" /> <span class="sxSmallText"><?PHP echo $sxLang['Characters']; ?></span></td>
	  </tr>
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['PhotoOptionsItemAlbumDate']; ?></td>
		<td><input name="sxFormDataGalleryShowCreated" type="checkbox" value="1"<?PHP if($sxSetup['GalleryShowCreated']) echo ' checked'; ?> /></td>
	  </tr>
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['PhotoOptionsItemPhotoName']; ?></td>
		<td><input name="sxFormDataAlbumShowPhotoName" type="checkbox" value="1"<?PHP if($sxSetup['AlbumShowPhotoName']) echo ' checked'; ?> /></td>
	  </tr>
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['PhotoOptionsItemPhotoDate']; ?></td>
		<td><input name="sxFormDataAlbumShowPhotoCreated" type="checkbox" value="1"<?PHP if($sxSetup['AlbumShowPhotoCreated']) echo ' checked'; ?> /></td>
	  </tr>
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['PhotoOptionsItemAlbumPhotos']; ?></td>
		<td><input name="sxFormDataAlbumShowNumPhotos" type="checkbox" value="1"<?PHP if($sxSetup['AlbumShowNumPhotos']) echo ' checked'; ?> /></td>
	  </tr>
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['PhotoOptionsItemColumnsGallery']; ?></td>
		<td><input type="text" name="sxFormDataGalleryNumColumns" value="<?PHP echo $sxSetup['GalleryNumColumns']; ?>" maxlength="10" style="width:30px;" /></td>
	  </tr>
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['PhotoOptionsItemColumnsAlbum']; ?></td>
		<td><input type="text" name="sxFormDataAlbumNumColumns" value="<?PHP echo $sxSetup['AlbumNumColumns']; ?>" maxlength="10" style="width:30px;" /></td>
	  </tr>
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['PhotoOptionsItemAlbumPP']; ?></td>
		<td><input type="text" name="sxFormDataAlbumsPerPage" value="<?PHP echo $sxSetup['AlbumsPerPage']; ?>" maxlength="10" style="width:30px;" /></td>
	  </tr>
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['PhotoOptionsItemPhotoPP']; ?></td>
		<td><input type="text" name="sxFormDataPicsPerPage" value="<?PHP echo $sxSetup['PicsPerPage']; ?>" maxlength="10" style="width:30px;" /></td>
	  </tr>
   </table>
   <div class="sxSection"><?PHP echo $sxLang['PhotoOptionsSectionProcessing']; ?></div>
   <table border="0" cellspacing="2" cellpadding="5">
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['PhotoOptionsItemMaxDimThumb']; ?></td>
		<td><input type="text" name="sxFormDataGalleryMaxDimensionThumb" value="<?PHP echo $sxSetup['GalleryMaxDimensionThumb']; ?>" maxlength="10" style="width:30px;" /> <?PHP echo $sxLang['PixelsShort']; ?></td>
	  </tr>
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['PhotoOptionsItemMaxDimScaled']; ?></td>
		<td><input type="text" name="sxFormDataGalleryMaxDimensionPhoto" value="<?PHP echo $sxSetup['GalleryMaxDimensionPhoto']; ?>" maxlength="10" style="width:30px;" /> <?PHP echo $sxLang['PixelsShort']; ?></td>
	  </tr>
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['PhotoOptionsItemQualityThumb']; ?></td>
		<td><input type="text" name="sxFormDataGalleryCompressionThumb" value="<?PHP echo $sxSetup['GalleryCompressionThumb']; ?>" maxlength="10" style="width:30px;" /> <?PHP echo $sxLang['PhotoOptionsItemQualityLimits']; ?></td>
	  </tr>
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['PhotoOptionsItemQualityScaled']; ?></td>
		<td><input type="text" name="sxFormDataGalleryCompressionPhoto" value="<?PHP echo $sxSetup['GalleryCompressionPhoto']; ?>" maxlength="10" style="width:30px;" /> <?PHP echo $sxLang['PhotoOptionsItemQualityLimits']; ?></td>
	  </tr>
   </table>
   <div class="sxSection"><?PHP echo $sxLang['PhotoOptionsSectionAdvanced']; ?></div>
   <table border="0" cellspacing="2" cellpadding="5">
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['PhotoOptionsItemStoreFullsize']; ?></td>
		<td><input name="sxFormDataGalleryStoreFullsize" type="checkbox" value="1"<?PHP if($sxSetup['GalleryStoreFullsize']) echo ' checked'; ?> /> <span class="sxSmallText"><?PHP echo $sxLang['PhotoOptionsItemDeleteFullsizeExplain']; ?></span></td>
	  </tr>
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['PhotoOptionsItemAllowPurchase']; ?></td>
		<td><input name="sxFormDataPhotoPurchase" type="checkbox" value="1"<?PHP if($sxSetup['PhotoPurchase']) echo ' checked'; ?> /></td>
	  </tr>
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['PhotoOptionsItemKeywordMETA']; ?></td>
		<td><input name="sxFormDataGalleryUseKeywords" type="checkbox" value="1"<?PHP if($sxSetup['GalleryUseKeywords']) echo ' checked'; ?> /></td>
	  </tr>
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['PhotoOptionsItemAllowSizeSelect']; ?></td>
		<td><input name="sxFormDataGallerySelectSize" type="checkbox" value="1"<?PHP if($sxSetup['GallerySelectSize']) echo ' checked'; ?> /></td>
	  </tr>
   </table>
   <div class="sxSection"><?PHP echo $sxLang['PhotoOptionsSectionWatermark']; ?></div>
   <table border="0" cellspacing="2" cellpadding="5">
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['PhotoOptionsItemWatermarking']; ?></td>
		<td><input name="sxFormDataGalleryWatermarking" type="radio" value="0"<?PHP if($sxSetup['GalleryWatermarking'] == 0) echo ' checked'; ?> /> <?PHP echo $sxLang['PhotoOptionsItemWatermarkingOff']; ?><br />
		    <input name="sxFormDataGalleryWatermarking" type="radio" value="1"<?PHP if($sxSetup['GalleryWatermarking'] == 1) echo ' checked'; ?> /> <?PHP echo $sxLang['PhotoOptionsItemWatermarkingPerm']; ?><br />
            <input name="sxFormDataGalleryWatermarking" type="radio" value="2"<?PHP if($sxSetup['GalleryWatermarking'] == 2) echo ' checked'; ?> /> <?PHP echo $sxLang['PhotoOptionsItemWatermarkingDyn']; ?></td>
	  </tr>
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['PhotoOptionsItemWatermarkingType']; ?></td>
		<td><input name="sxFormDataGalleryWatermarkingType" type="radio" value="txt"<?PHP if($sxSetup['GalleryWatermarkingType'] == 'txt') echo ' checked'; ?> onclick="sxWMText()" /> <?PHP echo $sxLang['PhotoOptionsItemWatermarkingTypeText']; ?><br />
            <input name="sxFormDataGalleryWatermarkingType" type="radio" value="img"<?PHP if($sxSetup['GalleryWatermarkingType'] == 'img') echo ' checked'; ?> onclick="sxWMImage()" /> <?PHP echo $sxLang['PhotoOptionsItemWatermarkingTypeImage']; ?></td>
	  </tr>
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['PhotoOptionsItemWatermarkingPosition']; ?></td>
		<td><input name="sxFormDataGalleryWatermarkingPosition" type="radio" value="center"<?PHP if($sxSetup['GalleryWatermarkingPosition'] == 'center') echo ' checked'; ?> />
			<?PHP echo $sxLang['PhotoOptionsItemWatermarkingPositionC']; ?><br />
			<input name="sxFormDataGalleryWatermarkingPosition" type="radio" value="lowleft"<?PHP if($sxSetup['GalleryWatermarkingPosition'] == 'lowleft') echo ' checked'; ?> />
			<?PHP echo $sxLang['PhotoOptionsItemWatermarkingPositionLL']; ?><br />
			<input name="sxFormDataGalleryWatermarkingPosition" type="radio" value="lowright"<?PHP if($sxSetup['GalleryWatermarkingPosition'] == 'lowright') echo ' checked'; ?> />
			<?PHP echo $sxLang['PhotoOptionsItemWatermarkingPositionLR']; ?></td>
	  </tr>
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['PhotoOptionsItemWatermarkingTextOptions']; ?></td>
	    <td><table border="0" cellspacing="2" cellpadding="5">
			  <tr> 
				<td><?PHP echo $sxLang['PhotoOptionsItemWatermarkingTextText']; ?></td>
				<td><input type="text" name="sxFormDataGalleryWatermarkingText" value="<?PHP echo $sxSetup['GalleryWatermarkingText']; ?>" maxlength="255" /></td>
			  </tr>
			  <tr> 
				<td><?PHP echo $sxLang['PhotoOptionsItemWatermarkingTextSize']; ?></td>
				<td><input type="text" name="sxFormDataGalleryWatermarkingTextSize" value="<?PHP echo $sxSetup['GalleryWatermarkingTextSize']; ?>" maxlength="10" style="width:30px;" /> <?PHP echo $sxLang['PhotoOptionsItemWatermarkingTextSizeExp']; ?></td>
			  </tr>
			  <tr> 
				<td><?PHP echo $sxLang['PhotoOptionsItemWatermarkingTextColor']; ?></td>
				<td><input type="text" name="sxFormDataGalleryWatermarkingTextColor" value="<?PHP echo $sxSetup['GalleryWatermarkingTextColor']; ?>" maxlength="10" style="width:60px;" /></td>
			  </tr>
			  <tr> 
				<td><?PHP echo $sxLang['PhotoOptionsItemWatermarkingTextTrans']; ?></td>
				<td><input type="text" name="sxFormDataGalleryWatermarkingTextTrans" value="<?PHP echo $sxSetup['GalleryWatermarkingTextTrans']; ?>" maxlength="10" style="width:30px;" /> <?PHP echo $sxLang['PhotoOptionsItemWatermarkingTextTransExp']; ?></td>
			  </tr>
			</table>
		 </td>
	  </tr>
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['PhotoOptionsItemWatermarkingImgOptions']; ?></td>
		<td><?PHP
			if($sxSetup['GalleryWatermarkingImage'])
			{
				echo $sxLang['PhotoOptionsItemWatermarkingImgCurrent'];
				echo ': <a href="../'.$sxContentDir['Root'].$sxSetup['GalleryWatermarkingImage'].'">';
				echo $sxSetup['GalleryWatermarkingImage'];
				echo '</a><br /><br />';
				echo $sxLang['PhotoOptionsItemWatermarkingImgChange'];
			}
			?>
		    <input name="sxFormDataGalleryWatermarkingImage" type="file" /></td>
	  </tr>
   </table>
   <div class="sxSection"><?PHP echo $sxLang['PhotoOptionsSectionRandom']; ?></div>
   <table border="0" cellspacing="2" cellpadding="5">
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['PhotoOptionsItemRandomShow']; ?></td>
		<td><input name="sxFormDataHomepageRandomPhotos" type="checkbox" value="1"<?PHP if($sxSetup['HomepageRandomPhotos']) echo ' checked'; ?> /></td>
	  </tr>
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['PhotoOptionsItemRandomUseVert']; ?></td>
		<td><input name="sxFormDataHomepageRandomPhotosVert" type="checkbox" value="1"<?PHP if($sxSetup['HomepageRandomPhotosVert']) echo ' checked'; ?> /></td>
	  </tr>
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['PhotoOptionsItemRandomUseHoriz']; ?></td>
		<td><input name="sxFormDataHomepageRandomPhotosHoriz" type="checkbox" value="1"<?PHP if($sxSetup['HomepageRandomPhotosHoriz']) echo ' checked'; ?> /></td>
	  </tr>
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['PhotoOptionsItemRandomTotal']; ?></td>
		<td><input type="text" name="sxFormDataHomepageRandomPhotosNum" value="<?PHP echo $sxSetup['HomepageRandomPhotosNum']; ?>" maxlength="10" style="width:30px;" /></td>
	  </tr>
	  <tr> 
		<td class="sxTdItem"><?PHP echo $sxLang['PhotoOptionsItemRandomPhotosPerLine']; ?></td>
		<td><input type="text" name="sxFormDataHomepageRandomPhotosPerLine" value="<?PHP echo $sxSetup['HomepageRandomPhotosPerLine']; ?>" maxlength="10" style="width:30px;" /></td>
	  </tr>
   </table>
   <p align="right"><input name="EditOptions" type="submit" value="<?PHP echo $sxLang['ButtonEditOptions']; ?>" class="sxButton" /></p>
   </form>
  </div>
<?PHP
include("../themes/$THEME_FOLDER/footer.php");
ob_end_flush();
?>
Return current item: SiteX