<?

/*
FlexCMS (http://www.flexcms.com)
Flexible, Powerful, Affordable.

Contents of this file are protected by the copyright
notice found at http://www.flexcms.com/flex/pages/copyright.html,
and its usage is subject to the terms of the licensing agreement 
available at http://www.flexcms.com/flex/pages/license.html
*/



	// ========================================================================================
	// Manage Forum Prefs
	// ========================================================================================
	
	$PageTitle = '<img src="'.$ImagesURL.'/admin/admincp_messageboard.gif" width="26" height="18"> '.$MsgText[2][2];
	$BrowserTitle = $MsgText[2][2];
	$LocationBar = '<a href="'.$IndexURL.'">'.$MsgText[0][1].'</a> > <a href="' . $MainURL . '/options.html">'.$MsgText[0][4].'</a> > '.$MsgText[2][2];
	
	if ($LoggedIn == 'y') {
		
		ReadPermissions();
		Global $Permissions;
		
		if ($Permissions[204] == 'y') {
		
			$query = "select * from `".$Settings['DBPrefix']."mb-Settings`";
			$result = mysql_query($query) or die (mysql_error());
			while ($row = mysql_fetch_array($result)) {
				$mbSettings[$row['Name']] = $row['Value'];
			}
			
									
			$TitleAlignmentSelected[$mbSettings['TitleAlignment']] = ' selected';
			$TopTextAlignmentSelected[$mbSettings['TopTextAlignment']] = ' selected';
			$BottomTextAlignmentSelected[$mbSettings['BottomTextAlignment']] = ' selected';
			$PEAlignmentSelected[$mbSettings['PEAlignment']] = ' selected';
			
			
			if ($mbSettings['SignatureImageMaxWidth'] < 1) {
				$mbSettings['SignatureImageMaxWidth'] = 500;
			}
			if ($mbSettings['SignatureImageMaxHeight'] < 1) {
				$mbSettings['SignatureImageMaxHeight'] = 200;
			}
						
				
			$PageContents = '<form name="PostForm" action="'.$MainURL.'/admin/messageboard_prefssave" method="post">
						
			<br><b>'.$MsgText[2][49].':</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;('.$MsgText[2][50].': <select name="TitleAlignment" style="'.$FormStyle.'">
			<option value="L"'.$TitleAlignmentSelected['L'].'> '.$MsgText[0][15].'</option>
			<option value="C"'.$TitleAlignmentSelected['C'].'> '.$MsgText[0][16].'</option>
			<option value="R"'.$TitleAlignmentSelected['R'].'> '.$MsgText[0][17].'</option>
			</select>)<br>
			<input type="text" name="PageTitle" size="45" value="'.str_replace('"','&#34;',$mbSettings['PageTitle']).'" style="'.$FormStyle.'"><br>
			
			
			<script>
var ImageDestination = "";

var ExistingImagesWindowCode = "";

function SelectImage(ImageDestinationSent) {
	var WindowProperties = "width=420,height=300,left=" + (screen.width-420)/2 + ",top=" + (screen.height-300)/2 + ",location=no,menubar=no,directories=no,toolbar=no,status=no,scrollbars=no,resizable=yes";

	ImageDestination = ImageDestinationSent;

	if (ImageDestination == "Photo") {
		ExistingImagesWindowCode = window.open("'.$BaseURL.'/inc-core-admin-editor-existingimages.php?"+document.forms["PostForm"].elements["PhotoURL"].value,"existingimages",WindowProperties);
	}
	else {
		ExistingImagesWindowCode = window.open("'.$BaseURL.'/inc-core-admin-editor-existingimages.php?"+document.forms["PostForm"].elements["TitleImage"].value,"existingimages",WindowProperties);
	}
}
function ExistingImageSelected(ImageName,ImageWidth,ImageHeight) {

	ExistingImagesWindowCode.close();
	
	if (ImageDestination == "Photo") {
		document.forms["PostForm"].elements["PhotoURL"].value = "/images/uploaded/"+ImageName;
	}
	else {
		document.forms["PostForm"].elements["TitleImage"].value = "/images/uploaded/"+ImageName;
	}

}
function UploadToServer(ImageDestinationSent) {

		ImageDestination = ImageDestinationSent;

		var WindowProperties = "width=580,height=380,left=" + (screen.width-580)/2 + ",top=" + (screen.height-380)/2 + ",location=no,menubar=no,directories=no,toolbar=no,status=no,scrollbars=no,resizable=yes";

		UploadWindowCode = window.open("'.$BaseURL.'/inc-core-admin-editor-imageupload.php","imageupload",WindowProperties);

	  }

	  function UploadedImageSelected(ImageName,ImageWidth,ImageHeight) {

		UploadWindowCode.close();
		
		
		if (ImageDestination == "Photo") {
			document.forms["PostForm"].elements["PhotoURL"].value = "/images/uploaded/"+ImageName;
		}
		else {
			document.forms["PostForm"].elements["TitleImage"].value = "/images/uploaded/"+ImageName;
		}
		
	  }
</script>
			
			
			'.$MsgText[0][519].':<br>
			<input type="text" name="TitleImage" size="50" value="'.str_replace('"', '&#34;', $mbSettings['TitleImage']).'" style="'.$FormStyle.'">
			<br>
			<input type="button" value="'.$MsgText[0][521].'" onClick="SelectImage();" style="'.$FormStyle.'">&nbsp;<input type="button" value="'.$MsgText[0][563].'" onClick="UploadToServer();" style="'.$FormStyle.'">
			<br><br>
			
			<br><b>'.$MsgText[2][51].':</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;('.$MsgText[2][50].': <select name="TopTextAlignment" style="'.$FormStyle.'">
			<option value="L"'.$TopTextAlignmentSelected['L'].'> '.$MsgText[0][15].'</option>
			<option value="C"'.$TopTextAlignmentSelected['C'].'> '.$MsgText[0][16].'</option>
			<option value="R"'.$TopTextAlignmentSelected['R'].'> '.$MsgText[0][17].'</option>
			</select>)<br>
			<textarea name="TopText" cols="39" rows="1" wrap="virtual" style="'.$FormStyle.'">'.str_replace('<','&lt;',$mbSettings['TopText']).'</textarea>
			<br><font size="1">'.$MsgText[2][52].'<br></font>

			<br><b>'.$MsgText[2][53].':</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;('.$MsgText[2][50].': <select name="BottomTextAlignment" style="'.$FormStyle.'">
			<option value="L"'.$BottomTextAlignmentSelected['L'].'> '.$MsgText[0][15].'</option>
			<option value="C"'.$BottomTextAlignmentSelected['C'].'> '.$MsgText[0][16].'</option>
			<option value="R"'.$BottomTextAlignmentSelected['R'].'> '.$MsgText[0][17].'</option>
			</select>)<br>
			<textarea name="BottomText" cols="39" rows="1" wrap="virtual" style="'.$FormStyle.'">'.str_replace('<','&lt;',$mbSettings['BottomText']).'</textarea>
			<br><font size="1">'.$MsgText[2][54].'<br></font>

					
			<br>
			
			<br><b>'.$MsgText[2][55].':</b><br>
			<input type="text" name="MessagesPerPage" size="5" value="'.$mbSettings['MessagesPerPage'].'" style="'.$FormStyle.'">
			<br>
			
			<br><b>'.$MsgText[2][154].':</b><br>
			<input type="text" name="ThreadsPerPage" size="5" value="'.$mbSettings['ThreadsPerPage'].'" style="'.$FormStyle.'">
			<br>			
			
			
			<br><b>'.$MsgText[2][137].':</b><br><select name="PEAlignment" style="'.$FormStyle.'">
			<option value="L"'.$PEAlignmentSelected['L'].'> '.$MsgText[0][15].'</option>
			<option value="C"'.$PEAlignmentSelected['C'].'> '.$MsgText[0][16].'</option>
			<option value="R"'.$PEAlignmentSelected['R'].'> '.$MsgText[0][17].'</option>
			</select>
			
			
			<br><br>
			
			<br><b>'.$MsgText[2][164].':</b><br>
			<input type="text" name="SignatureImageMaxWidth" size="3" value="'.$mbSettings['SignatureImageMaxWidth'].'" style="'.$FormStyle.'"> x <input type="text" name="SignatureImageMaxHeight" size="3" value="'.$mbSettings['SignatureImageMaxHeight'].'" style="'.$FormStyle.'">
			
			
			
					
			<br>
			<br><br><br>
			<input type="submit" value="'.$MsgText[0][123].'" style="'.$FormStyle.'">
			</form>';
			
			
	
	
		}
		else {
		
			$PageContents = $MsgText[0][97];
		
		}

	}
	else {
	
		RedirectToLogin();
	
	}
	

	// ========================================================================================




?>
