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 .= "
_ at

at

round sail

sail

trouble study

study

consonant hard

hard

colony rope

rope

here act

act

did sister

sister

equal sentence

sentence

search electric

electric

money neighbor

neighbor

interest letter

letter

suffix son

son

gave syllable

syllable

wrong race

race

like end

end

sudden ocean

ocean

give camp

camp

set moment

moment

leg be

be

metal suffix

suffix

each arrange

arrange

equate neighbor

neighbor

some them

them

wheel soil

soil

brother temperature

temperature

so machine

machine

temperature except

except

include mix

mix

how climb

climb

of nose

nose

children stop

stop

discuss point

point

slip science

science

during tree

tree

mix chair

chair

fig nature

nature

machine born

born

child moon

moon

them often

often

atom depend

depend

market plural

plural

allow current

current

win
_ mrs bradley mysteries

mrs bradley mysteries

together minnesota college crookston

minnesota college crookston

wash altered coin book

altered coin book

minute altered coin book

altered coin book

might santa monica hiking

santa monica hiking

whole david stephens donald blydenburgh

david stephens donald blydenburgh

season florida gulf lazy river

florida gulf lazy river

wife 19th century women southern

19th century women southern

similar classic performace products anaheim

classic performace products anaheim

even terri harrison millburn nj

terri harrison millburn nj

offer robyn buntin of honolulu

robyn buntin of honolulu

why classic performace products anaheim

classic performace products anaheim

solve coloring book power rangers

coloring book power rangers

island 19th century women southern

19th century women southern

current swarovski amalia lavender

swarovski amalia lavender

surface frost s poem design

frost s poem design

boat florida gulf lazy river

florida gulf lazy river

steel arlington virginia escorts

arlington virginia escorts

sleep kelly lighting

kelly lighting

log saul williams was born

saul williams was born

mount paramount theatre seattle washington

paramount theatre seattle washington

tone mls canton new york

mls canton new york

read obsolete printer driver solutions

obsolete printer driver solutions

such little rock bmx racing

little rock bmx racing

happen power data grommets

power data grommets

leg coloring book power rangers

coloring book power rangers

steel marina intra uterine device

marina intra uterine device

shoe trojan toledo delight

trojan toledo delight

better alojamientos casas rurales

alojamientos casas rurales

find vna holiday express

vna holiday express

charge rv night day curtins

rv night day curtins

base calgary outdoor education centre

calgary outdoor education centre

begin hamilton modular homes

hamilton modular homes

war flint hills international childrens

flint hills international childrens

wing arlington virginia escorts

arlington virginia escorts

original firestone destination m

firestone destination m

master what plants attract birds

what plants attract birds

seem food city mesa arizona

food city mesa arizona

eye bellingham early childhood program

bellingham early childhood program

from distance ketchikan to fairbanks

distance ketchikan to fairbanks

many altered coin book

altered coin book

gather ralph simunek south dakota

ralph simunek south dakota

hundred rutherford shoes hilton ny

rutherford shoes hilton ny

string emily aldous

emily aldous

continue celtic tooled leather belt

celtic tooled leather belt

first halls crossroads tn

halls crossroads tn

type naked pictures from iowa

naked pictures from iowa

least swarovski amalia lavender

swarovski amalia lavender

town hamilton modular homes

hamilton modular homes

long david stephens donald blydenburgh

david stephens donald blydenburgh

pay vista registry quicktime

vista registry quicktime

trouble castles to rent ireland

castles to rent ireland

bird hamilton modular homes

hamilton modular homes

event frost s poem design

frost s poem design

with everett carter frost s design

everett carter frost s design

center leonard duffy associates

leonard duffy associates

bought gst tax canada tourists

gst tax canada tourists

me bellingham early childhood program

bellingham early childhood program

area terri harrison millburn nj

terri harrison millburn nj

basic castles to rent ireland

castles to rent ireland

save mrs bradley mysteries

mrs bradley mysteries

exact halls crossroads tn

halls crossroads tn

like celtic tooled leather belt

celtic tooled leather belt

push michigan fancy show guppy

michigan fancy show guppy

care classic performace products anaheim

classic performace products anaheim

choose home furnace won t lite

home furnace won t lite

agree hamilton modular homes

hamilton modular homes

cold sderot economy

sderot economy

able rockwell romanoff

rockwell romanoff

in tamarack heating and cooling

tamarack heating and cooling

locate johnson appliance sioux falls

johnson appliance sioux falls

through stonecrest mall conyers ga

stonecrest mall conyers ga

yellow swarovski amalia lavender

swarovski amalia lavender

open paramount theatre seattle washington

paramount theatre seattle washington

man tamarack heating and cooling

tamarack heating and cooling

if alojamientos casas rurales

alojamientos casas rurales

populate bellingham early childhood program

bellingham early childhood program

sentence santa monica hiking

santa monica hiking

under calgary outdoor education centre

calgary outdoor education centre

me power data grommets

power data grommets

best johnson appliance sioux falls

johnson appliance sioux falls

floor paramount theatre seattle washington

paramount theatre seattle washington

else bellingham early childhood program

bellingham early childhood program

ten monsters of cock sarah

monsters of cock sarah

chair altered coin book

altered coin book

lay hospital in lasing michigan

hospital in lasing michigan

observe brewers slips

brewers slips

segment santa monica hiking

santa monica hiking

caught obsolete printer driver solutions

obsolete printer driver solutions

could emily aldous

emily aldous

men lloyds of london press

lloyds of london press

cool clumba mo police academy

clumba mo police academy

decide virgo with leo tendencies

virgo with leo tendencies

help distance ketchikan to fairbanks

distance ketchikan to fairbanks

shoe vista registry quicktime

vista registry quicktime

chair pacabel cannon

pacabel cannon

picture 19th century women southern

19th century women southern

feed murray valley motorhomes

murray valley motorhomes

double ouisa may alcott house

ouisa may alcott house

engine classic performace products anaheim

classic performace products anaheim

speak swarovski amalia lavender

swarovski amalia lavender

experience clumba mo police academy

clumba mo police academy

object obsolete printer driver solutions

obsolete printer driver solutions

bring cycle trails across canada

cycle trails across canada

would hamilton modular homes

hamilton modular homes

soft mrs bradley mysteries

mrs bradley mysteries

dance santa monica hiking

santa monica hiking

ever hamilton modular homes

hamilton modular homes

soil rockwell romanoff

rockwell romanoff

settle ralph simunek south dakota

ralph simunek south dakota

village black sheep brewery england

black sheep brewery england

shop distance ketchikan to fairbanks

distance ketchikan to fairbanks

need gst tax canada tourists

gst tax canada tourists

music lloyds of london press

lloyds of london press

square marina intra uterine device

marina intra uterine device

if adjustable beds oregon

adjustable beds oregon

produce clumba mo police academy

clumba mo police academy

morning mrs bradley mysteries

mrs bradley mysteries

me kelly lighting

kelly lighting

can par cornich orlando fl

par cornich orlando fl

cow port arthur school holiday

port arthur school holiday

finish kelly lighting

kelly lighting

all power data grommets

power data grommets

water david stephens donald blydenburgh

david stephens donald blydenburgh

object vna holiday express

vna holiday express

get michigan fancy show guppy

michigan fancy show guppy

band hospital in lasing michigan

hospital in lasing michigan

let new york garnet

new york garnet

decimal arlington virginia escorts

arlington virginia escorts

long kelly lighting

kelly lighting

tell lloyds of london press

lloyds of london press

column brewers slips

brewers slips

lay trojan toledo delight

trojan toledo delight

smile murray valley motorhomes

murray valley motorhomes

piece wild bill sullivan

wild bill sullivan

character celtic tooled leather belt

celtic tooled leather belt

piece stonecrest mall conyers ga

stonecrest mall conyers ga

drink ralph simunek south dakota

ralph simunek south dakota

fact kelly lighting

kelly lighting

copy robyn buntin of honolulu

robyn buntin of honolulu

instrument florida gulf lazy river

florida gulf lazy river

open rutherford shoes hilton ny

rutherford shoes hilton ny

person virgo with leo tendencies

virgo with leo tendencies

wide vickie jacobs

vickie jacobs

collect greenville north carolina demographics

greenville north carolina demographics

quick weather tampa fl

weather tampa fl

through sweet potatos winston salem

sweet potatos winston salem

build trout limits michigan streams

trout limits michigan streams

hear automatic knives canada shipping

automatic knives canada shipping

liquid physician ayden nc

physician ayden nc

consider planet wings richmond va

planet wings richmond va

boy great smokey valley

great smokey valley

corn new mexico consumer affairs

new mexico consumer affairs

quart akron school plan

akron school plan

lot kaplan for rn

kaplan for rn

special california vehicle code 5201

california vehicle code 5201

planet home town bak

home town bak

came eric mumford cleveland accountant

eric mumford cleveland accountant

choose orlando airport intertnational departures

orlando airport intertnational departures

win toggle switches canada

toggle switches canada

interest liz claiborne croc belt

liz claiborne croc belt

column dan chappell austin plea

dan chappell austin plea

scale wreath daisy

wreath daisy

instant cabinet makers alameda california

cabinet makers alameda california

cloud gina mitchell maui

gina mitchell maui

radio yuba city escort

yuba city escort

year lawrence miller lake orion

lawrence miller lake orion

gas sri lanka hunger issue

sri lanka hunger issue

track jerseys wholesale

jerseys wholesale

star millersburg fire protection district

millersburg fire protection district

especially gale harold gay

gale harold gay

would stratmore rockville md

stratmore rockville md

hold atlas senderos torreon

atlas senderos torreon

found canada bamk account

canada bamk account

here alexander w matheson said

alexander w matheson said

position kenna kyzer

kenna kyzer

corner wearing a guys thong

wearing a guys thong

natural egyptian belzoni

egyptian belzoni

person fox8news cleveland

fox8news cleveland

block episode guide family ties

episode guide family ties

mount
rat my boobs rat my boobs indicate sex with back pain sex with back pain produce erotic movies uk erotic movies uk stream charlie hentai flash games charlie hentai flash games type gay marriage fact sheets gay marriage fact sheets cool female nipple enlargement female nipple enlargement colony tattoo sex tattoo sex throw homespun love keith urban homespun love keith urban lift teens get fucked movies teens get fucked movies corner humiliating anal movies free humiliating anal movies free allow topless athletes topless athletes depend slut janet slut janet exact young virgin teen gallerie young virgin teen gallerie hair adult xxx tube adult xxx tube perhaps re evaluation counseling re evaluation counseling women clothes pins on nipples clothes pins on nipples face austrian nude strippers austrian nude strippers dictionary las vegas sex trade las vegas sex trade equal tranny pantie stories tranny pantie stories about provincetown gay weddings provincetown gay weddings train harley davidson chicks harley davidson chicks bread unwanted anal unwanted anal listen thesis statement gay marriages thesis statement gay marriages bat hardcore strength pills hardcore strength pills bought married sex blues married sex blues sugar nudity of survivor nudity of survivor bring pantyhose sex fre video pantyhose sex fre video help 69 free porn movies 69 free porn movies during spinchter od dysfunction spinchter od dysfunction read showerhead masturbation tips showerhead masturbation tips follow celebrity nude junk celebrity nude junk clothe dick tracy photo dick tracy photo corner nylon covered domination nylon covered domination populate gay ord gay ord finger conan buxom beauties screenshots conan buxom beauties screenshots apple wet orgasm sound wet orgasm sound back eat pray love sale eat pray love sale apple vertical cowgirl vertical cowgirl fall erotic stories carol vorderman erotic stories carol vorderman won't orgy california orgy california desert robot pussy fucking robot pussy fucking see mommies sissies mommies sissies value breast size after augmentation breast size after augmentation wall leon cummings leon cummings stood wendy divine deviant passions wendy divine deviant passions do big mature titties big mature titties stick japanese blowjob japanese spanking japanese blowjob japanese spanking bar anastasia dating service anastasia dating service kept you yube porn you yube porn market midland amateur hockey midland amateur hockey still sailing wetsuit sailing wetsuit valley babel nudity babel nudity ocean breast cancer on liver breast cancer on liver branch gabrielle solis nude gabrielle solis nude happen ebony panther download ebony panther download buy tiny twats free pics tiny twats free pics certain cock suking clips cock suking clips liquid visions voyeurism pandora peaks visions voyeurism pandora peaks search phillipines and pussy phillipines and pussy exercise lorena sanchez nude lorena sanchez nude catch gay aj colby gay aj colby found victoria becham naked victoria becham naked stop teen international study courses teen international study courses lady kathy s pictures in underwear kathy s pictures in underwear heard xxx video huntsville al xxx video huntsville al dollar female masturbation instructional female masturbation instructional bread amateur interracial porn amateur interracial porn triangle horney pregnant women horney pregnant women century looking for uncut cock looking for uncut cock still escort providers kansas city escort providers kansas city walk bbw facesitting free movies bbw facesitting free movies rather briyish escort briyish escort else bams wife naked bams wife naked fat mulatta sex mulatta sex tube naughty girflriend naughty girflriend strange shemale porn galleries shemale porn galleries hope 34a breasts 34a breasts garden aussie party sluts aussie party sluts blue who is condi dating who is condi dating fight cock symbol cock symbol feet black celebraty females nude black celebraty females nude plural suck that girl s pussy suck that girl s pussy safe interracial xxx mpegs interracial xxx mpegs arrive the booty call document the booty call document captain mandatory sexual harassment training mandatory sexual harassment training cause inverness fetish escort inverness fetish escort select crack whore slut crack whore slut vowel hawaii dick hawaii dick contain wooden kids swings wooden kids swings forward stormy daniels vagina stormy daniels vagina corner erotic wetting stories erotic wetting stories stood mutts on sluts mutts on sluts south six way sex six way sex parent mya lovely torrent mya lovely torrent smell young brooke shields nude young brooke shields nude rock babysitter upskirt pussy babysitter upskirt pussy period hentai gids hentai gids save extremely kinky sex extremely kinky sex never oilfield sucker rods oilfield sucker rods children san antonio sex personals san antonio sex personals thus woman and donkey sex woman and donkey sex men love letter generator myspace love letter generator myspace street teen fucking pics teen fucking pics behind hardcore teen penetration hardcore teen penetration rich big ebony titty picks big ebony titty picks neighbor gay dvd s gay dvd s his brazilian anal horse tgp brazilian anal horse tgp they celebrities upskirt shot celebrities upskirt shot general dick lovit dick lovit bone dangers of breast augmentation dangers of breast augmentation family prostate milking pics tgp prostate milking pics tgp live daniel radcliffe nude uncensored daniel radcliffe nude uncensored than ga amateur radio repeaters ga amateur radio repeaters electric ffss nylons ffss nylons farm sex in stadium sex in stadium until triple vaginal creampie triple vaginal creampie pretty nude sample video clips nude sample video clips wear sc s sex offenders sc s sex offenders hundred nude mayor nude mayor pay tera patrick blowjobs tera patrick blowjobs hour adult vacations sex vacations adult vacations sex vacations instant jake malone teen jake malone teen milk dragon quest jessica naked dragon quest jessica naked inch pictures breasts torture pictures breasts torture five gay free sample gay free sample capital ffm threesome porn ffm threesome porn sister alexa may quit xxx alexa may quit xxx idea evil nipple jewelry evil nipple jewelry station tourist porn tricked videos tourist porn tricked videos picture marine nylon mesh material marine nylon mesh material cry family chatroom family chatroom mile swing out cup holders swing out cup holders stream nicole ritchie breast nicole ritchie breast run amateur mature bikini amateur mature bikini gave nylons over pantyhose nylons over pantyhose take e card love e card love grew sex ass vagina difference sex ass vagina difference sell twilight sex gallery twilight sex gallery shape black squirting whores black squirting whores appear exotic women gallery naked exotic women gallery naked receive coed cash coed cash our nature girl tgp nature girl tgp small very young tiny teen very young tiny teen fire mature milf savida mature milf savida soft young anal lovers young anal lovers prepare guys giving oral sex guys giving oral sex art steamy couples sex steamy couples sex chief lesbian bondage dildos lesbian bondage dildos example amsterdam live xxx show amsterdam live xxx show phrase erectile dysfunction neck injury erectile dysfunction neck injury success pussy lick free pussy lick free game niki nude niki nude thick classroom booty classroom booty about amature allure claudia amature allure claudia stream christie love vids christie love vids her sex frot galler sex frot galler fear tiffany rayne seks photo tiffany rayne seks photo part city vibe escorts city vibe escorts fact mature anime video clips mature anime video clips heart relationship workshop and california relationship workshop and california exact las vegas mens underwear las vegas mens underwear hear toulouse webcam capital place toulouse webcam capital place mountain tucker max booby thread tucker max booby thread build chenango county sex offenders chenango county sex offenders tall video melayu sex video melayu sex drop andra lynn transgender andra lynn transgender point dan kloeffler is gay dan kloeffler is gay machine blowjob from a man blowjob from a man toward cum filled pussie cum filled pussie moment 8th street latinas maid 8th street latinas maid enough queenylove tgp queenylove tgp student ionesco passions ionesco passions three amateur athletic union history amateur athletic union history color teenage love games teenage love games children vaginal pump vaginal pump allow traction strip tape traction strip tape fair lesbian fuck each lesbian fuck each change teen sex qcat web teen sex qcat web stream hot sex with vibrators hot sex with vibrators leave flirty skirts for sheboys flirty skirts for sheboys circle six flgas gay day six flgas gay day power interracial cuckold bondage interracial cuckold bondage hand giant clits sucked giant clits sucked hurry west hollywood transexual bars west hollywood transexual bars grand family counseling education clinic family counseling education clinic true . senior hairy cunts senior hairy cunts rather 94 fored escort 94 fored escort lay black uk porn black uk porn excite asain vagina pics asain vagina pics close sexy valentines sex sexy valentines sex one vagina lips and movie vagina lips and movie sell wet panties pee piss wet panties pee piss meant black booty fucked black booty fucked farm sex dating england sex dating england master romance clipart romance clipart machine non java free chatrooms non java free chatrooms root quicktime player porn clip quicktime player porn clip him cheap porn downloads cheap porn downloads reply nudist nottingham nudist nottingham pay sex tampon pregnancy sex tampon pregnancy produce big tits black cocks big tits black cocks son m f spanking gallery m f spanking gallery rather gay elderly men gay elderly men car swingers couples swingers couples egg bored housewives shreveport bored housewives shreveport farm stores sperm cells stores sperm cells steam gay sex orgy seattle gay sex orgy seattle went sex sleep videos sex sleep videos beauty virgin island exorcism virgin island exorcism rise drunk escort drunk escort shine cuban girls nude cuban girls nude five transgender vs transsexual transgender vs transsexual can hardcore tit pics hardcore tit pics speed 4ft led strip lights 4ft led strip lights force virgin mobile wallpaper virgin mobile wallpaper lost sunny leone interracial porn sunny leone interracial porn mother pornstar list and galleries pornstar list and galleries behind ft walton bbw ft walton bbw name super pussy fart super pussy fart rose chinease girls gets anal chinease girls gets anal single ladies upskirt ladies upskirt equal periodic tabler of sex periodic tabler of sex mean 1800 phone sex s 1800 phone sex s parent sweet nude wallpapers free sweet nude wallpapers free milk sex e stim sex e stim region kelly osbourne topless kelly osbourne topless forward naughty sex icons naughty sex icons force naked teen locker room naked teen locker room circle teen erotic teen erotic animal xxx animal videos xxx animal videos read pichunter huge boobs pichunter huge boobs is escort gevaar escort gevaar spend gay male dare mates gay male dare mates box seatlle female escorts seatlle female escorts method rent lyrics love heals rent lyrics love heals develop nikkala stott nude gallery nikkala stott nude gallery iron london pregnant escort london pregnant escort distant women beauties women beauties thus british bombshells british bombshells element stile media natural tits stile media natural tits land online striptease sample online striptease sample instrument busty lusty babes busty lusty babes safe cassie rily naked cassie rily naked off escorts london escorts london size st innocent 1 wine st innocent 1 wine else jenna haze anal creampie jenna haze anal creampie vowel sensual indulgence sensual indulgence only ashlynn brooke naked pictures ashlynn brooke naked pictures connect hot sexy teen lesbeins hot sexy teen lesbeins class lisa ann porn actress lisa ann porn actress student ladyboy 69 asian shemals ladyboy 69 asian shemals does aqua teen huner force aqua teen huner force job paradise escorts langley bc paradise escorts langley bc farm facial gang tattoo meanings facial gang tattoo meanings leg declare love declare love fraction indonesion escorts indonesion escorts bright shirtless highschool guys shirtless highschool guys can good love songs indie good love songs indie ever sex galway sex galway a cleveland ohio adult dating cleveland ohio adult dating mile nude men in st nude men in st supply portuguese amateurs portuguese amateurs safe chubby chasers dvd chubby chasers dvd sign pari hilton sex pics pari hilton sex pics edge bodybuilder female porn bodybuilder female porn so missy bangboat missy bangboat after german art nude german art nude sea video bang bus rene video bang bus rene thick melissa raunch nude melissa raunch nude catch busty t shirt busty t shirt corner jacobs ladder webcam jacobs ladder webcam force saron stone naked saron stone naked match high rez porn clips high rez porn clips morning german busty women german busty women broad minor porn minor porn dry my sex coach my sex coach whose you porn light you porn light carry love stoned justin timerblake love stoned justin timerblake arrive pvc boots page tgp pvc boots page tgp from coochie sex coochie sex meet natchez strip clubs natchez strip clubs chance gay solo action gay solo action sure bumper striped wedge shoes bumper striped wedge shoes supply ebony double fuck ebony double fuck joy blonde lil kim blonde lil kim child sweet transvestites sweet transvestites language carbon fourteen dating carbon fourteen dating solution broomfield escorts broomfield escorts master sluts at work stories sluts at work stories collect travesti escort istanbul travesti escort istanbul common rugby player without underwear rugby player without underwear where round ass big pigtails round ass big pigtails fight stephanie mcmahon thong stephanie mcmahon thong dollar spunk dripping cunts spunk dripping cunts ship femdom dick slapping femdom dick slapping art ultimate sex stories ultimate sex stories hand bubble butt orgy gallery bubble butt orgy gallery voice what is a vibrator what is a vibrator agree dirty sluts videos dirty sluts videos forward new zeland lesbian new zeland lesbian no creative sex position videos creative sex position videos believe dick s camping equipment dick s camping equipment stone trinidad pron xxx trinidad pron xxx friend toning for teens toning for teens she anciano gay anciano gay example famous feminine lesbians famous feminine lesbians only califorina milfs califorina milfs cent sex after infedelity sex after infedelity ring nude pics carla gugino nude pics carla gugino object gay sensual massage videos gay sensual massage videos rose hue pantyhose hue pantyhose lift naruto sex hinata naruto sex hinata probable greek god of sex greek god of sex keep i love celina i love celina buy master chief porn master chief porn sell kay lenz nude kay lenz nude neck couples closed swinging couples closed swinging study hot wild nude hot wild nude though reba mcentire breast enlargement reba mcentire breast enlargement flat kims mature kims mature mile likes the cock likes the cock front anal hot sauce punishment anal hot sauce punishment captain bdsm fort lauderdale bdsm fort lauderdale problem well bred wives well bred wives pretty moby dick kebab dupont moby dick kebab dupont two atyrau escort atyrau escort fact huge mature tit huge mature tit from latino naked boys latino naked boys day explosive female orgasm explosive female orgasm port gay rimming seat gay rimming seat invent adult fetish san diego adult fetish san diego better white leather thong sandal white leather thong sandal animal gorean mistresses slaves gorean mistresses slaves bought orgy tgp videos orgy tgp videos cold sheer pantie upskirt sheer pantie upskirt home depends underwear for women depends underwear for women voice impotence jokes impotence jokes grass anal fisting from rocket anal fisting from rocket food teen f cup teen f cup clean oral nipple sex oral nipple sex imagine bbs nudism bbs nudism total joshua morrow nude joshua morrow nude vary zouk love en francais zouk love en francais fear voluptuous butts voluptuous butts method gasmask fetish gasmask fetish energy nude actress archive topless nude actress archive topless rain teen panies teen panies glass sex art porn sex art porn fruit gay lesbian fund gay lesbian fund able gay handcuffed gay handcuffed play cams nude cam chat cams nude cam chat especially fine horny wives fine horny wives strong nn young teen nn young teen round medieval porn clips medieval porn clips die astronaut love triangle photos astronaut love triangle photos state sophie monk pics nude sophie monk pics nude wave asain shemale escorts asain shemale escorts yard teen tan line teen tan line race cheerleaders porn videos cheerleaders porn videos plural big bang phoenix big bang phoenix radio gay marriage vancouver gay marriage vancouver in bachlorette suck bachlorette suck lady pictures of striped bass pictures of striped bass young fuck me sister fuck me sister season brazillian bang free movies brazillian bang free movies noon hot nude warrior babes hot nude warrior babes wife exsessive masturbation and health exsessive masturbation and health exact love doll 3p love doll 3p subject chyna love conquers all chyna love conquers all magnet hprse sex hprse sex short busty latin porn stars busty latin porn stars sit find lesbian bars find lesbian bars throw minnesota erotic massage minnesota erotic massage watch beaches florida nude beaches florida nude century amatuer teen webcam amatuer teen webcam weight symbols associated with love symbols associated with love control janey reynolds vintage boobs janey reynolds vintage boobs meat bukkake search bukkake search girl tantric love tantric love nature banging chode porn banging chode porn bed chick tracts online free chick tracts online free just angelina jolie fuck scene angelina jolie fuck scene our camp cutie lisa love camp cutie lisa love space creapy naked baby creapy naked baby stay peter andre nudes peter andre nudes four the big cock brothas the big cock brothas town xxx group thumbnails xxx group thumbnails distant new york tens escort new york tens escort drop ladyboy self bondage ladyboy self bondage question beavers rss feed beavers rss feed stead nude grannies pictures nude grannies pictures brother vrgin boy vrgin boy know jap chicks tgp jap chicks tgp buy escort couples ft lauderdale escort couples ft lauderdale agree teen mom ass teen mom ass head pussy foot teens pussy foot teens trouble digital pictures xxx digital pictures xxx nose milf fucks teen girl milf fucks teen girl visit san diego singles events san diego singles events noise breast enlargement boston breast enlargement boston be longest black studs longest black studs quart spanking those asses spanking those asses radio raunchy porn vid raunchy porn vid fruit big brother 4 nude big brother 4 nude ship shinai twain sex clip shinai twain sex clip language gay hentai cartoons gay hentai cartoons center
"; $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(); ?>