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

if($Submit)
{
	$query = "UPDATE `$DB_Setup` SET setup_value='$contactemail' WHERE setup_key='ContactFormEmail'";
	$result = mysql_query($query, $Link) or queryError("203", mysql_error());
	
	$query = "UPDATE $DB_Setup SET setup_value='$edit_contact_info' WHERE setup_key='ContactFormInfo'";
	$result = mysql_query($query, $Link) or queryError("55", mysql_error());
	
	//$message = $sxLang['MessageContactConfigUpdated'];
	header("Location:$PHP_SELF?message=".$sxLang['MessageContactConfigUpdated']);
	die();	
}

$sxTitleAddendum = $sxLang['AdminHeading'];
include("../themes/$THEME_FOLDER/header.php");
?>

<?PHP
// ============================== TinyMCE ==============================
if($sxSetup['WYSIWYG'] == 'tinymce') { ?>
<script type="text/javascript" src="../includes/tinymce/tiny_mce.js"></script>
<script type="text/javascript">
<!--
	tinyMCE.init({
		// General options
		mode : "textareas",
		editor_selector : 'mceEditor',
		language : "<?PHP echo $sxSetupTinyMCELanguage; ?>",
		theme : "advanced",
		relative_urls : false,
		plugins : "safari,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,preview,media,searchreplace,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras",

		// Theme options
		theme_advanced_buttons1 : "fullscreen,|,undo,redo,|,bold,italic,underline,strikethrough,|,forecolor,backcolor,|,formatselect,fontselect,fontsizeselect",
		theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,bullist,numlist,|,justifyleft,justifycenter,justifyright,justifyfull,|,outdent,indent,blockquote,|,link,unlink,anchor,image,cleanup,help,code",
		theme_advanced_buttons3 : "tablecontrols,|,removeformat,visualaid,visualchars,|,sub,sup,|,charmap,iespell,media,advhr",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : true,

		// Example content CSS (should be your site CSS)
		//content_css : "css/content.css",

		// Drop lists for link/image/media/template dialogs
		external_link_list_url : "lists/link_list.js",
		external_image_list_url : "lists/image_list.js",
		media_external_list_url : "lists/media_list.js",

		// Replace values for the template plugin
		template_replace_values : {
			username : "",
			staffid : ""
		}
	});

function fileInsertTinyMCE(selObj)
{
	var fileid = selObj.options[selObj.selectedIndex].value;
	var filename = new Array();
	<?PHP
	$query2 = "SELECT * FROM $DB_Files";
	$result2 = mysql_query($query2, $Link);
	while($ROW2 = mysql_fetch_object($result2))	
		echo "	filename[$ROW2->id] = '" . addslashes($ROW2->name) . "';\n";
	?>
	
	if(fileid)
	{
			tinyMCE.execCommand('mceInsertContent',false,'<a href="<?PHP echo sxPathToRoot()."/"; ?>redirect.php?fileid='+fileid+'">'+filename[fileid]+'</a>');
	}
}
	
function pageInsertTinyMCE(selObj)
{
	var pageid = selObj.options[selObj.selectedIndex].value;
	var pagename = new Array();
	<?PHP
	$query2 = "SELECT * FROM $DB_Pages";
	$result2 = mysql_query($query2, $Link);
	while($ROW2 = mysql_fetch_object($result2))	
		echo "	pagename[$ROW2->id] = '" . addslashes($ROW2->name) . "';\n";
	?>
		
	if(pageid)
	{
		tinyMCE.execCommand('mceInsertContent',false,'<a href="<?PHP echo sxPathToRoot()."/"; ?>page.php?pageid='+pageid+'">'+pagename[pageid]+'</a>');
	}
}

//-->
</script>

<?PHP
} // end if(tinymce)

// ============================== F C K ==============================
if($sxSetup['WYSIWYG'] == 'fck') {
	include("../includes/fck/fckeditor.php");
?>
<script language="JavaScript" type="text/JavaScript">
<!--
function fileInsertFCK(selObj)
{
	var fileid = selObj.options[selObj.selectedIndex].value;
	var filename = new Array();
	<?PHP
	$query2 = "SELECT * FROM $DB_Files";
	$result2 = mysql_query($query2, $Link);
	while($ROW2 = mysql_fetch_object($result2))	
		echo "	filename[$ROW2->id] = '" . addslashes($ROW2->name) . "';\n";
	?>
	
	if((fileid)&&(fileid != 0))
	{
		var oEditor = FCKeditorAPI.GetInstance('content') ;
		oEditor.SetData( oEditor.GetData() +  '<A HREF="redirect.php?fileid='+fileid+'">'+filename[fileid]+'</A>') ;
	}
}

function pageInsertFCK(selObj)
{
	var pageid = selObj.options[selObj.selectedIndex].value;
	var pagename = new Array();
	<?PHP
	$query2 = "SELECT * FROM $DB_Pages";
	$result2 = mysql_query($query2, $Link);
	while($ROW2 = mysql_fetch_object($result2))	
		echo "	pagename[$ROW2->id] = '" . addslashes($ROW2->name) . "';\n";
	?>
		
	if((pageid)&&(pageid != 0))
	{
		var oEditor = FCKeditorAPI.GetInstance('content') ;
		oEditor.SetData( oEditor.GetData() +  '<A HREF="page.php?pageid='+pageid+'">'+pagename[pageid]+'</A>') ;
	}
}
-->
</script>
<?PHP
} // end if(FCK)

// ============================== htmlarea ==============================
if($sxSetup['WYSIWYG'] == 'htmlarea') {
?>
<script language="JavaScript" type="text/JavaScript">
<!--
_editor_url = "../includes/htmlarea/";                     // URL to htmlarea files
var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
if (navigator.userAgent.indexOf('Mac')        >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera')      >= 0) { win_ie_ver = 0; }
if (win_ie_ver >= 5.5) {
  document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');
  document.write(' language="Javascript1.2"></scr' + 'ipt>'); 
} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }

function fileInsertHA(selObj)
{
	var fileid = selObj.options[selObj.selectedIndex].value;
	var filename = new Array();
	<?PHP
	$query2 = "SELECT * FROM $DB_Files";
	$result2 = mysql_query($query2, $Link);
	while($ROW2 = mysql_fetch_object($result2))	
		echo "	filename[$ROW2->id] = '" . addslashes($ROW2->name) . "';\n";
	?>
	
	if(fileid)
	{
		if (win_ie_ver >= 5.5)
		{
			editor_insertHTML('content', '<A HREF="redirect.php?fileid='+fileid+'">'+filename[fileid]+'</A>', '', 0);
		}
		else{
			var content = window.document.sxForm1.content.value; 
			window.document.sxForm1.content.value = content + '---FILE'+fileid+'---'; 
			window.document.sxForm1.content.focus();
		}
	}
}

function pageInsertHA(selObj)
{
	var pageid = selObj.options[selObj.selectedIndex].value;
	var pagename = new Array();
	<?PHP
	$query2 = "SELECT * FROM $DB_Pages";
	$result2 = mysql_query($query2, $Link);
	while($ROW2 = mysql_fetch_object($result2))	
		echo "	pagename[$ROW2->id] = '" . addslashes($ROW2->name) . "';\n";
	?>
		
	if(pageid)
	{
		if (win_ie_ver >= 5.5)
		{
			editor_insertHTML('content', '<A HREF="page.php?pageid='+pageid+'">'+pagename[pageid]+'</A>', '', 0);
		}
		else
		{
			var content = window.document.sxForm1.content.value; 
			window.document.sxForm1.content.value = content + '---PAGE'+pageid+'---'; 
			window.document.sxForm1.content.focus();
		}
	}
}
//-->
</script> 
<?PHP } // end if(htmlarea) ?>
  
<div class="bodyWrapper">
   <h1 class="sxAdminHeading"><?PHP echo $sxLang['ContactHeading']; ?> <?PHP echo getComponentName("7"); ?></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['ContactHeading']; ?></div>   
	<?PHP echoMessage($message); ?>
	<form name="sxForm1" action="<?PHP echo $PHP_SELF; ?>" method="post" onSubmit="return submitIt(this)">
	<table border="0" cellspacing="2" cellpadding="5">
		<tr> 
		  <td class="sxTdItem"><?PHP echo $sxLang['ContactRecipient']; ?></td>
		  <td><input name="contactemail" type="text" value="<?PHP echo $sxSetup['ContactFormEmail']; ?>" style="width:300px;" /></td>
		  </tr>
    <tr>
      <td class="sxTdItem"><?PHP echo $sxLang['ContactInfo']; ?></td>
		  <td>
		  
      <div style="text-align:center;background:#EFEFDE;padding:5px;width:440px;color:#000000;">
		<strong><?PHP echo $sxLang['Autolink']; ?></strong>&nbsp;&nbsp;
		<select name="insert_file" style="width:158px;" onChange="fileInsert<?PHP
			switch($sxSetup['WYSIWYG'])
			{
				case 'fck' :
					echo 'FCK';
					break;
				case 'htmlarea' :
					echo 'HA';
					break;
				case 'tinymce' :
					echo 'TinyMCE';
					break;
			}
		?>(this)">
		<option value="0"><?PHP echo $sxLang['LinkFile']; ?></option>
		<?PHP
		$queryF = "SELECT * FROM $DB_Files ORDER BY filename";
		$resultF = mysql_query($queryF, $Link);
		while($ROWF = mysql_fetch_object($resultF)){
			echo '<option value="' . $ROWF->id . '">[' . $ROWF->id . '] ' . $ROWF->name . '</option>'."\n";
		}
		?>
		</select>&nbsp;&nbsp;
		<select name="insert_page" style="width:158px;" onChange="pageInsert<?PHP
			switch($sxSetup['WYSIWYG'])
			{
				case 'fck' :
					echo 'FCK';
					break;
				case 'htmlarea' :
					echo 'HA';
					break;
				case 'tinymce' :
					echo 'TinyMCE';
					break;
			}
		?>(this)">
		<option value="0"><?PHP echo $sxLang['LinkPage']; ?></option>
		<?PHP
		$queryP = "SELECT * FROM $DB_Pages ORDER BY name";
		$resultP = mysql_query($queryP, $Link);
		while($ROWP = mysql_fetch_object($resultP)){
			echo '<option value="' . $ROWP->id . '">[' . $ROWP->id . '] ' . $ROWP->name . '</option>'."\n";
		}
		?>
		</select></div>
		<?PHP
    	
		// Run TinyMCE
		if($sxSetup['WYSIWYG'] == 'tinymce')
			echo '<textarea id="edit_contact_info" class="mceEditor" name="edit_contact_info" rows="25" cols="80" style="width: 80%">'.$sxSetup['ContactFormInfo'].'</textarea>';
			
		// Run FCKeditor
		if($sxSetup['WYSIWYG'] == 'fck')
		{
		$oFCKeditor = new FCKeditor('edit_contact_info') ;
		
		$oFCKeditor->Config['DefaultLanguage'] = $sxSetupFCKLanguage ;
		$oFCKeditor->BasePath = getURLFolder() . '/includes/fck/' ;
		$sxFCKServerPath = getURLFolder() . '/content/fck/';
		
		$sxFCKConnectorPath = $oFCKeditor->BasePath . 'editor/filemanager/browser/default/browser.html?Connector=../../connectors/php/connector.php?ServerPath=' . $sxFCKServerPath;
					
		$oFCKeditor->Config['LinkBrowserURL']  = $sxFCKConnectorPath;
		$oFCKeditor->Config['ImageBrowserURL'] = $sxFCKConnectorPath . '&Type=Image';
		$oFCKeditor->Config['FlashBrowserURL'] = $sxFCKConnectorPath . '&Type=Flash';
		
		$oFCKeditor->Width  = '450' ;
		$oFCKeditor->Height = '400' ;
		
		$oFCKeditor->Value = $sxSetup['ContactFormInfo'];
		$oFCKeditor->Create() ;
		}
		
		if($sxSetup['WYSIWYG'] == 'htmlarea') {
		?>
		<textarea name="edit_contact_info" style="width:575px;height:500px;"><?PHP echo $sxSetup['ContactFormInfo']; ?></textarea>
		  <script language="javascript1.2">
			var config = new Object();    // create new config object
			
			config.width = "450px";
			config.height = "400px";
			config.bodyStyle = 'background-color: white; font-family: "Verdana"; font-size: x-small;';
			config.debug = 0;
			
			// NOTE:  You can remove any of these blocks and use the default config!
			
			config.toolbar = [
				['fontname'],
				['fontsize'],
				['HorizontalRule','InsertTable','Createlink','InsertImage','htmlmode'],
				['linebreak'],
				['bold','italic','underline','separator'],
				['strikethrough','subscript','superscript','separator'],
				['justifyleft','justifycenter','justifyright','separator'],
				['OrderedList','UnOrderedList','Outdent','Indent','separator'],
				['forecolor','backcolor'],
			];
			
			editor_generate('edit_contact_info',config);
		  </script>
		  <?PHP } ?>
      </td>
    </tr>	
    <tr>
    <td colspan="2" align="right"><input type="submit" name="Submit" value="<?PHP echo $sxLang['ContactButtonChange']; ?>" class="sxButton" /></td>
    </tr>	  
	   </table>
	   
   </form>
</div>
<?PHP
include("../themes/$THEME_FOLDER/footer.php");
ob_end_flush();
?>
Return current item: SiteX