dbConfig['host'] = $GLOBALS['database_server']; $this->dbConfig['dbase'] = $GLOBALS['dbase']; $this->dbConfig['user'] = $GLOBALS['database_user']; $this->dbConfig['pass'] = $GLOBALS['database_password']; $this->dbConfig['table_prefix'] = $GLOBALS['table_prefix']; $this->db = $this->dbConfig['dbase'].".".$this->dbConfig['table_prefix']; } function checkCookie() { if(isset($_COOKIE['etomiteLoggingCookie'])) { $this->visitor = $_COOKIE['etomiteLoggingCookie']; if(isset($_SESSION['_logging_first_hit'])) { $this->entrypage = 0; } else { $this->entrypage = 1; $_SESSION['_logging_first_hit'] = 1; } } else { if (function_exists('posix_getpid')) { $visitor = crc32(microtime().posix_getpid()); } else { $visitor = crc32(microtime().session_id()); } $this->visitor = $visitor; $this->entrypage = 1; setcookie('etomiteLoggingCookie', $visitor, time()+(365*24*60*60), '', ''); } } function getMicroTime() { list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec); } function sendRedirect($url, $count_attempts=3, $type='') { if(empty($url)) { return false; } else { if($count_attempts==1) { // append the redirect count string to the url $currentNumberOfRedirects = isset($_REQUEST['err']) ? $_REQUEST['err'] : 0 ; if($currentNumberOfRedirects>3) { $this->messageQuit("Redirection attempt failed - please ensure the document you're trying to redirect to exists. Redirection URL: $url"); } else { $currentNumberOfRedirects += 1; if(strpos($url, "?")>0) { $url .= "&err=$currentNumberOfRedirects"; } else { $url .= "?err=$currentNumberOfRedirects"; } } } if($type=="REDIRECT_REFRESH") { $header = "Refresh: 0;URL=".$url; } elseif($type=="REDIRECT_META") { $header = ""; echo $header; exit; } elseif($type=="REDIRECT_HEADER" || empty($type)) { $header = "Location: $url"; } header($header); $this->postProcess(); } } function dbConnect() { // function to connect to the database $tstart = $this->getMicroTime(); if(@!$this->rs = mysql_connect($this->dbConfig['host'], $this->dbConfig['user'], $this->dbConfig['pass'])) { $this->messageQuit("Failed to create the database connection!"); } else { mysql_select_db($this->dbConfig['dbase']); $tend = $this->getMicroTime(); $totaltime = $tend-$tstart; if($this->dumpSQL) { $this->queryCode .= "
Database connection".sprintf("Database connection was created in %2.4f s", $totaltime)."

"; } $this->queryTime = $this->queryTime+$totaltime; } } function dbQuery($query) { // function to query the database // check the connection and create it if necessary if(empty($this->rs)) { $this->dbConnect(); } $tstart = $this->getMicroTime(); if(@!$result = mysql_query($query, $this->rs)) { $this->messageQuit("Execution of a query to the database failed", $query); } else { $tend = $this->getMicroTime(); $totaltime = $tend-$tstart; $this->queryTime = $this->queryTime+$totaltime; if($this->dumpSQL) { $this->queryCode .= "
Query ".($this->executedQueries+1)." - ".sprintf("%2.4f s", $totaltime)."".$query."

"; } $this->executedQueries = $this->executedQueries+1; if(count($result) > 0) { return $result; } else { return false; } } } function recordCount($rs) { // function to count the number of rows in a record set return mysql_num_rows($rs); } function fetchRow($rs, $mode='assoc') { if($mode=='assoc') { return mysql_fetch_assoc($rs); } elseif($mode=='num') { return mysql_fetch_row($rs); } elseif($mode=='both') { return mysql_fetch_array($rs, MYSQL_BOTH); } else { $this->messageQuit("Unknown get type ($mode) specified for fetchRow - must be empty, 'assoc', 'num' or 'both'."); } } function affectedRows($rs) { return mysql_affected_rows($this->rs); } function insertId($rs) { return mysql_insert_id($this->rs); } function dbClose() { // function to close a database connection mysql_close($this->rs); } function getSettings() { if(file_exists("assets/cache/etomiteCache.idx.php")) { include_once "assets/cache/etomiteCache.idx.php"; } else { $result = $this->dbQuery("SELECT setting_name, setting_value FROM ".$this->db."system_settings"); while ($row = $this->fetchRow($result, 'both')) { $this->config[$row[0]] = $row[1]; } } // get current version information include "manager/includes/version.inc.php"; $this->config['release'] = $release; $this->config['patch_level'] = $patch_level; $this->config['code_name'] = $code_name; $this->config['full_appname'] = $full_appname; $this->config['small_version'] = $small_version; $this->config['slogan'] = $full_slogan; // compile array of document aliases // relocated from rewriteUrls() for greater flexibility in 0.6.1 Final // we always run this routine now so that the template info gets populated too // a blind array(), $this->tpl_list, is also included for comparisons $aliases = array(); $templates = array(); $parents = array(); $limit_tmp = count($this->aliasListing); for ($i_tmp=0; $i_tmp<$limit_tmp; $i_tmp++) { if($this->aliasListing[$i_tmp]['alias'] != "") { $aliases[$this->aliasListing[$i_tmp]['id']] = $this->aliasListing[$i_tmp]['alias']; } $templates[$this->aliasListing[$i_tmp]['id']] = $this->aliasListing[$i_tmp]['template']; $parents[$this->aliasListing[$i_tmp]['id']] = $this->aliasListing[$i_tmp]['parent']; $authenticates[$this->aliasListing[$i_tmp]['id']] = $this->aliasListing[$i_tmp]['authenticate']; } $this->aliases = $aliases; $this->templates = $templates; $this->parents = $parents; $this->authenticates = $authenticates; } function getDocumentMethod() { // function to test the query and find the retrieval method if(isset($_REQUEST['q'])) { return "alias"; } elseif(isset($_REQUEST['id'])) { return "id"; } else { return "none"; } } function getDocumentIdentifier($method) { // function to test the query and find the retrieval method switch($method) { case "alias" : return strip_tags($_REQUEST['q']); break; case "id" : return strip_tags($_REQUEST['id']); break; case "none" : return $this->config['site_start']; break; default : return $this->config['site_start']; } } function checkSession() { if(isset($_SESSION['validated'])) { return true; } else { return false; } } function checkPreview() { if($this->checkSession()==true) { if(isset($_REQUEST['z']) && $_REQUEST['z']=='manprev') { return true; } else { return false; } } else { return false; } } function checkSiteStatus() { $siteStatus = $this->config['site_status']; if($siteStatus==1) { return true; } else { return false; } } function cleanDocumentIdentifier($qOrig) { if(strpos($q, "/")>0) { $q = substr($q, 0, strpos($q, "/")); } $q = str_replace($this->config['friendly_url_prefix'], "", $qOrig); $q = str_replace($this->config['friendly_url_suffix'], "", $q); // we got an ID returned unless the error_page alias is "404" if(is_numeric($q) && ($q != $this->aliases[$this->config['error_page']])) { $this->documentMethod = 'id'; return $q; // we didn't get an ID back, so instead we assume it's an alias } else { $this->documentMethod = 'alias'; return $q; } } function checkCache($id) { $cacheFile = "assets/cache/docid_".$id.".etoCache"; if(file_exists($cacheFile)) { $this->documentGenerated=0; return join("",file($cacheFile)); } else { $this->documentGenerated=1; return ""; } } function addNotice($content, $type="text/html") { /* PLEASE READ! This function places a copyright message and a link to Etomite in the page about to be sent to the visitor's browser. The message is placed just before your or tag, and if Etomite can't find either of these, it will simply paste the message onto the end of the page. I've not obfuscated this notice, or hidden it away somewhere deep in the code, to give you the chance to alter the markup on the P tag, should you wish to do so. You can even remove the message as long as: 1 - the "Etomite is Copyright..." message stays (doesn't have to be visible) and, 2 - the link remains in place (must be visible, and must be a regular HTML link). You are allowed to add a target="_blank" attribute to the link if you wish to do so. Should you decide to remove the entire message and the link, I will probably refuse to give you any support you request, unless you have a very good reason for removing the message. Donations or other worthwhile contributions are usually considered to be a good reason. ;) If in doubt, contact me through the Private Messaging system in the forums at http://www.etomite.org/forums. If you have a 'powered by' logo of Etomite on your pages, you are hereby granted permission to remove this message. The 'powered by' logo must, however, be visible on all pages within your site, and must have a regular HTML link to http://www.etomite.org. The link's title attribute must contain the text "Etomite Content Management System". Textual links are also allowed, as long as they also appear on every page, have the same title attribute, and contain "Etomite Content Management System" as the visible, clickable test. These links also must be regular HTML links. Leaving this message and the link intact will show your appreciation of the 2500+ hours I've spent building the system and providing support to it's users, and the hours I will be spending on it in future. Removing this message, in my opinion, shows a lack of appreciation, and a lack of community spirit. The term 'free-loading' comes to mind. :) Thanks for understanding, and thanks for not removing the message and link! - Alex */ if($type == "text/html"){ $notice = "\n\n\n". "
\n". "\tContent managed by the Etomite Content Management System.\n". "
\n\n". "\t\n\n"; } // insert the message into the document if(strpos($content, "")>0) { $content = str_replace("", $notice."", $content); } elseif(strpos($content, "")>0) { $content = str_replace("", $notice."", $content); } else { $content .= $notice; } return $content; } function outputContent() { $output = $this->documentContent; // check for non-cached snippet output if(strpos($output, '[!')>-1) { $output = str_replace('[!', '[[', $output); $output = str_replace('!]', ']]', $output); $this->nonCachedSnippetParsePasses = empty($this->nonCachedSnippetParsePasses) ? 1 : $this->nonCachedSnippetParsePasses; for($i=0; $i<$this->nonCachedSnippetParsePasses; $i++) { if($this->dumpSnippets==1) { echo "
NONCACHED PARSE PASS ".($i+1)."The following snipppets (if any) were parsed during this pass.
"; } // replace settings referenced in document $output = $this->mergeSettingsContent($output); // replace HTMLSnippets in document $output = $this->mergeHTMLSnippetsContent($output); // find and merge snippets $output = $this->evalSnippets($output); if($this->dumpSnippets==1) { echo "

"; } } } $output = $this->rewriteUrls($output); $totalTime = ($this->getMicroTime() - $this->tstart); $queryTime = $this->queryTime; $phpTime = $totalTime-$queryTime; $queryTime = sprintf("%2.4f s", $queryTime); $totalTime = sprintf("%2.4f s", $totalTime); $phpTime = sprintf("%2.4f s", $phpTime); $source = $this->documentGenerated==1 ? "database" : "cache"; $queries = isset($this->executedQueries) ? $this->executedQueries : 0 ; // send out content-type headers $type = !empty($this->contentTypes[$this->documentIdentifier]) ? $this->contentTypes[$this->documentIdentifier] : "text/html"; header('Content-Type: '.$type.'; charset='.$this->config['etomite_charset']); if(($this->documentIdentifier == $this->config['error_page']) && ($this->config['error_page'] != $this->config['site_start'])) { header("HTTP/1.0 404 Not Found"); } // Check to see whether or not addNotice should be called if($this->useNotice){ $documentOutput = $this->addNotice($output, $type); } else { $documentOutput = $output; } if($this->dumpSQL) { $documentOutput .= $this->queryCode; } $documentOutput = str_replace("[^q^]", $queries, $documentOutput); $documentOutput = str_replace("[^qt^]", $queryTime, $documentOutput); $documentOutput = str_replace("[^p^]", $phpTime, $documentOutput); $documentOutput = str_replace("[^t^]", $totalTime, $documentOutput); $documentOutput = str_replace("[^s^]", $source, $documentOutput); // Check to see if document content contains PHP tags. // PHP tag support contributed by SniperX if( (preg_match("/(<\?php|<\?)(.*?)\?>/", $documentOutput)) && ($type == "text/html") && ($this->allow_embedded_php) ) { $documentOutput = '?'.'>' . $documentOutput . '<'.'?php '; // Parse the PHP tags. eval($documentOutput); } else { // No PHP tags so just echo out the content. echo $documentOutput; } } function checkPublishStatus(){ include "assets/cache/etomitePublishing.idx"; $timeNow = time()+$this->config['server_offset_time']; if(($cacheRefreshTime<=$timeNow && $cacheRefreshTime!=0) || !isset($cacheRefreshTime)) { // now, check for documents that need publishing $sql = "UPDATE ".$this->db."site_content SET published=1 WHERE ".$this->db."site_content.pub_date <= ".$timeNow." AND ".$this->db."site_content.pub_date!=0"; if(@!$result = $this->dbQuery($sql)) { $this->messageQuit("Execution of a query to the database failed", $sql); } // now, check for documents that need un-publishing $sql = "UPDATE ".$this->db."site_content SET published=0 WHERE ".$this->db."site_content.unpub_date <= ".$timeNow." AND ".$this->db."site_content.unpub_date!=0"; if(@!$result = $this->dbQuery($sql)) { $this->messageQuit("Execution of a query to the database failed", $sql); } // clear the cache $basepath=dirname(__FILE__); if ($handle = opendir($basepath."/assets/cache")) { $filesincache = 0; $deletedfilesincache = 0; while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $filesincache += 1; if (preg_match ("/\.etoCache/", $file)) { $deletedfilesincache += 1; while(!unlink($basepath."/assets/cache/".$file)); } } } closedir($handle); } // update publish time file $timesArr = array(); $sql = "SELECT MIN(".$this->db."site_content.pub_date) AS minpub FROM ".$this->db."site_content WHERE ".$this->db."site_content.pub_date >= ".$timeNow.";"; if(@!$result = $this->dbQuery($sql)) { $this->messageQuit("Failed to find publishing timestamps", $sql); } $tmpRow = $this->fetchRow($result); $minpub = $tmpRow['minpub']; if($minpub!=NULL) { $timesArr[] = $minpub; } $sql = "SELECT MIN(".$this->db."site_content.unpub_date) AS minunpub FROM ".$this->db."site_content WHERE ".$this->db."site_content.unpub_date >= ".$timeNow.";"; if(@!$result = $this->dbQuery($sql)) { $this->messageQuit("Failed to find publishing timestamps", $sql); } $tmpRow = $this->fetchRow($result); $minunpub = $tmpRow['minunpub']; if($minunpub!=NULL) { $timesArr[] = $minunpub; } if(count($timesArr)>0) { $nextevent = min($timesArr); } else { $nextevent = 0; } $basepath=dirname(__FILE__); $fp = @fopen($basepath."/assets/cache/etomitePublishing.idx","wb"); if($fp) { @flock($fp, LOCK_EX); $data = ""; $len = strlen($data); @fwrite($fp, $data, $len); @flock($fp, LOCK_UN); @fclose($fp); } } } function postProcess() { // if enabled, do logging if($this->config['track_visitors']==1 && !isset($_REQUEST['z'])) { if((preg_match($this->blockLogging,$_SERVER['HTTP_USER_AGENT'])) && $etomite->useblockLogging) return; $this->log(); } // if the current document was generated, cache it, unless an alternate template is being used! if( isset($_SESSION['tpl']) && ($_SESSION['tpl']!=$this->documentObject['template'])) return; if( $this->documentGenerated==1 && $this->documentObject['cacheable']==1 && $this->documentObject['type']=='document' ) { $basepath=dirname(__FILE__); if($fp = @fopen($basepath."/assets/cache/docid_".$this->documentIdentifier.".etoCache","w")){ fputs($fp,$this->documentContent); fclose($fp); } } } function mergeDocumentContent($template) { foreach ($this->documentObject as $key => $value) { $template = str_replace("[*".$key."*]", stripslashes($value), $template); } return $template; } function mergeSettingsContent($template) { preg_match_all('~\[\((.*?)\)\]~', $template, $matches); $settingsCount = count($matches[1]); for($i=0; $i<$settingsCount; $i++) { $replace[$i] = $this->config[$matches[1][$i]]; } $template = str_replace($matches[0], $replace, $template); return $template; } function mergeHTMLSnippetsContent($content) { preg_match_all('~{{(.*?)}}~', $content, $matches); $settingsCount = count($matches[1]); for($i=0; $i<$settingsCount; $i++) { if(isset($this->chunkCache[$matches[1][$i]])) { $replace[$i] = base64_decode($this->chunkCache[$matches[1][$i]]); } else { $sql = "SELECT * FROM ".$this->db."site_htmlsnippets WHERE ".$this->db."site_htmlsnippets.name='".$matches[1][$i]."';"; $result = $this->dbQuery($sql); $limit=$this->recordCount($result); if($limit<1) { $this->chunkCache[$matches[1][$i]] = ""; $replace[$i] = ""; } else { $row=$this->fetchRow($result); $this->chunkCache[$matches[1][$i]] = $row['snippet']; $replace[$i] = $row['snippet']; } } } $content = str_replace($matches[0], $replace, $content); return $content; } function evalSnippet($snippet, $params) { $etomite = $this; if(is_array($params)) { extract($params, EXTR_SKIP); } $snip = eval(base64_decode($snippet)); return $snip; } function evalSnippets($documentSource) { preg_match_all('~\[\[(.*?)\]\]~', $documentSource, $matches); $etomite = $this; $matchCount=count($matches[1]); for($i=0; $i<$matchCount; $i++) { $spos = strpos($matches[1][$i], '?', 0); if($spos!==false) { $params = substr($matches[1][$i], $spos, strlen($matches[1][$i])); } else { $params = ''; } $matches[1][$i] = str_replace($params, '', $matches[1][$i]); $snippetParams[$i] = $params; } $nrSnippetsToGet = count($matches[1]); for($i=0;$i<$nrSnippetsToGet;$i++) { if(isset($this->snippetCache[$matches[1][$i]])) { $snippets[$i]['name'] = $matches[1][$i]; $snippets[$i]['snippet'] = $this->snippetCache[$matches[1][$i]]; } else { $sql = "SELECT * FROM ".$this->db."site_snippets WHERE ".$this->db."site_snippets.name='".$matches[1][$i]."';"; $result = $this->dbQuery($sql); if($this->recordCount($result)==1) { $row = $this->fetchRow($result); $snippets[$i]['name'] = $row['name']; $snippets[$i]['snippet'] = base64_encode($row['snippet']); $this->snippetCache = $snippets[$i]; } else { $snippets[$i]['name'] = $matches[1][$i]; $snippets[$i]['snippet'] = base64_encode("return false;"); $this->snippetCache = $snippets[$i]; } } } for($i=0; $i<$nrSnippetsToGet; $i++) { $parameter = array(); $snippetName = $this->currentSnippet = $snippets[$i]['name']; $currentSnippetParams = $snippetParams[$i]; if(!empty($currentSnippetParams)) { $tempSnippetParams = str_replace("?", "", $currentSnippetParams); $splitter = strpos($tempSnippetParams, "&")>0 ? "&" : "&"; $tempSnippetParams = split($splitter, $tempSnippetParams); for($x=0; $xevalSnippet($snippets[$i]['snippet'], $parameter); if($this->dumpSnippets==1) { echo "
$snippetName

"; } $documentSource = str_replace("[[".$snippetName.$currentSnippetParams."]]", $executedSnippets[$i], $documentSource); } return $documentSource; } function rewriteUrls($documentSource) { // rewrite the urls // based on code by daseymour ;) if($this->config['friendly_alias_urls']==1) { // additional code that was here originally has been moved to getSettings() for added functionality // write the function for the preg_replace_callback. Probably not the best way of doing this, // but otherwise it brakes on some people's installs... $func = ' $aliases=unserialize("'.addslashes(serialize($this->aliases)).'"); if (isset($aliases[$m[1]])) { if('.$this->config["friendly_alias_urls"].'==1) { return "'.$this->config["friendly_url_prefix"].'".$aliases[$m[1]]."'.$this->config["friendly_url_suffix"].'"; } else { return $aliases[$m[1]]; } } else { return "'.$this->config["friendly_url_prefix"].'".$m[1]."'.$this->config["friendly_url_suffix"].'"; }'; $in = '!\[\~(.*?)\~\]!is'; $documentSource = preg_replace_callback($in, create_function('$m', $func), $documentSource); } else { $in = '!\[\~(.*?)\~\]!is'; $out = "index.php?id=".'\1'; $documentSource = preg_replace($in, $out, $documentSource); } return $documentSource; } function executeParser() { //error_reporting(0); set_error_handler(array($this,"phpError")); // get the settings if(empty($this->config)) { $this->getSettings(); // detect current protocol $protocol = (isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) == 'on') ? "https://" : "http://"; // get server host name $host = $_SERVER['HTTP_HOST']; // create 404 Page Not Found error url $this->error404page = $this->makeURL($this->config['error_page']); } // convert variables initially calculated in config.inc.php into config variables $this->config['absolute_base_path'] = $GLOBALS['absolute_base_path']; $this->config['relative_base_path'] = $GLOBALS['relative_base_path']; $this->config['www_base_path'] = $GLOBALS['www_base_path']; // stop processing here, as the site's offline if(!$this->checkSiteStatus() && ($_REQUEST['z'] != "manprev")) { $this->documentContent = $this->config['site_unavailable_message']; $this->outputContent(); ob_end_flush(); exit; } // make sure the cache doesn't need updating $this->checkPublishStatus(); // check the logging cookie if($this->config['track_visitors']==1 && !isset($_REQUEST['z'])) { $this->checkCookie(); } // find out which document we need to display $this->documentMethod = $this->getDocumentMethod(); $this->documentIdentifier = $this->getDocumentIdentifier($this->documentMethod); // now we know the site_start, change the none method to id if($this->documentMethod=="none"){ $this->documentMethod = "id"; } if($this->documentMethod=="alias"){ $this->documentIdentifier = $this->cleanDocumentIdentifier($this->documentIdentifier); } if($this->documentMethod=="alias"){ // jbc added to remove case sensitivity $tmpArr=array(); foreach($this->documentListing as $key => $value) { $tmpArr[strtolower($key)] = $value; } $this->documentIdentifier = $tmpArr[strtolower($this->documentIdentifier)]; $this->documentMethod = 'id'; } // if document level authentication is required, authenticate now if($this->authenticates[$this->documentIdentifier]) { if(($this->config['use_uvperms'] && !$this->checkPermissions()) || !$_SESSION['validated']) { include_once("manager/includes/lang/".$this->config['manager_language'].".inc.php"); $msg = ($this->config['access_denied_message']!="") ? $this->config['access_denied_message'] : $_lang['access_permission_denied']; echo $msg; exit; } } $template = $this->templates[$this->documentIdentifier]; // we now know the method and identifier, let's check the cache based on conditions below if( ($this->templates[$this->documentIdentifier]==$this->config['default_template']) // page uses default template && ($_GET['tpl'] == '') // no new alternate template has been selected && ($_SESSION['tpl'] == '') && !isset($_GET['printable']) ) // no alternate template is currently being used { $this->documentContent = $this->checkCache($this->documentIdentifier); } if($this->documentContent=="") { $source = "database"; $sql = "SELECT * FROM ".$this->db."site_content WHERE ".$this->db."site_content.".$this->documentMethod." = '".$this->documentIdentifier."';"; $result = $this->dbQuery($sql); if($this->recordCount($result) < 1) { // no match found, send the visitor to the error_page $this->sendRedirect($this->error404page); ob_clean(); exit; } if($rowCount>1) { // no match found, send the visitor to the error_page $this->messageQuit("More than one result returned when attempting to translate `alias` to `id` - there are multiple documents using the same alias"); } // this is now the document $this->documentObject = $this->fetchRow($result); // write the documentName to the object $this->documentName = $this->documentObject['pagetitle']; // validation routines if($this->documentObject['deleted']==1) { // no match found, send the visitor to the error_page $this->sendRedirect($this->error404page); } if($this->documentObject['published']==0){ // no match found, send the visitor to the error_page $this->sendRedirect($this->error404page); } // check whether it's a reference if($this->documentObject['type']=="reference") { $this->sendRedirect($this->documentObject['content']); ob_clean(); exit; } // get the template and start parsing! // if a request for a template change was passed, save old template and use the new one if( ($_GET['tpl'] != "") && ($template==$this->config['default_template']) && (in_array($_GET['tpl'],$this->tpl_list)) ) { $template = strip_tags($_GET['tpl']); $_GET['tpl'] = ""; // if the session template has been set, use it } elseif( isset($_SESSION['tpl']) && ($template==$this->config['default_template']) && (in_array($_SESSION['tpl'],$this->tpl_list)) ) { $template = strip_tags($_SESSION['tpl']); } // if a printable page was requested, switch to the proper template if(isset($_GET['printable'])) { //$_GET['printable'] = ""; $sql = "SELECT * FROM ".$this->db."site_templates WHERE ".$this->db."site_templates.templatename = '".$this->printable."';"; // otherwise use the assigned template } else { $sql = "SELECT * FROM ".$this->db."site_templates WHERE ".$this->db."site_templates.id = '".$template."';"; } // run query and process the results $result = $this->dbQuery($sql); $rowCount = $this->recordCount($result); // if the template wasn't found, send an error if($rowCount != 1) { $this->messageQuit("Row count error in template query result.",$sql,true); } // assign this template to be the active template on success if(($template != $this->config['default_template']) && ($this->templates[$this->documentIdentifier]==$this->config['default_template'])) { $_SESSION['tpl']=$template; } else { if($template == $this->config['default_template']) { unset($_SESSION['tpl']); } } $row = $this->fetchRow($result); $documentSource = $row['content']; // get snippets and parse them the required number of times $this->snippetParsePasses = empty($this->snippetParsePasses) ? 3 : $this->snippetParsePasses ; for($i=0; $i<$this->snippetParsePasses; $i++) { if($this->dumpSnippets==1) { echo "
PARSE PASS ".($i+1)."The following snipppets (if any) were parsed during this pass.
"; } // combine template and content $documentSource = $this->mergeDocumentContent($documentSource); // replace settings referenced in document $documentSource = $this->mergeSettingsContent($documentSource); // replace HTMLSnippets in document $documentSource = $this->mergeHTMLSnippetsContent($documentSource); // find and merge snippets $documentSource = $this->evalSnippets($documentSource); if($this->dumpSnippets==1) { echo "

"; } } $this->documentContent = $documentSource; } register_shutdown_function(array($this,"postProcess")); // tell PHP to call postProcess when it shuts down $this->outputContent(); } /***************************************************************************************/ /* Error Handler and Logging Functions /***************************************************************************************/ function phpError($nr, $text, $file, $line) { if($nr==2048) return true; // added by mfx 10-18-2005 to ignore E_STRICT erros in PHP5 if($nr==8 && $this->stopOnNotice==false) { return true; } if (is_readable($file)) { $source = file($file); $source = htmlspecialchars($source[$line-1]); } else { $source = ""; } //Error $nr in $file at $line:
$source
$this->messageQuit("PHP Parse Error", '', true, $nr, $file, $source, $text, $line); } function messageQuit($msg='unspecified error', $query='', $is_error=true,$nr='', $file='', $source='', $text='', $line='') { $parsedMessageString = "Etomite ".$GLOBALS['version']." »".$GLOBALS['code_name']." "; // jbc: added link back to home page, removed "Etomite parse" and left just "error" $homePage = $_SERVER['PHP_SELF']; $siteName = $this->config['site_name']; if($is_error) { $parsedMessageString .= "

$siteName

« Error »

"; } else { $parsedMessageString .= "

$siteName

« Etomite Debug/ stop message »

Etomite encountered the following error while attempting to parse the requested resource:
« $msg »
"; } // end jbc change if(!empty($query)) { $parsedMessageString .= ""; } if($text!='') { $errortype = array ( E_ERROR => "Error", E_WARNING => "Warning", E_PARSE => "Parsing Error", E_NOTICE => "Notice", E_CORE_ERROR => "Core Error", E_CORE_WARNING => "Core Warning", E_COMPILE_ERROR => "Compile Error", E_COMPILE_WARNING => "Compile Warning", E_USER_ERROR => "User Error", E_USER_WARNING => "User Warning", E_USER_NOTICE => "User Notice", ); $parsedMessageString .= ""; $parsedMessageString .= ""; $parsedMessageString .= ""; $parsedMessageString .= ""; $parsedMessageString .= ""; $parsedMessageString .= ""; $parsedMessageString .= ""; $parsedMessageString .= ""; $parsedMessageString .= ""; $parsedMessageString .= ""; $parsedMessageString .= ""; $parsedMessageString .= ""; $parsedMessageString .= ""; if($source!='') { $parsedMessageString .= ""; $parsedMessageString .= ""; $parsedMessageString .= ""; } } $parsedMessageString .= ""; $parsedMessageString .= ""; $parsedMessageString .= ""; $parsedMessageString .= ""; $parsedMessageString .= ""; $parsedMessageString .= ""; $parsedMessageString .= ""; $parsedMessageString .= ""; $parsedMessageString .= ""; $parsedMessageString .= ""; $parsedMessageString .= "
The Etomite parser recieved the following debug/ stop message:
« $msg »
      SQL: $query
      [Copy SQL to ClipBoard]
 
PHP error debug
  Error: $text 
  Error type/ Nr.: ".$errortype[$nr]." - $nr 
  File: $file 
  Line: $line 
  Line $line source: $source 
 
Parser timing
  MySQL: [^qt^] s([^q^] Requests)
  PHP: [^p^] s 
  Total: [^t^] s 
"; $parsedMessageString .= "
six flags springfield ma six flags springfield ma winter nuclear issues cdi nuclear issues cdi boat washington state halibut fishing washington state halibut fishing branch chicago public parks chicago public parks me rogers jewelers sacramento rogers jewelers sacramento valley colima city government house colima city government house air granny seduces young granny seduces young count portor cable 5554 portor cable 5554 beauty douglas arizona performing arts douglas arizona performing arts hit oregon trail unit oregon trail unit state grady foster dentist md grady foster dentist md gold hammond indiana most wanted hammond indiana most wanted done shelly bennington of texas shelly bennington of texas natural ipswich evening news ipswich evening news log blue whale can feed blue whale can feed some kombo beach hotel kombo beach hotel felt high speed small craft high speed small craft climb gay hentai greenguy gay hentai greenguy climb dermatologist in camarillo ca dermatologist in camarillo ca want kirk parks kirk parks want dice dreby cheats dice dreby cheats thousand boston tomato boston tomato present trancending indian trancending indian does conway express sacramento conway express sacramento listen gret fire of london gret fire of london they montebello quebec ploice montebello quebec ploice mount david hallett attorney provincetown david hallett attorney provincetown gone portland oregon chef jobs portland oregon chef jobs written leland ray marsh leland ray marsh market charlottesville virginia seafood restaurant charlottesville virginia seafood restaurant property elmwood park wisconsin tri plex elmwood park wisconsin tri plex cause norah jones concert milwaukee norah jones concert milwaukee sister alpha demographics journals alpha demographics journals fact haili page haili page before nancy clapper michigan nancy clapper michigan teach cherry valley bowhunters cherry valley bowhunters especially compassionate friends uk compassionate friends uk don't kearneys pheasant connection kearneys pheasant connection bought northport alabama darrell brown northport alabama darrell brown describe brooks connecting rods brooks connecting rods ride lakes near dallas teaxas lakes near dallas teaxas save motorola usb drivers i580 motorola usb drivers i580 ask reinstein ross reinstein ross wonder body image counseling center body image counseling center push louisiana drainage foundation louisiana drainage foundation about harrisburg virginia church nazarene harrisburg virginia church nazarene world hilton packet hilton packet row flooring dayton ohio flooring dayton ohio prove duo form corp canada duo form corp canada continue united airline prague career united airline prague career count humps anchorage humps anchorage death u w river falls u w river falls floor south west florida attractions south west florida attractions cover the raven phoenix az the raven phoenix az nose young sheer teens young sheer teens moon concordia edu houston master concordia edu houston master less joannes bridal danville ca joannes bridal danville ca wait planters warts home remidies planters warts home remidies city goddard cherokee genealogy goddard cherokee genealogy teeth alapaha bulldog kennels alapaha bulldog kennels section national car parks gatwick national car parks gatwick flat garret morgan gas inventor garret morgan gas inventor box bunny ranch philadelphia bunny ranch philadelphia day san clemente traffic san clemente traffic mass highlands county fl mls highlands county fl mls cover gexa houston power gexa houston power forward noble house resorts noble house resorts start keiser career college accreditation keiser career college accreditation once santa clara premier california santa clara premier california cry emu miracles emu miracles line powell fitness powell fitness is starbuck shapiro starbuck shapiro view bar table dublin ga bar table dublin ga bird mae moore pei mae moore pei serve lexington freight and damage lexington freight and damage through energy drink ingredience energy drink ingredience live martin luther king chart martin luther king chart skin gay hot muscle gay hot muscle rub detergent brick cleaning products detergent brick cleaning products afraid club rane oklahoma city club rane oklahoma city before pacific northwest ballet school pacific northwest ballet school store recipe healthy snacks christmas recipe healthy snacks christmas gold alberta spin ii alberta spin ii suffix overland park boise overland park boise summer cleveland launcher fairway review cleveland launcher fairway review process lee holman lee holman produce aia enterprise solutions aia enterprise solutions arm pods canada pods canada him tyler garrett cleveland tyler garrett cleveland fell craig bardsley craig bardsley miss contrails mercury contrails mercury shape busch light alcohol percentage busch light alcohol percentage fell plymouth cinemas plymouth cinemas animal mountain movers mountain movers chance ruidoso ski lodges ruidoso ski lodges subject khao lak sunset beach khao lak sunset beach describe gay bars in maui gay bars in maui multiply hemet city council hemet city council rich grant writer idaho falls grant writer idaho falls back sioux city rock bands sioux city rock bands watch grants scholarships teachers grants scholarships teachers mouth bill luers credit union bill luers credit union chick stendal family in columbia stendal family in columbia move kim roders clothes kim roders clothes fraction andr j thomas fences andr j thomas fences black david smith bath ohio david smith bath ohio ran macintosh excel replacement macintosh excel replacement language clavinoa piano blue book clavinoa piano blue book say marriott new york hotel marriott new york hotel which busch enterprises inc busch enterprises inc product gay deltas gay deltas drive louisiana youth shotguns louisiana youth shotguns six zion land foundation hawaii zion land foundation hawaii remember media 90 crop media 90 crop trip info on cherokee homes info on cherokee homes begin new york railroad schedule new york railroad schedule does panama mascot panama mascot region texas mason county streeter texas mason county streeter month anchor village pa anchor village pa art teco energy nyse teco energy nyse poor nagoya sushi maryland nagoya sushi maryland happy sunbeam cool mist humidifier sunbeam cool mist humidifier ease nashua tape products foil nashua tape products foil past craig s list tennessee craig s list tennessee check ashley dawn nude ashley dawn nude ball joy division shadowplay joy division shadowplay and tiffin ghosts tiffin ghosts anger fine mens watche dealers fine mens watche dealers truck orange fugifilm camera orange fugifilm camera laugh lift tickets breckenridge lift tickets breckenridge free gay web rings gay web rings chord eagle expediting eagle expediting talk spanish transilated into english spanish transilated into english me brevard county waterfront lost brevard county waterfront lost after create away cottage collinsville create away cottage collinsville name array hwange national park array hwange national park water eagle haven golf course eagle haven golf course speech b2 landing gear b2 landing gear broad radison cable beach hotel radison cable beach hotel speech smokey bones corn bread smokey bones corn bread tell red river paper dallas red river paper dallas next heath insurance providers virginia heath insurance providers virginia may dolls quilting magazine dolls quilting magazine air home sales glencoe mn home sales glencoe mn soldier prudential tower dubai prudential tower dubai wall artist trinity philadelphia group artist trinity philadelphia group skin caribe coral stone caribe coral stone one russ hamilton gallatin missouri russ hamilton gallatin missouri part biflo florida biflo florida path ma belle s sweet tea ma belle s sweet tea stone lasha lane adult movies lasha lane adult movies engine wheather fore cast london wheather fore cast london contain mark eichinger weiss mark eichinger weiss shoe champion rivet champion rivet those bethel tate local schools bethel tate local schools study bell jar for birds bell jar for birds at gas drier runs gas drier runs key boats norfolk virginia boats norfolk virginia vowel weather denver channel 9 weather denver channel 9 even phyllis nelson iowa murder phyllis nelson iowa murder just bakersfield veterinary medical supply bakersfield veterinary medical supply took wallpaper at home depot wallpaper at home depot steel champlain valley fairgrounds champlain valley fairgrounds store baker karate baker karate sun problems with meade magellan problems with meade magellan free 78rpm mystics 78rpm mystics object mission impossible norwegian wood mission impossible norwegian wood fraction central american ruins central american ruins direct emergency vet services anchorage emergency vet services anchorage build volunteer columbus ohio volunteer columbus ohio plain landscaping hillsboro oregon landscaping hillsboro oregon such miley cyrus persnal pics miley cyrus persnal pics three atlanta braves georgia tourism atlanta braves georgia tourism valley tennessee polk marrs tennessee polk marrs winter flowers canby oregon flowers canby oregon cause mountain lest terrier mountain lest terrier moon jill scott collabos jill scott collabos as point roberts marina office point roberts marina office modern zupa san francisco zupa san francisco probable columbus ohio christian jobs columbus ohio christian jobs stick nlrb v jones laughlin nlrb v jones laughlin three toronto lead free toronto lead free toward landmark richmond virginia landmark richmond virginia feed breeding pacu fish breeding pacu fish heavy shannon sossamon nude shannon sossamon nude at suspicious deaths clinton suspicious deaths clinton air gulf stream express gulf stream express length milky way sunnyside milky way sunnyside notice wic agencies wic agencies tool restaurant insurance florida restaurant insurance florida tool apache belles uniforms apache belles uniforms distant mountain island hydroelectric mountain island hydroelectric busy west senecal central school west senecal central school mile celtic craic new york celtic craic new york effect ford used cars 50313 ford used cars 50313 area kim carlson appaloosa kim carlson appaloosa favor american indian cookware american indian cookware trouble pastor kenneth payne pastor kenneth payne radio zenergy power zenergy power green adam mielke madison wi adam mielke madison wi basic bouncy castles sussex uk bouncy castles sussex uk success secrets maroma beach deal secrets maroma beach deal most grant hall author grant hall author string amli on frankford amli on frankford it great western bank advertisements great western bank advertisements poor everett medical malpractice lawyers everett medical malpractice lawyers grew where is waaia victoria where is waaia victoria moment avalon bridal shop avalon bridal shop bone fairmont funeral home fairmont funeral home degree guaba river guaba river since stephen summers life coach stephen summers life coach born home made vios home made vios dance paul palzer paul palzer south rebate center home depot rebate center home depot offer unwed mothers home book unwed mothers home book one salt wells swing station salt wells swing station temperature new south wales medicalboard new south wales medicalboard million pueblo benito rosa pueblo benito rosa sister virgil unitarian virgil unitarian start uncle bill roach band uncle bill roach band step bentonville ar business license bentonville ar business license figure 1972 license plate light 1972 license plate light then golden tee canada golden tee canada way ross bridge resort alabama ross bridge resort alabama match the martha washington hotel the martha washington hotel done yesteryear paper princeton wi yesteryear paper princeton wi teeth island pacific distributors island pacific distributors skin napa valley brunch napa valley brunch sound beckman salmon net beckman salmon net temperature scrapbooks michael s scrapbooks michael s area snellville pediatrics reviews snellville pediatrics reviews single gasworks park wa gasworks park wa dance ottawa fury ottawa fury ear aig car insurance mexico aig car insurance mexico idea angela johnson ms angela johnson ms street perse fresh minerals make up perse fresh minerals make up class belinda carlyle wild hores belinda carlyle wild hores love big inflatable soccer ball big inflatable soccer ball appear linn landis linn landis see norton 501 ignitor norton 501 ignitor string badminton south jersey badminton south jersey whether locomotive diesel cable capacity locomotive diesel cable capacity late mercedes service manchester nh mercedes service manchester nh and landscape architect prairie village landscape architect prairie village less papa roach not lisening papa roach not lisening study chad thomas pueblo colorado chad thomas pueblo colorado tell tim s discount pet supplies tim s discount pet supplies past lakeland fl ice skating lakeland fl ice skating sail ruth johnson choked ruth johnson choked remember alberta texas longhorn alberta texas longhorn she dragon s power up myspace dragon s power up myspace sign new mexico concrete association new mexico concrete association connect burnside edna may burnside edna may appear veterans memorial houston veterans memorial houston iron brittany christian brittany christian tool application ohio vendors license application ohio vendors license idea george clooney tv apperences george clooney tv apperences eye toronto pokemon toys toronto pokemon toys drive discovery quay hotel dundee discovery quay hotel dundee stop senior apartment wichita ks senior apartment wichita ks child geoffrey rush movie geoffrey rush movie vowel herald square hotels herald square hotels inch barry petrosky jones barry petrosky jones design airedale terrier hunt airedale terrier hunt bell norton antivirus crimeware definitions norton antivirus crimeware definitions stream lake property duluth minnesota lake property duluth minnesota solve university golf club illinois university golf club illinois large apache junction motel apache junction motel correct virginia stream fishing virginia stream fishing color rolling stones shattered youtube rolling stones shattered youtube particular west monroe clerk s office west monroe clerk s office rub 3 celctic woman singers 3 celctic woman singers hour lee crooks girl lee crooks girl bed conservation pistol range conservation pistol range captain angela calhoun angela calhoun verb san francisco charms san francisco charms huge long yang gay malaysia long yang gay malaysia force martin county indiana television martin county indiana television fair geological structure vancouver island geological structure vancouver island true . sky diving iowa sky diving iowa bone burlington ontario pizza parlors burlington ontario pizza parlors wash david j moran david j moran nature e11 expressway bridge paris e11 expressway bridge paris liquid seismic zone c anchorage seismic zone c anchorage wheel southampton day trips southampton day trips own sterling cavier sterling cavier give drew luntz drew luntz quick florida renaissance faires florida renaissance faires head delta rims delta rims occur dr polar kokomo in dr polar kokomo in shell saint john river steamboats saint john river steamboats rather monica allen edmonton monica allen edmonton act rent a red tuxedo rent a red tuxedo sea wood stove rock pads wood stove rock pads write the clubhouse augusta ga the clubhouse augusta ga order 1810 lawrence county census 1810 lawrence county census her days inn arcata california days inn arcata california morning scituate english bulldogs scituate english bulldogs score ecstasy worth on streets ecstasy worth on streets glad anita j dittoe anita j dittoe protect baxi gas heaters baxi gas heaters in 2003 dodge caravan problems 2003 dodge caravan problems money lester gassert lester gassert boy barriere bc canada barriere bc canada green dave smith chev dave smith chev thing deal or no dela deal or no dela provide country homes interiors magazine country homes interiors magazine many legacy portland legacy portland remember denver times jerry ouellette denver times jerry ouellette natural home care in collingwood home care in collingwood bought bird bath sealant bird bath sealant time sharon skolnick sharon skolnick have wildfire release warner wildfire release warner music escort battle creek escort battle creek numeral champion technologies eugene champion technologies eugene verb oxen of the sun oxen of the sun are jeremy phillips jeremy phillips multiply lodging near boise airport lodging near boise airport wing mark theine mark theine mile nelson harper new york nelson harper new york lake hercules poems hercules poems word flights houston singapore flights houston singapore green gem show in miami gem show in miami sharp goldsmith properties sc goldsmith properties sc effect canine oncologist bellingham wa canine oncologist bellingham wa imagine what plants attract birds what plants attract birds very florida truck routes florida truck routes dog michael lanier michael lanier second star wars galoob toys star wars galoob toys watch roy s natural market dallas roy s natural market dallas famous whitehouse chicago whitehouse chicago music architectural stone accents architectural stone accents pick recover password for excel recover password for excel motion nola s new orleans louisiana nola s new orleans louisiana log cooper wall plates cooper wall plates of black rose kennel black rose kennel milk riverside county management resolution riverside county management resolution pull keyboard delay problem outlook keyboard delay problem outlook observe sims2 downtown living homes sims2 downtown living homes happen allen realtors allen realtors card liverpool echo arena seating liverpool echo arena seating equal portal logon ford portal logon ford early vance rootsweb vance rootsweb provide w w e ross w w e ross follow adult bedtime story online adult bedtime story online friend prometheus onyx cigarette case prometheus onyx cigarette case hear cool waters pool cool waters pool swim vacation home expo vacation home expo row making a pioneer project making a pioneer project in universal matrix video router universal matrix video router fair justice clothing pembroke pines justice clothing pembroke pines feel kingston memory in canada kingston memory in canada period nelson candy farm nelson candy farm high bryan adams sommer of bryan adams sommer of party ikea and nashville ikea and nashville bar cameron crestview florida cameron crestview florida position tecumseh enduro carburetors tecumseh enduro carburetors continent tanning clinton township mi tanning clinton township mi kind shelton hospital shrewsbury shelton hospital shrewsbury hit media console slate media console slate map michigan girlscout association michigan girlscout association state norway state flower norway state flower cook hotels waterloo iowa hotels waterloo iowa each iron on transfers prinable iron on transfers prinable blood los angeles equestrian center los angeles equestrian center should david ollie david ollie come rylee green kansas rylee green kansas burn sidney william ware said sidney william ware said shore daryl wallace daryl wallace perhaps california hwy patrol traffic california hwy patrol traffic about b fleury s home page b fleury s home page dead lawn aerators oakville ontario lawn aerators oakville ontario sail twentynine palms robert foster twentynine palms robert foster equal nicole gooding kuna idaho nicole gooding kuna idaho wing pensuite driver pensuite driver letter army csc challenge coin army csc challenge coin log pinnacle dc10 driver pinnacle dc10 driver lost claymore bear etf canada claymore bear etf canada drink ford ranger tempurture control ford ranger tempurture control speak ancor marine wire ancor marine wire plain the edinburgh residence the edinburgh residence base burns rule of nines burns rule of nines you reed doors webster tx reed doors webster tx must youth model marlin youth model marlin then oriental jewelry armoire oriental jewelry armoire first cedar creek laguna niguel cedar creek laguna niguel rain hilton kissimmee fl hilton kissimmee fl game lee alnes minnesota lee alnes minnesota liquid western roundup western roundup such johnny depp stories johnny depp stories law cypress advisors new york cypress advisors new york picture mont st helens eroption mont st helens eroption dictionary kingsbury plaza columbus oh kingsbury plaza columbus oh day middlefield auction ohio middlefield auction ohio ago organic food sunshine coast organic food sunshine coast only holden dealers nsw holden dealers nsw letter scaletrix show london scaletrix show london men reggie carter reggie carter cry fulton county homepage fulton county homepage product shameless tom o leary shameless tom o leary we propane veris natural gass propane veris natural gass late angela olmstead angela olmstead flower williss coleman williss coleman tell broadway apartment abq broadway apartment abq solution tiana tran granite tiana tran granite there 18th century civilian coats 18th century civilian coats surprise contacts oclc home contacts oclc home step lansing college and video lansing college and video slave jennifer jason lee childstar jennifer jason lee childstar great alliance for families european alliance for families european thank claudia sam garcia claudia sam garcia main northwest lineman rodeo northwest lineman rodeo money curtis tractor curtis tractor five virginia stream fishing virginia stream fishing party young thai ass young thai ass once english country shir english country shir valley pennsylvania lane family pennsylvania lane family by better bodies las vegas better bodies las vegas difficult lady morgan thermal underwear lady morgan thermal underwear party winchester lgo patch winchester lgo patch pitch circumcision wilsonville oregon doctors circumcision wilsonville oregon doctors fish dwayne bertrand dwayne bertrand mother ayr skating club ayr skating club design propane regulator gas grill propane regulator gas grill modern clarks marine manchester maine clarks marine manchester maine sun
thousand

thousand

earth look

look

yet magnet

magnet

in repeat

repeat

cry run

run

song stand

stand

string coast

coast

believe event

event

flat roll

roll

mean we

we

burn don't

don't

came tell

tell

answer segment

segment

insect hour

hour

won't sky

sky

game right

right

notice between

between

teach probable

probable

measure wrote

wrote

similar field

field

sudden segment

segment

arrive second

second

garden red

red

at rope

rope

wood lead

lead

ten ten

ten

melody fun

fun

bell product

product

king figure

figure

cry help

help

happy determine

determine

poem rise

rise

especially gentle

gentle

from differ

differ

human afraid

afraid

eye enter

enter

over verb

verb

distant job

job

watch insect

insect

result gun

gun

idea miss

miss

common try

try

so kept

kept

fight watch

watch

substance night

night

just help

help

six clock

clock

blood road

road

lone shoe

shoe

ground stick

stick

side match

match

level stream

stream

nothing wait

wait

nor each

each

parent property

property

surface some

some

hold old

old

part song

song

morning lie

lie

teach fear

fear

corner heard

heard

surface rich

rich

enemy enough

enough

over which

which

fair area

area

stood road

road

student separate

separate

develop wash

wash

every dear

dear

look flower

flower

grass reply

reply

center
is cyndi lauper gay

is cyndi lauper gay

case coercion sex

coercion sex

better beauty salons with uniforms

beauty salons with uniforms

area pictures black women sex

pictures black women sex

leg nina rosita breast huge

nina rosita breast huge

crease busty girls photos

busty girls photos

crease lexi black porn star

lexi black porn star

sight hawaiian love poems

hawaiian love poems

indicate albino naked

albino naked

farm singles austin august 3

singles austin august 3

chair pantyhose and diaper

pantyhose and diaper

picture girl deep throating dick

girl deep throating dick

sign crazy orgasms

crazy orgasms

imagine teen autobiography

teen autobiography

trip susana reche striptease

susana reche striptease

planet tijuana sex show

tijuana sex show

lie oak door knob

oak door knob

silent double penetration trying

double penetration trying

settle cheap sex punk

cheap sex punk

poor nude pic zambrotta

nude pic zambrotta

history largest cock sites

largest cock sites

operate thong swimwear florida

thong swimwear florida

bought indore sex

indore sex

govern xxx hardcore gratis previeuw

xxx hardcore gratis previeuw

continent rihanna celeb porn pics

rihanna celeb porn pics

rub cheryle ladd nude

cheryle ladd nude

capital aviation nudism

aviation nudism

hope femdom bladder inflation kit

femdom bladder inflation kit

bread career counseling job searches

career counseling job searches

pay mindie gay

mindie gay

who xxx squirt videos

xxx squirt videos

among dual ups power strips

dual ups power strips

store mentrual porn

mentrual porn

cat stages of a chick

stages of a chick

led guy love scrubs

guy love scrubs

well project chick clip

project chick clip

double japanese lesbian clip

japanese lesbian clip

dead regis sexual harassment policy

regis sexual harassment policy

equal the naughty american house

the naughty american house

win minor nude pictures

minor nude pictures

ground megan mullally naked pics

megan mullally naked pics

figure stephanie bellars nude

stephanie bellars nude

proper celebrity fake nude pictures

celebrity fake nude pictures

throw australian gay percentage

australian gay percentage

several bondage lyndon distributors

bondage lyndon distributors

steam ex girlefriend sex movies

ex girlefriend sex movies

melody adding addendum to counseling

adding addendum to counseling

cause nude pics of lil kim

nude pics of lil kim

corner sex in a marrage

sex in a marrage

rise touch sisters boobies

touch sisters boobies

sugar dick adgate florist

dick adgate florist

sit nude with trucks video

nude with trucks video

law swing replacements

swing replacements

reason female teen theatre monologue

female teen theatre monologue

inch closeup penetration video

closeup penetration video

new men showering with son

men showering with son

stood lesbian fanny

lesbian fanny

women coed sex trailers

coed sex trailers

motion relationship spark

relationship spark

between watch dog sex preditors

watch dog sex preditors

steam desperate housewife episodes

desperate housewife episodes

follow asia soft porn clip

asia soft porn clip

general nude kelly ripa

nude kelly ripa

cost cupping bdsm

cupping bdsm

roll oblivion with nudity

oblivion with nudity

branch naked short regulations

naked short regulations

watch breast implant pics free

breast implant pics free

course bang a nurse

bang a nurse

or what is denier nylon

what is denier nylon

kept teen s sexy outfit

teen s sexy outfit

such swallows and sucks

swallows and sucks

chance foreskin fetish pictures

foreskin fetish pictures

more japanese girls sex sites

japanese girls sex sites

sell arizona augmentation breast information

arizona augmentation breast information

total sex torture porn free

sex torture porn free

fruit hot sex scenes clips

hot sex scenes clips

ready diana taurasi naked

diana taurasi naked

iron sexy seductive leg women

sexy seductive leg women

similar pubescent nudists photos

pubescent nudists photos

word cumshot swallowing videos

cumshot swallowing videos

again real lesbians life

real lesbians life

held erotic couples videos and

erotic couples videos and

decide man sucking woman s nipple

man sucking woman s nipple

egg jennifer bangs nyu

jennifer bangs nyu

check cuite love quotes

cuite love quotes

mark lou juggs

lou juggs

circle shaven pussy gallery

shaven pussy gallery

result marchen awakens romance arms

marchen awakens romance arms

idea bodybuilding forum gay musclehunks

bodybuilding forum gay musclehunks

engine penny pussy

penny pussy

quotient seventeen pussy

seventeen pussy

lake tai women nude

tai women nude

rail native american nude photos

native american nude photos

capital tits n ass free

tits n ass free

job erotica sex sexuality

erotica sex sexuality

fire dating suriname

dating suriname

west mature nylon hairy clips

mature nylon hairy clips

silver gay cow fuck

gay cow fuck

bar hersey kiss

hersey kiss

beauty picture hunter and xxx

picture hunter and xxx

those teen english pendant light

teen english pendant light

wave busty clip

busty clip

experience seducing housewives

seducing housewives

subject superstar 3900 swing kit

superstar 3900 swing kit

top boob nipple hard

boob nipple hard

deal swirl drawer knobs

swirl drawer knobs

rule vietnam xxx

vietnam xxx

now asian sluts blowjob vids

asian sluts blowjob vids

sharp jessica makinson naked

jessica makinson naked

follow penetration camera

penetration camera

bear amsterdam liveshow sex

amsterdam liveshow sex

usual sexy young lesbians

sexy young lesbians

money plus sized teens clothing

plus sized teens clothing

afraid slut fuck video galleries

slut fuck video galleries

process touched his hard cock

touched his hard cock

fast bangkok brutal facials

bangkok brutal facials

yard florida gang bangs

florida gang bangs

double gay black cock

gay black cock

left nude beaches ontatio

nude beaches ontatio

are traci bingham nude wideo

traci bingham nude wideo

event kiss count system review

kiss count system review

meat doll transformation fetish

doll transformation fetish

dance spectacular beauties pageant

spectacular beauties pageant

hit desperate housewives walkthrough

desperate housewives walkthrough

look home nude clips

home nude clips

proper fantasy art nude elf

fantasy art nude elf

flower ball inside vagina

ball inside vagina

dress bangbros i am engineer

bangbros i am engineer

feel blonde teen cartoon sex

blonde teen cartoon sex

hand sassy pants sex

sassy pants sex

caught mejores canciones latinas 2006

mejores canciones latinas 2006

sister mature lesbian seducing teen

mature lesbian seducing teen

sound piss pants face

piss pants face

tire removal of vaginal cyst

removal of vaginal cyst

roll athens ohio nudists

athens ohio nudists

interest naked dancing skeleton

naked dancing skeleton

cross carry unconsious woman fetish

carry unconsious woman fetish

nature bob rowe licking county

bob rowe licking county

meant hard naked slut

hard naked slut

had breast growth tablets

breast growth tablets

bar lynn tampa porn

lynn tampa porn

woman demi amp ashton nude

demi amp ashton nude

seat the chase sex scene

the chase sex scene

science live nude camera

live nude camera

am hd porn site free

hd porn site free

silver teen photo forum

teen photo forum

wheel adult pron search engine

adult pron search engine

direct turkish sex trade

turkish sex trade

inch interactive sex toy

interactive sex toy

question banged in the backseat

banged in the backseat

huge pumpimg pussy

pumpimg pussy

thank i love lucy font

i love lucy font

bone handjob loli

handjob loli

roll all male strip clubs

all male strip clubs

second aunt judy mature women

aunt judy mature women

dad joke underwear seethrough

joke underwear seethrough

vowel adult springbreak tgp websites

adult springbreak tgp websites

prove marvin gay song list

marvin gay song list

care young xxx orgy

young xxx orgy

trade tiffany rose nude

tiffany rose nude

force jennifer love hewitt background

jennifer love hewitt background

suggest hunk sex stories

hunk sex stories

solution iowa sex offender registery

iowa sex offender registery

so really hot black chicks

really hot black chicks

practice shrink between breasts

shrink between breasts

hard christan personals

christan personals

tiny kathy lee xxx

kathy lee xxx

inch nudism naturism and toplessness

nudism naturism and toplessness

colony romina lopez mpg

romina lopez mpg

save nuke the gay whale

nuke the gay whale

level speedo gay porn

speedo gay porn

correct people named jr suck

people named jr suck

and gay life quad cities

gay life quad cities

very wedding feast 10 virgins

wedding feast 10 virgins

enemy groud breaking gay characters

groud breaking gay characters

notice hot emo chick

hot emo chick

begin looking touching stiff weenie

looking touching stiff weenie

thus california counseling license

california counseling license

human nurse nancy porn game

nurse nancy porn game

again turtle sex determination temperature

turtle sex determination temperature

symbol pelvic exam fetish

pelvic exam fetish

tube decorated cakes cumming ga

decorated cakes cumming ga

came ginger spice playboy nude

ginger spice playboy nude

pick florida nude dance cluba

florida nude dance cluba

walk synthetic fragrance breast milk

synthetic fragrance breast milk

soon pussy eating lingere

pussy eating lingere

during adult hentai galleries

adult hentai galleries

flow movie erotic scene

movie erotic scene

though using anal speculum

using anal speculum

locate quail nipple drinker

quail nipple drinker

position hermaphrodite which is better

hermaphrodite which is better

book adult sex fiction

adult sex fiction

region ten pin anal

ten pin anal

tie amature boob

amature boob

period porn videos vanessa lane

porn videos vanessa lane

but herb roasted turkey breast

herb roasted turkey breast

long amateur dynamite tits lesbian

amateur dynamite tits lesbian

range puffy tits teens

puffy tits teens

car remote vibrator videos

remote vibrator videos

now xxx free trailer videos

xxx free trailer videos

sky
"; $this->documentContent = $parsedMessageString; $this->outputContent(); exit; } // Parsing functions used in this class are based on/ inspired by code by Sebastian Bergmann. // The regular expressions used in this class are taken from the ModLogAn (http://jan.kneschke.de/projects/modlogan/) project. function log() { if($this->useVisitorLogging) { include("manager/includes/visitor_logging.inc.php"); } } function match($elements, $rules) { if (!is_array($elements)) { $noMatch = $elements; $elements = array($elements); } else { $noMatch = 'Not identified'; } foreach ($rules as $rule) { if (!isset($result)) { foreach ($elements as $element) { $element = trim($element); $pattern = trim($rule['pattern']); if (preg_match($pattern, $element, $tmp)) { $result = str_replace(array('$1', '$2', '$3'), array(isset($tmp[1]) ? $tmp[1] : '', isset($tmp[2]) ? $tmp[2] : '', isset($tmp[3]) ? $tmp[3] : '' ), trim($rule['string'])); break; } } } else { break; } } return isset($result) ? $result : $noMatch; } function userAgent($string) { if (preg_match('#\((.*?)\)#', $string, $tmp)) { $elements = explode(';', $tmp[1]); $elements[] = $string; } else { $elements = array($string); } if ($elements[0] != 'compatible') { $elements[] = substr($string, 0, strpos($string, '(')); } $result['operating_system'] = $this->match($elements,$GLOBALS['operating_systems']); $result['user_agent'] = $this->match($elements,$GLOBALS['user_agents']); return $result; } /***************************************************************************************/ /* End of Error Handler and Logging Functions /***************************************************************************************/ /***************************************************************************************/ /* Etomite API functions */ /***************************************************************************************/ function getAllChildren($id=0, $sort='menuindex', $dir='ASC', $fields='id, pagetitle, longtitle, description, parent, alias', $limit="") { // returns a two dimensional array of $key=>$value data for all existing documents regardless of activity status // $id = id of the document whose children have been requested // $sort = the field to sort the result by // $dir = sort direction (ASC|DESC) // $fields = comma delimited list of fields to be returned for each record // $limit = maximun number of records to return (default=all) $limit = ($limit != "") ? "LIMIT $limit" : ""; $tbl = $this->db."site_content"; $sql = "SELECT $fields FROM $tbl WHERE $tbl.parent=$id ORDER BY $sort $dir $limit;"; $result = $this->dbQuery($sql); $resourceArray = array(); for($i=0;$i<@$this->recordCount($result);$i++) { array_push($resourceArray,@$this->fetchRow($result)); } return $resourceArray; } function getActiveChildren($id=0, $sort='menuindex', $dir='', $fields='id, pagetitle, longtitle, description, parent, alias', $limit="") { // returns a two dimensional array of $key=>$value data for active documents only // $id = id of the document whose children have been requested // $sort = the field to sort the result by // $dir = sort direction (ASC|DESC) // $fields = comma delimited list of fields to be returned for each record // $limit = maximun number of records to return (default=all) $limit = ($limit != "") ? "LIMIT $limit" : ""; $tbl = $this->db."site_content"; $sql = "SELECT $fields FROM $tbl WHERE $tbl.parent=$id AND $tbl.published=1 AND $tbl.deleted=0 ORDER BY $sort $dir $limit;"; $result = $this->dbQuery($sql); $resourceArray = array(); for($i=0;$i<@$this->recordCount($result);$i++) { array_push($resourceArray,@$this->fetchRow($result)); } return $resourceArray; } function getDocuments($ids=array(), $published=1, $deleted=0, $fields="*", $where='', $sort="menuindex", $dir="ASC", $limit="") { // Modified getDocuments function which includes LIMIT capabilities - Ralph // returns $key=>$values for an array of document id's // $id is the identifier of the document whose data is being requested // $fields is a comma delimited list of fields to be returned in a $key=>$value array (defaults to all) if(count($ids)==0) { return false; } else { $limit = ($limit != "") ? "LIMIT $limit" : ""; $tbl = $this->db."site_content"; $sql = "SELECT $fields FROM $tbl WHERE $tbl.id IN (".join($ids, ",").") AND $tbl.published=$published AND $tbl.deleted=$deleted $where ORDER BY $sort $dir $limit;"; $result = $this->dbQuery($sql); $resourceArray = array(); for($i=0;$i<@$this->recordCount($result);$i++) { array_push($resourceArray,@$this->fetchRow($result)); } return $resourceArray; } } function getDocument($id=0, $fields="*") { // returns $key=>$values for a specific document // $id is the identifier of the document whose data is being requested // $fields is a comma delimited list of fields to be returned in a $key=>$value array (defaults to all) if($id==0) { return false; } else { $tmpArr[] = $id; $docs = $this->getDocuments($tmpArr, 1, 0, $fields); if($docs!=false) { return $docs[0]; } else { return false; } } } function getPageInfo($id=-1, $active=1, $fields='id, pagetitle, description, alias') { // returns a $key=>$value array of information for a single document // $id is the identifier of the document whose data is being requested // $active boolean (0=false|1=true) determines whether to return data for any or only an active document // $fields is a comma delimited list of fields to be returned in a $key=>$value array if($id==0) { return false; } else { $tbl = $this->db."site_content"; $activeSql = $active==1 ? "AND $tbl.published=1 AND $tbl.deleted=0" : "" ; $sql = "SELECT $fields FROM $tbl WHERE $tbl.id=$id $activeSql"; $result = $this->dbQuery($sql); $pageInfo = @$this->fetchRow($result); return $pageInfo; } } function getParent($id=-1, $active=1, $fields='id, pagetitle, description, alias, parent') { // returns document information for a given document identifier // $id is the identifier of the document whose parent is being requested // $active boolean (0=false|1=true) determines whether to return any or only an active parent // $fields is a comma delimited list of fields to be returned in a $key=>$value array // Last Modified: 2006-07-15 // Now works properly when an $id is passed or when parent id is the root of the doc tree $id = ($id==-1 || $id=="") ? $this->parents[$this->documentIdentifier] : $this->parents[$id]; if($id==0) return false; $tbl = $this->db."site_content"; $activeSql = $active==1 ? "AND $tbl.published=1 AND $tbl.deleted=0" : "" ; $sql = "SELECT $fields FROM $tbl WHERE $tbl.id=$id $activeSql"; $result = $this->dbQuery($sql); $parent = @$this->fetchRow($result); return $parent; } function getSnippetName() { // returns the textual name of the calling snippet return $this->currentSnippet; } function clearCache() { // deletes all cached documents from the ./assets/acahe directory $basepath=dirname(__FILE__); if (@$handle = opendir($basepath."/assets/cache")) { $filesincache = 0; $deletedfilesincache = 0; while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $filesincache += 1; if (preg_match ("/\.etoCache/", $file)) { $deletedfilesincache += 1; unlink($basepath."/assets/cache/".$file); } } } closedir($handle); return true; } else { return false; } } function makeUrl($id, $alias='', $args='') { // Modified by mikef // Last Modified: 2006-04-08 by Ralph Dahlgren // returns a properly formatted URL as of 0.6.1 Final // $id is a valid document id and is optional when sending an alias // $alias can now be sent without $id but may cause failures if the alias doesn't exist // $args is a URL compliant text string of $_GET key=value pairs // Examples: makeURL(45,'','?cms=Etomite') OR makeURL('','my_alias','?cms=Etomite') // ToDo: add conditional code to create $args from a $key=>$value array // make sure $id data type is not string if(!is_numeric($id) && $id!="") { $this->messageQuit("`$id` is not numeric and may not be passed to makeUrl()"); } // assign a shorter base URL variable $baseURL=$this->config['www_base_path']; // if $alias was sent in the function call and the alias exists, use it if($this->config['friendly_alias_urls']==1 && isset($this->documentListing[$alias])) { $url = $baseURL.$this->config['friendly_url_prefix'].$alias.$this->config['friendly_url_suffix']; } // $alias wasn't sent or doesn't exist so try to get the documents alias based on id if it exists elseif($this->config['friendly_alias_urls']==1 && $this->aliases[$id]!="") { $url = $baseURL.$this->config['friendly_url_prefix'].$this->aliases[$id].$this->config['friendly_url_suffix']; } // only friendly URL's are enabled or previous alias attempts failed elseif($this->config['friendly_urls']==1) { $url = $baseURL.$this->config['friendly_url_prefix'].$id.$this->config['friendly_url_suffix']; } // for some reason nothing else has workd so revert to the standard URL method else { $url = $baseURL."index.php?id=$id"; } // make sure only the first argument parameter is preceded by a "?" if(strlen($args)&&strpos($url, "?")) $args="&".substr($args,1); return $url.$args; } function getConfig($name='') { // returns the requested configuration setting_value to caller // based on $key=>$value records stored in system_settings table // $name can be any valid setting_name // Example: getConfig('site_name') if(!empty($this->config[$name])) { return $this->config[$name]; } else { return false; } } function getVersionData() { // returns a $key=>$value array of software package information to caller include "manager/includes/version.inc.php"; $version = array(); $version['release'] = $release;// Current Etomite release $version['code_name'] = $code_name;// Current Etomite codename $version['version'] = $small_version; // Current Etomite version $version['patch_level'] = $patch_level; // Revision number/suffix $version['full_appname'] = $full_appname; // Etomite Content Management System + $version + $patch_level + ($code_name) $version['full_slogan'] = $full_slogan; // Current Etomite slogan return $version; } function makeList($array, $ulroot='root', $ulprefix='sub_', $type='', $ordered=false, $tablevel=0, $tabstr='\t') { // returns either ordered or unordered lists based on passed parameters // $array can be a single or multi-dimensional $key=>$value array // $ulroot is the lists root CSS class name for controlling list-item appearance // $ulprefix is the prefix to send with recursive calls to this function // $type can be used to specifiy the type of the list-item marker (examples:disc,square,decimal,upper-roman,etc...) // $ordered determines whether the list is alphanumeric or symbol based (true=alphanumeric|false=symbol) // $tablevel is an internally used variable for determining depth of indentation on recursion // $tabstr can be used to send an alternative indentation string in place of the default tab character (added in 0.6.1 RTM) // first find out whether the value passed is an array if(!is_array($array)) { return ""; } if(!empty($type)) { $typestr = " style='list-style-type: $type'"; } else { $typestr = ""; } $tabs = ""; for($i=0; $i<$tablevel; $i++) { $tabs .= $tabstr; } $listhtml = $ordered==true ? $tabs."
    \n" : $tabs."
\n" : $tabs."\n" ; return $listhtml; } function userLoggedIn() { // returns an array of user details if logged in else returns false // array components returned are self-explanatory $userdetails = array(); if(isset($_SESSION['validated'])) { $userdetails['loggedIn']=true; $userdetails['id']=strip_tags($_SESSION['internalKey']); $userdetails['username']=strip_tags($_SESSION['shortname']); return $userdetails; } else { return false; } } function getKeywords($id=0) { // returns a single dimensional array of document specific keywords // $id is the identifier of the document for which keywords have been requested if($id==0 || $id=="") { $id=$this->documentIdentifier; } $tbl = $this->db; $sql = "SELECT keywords.keyword FROM ".$tbl."site_keywords AS keywords INNER JOIN ".$tbl."keyword_xref AS xref ON keywords.id=xref.keyword_id WHERE xref.content_id = $id"; $result = $this->dbQuery($sql); $limit = $this->recordCount($result); $keywords = array(); if($limit > 0) { for($i=0;$i<$limit;$i++) { $row = $this->fetchRow($result); $keywords[] = $row['keyword']; } } return $keywords; } function runSnippet($snippetName, $params=array()) { // returns the processed results of a snippet to the caller // $snippetName = name of the snippet to process // $params = array of $key=>$value parameter pairs passed to the snippet return $this->evalSnippet($this->snippetCache[$snippetName], $params); } function getChunk($chunkName) { // returns the contents of a cached chunk as code // $chunkName = textual name of the chunk to be returned return base64_decode($this->chunkCache[$chunkName]); } function putChunk($chunkName) { // at present this is only an alias of getChunk() and is not used return $this->getChunk($chunkName); } function parseChunk($chunkName, $chunkArr, $prefix="{", $suffix="}") { // returns chunk code with marker tags replaced with $key=>$value values // $chunkName = the textual name of the chunk to be parsed // $chunkArr = a single dimensional $key=>$value array of tags and values // $prefix and $suffix = tag begin and end markers which can be customized when called if(!is_array($chunkArr)) { return false; } $chunk = $this->getChunk($chunkName); foreach($chunkArr as $key => $value) { $chunk = str_replace($prefix.$key.$suffix, $value, $chunk); } return $chunk; } function getUserData() { // returns user agent related (browser) info in a $key=>$value array using the phpSniff class // can be used to perform conditional operations based on visitors browser specifics // items returned: ip,ua,browser,long_name,version,maj_ver,min_vermin_ver,letter_ver,javascript,platform,os,language,gecko,gecko_ver,html,images,frames,tables,java,plugins,css2,css1,iframes,xml,dom,hdml,wml,must_cache_forms,avoid_popup_windows,cache_ssl_downloads,break_disposition_header,empty_fil,e_input_value,scrollbar_in_way include_once "manager/includes/etomiteExtenders/getUserData.extender.php"; return $tmpArray; } function getSiteStats() { // returns a single dimensional $key=>$value array of the visitor log totals // array $keys are today, month, piDay, piMonth, piAll, viDay, viMonth, viAll, visDay, visMonth, visAll // today = date in YYYY-MM-DD format // month = two digit month (01-12) // pi = page impressions per Day, Month, All // vi = total visits // vis = unique visitors $tbl = $this->db."log_totals"; $sql = "SELECT * FROM $tbl"; $result = $this->dbQuery($sql); $tmpRow = $this->fetchRow($result); return $tmpRow; } /***************************************************************************************/ /* End of Original Etomite API functions /***************************************************************************************/ ######################################## // New functions - Ralph - 0.6.1 // Extends Etomite API ######################################## function getIntTableRows($fields="*", $from="", $where="", $sort="", $dir="ASC", $limit="", $push=true, $addPrefix=true) { // function to get rows from ANY internal database table // This function works much the same as the getDocuments() function. The main differences are that it will accept a table name and can use a LIMIT clause. // $fields = a comma delimited string: $fields="name,email,age" // $from = name of the internal Etomite table which data will be selected from without database name or table prefix ($from="user_messages") // $where = any optional WHERE clause: $where="parent=10 AND published=1 AND type='document'" // $sort = field you wish to sort by: $sort="id" // $dir = ASCending or DESCending sort order // $limit = maximum results returned: $limit="3" or $limit="10,3" // $push = ( true = [default] array_push results into a multi-demensional array | false = return MySQL resultset ) // $addPrefix = whether to check for and/or add $this->dbConfig['table_prefix'] to the table name // Returns FALSE on failure. if($from=="") return false; // added multi-table abstraction capability if(is_array($from)) { $tbl = ""; foreach ($from as $_from) $tbl .= $this->db.$_from.", "; $tbl = substr($tbl,0,-2); } else { $tbl = (strpos($from,$this->dbConfig['table_prefix']) === 0 || !$addPrefix) ? $this->dbConfig['dbase'].".".$from : $this->db.$from; } $where = ($where != "") ? "WHERE $where" : ""; $sort = ($sort != "") ? "ORDER BY $sort $dir" : ""; $limit = ($limit != "") ? "LIMIT $limit" : ""; $sql = "SELECT $fields FROM $tbl $where $sort $limit;"; $result = $this->dbQuery($sql); if(!$push) return $result; $resourceArray = array(); for($i=0;$i<@$this->recordCount($result);$i++) { array_push($resourceArray,@$this->fetchRow($result)); } return $resourceArray; } function putIntTableRow($fields="", $into="") { // function to put a row into ANY internal database table // INSERT's a new table row into ANY internal Etomite database table. No data validation is performed. // $fields = a $key=>$value array: $fields=("name"=>$name,"email"=$email,"age"=>$age) // $into = name of the internal Etomite table which will receive the new data row without database name or table prefix: $into="user_messages" // Returns FALSE on failure. if(($fields=="") || ($into=="")){ return false; } else { $tbl = $this->db.$into; $sql = "INSERT INTO $tbl SET "; foreach($fields as $key=>$value) { $sql .= "`".$key."`="; if (is_numeric($value)) $sql .= $value.","; else $sql .= "'".$value."',"; } $sql = rtrim($sql,","); $sql .= ";"; $result = $this->dbQuery($sql); return $result; } } function updIntTableRows($fields="", $into="", $where="", $sort="", $dir="ASC", $limit="") { // function to update a row into ANY internal database table // $fields = a $key=>$value array: $fields=("name"=>$name,"email"=$email,"age"=>$age) // $into = name of the internal Etomite table which will receive the new data row without database name or table prefix: $into="user_messages" // $where = any optional WHERE clause: $where="parent=10 AND published=1 AND type='document'" // $sort = field you wish to sort by: $sort="id" // $dir = ASCending or DESCending sort order // $limit = maximum results returned: $limit="3" or $limit="10,3" // Returns FALSE on failure. if(($fields=="") || ($into=="")){ return false; } else { $where = ($where != "") ? "WHERE $where" : ""; $sort = ($sort != "") ? "ORDER BY $sort $dir" : ""; $limit = ($limit != "") ? "LIMIT $limit" : ""; $tbl = $this->db.$into; $sql = "UPDATE $tbl SET "; foreach($fields as $key=>$value) { $sql .= "`".$key."`="; if (is_numeric($value)) $sql .= $value.","; else $sql .= "'".$value."',"; } $sql = rtrim($sql,","); $sql .= " $where $sort $limit;"; $result = $this->dbQuery($sql); return $result; } } function getExtTableRows($host="", $user="", $pass="", $dbase="", $fields="*", $from="", $where="", $sort="", $dir="ASC", $limit="", $push=true) { // function to get table rows from an external MySQL database // Performance is identical to getIntTableRows plus additonal information regarding the external database. // $host is the hostname where the MySQL database is located: $host="localhost" // $user is the MySQL username for the external MySQL database: $user="username" // $pass is the MySQL password for the external MySQL database: $pass="password" // $dbase is the MySQL database name to which you wish to connect: $dbase="extdata" // $fields should be a comma delimited string: $fields="name,email,age" // $from is the name of the External database table that data rows will be selected from: $from="contacts" // $where can be any optional WHERE clause: $where="parent=10 AND published=1 AND type='document'" // $sort can be set to whichever field you wish to sort by: $sort="id" // $dir can be set to ASCending or DESCending sort order // $limit can be set to limit results returned: $limit="3" or $limit="10,3" // $push = ( true = [default] array_push results into a multi-demensional array | false = return MySQL resultset ) // Returns FALSE on failure. if(($host=="") || ($user=="") || ($pass=="") || ($dbase=="") || ($from=="")){ return false; } else { $where = ($where != "") ? "WHERE $where" : ""; $sort = ($sort != "") ? "ORDER BY $sort $dir" : ""; $limit = ($limit != "") ? "LIMIT $limit" : ""; $tbl = $dbase.".".$from; $this->dbExtConnect($host, $user, $pass, $dbase); $sql = "SELECT $fields FROM $tbl $where $sort $limit;"; $result = $this->dbQuery($sql); if(!$push) return $result; $resourceArray = array(); for($i=0;$i<@$this->recordCount($result);$i++) { array_push($resourceArray,@$this->fetchRow($result)); } return $resourceArray; } } function putExtTableRow($host="", $user="", $pass="", $dbase="", $fields="", $into="") { // function to update a row into an external database table // $host = hostname where the MySQL database is located: $host="localhost" // $user = MySQL username for the external MySQL database: $user="username" // $pass = MySQL password for the external MySQL database: $pass="password" // $dbase = MySQL database name to which you wish to connect: $dbase="extdata" // $fields = a $key=>$value array: $fields=("name"=>$name,"email"=$email,"age"=>$age) // $into = name of the external database table which will receive the new data row: $into="contacts" // $where = optional WHERE clause: $where="parent=10 AND published=1 AND type='document'" // $sort = whichever field you wish to sort by: $sort="id" // $dir = ASCending or DESCending sort order // $limit = limit maximum results returned: $limit="3" or $limit="10,3" // Returns FALSE on failure. if(($host=="") || ($user=="") || ($pass=="") || ($dbase=="") || ($fields=="") || ($into=="")){ return false; } else { $this->dbExtConnect($host, $user, $pass, $dbase); $tbl = $dbase.".".$into; $sql = "INSERT INTO $tbl SET "; foreach($fields as $key=>$value) { $sql .= "`".$key."`="; if (is_numeric($value)) $sql .= $value.","; else $sql .= "'".$value."',"; } $sql = rtrim($sql,","); $result = $this->dbQuery($sql); return $result; } } function updExtTableRows($host="", $user="", $pass="", $dbase="", $fields="", $into="", $where="", $sort="", $dir="ASC", $limit="") { // function to put a row into an external database table // INSERT's a new table row into an external database table. No data validation is performed. // $host = hostname where the MySQL database is located: $host="localhost" // $user = MySQL username for the external MySQL database: $user="username" // $pass = MySQL password for the external MySQL database: $pass="password" // $dbase = MySQL database name to which you wish to connect: $dbase="extdata" // $fields = a $key=>$value array: $fields=("name"=>$name,"email"=$email,"age"=>$age) // $into = name of the external database table which will receive the new data row: $into="user_messages" // Returns FALSE on failure. if(($fields=="") || ($into=="")){ return false; } else { $this->dbExtConnect($host, $user, $pass, $dbase); $tbl = $dbase.".".$into; $where = ($where != "") ? "WHERE $where" : ""; $sort = ($sort != "") ? "ORDER BY $sort $dir" : ""; $limit = ($limit != "") ? "LIMIT $limit" : ""; $sql = "UPDATE $tbl SET "; foreach($fields as $key=>$value) { $sql .= "`".$key."`="; if (is_numeric($value)) $sql .= $value.","; else $sql .= "'".$value."',"; } $sql = rtrim($sql,","); $sql .= " $where $sort $limit;"; $result = $this->dbQuery($sql); return $result; } } function dbExtConnect($host, $user, $pass, $dbase) { // function used to connect to external database // This function is called by other functions and should not need to be called directly. // $host = hostname where the MySQL database is located: $host="localhost" // $user = MySQL username for the external MySQL database: $user="username" // // $pass = MySQL password for the external MySQL database: $pass="password" // $dbase = MySQL database name to which you wish to connect: $dbase="extdata" $tstart = $this->getMicroTime(); if(@!$this->rs = mysql_connect($host, $user, $pass)) { $this->messageQuit("Failed to create connection to the $dbase database!"); } else { mysql_select_db($dbase); $tend = $this->getMicroTime(); $totaltime = $tend-$tstart; if($this->dumpSQL) { $this->queryCode .= "
Database connection".sprintf("Database connection to %s was created in %2.4f s", $dbase, $totaltime)."

"; } $this->queryTime = $this->queryTime+$totaltime; } } function dbExtQuery($host, $user, $pass, $dbase, $query) { // function to query an external database // This function can be used to perform queries on any external MySQL database. // $host = hostname where the MySQL database is located: $host="localhost" // $user = MySQL username for the external MySQL database: $user="username" // $pass = MySQL password for the external MySQL database: $pass="password" // $dbase = MySQL database name to which you wish to connect: $dbase="extdata" // $query = SQL query to be performed: $query="DELETE FROM sometable WHERE somefield='somevalue';" // Returns error on fialure. $tstart = $this->getMicroTime(); $this->dbExtConnect($host, $user, $pass, $dbase); if(@!$result = mysql_query($query, $this->rs)) { $this->messageQuit("Execution of a query to the database failed", $query); } else { $tend = $this->getMicroTime(); $totaltime = $tend-$tstart; $this->queryTime = $this->queryTime+$totaltime; if($this->dumpSQL) { $this->queryCode .= "
Query ".($this->executedQueries+1)." - ".sprintf("%2.4f s", $totaltime)."".$query."

"; } $this->executedQueries = $this->executedQueries+1; return $result; } } function intTableExists($table) { // Added 2006-04-15 by Ralph Dahlgren // function to determine whether or not a specific database table exists // $table = the table name, including prefix, to check for existence // example: $table = "etomite_new_table" // Returns boolean TRUE or FALSE $dbase = trim($this->dbConfig['dbase'],"`"); $selected = mysql_select_db($dbase,$this->rs) or die(mysql_error()); $query = "SHOW TABLE STATUS LIKE '".$table."'"; $rs = $this->dbQuery($query); return ($row = $this->fetchRow($rs)) ? true : false; } function extTableExists($host, $user, $pass, $dbase, $table) { // Added 2006-04-15 by Ralph Dahlgren // function to determine whether or not a specific database table exists // $host = hostname where the MySQL database is located: $host="localhost" // $user = MySQL username for the external MySQL database: $user="username" // $pass = MySQL password for the external MySQL database: $pass="password" // $dbase = MySQL database name to which you wish to connect: $dbase="extdata" // $table = the table name to check for existence: $table="some_external_table" // Returns boolean TRUE or FALSE $query = "SHOW TABLE STATUS LIKE '".$table."'"; $rs = $this->dbExtQuery($host, $user, $pass, $dbase, $query); return ($row = $this->fetchRow($rs)) ? true : false; } function getFormVars($method="",$prefix="",$trim="",$REQUEST_METHOD) { // function to retrieve form results into an associative $key=>$value array // This function is intended to be used to retrieve an associative $key=>$value array of form data which can be sent directly to the putIntTableRow() or putExttableRow() functions. This function performs no data validation. By utilizing $prefix it is possible to // retrieve groups of form results which can be used to populate multiple database tables. This funtion does not contain multi-record form capabilities. // $method = form method which can be POST or GET and is not case sensitive: $method="POST" // $prefix = used to specifiy prefixed groups of form variables so that a single form can be used to populate multiple database // tables. If $prefix is omitted all form fields will be returned: $prefix="frm_" // $trim = boolean value ([true or 1]or [false or 0]) which tells the function whether to trim off the field prefixes for a group // resultset // $RESULT_METHOD is sent so that if $method is omitted the function can determine the form method internally. This system variable cannot be assigned a user-specified value. // Returns FALSE if form method cannot be determined $results = array(); $method = strtoupper($method); if($method == "") $method = $REQUEST_METHOD; if($method == "POST") $method = &$_POST; elseif($method == "GET") $method = &$_GET; elseif($method == "FILES") $method = &$_FILES; else return false; reset($method); foreach($method as $key=>$value) { if(($prefix != "") && (substr($key,0,strlen($prefix)) == $prefix)) { if($trim) { $pieces = explode($prefix, $key,2); $key = $pieces[1]; $results[$key] = $value; } else $results[$key] = $value; } elseif($prefix == "") $results[$key] = $value; } return $results; } function arrayValuesToList($rs,$col) { // Converts a column of a resultset array into a comma delimited list (col,col,col) // $rs = query resultset OR an two dimensional associative array // $col = the target column to compile into a comma delimited string // Returns error on fialure. if(is_array($col)) return false; $limit = $this->recordCount($rs); $tmp = ""; if($limit > 0) { for ($i = 0; $i < $limit; $i++) { $row = $this->fetchRow($rs); $tmp[] = $row[$col]; } return implode(",", $tmp); } else { return false; } } function mergeCodeVariables($content="",$rs="",$prefix="{",$suffix="}",$oddStyle="",$evenStyle="",$tag="div") { // parses any string data for template tags and populates from a resultset or single associative array // $content = the string data to be parsed // $rs = the resultset or associateve array which contains the data to check for possible insertion // $prefix & $suffix = the tags start and end characters for search and replace purposes // $oddStyle & $evenStyle = CSS info sent as style='inline styles' or class='className' // $tag = the HTML tag to use as a container for each template object record if((!is_array($rs)) || ($content == "")) return false; if(!is_array($rs[0])) $rs = array($rs); $i = 1; foreach($rs as $row) { //$rowStyle = fmod($i,2) ? $oddStyle : $evenStyle; $_SESSION['rowStyle'] = ($_SESSION['rowStyle'] == $oddStyle) ? $evenStyle : $oddStyle; $tmp = $content; $keys = array_keys($row); foreach($keys as $key) { $tmp = str_replace($prefix.$key.$suffix, $row[$key], $tmp); } if((($oddStyle > "") || ($evenStyle > "")) && ($tag > "")) { //$output .= "\n<$tag ".$rowStyle.">$tmp\n"; $output .= "\n<$tag ".$_SESSION['rowStyle'].">$tmp\n"; } else { $output .= "$tmp\n"; } $i++; } return $output; } function getAuthorData($internalKey){ // returns a $key=>$value array of information from the user_attributes table // $internalKey which correlates with a documents createdby value. // Uasge: There are several ways in which this function can be called. // To call this function from within a snippet you could use // $author = $etomite->getAuthorData($etomite->documentObject['createdby']) // or $author = $etomite->getAuthorData($row['createdby']) or $author = $etomite->getAuthorData($rs[$i]['createdby']). // Once the $key=>$value variable, $author, has been populated you can access the data by using code similar to // $name = $author['fullname'] or $output .= $author['email'] for example. // There is also a snippet named GetAuthorData which uses the format: // [[GetAuthorData?internalKey=[*createdby*]&field=fullname]] $tbl = $this->db."user_attributes"; $sql = "SELECT * FROM $tbl WHERE $tbl.internalKey = ".$internalKey; $result = $this->dbQuery($sql); $limit = $this->recordCount($result); if($limit < 1) { $authorName .= "Anonymous"; } else { $user = $this->fetchRow($result); return $user; } } function checkUserRole($action="",$user="",$id="") { // determine document permissions for a user // $action = any role action name (edit_document,delete_document,etc.) // $user = user id or internalKey // $id = id of document in question // because user permissions are stored in the session data the users role is not required // Returns error on fialure. if(($this->config['use_udperms'] == 0) || ($_SESSION['role'] == 1)) return true; if($user == "") $user = $_SESSION['internalKey']; // Modified 2006-08-04 Ralph if($id == "") $id = $this->documentIdentifier; if($user == "" || $id == "" || $_SESSION['role'] == "") return false; if(($action != "") && ($_SESSION['permissions'][$action] != 1)) return false; if(($document == 0) && ($this->config['udperms_allowroot'] == 1)) return true; if($_SESSION['permissions'][$action] == 1) { return true; } else { return false; } } function checkPermissions($id="") { // determines user permissions for the current document // Returns error on fialure. // $id = id of document whose permissions are to be checked against the current user $user = $_SESSION['internalKey']; $document = ($id!="") ? $id : $this->documentIdentifier; $role = $_SESSION['role']; if($_SESSION['internalKey']=="") return false; if($role==1) return true; // administrator - grant all document permissions if($document==0 && $this->config['udperms_allowroot']==0) return false; $permissionsok = false; // set permissions to false if($this->config['use_udperms']==0 || $this->config['use_udperms']=="" || !isset($this->config['use_udperms'])) { return true; // user document permissions aren't in use } // Added by Ralph 2006-07-07 to handle visitor permissions checks properly if($this->config['use_uvperms']==0 || $this->config['use_uvperms']=="" || !isset($this->config['use_uvperms'])) { return true; // visitor document permissions aren't in use } // get the groups this user is a member of $sql = " SELECT * FROM ".$this->db."member_groups WHERE ".$this->db."member_groups.member = $user; "; $rs = $this->dbQuery($sql); $limit = $this->recordCount($rs); if($limit<1) { return false; } for($i=0; $i < $limit; $i++) { $row = $this->fetchRow($rs); $membergroups[$i] = $row['user_group']; } $list = implode(",", $membergroups); // get the permissions for the groups this user is a member of $sql = " SELECT * FROM ".$this->db."membergroup_access WHERE ".$this->db."membergroup_access.membergroup IN($list); "; $rs = $this->dbQuery($sql); $limit = $this->recordCount($rs); if($limit<1) { return false; } for($i=0; $i < $limit; $i++) { $row = $this->fetchRow($rs); $documentgroups[$i] = $row['documentgroup']; } $list = implode(",", $documentgroups); // get the groups this user has permissions for $sql = " SELECT * FROM ".$this->db."document_groups WHERE ".$this->db."document_groups.document_group IN($list); "; $rs = $this->dbQuery($sql); $limit = $this->recordCount($rs); if($limit<1) { return false; } for($i=0; $i < $limit; $i++) { $row = $this->fetchRow($rs); if($row['document']==$document) { $permissionsok = true; } } return $permissionsok; } function userLogin($username,$password,$rememberme=0,$url="",$id="",$alias="",$use_captcha=0,$captcha_code="") { // Performs user login and permissions assignment // And combination of the following variables can be sent // Defaults to current document // $url = and fully qualified URL (no validation performed) // $id = an existing document ID (no validation performed) // $alias = any document alias (no validation performed) // include the crypto thing include_once("./manager/includes/crypt.class.inc.php"); // include_once the error handler include_once("./manager/includes/error.class.inc.php"); $e = new errorHandler; if($use_captcha==1) { if($_SESSION['veriword']!=$captcha_code) { unset($_SESSION['veriword']); $e->setError(905); $e->dumpError(); $newloginerror = 1; } } unset($_SESSION['veriword']); $username = htmlspecialchars($username); $givenPassword = htmlspecialchars($password); $sql = "SELECT ".$this->db."manager_users.*, ".$this->db."user_attributes.* FROM ".$this->db."manager_users, ".$this->db."user_attributes WHERE ".$this->db."manager_users.username REGEXP BINARY '^".$username."$' and ".$this->db."user_attributes.internalKey=".$this->db."manager_users.id;"; $rs = $this->dbQuery($sql); $limit = $this->recordCount($rs); if($limit==0 || $limit>1) { $e->setError(900); $e->dumpError(); } $row = $this->fetchRow($rs); $_SESSION['shortname'] = $username; $_SESSION['fullname'] = $row['fullname']; $_SESSION['email'] = $row['email']; $_SESSION['phone'] = $row['phone']; $_SESSION['mobilephone'] = $row['mobilephone']; $_SESSION['internalKey'] = $row['internalKey']; $_SESSION['failedlogins'] = $row['failedlogincount']; $_SESSION['lastlogin'] = $row['lastlogin']; $_SESSION['role'] = $row['role']; $_SESSION['lastlogin'] = $lastlogin; $_SESSION['nrlogins'] = $row['logincount']; if($row['failedlogincount']>=3 && $row['blockeduntil']>time()) { session_destroy(); session_unset(); $e->setError(902); $e->dumpError(); } if($row['failedlogincount']>=3 && $row['blockeduntil']db."user_attributes SET failedlogincount='0', blockeduntil='".(time()-1)."' where internalKey=".$row['internalKey'].";"; $rs = $this->dbQuery($sql); } if($row['blocked']=="1") { session_destroy(); session_unset(); $e->setError(903); $e->dumpError(); } if($row['blockeduntil']>time()) { session_destroy(); session_unset(); $e->setError(904); $e->dumpError(); } if($row['password'] != md5($givenPassword)) { session_destroy(); session_unset(); $e->setError(901); $newloginerror = 1; $e->dumpError(); } $sql="SELECT * FROM ".$this->db."user_roles where id=".$row['role'].";"; $rs = $this->dbQuery($sql); $row = $this->fetchRow($rs); $_SESSION['permissions'] = $row; $_SESSION['frames'] = 0; $_SESSION['validated'] = 1; if($url=="") { $url = $this->makeURL($id,$alias); } $this->sendRedirect($url); } function userLogout($url="",$id="",$alias="") { // Use the managers logout routine to end the current session // And combination of the following variables can be sent // Defaults to index.php in the current directory // $url = any fully qualified URL (no validation performed) // $id = an existing document ID (no validation performed) // $alias = any document alias (no validation performed) if($url == "") { if($alias == "") { $id = ($id != "") ? $id : $this->documentIdentifier; $rs = $this->getDocument($id,'alias'); $alias = $rs['alias']; } else { $id = 0; } $url = $this->makeURL($id,$alias); } if($url != "") { include_once("manager/processors/logout.processor.php"); } } function getCaptchaNumber($length, $alt='Captcha Number', $title='Security Code') { // returns a Captcha Number image to caller and stores value in $_SESSION['captchNumber'] // $length = number of digits to return // $alt = alternate text if image cannot be displayed // $title = message to display for onhover event if($length < 1) return false; return ''.$alt.''; } function validCaptchaNumber($number) { // returns Captcha Number validation back to caller - boolean (true|false) // $number = number entered by user for validation (example: $_POST['captchaNumber']) $result = ($_SESSION['captchaNumber'] == $number) ? true : false; return $result; } function getCaptchaCode($alt='CaptchaCode', $title='Security Code', $width="148", $height="80") { // returns a CaptchaCode image to caller and stores value in $_SESSION['captchCode'] // $alt = alternate text if image cannot be displayed // $title = message to display for onhover event // $width & height = desired width and height of returned image //$dummy = rand(); return ''.$_lang['; } function validCaptchaCode($captchaCode) { // returns CaptchaCode validation back to caller - boolean (true|false) // $captchaCode = code entered by user for validation (example: $_POST['captchaCode']) $result = ($_SESSION['veriword'] == $captchaCode) ? true : false; return $result; } function syncsite() { // clears and rebuilds the site cache // added in 0.6.1.1 include_once('./manager/processors/cache_sync.class.processor.php'); $sync = new synccache(); $sync->setCachepath("./assets/cache/"); $sync->setReport(false); $sync->emptyCache(); } ######################################## // END New functions - Ralph - 0.6.1 ######################################## // End of etomite class. } /*************************************************************************** Filename: index.php Function: This file loads and executes the parser. /***************************************************************************/ // first, set some settings, and do some stuff $mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $tstart = $mtime; @ini_set('session.use_trans_sid', false); @ini_set("url_rewriter.tags",""); header('P3P: CP="NOI NID ADMa OUR IND UNI COM NAV"'); // header for weird cookie stuff. Blame IE. ob_start(); error_reporting(E_ALL); define("IN_ETOMITE_PARSER", "true"); session_start(); // get the required includes and/or additional classes // contents of manager/includes/config.inc.php can be copied and pasted here for a small speed increase include "manager/includes/config.inc.php"; include("manager/includes/form_class.php"); startCMSSession(); // create a customized session // initiate a new document parser and additional classes $etomite = new etomite; // set some options $etomite->printable = "Printable Page"; // Name of Printable Page template // the following settings are for blocking search bot page hit logging $etomite->useblockLogging = true; $etomite->blockLogging = "/(google|bot|msn|slurp|spider|agent|validat|miner|walk|crawl|robozilla|search|combine|theophrastus|larbin|dmoz)/i"; // these settings allow for fine tuning the parser recursion $etomite->snippetParsePasses = 5; # Original default: 3 $etomite->nonCachedSnippetParsePasses = 5; # Original default: 2 // the next two lines are debugger flags only and should not be modified unless debugging this parser code $etomite->dumpSQL = false; $etomite->dumpSnippets = false; // DO NOT CHANGE THE FOLLOWING SETTING UNLESS YOU ARE FAMILIAR WITH THE SECURITY RISKS DOING SO PRESENTS // If set to true the developer is responsible for validating all form text input to prevent PHP script entry $etomite->allow_embedded_php = false; # true=parse embedded PHP scripts. false=ignore PHP scripting // Should the parser add the notice text and hyperlink to the Etomite website or was it coded in manually? // Please read the notes located in the addNotice function for more information $etomite->useNotice = true; # default: true - display the notice // feed the parser the execution start time // Should the site use the visitor logging module or not (0=false|1=true) $etomite->useVisitorLogging = 1; $etomite->tstart = $tstart; // execute the parser $etomite->executeParser(); // flush the content buffer ob_end_flush(); ?>