<?php

	define($ns."USE_SSL", 0);
	define($ns."SHOW_ERRORS", 1);
	
	// get values to set up the next block of constants automatically
	$protocol = (USE_SSL) ? "https" : "http" ;
	$domain = $_SERVER["HTTP_HOST"];
	$request = ((isset($_SERVER["OS"]))&&(strstr($_SERVER["OS"], "Win"))) ? $_SERVER["SCRIPT_NAME"] : ( (strpos($_SERVER["REQUEST_URI"], "?")) ? substr($_SERVER["REQUEST_URI"], 0, strpos($_SERVER["REQUEST_URI"], "?")) : $_SERVER["REQUEST_URI"] ) ;
	$cwd = preg_replace("/\\\+/", "/", getcwd());
	$site_directory = preg_replace("/(.*)\/[^\/]*/", "$1", $cwd);
	preg_match("/(\/?.*)\/([^\/]+)\/([^\/]*)/", $request, $request_parts);
	list(, $site_subdirectory, $editor_subdirectory, $editor_index) = $request_parts;

	// if the values calculated above are not correct, you can override these constants here
	define($ns."SITE_PROTOCOL", $protocol);
	define($ns."SITE_DOMAIN", $domain);
	define($ns."SITE_DIRECTORY", $site_directory); // complete filesystem path of website's root directory; leading slash, no trailing slash
	define($ns."SITE_SUBDIRECTORY", $site_subdirectory); // any directories between the domain root directory and the website root directory; leading slash, no trailing slash; leave blank if website root directory is the same as domain root directory
	define($ns."EDITOR_SUBDIRECTORY", $site_subdirectory."/".$editor_subdirectory); // all directories between the domain root directory and the editor root directory; leading slash, no trailing slash
	define($ns."EDITOR_INDEX", $site_subdirectory."/".$editor_subdirectory."/".$editor_index); // editor subdirectory plus editor's index file; leading slash

	/*
	// activate this code to test the previous block of constants
	print "request: ".$request."<br />\n";
	print "SITE_DIRECTORY: ".SITE_DIRECTORY."<br />\n";
	print "SITE_SUBDIRECTORY: ".SITE_SUBDIRECTORY."<br />\n";
	print "EDITOR_SUBDIRECTORY: ".EDITOR_SUBDIRECTORY."<br />\n";
	print "EDITOR_INDEX: ".EDITOR_INDEX."<br />\n";
	*/
	
	// use these settings to embed the editor into your own system
	define($ns."INTEGRATION_MODE", 0); // 1 or 0
	define($ns."WRAPPER_PAGE", ""); // your wrapper page, which should perform an include of the editor's index page; e.g., /admin/editor_wrapper.php
	define($ns."LOGIN_PAGE", ""); // your login page, which the editor will load if its session expires; e.g., /admin/editor_wrapper.php
	$this_page_wrapped = ( (INTEGRATION_MODE) && ((strpos($request, WRAPPER_PAGE) !== false)||($_GET["page"] == "integration_login")) ) ? 1 : 0 ;
	define($ns."THIS_PAGE_WRAPPED", $this_page_wrapped);
	
	// add your site's stylesheet here to make it available in the content editor
	define($ns."SITE_STYLESHEET", SITE_SUBDIRECTORY."/styles.css"); // allows a comma-delimited list

	// add your site's image directory here to browse it from the image dialog box in the content editor
	define($ns."SITE_IMAGE_DIRECTORIES", SITE_SUBDIRECTORY."/images"); // allows a comma-delimited list

	// if your content normally appears on a colored background, you can set a background color for the editor
	define($ns."EDITOR_BG_COLOR", "#FFFFFF");

	// you can change these values to wrap the pages in your own template
	define($ns."HEAD_FILE", "config/head.php");
	define($ns."HEADER_FILE", "config/header.php");
	define($ns."FOOTER_FILE", "config/footer.php");

	// enter the connection details for the editor database here
	// it is recommended to create a new database for the editor rather than installing into an existing database
	define($ns."DB_HOSTNAME", ""); // this may include a port number; 3306 is the default
	define($ns."DB_USERNAME", "");
	define($ns."DB_PASSWORD", "");
	define($ns."DB_NAME", "");

	// configure miscellaneous display options
	define($ns."MULTIPLE_SPACES", 0);
	define($ns."COLLAPSABLE_GROUPS", 1);
	define($ns."LIST_ITEMS_PER_PAGE", 20);
	define($ns."MINI_LIST_ITEMS_PER_PAGE", 10);
	define($ns."EDITOR_NAME", "Meditate&trade; Web Content Editor");
	define($ns."WEBMASTER_EMAIL", "");
	
	// this feature adds .LCK files to the web server when content is opened for editing
	// this prevents editing conflicts with Dreamweaver, Contribute and direct FTP users
	// however, you can turn it off to avoid creating these files
	define($ns."USE_LCK_FILES", 1);

	// this can be set to: contemplate, database, dreamweaver
	define($ns."CONTENT_TYPE", "contemplate");
	
	// these options control the contemplate content type
	define($ns."CONTEMPLATE_CONTENT_DIRECTORIES", "content"); // allows a comma-delimited list
	define($ns."CONTEMPLATE_DIRECTORY", SITE_DIRECTORY."/contemplate");

	// these options control the database content type
	define($ns."DATABASE_HOST", ""); // this may include a port number; 3306 is the default
	define($ns."DATABASE_NAME", "");
	define($ns."DATABASE_USERNAME", "");
	define($ns."DATABASE_PASSWORD", "");
	define($ns."DATABASE_TABLES", ""); // allows a comma-delimited list
	define($ns."DATABASE_ID1_COLUMN", "");
	define($ns."DATABASE_ID2_COLUMN", "");
	define($ns."DATABASE_CONTENT_COLUMN", "");

	// these options control the Dreamweaver content type
	define($ns."DREAMWEAVER_CONTENT_DIRECTORIES", ""); // allows a comma-delimited list
	define($ns."DREAMWEAVER_CONTENT_SUBDIRECTORIES", 1); // determines whether files in subdirectories are displayed (Contemplate has a similar option READ_FILES_RECURSIVELY in its own constants file)

	// the contemplate and dreamweaver content types read content from HTML files in your site
	// you can add extensions here if you use .php or other extensions for these files
	define($ns."CONTENT_FILE_EXTENSIONS", "html,htm"); // allows a comma-delimited list; do not include periods

?>
