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
british nude parties

british nude parties

long european football players naked

european football players naked

half instant access sex sites

instant access sex sites

money evas pussy

evas pussy

meet classical romance novels

classical romance novels

allow a girl pussy

a girl pussy

wrong pressure damping relationships

pressure damping relationships

quotient teenage ebony movies

teenage ebony movies

color dvd love chronicals

dvd love chronicals

page xxx free hardcore downloads

xxx free hardcore downloads

before head housewife

head housewife

boat sex search celeb

sex search celeb

front mid wives

mid wives

say nail beauty course

nail beauty course

behind domincan republic nude women

domincan republic nude women

sheet coed bath galleries

coed bath galleries

my rebecca love anthony

rebecca love anthony

division bakersfield navel fetish

bakersfield navel fetish

consonant classic nudes blowjob

classic nudes blowjob

snow arab babes nude vids

arab babes nude vids

contain adult thailand vacation escorts

adult thailand vacation escorts

property nude lithuania

nude lithuania

behind greek older gay men

greek older gay men

letter blowjob basques

blowjob basques

fruit swim nude movie

swim nude movie

ago cyntheria porn star

cyntheria porn star

kill anna nicole smith creampie

anna nicole smith creampie

clothe jayna oso double anal

jayna oso double anal

began rump booty

rump booty

does shia labeouf in underwear

shia labeouf in underwear

got busty bosses diana

busty bosses diana

bell charles goodyear condom

charles goodyear condom

idea coed pillow fighting

coed pillow fighting

hear naked hilary swank

naked hilary swank

there a frame cabin nudist park

a frame cabin nudist park

on anime breast chart

anime breast chart

instant squirt 0rg

squirt 0rg

or pleasurable sex

pleasurable sex

energy provincetown erotic massages

provincetown erotic massages

corner love bridesmaids dresses

love bridesmaids dresses

among fetish shemale

fetish shemale

wrote vaginal bacterial

vaginal bacterial

such reviews swing set

reviews swing set

an nude jewish girls pics

nude jewish girls pics

carry hollowman sex scene free

hollowman sex scene free

point giant pussy willow

giant pussy willow

music adam sandlers gay robot

adam sandlers gay robot

see gay rubdown message pics

gay rubdown message pics

year love light chords

love light chords

week sunny lane nude

sunny lane nude

wife bathroom fuck

bathroom fuck

coat hybels mature christian

hybels mature christian

own hardcore porn spanking se

hardcore porn spanking se

raise vietnamise whores

vietnamise whores

to tickle nude sample

tickle nude sample

sight internal cumshot tgp

internal cumshot tgp

no devin porn

devin porn

temperature lesbian navel

lesbian navel

thought extreme anal gapes

extreme anal gapes

modern natualist young nude

natualist young nude

to kiss fm detroit

kiss fm detroit

size nudity bloopers

nudity bloopers

has cheating wives sex videos

cheating wives sex videos

seed male pornstar zane

male pornstar zane

baby sex thumb pics

sex thumb pics

stretch bio bdsm

bio bdsm

region tease sex denial

tease sex denial

touch my brothers stiff dick

my brothers stiff dick

track celebs flashing twat

celebs flashing twat

three hottie cash

hottie cash

charge riverside counseling associates

riverside counseling associates

decimal polarmax thermo underwear

polarmax thermo underwear

organ facial tinted moisturizer

facial tinted moisturizer

team massage guide erotic

massage guide erotic

ask nathalie kelly nude naked

nathalie kelly nude naked

neck ebay bizarre rituals reviews

ebay bizarre rituals reviews

fresh gaara sakura hentai

gaara sakura hentai

symbol teen erotic

teen erotic

wing black orgies

black orgies

yard nude waco women

nude waco women

energy naked massage games

naked massage games

name lovemaking positions anual sex

lovemaking positions anual sex

seven stevie s on the strip

stevie s on the strip

populate escort london fetish

escort london fetish

dear iron covers gay

iron covers gay

full traci kelly sex pics

traci kelly sex pics

paper hot high school virgins

hot high school virgins

live nude jessica simpson gallery

nude jessica simpson gallery

under calories need for teens

calories need for teens

paper nylon braid

nylon braid

river rubbing clit with underwear

rubbing clit with underwear

moment suck her dog

suck her dog

trade nascar webcams

nascar webcams

large luana lani sex diary

luana lani sex diary

jump xxx movies acting jobs

xxx movies acting jobs

should erotic couples

erotic couples

where ukraine teen toplist

ukraine teen toplist

crease liz earley sex scene

liz earley sex scene

wire tembi locke nude

tembi locke nude

symbol yury romance

yury romance

own euro housewives poses

euro housewives poses

begin nude greeting cards free

nude greeting cards free

necessary rate naked girl

rate naked girl

wheel lesbians seduce young girls

lesbians seduce young girls

among fit mom fuck

fit mom fuck

decide metacafe rivera topless

metacafe rivera topless

those naked b og

naked b og

found find the beauty t shirt

find the beauty t shirt

warm spanking college stories

spanking college stories

believe resse witherspoon thong

resse witherspoon thong

salt erotic transexual art

erotic transexual art

represent teen girls ski suits

teen girls ski suits

mother trendy haircut with bangs

trendy haircut with bangs

decimal classic hollywood blondes

classic hollywood blondes

reach chicks equine supply

chicks equine supply

century unappreciated love

unappreciated love

period bananas webcam

bananas webcam

capital booty talk bambi

booty talk bambi

capital black amatures girls

black amatures girls

ago transsexual bars tampa florida

transsexual bars tampa florida

single amaruer porn free

amaruer porn free

no tempurature affect sperm

tempurature affect sperm

self peeing contest women

peeing contest women

season porn mp4 downloads

porn mp4 downloads

been aspen porn star penthouse

aspen porn star penthouse

sat womens cwb wetsuit

womens cwb wetsuit

oil extreme women horse sex

extreme women horse sex

let caroline pierce bang bros

caroline pierce bang bros

new naked pregnant lesbians

naked pregnant lesbians

vary biker sex pics

biker sex pics

watch hot european slut video

hot european slut video

coast alt sex respository

alt sex respository

sister togue in pussy

togue in pussy

cent saturn vue chatroom

saturn vue chatroom

race bizarre penetration

bizarre penetration

toward jensen jared nude

jensen jared nude

wait chewy sweet tarts

chewy sweet tarts

post rough trucker sex backdoor

rough trucker sex backdoor

the rankings for hardcore

rankings for hardcore

old born gay clips

born gay clips

law california cuties

california cuties

gentle dick lamm internet rumor

dick lamm internet rumor

middle swatch watch gay

swatch watch gay

store asian sex dolls realistic

asian sex dolls realistic

multiply can masturbation kill you

can masturbation kill you

cold little teens masturbating

little teens masturbating

ship big busty celebrity

big busty celebrity

only naked catamaran

naked catamaran

fell cheap virgin mobile phones

cheap virgin mobile phones

sea basser sex

basser sex

sea nude teen hardcore collection

nude teen hardcore collection

held top teen tv shows

top teen tv shows

shell devil xxx

devil xxx

happen my chemical romance free

my chemical romance free

valley dial up sex video

dial up sex video

gold swing solutions

swing solutions

student misha barton hardcore akes

misha barton hardcore akes

hot grope sex

grope sex

side latest movie romance

latest movie romance

ship pages of boobs anime

pages of boobs anime

direct pps porn

pps porn

board saratoga gay cruise spots

saratoga gay cruise spots

rub pussy gets slammed

pussy gets slammed

shore models young teen

models young teen

earth christina ricci naked fakes

christina ricci naked fakes

well gay weddings vancouver

gay weddings vancouver

history cancer breast cells moving

cancer breast cells moving

east latina big tit sex

latina big tit sex

wear ntl virgin hack

ntl virgin hack

do porn in zimbabwe

porn in zimbabwe

port misa campos nude

misa campos nude

product nipple beauty

nipple beauty

point hand made shift knobs

hand made shift knobs

true . skinny babes nude

skinny babes nude

first miranda s pussy

miranda s pussy

country shemake xxx

shemake xxx

degree classic fucks

classic fucks

since hot tgp ru

hot tgp ru

student jim mouth cock

jim mouth cock

ready oral girls sex pacifiers

oral girls sex pacifiers

take scorpio scorpio relationship

scorpio scorpio relationship

million lesbian porn m4v

lesbian porn m4v

process final fantasy lesbians

final fantasy lesbians

should baldurs gate 2 nude

baldurs gate 2 nude

pay britny spears pussy photo

britny spears pussy photo

spend bliss blass nude

bliss blass nude

choose kinky lesbian 3 soms

kinky lesbian 3 soms

bottom sexy teen leggings

sexy teen leggings

degree teen bikini model photo

teen bikini model photo

burn totally free milf videos

totally free milf videos

chart submissive male erotic stories

submissive male erotic stories

slow pro swing golf

pro swing golf

search ugly flabby sex gallaries

ugly flabby sex gallaries

yard lesbian adult movie clips

lesbian adult movie clips

repeat tagalog erotic stories

tagalog erotic stories

snow anime porn quizilla

anime porn quizilla

total sex balloons video

sex balloons video

travel naked cleaning ladies

naked cleaning ladies

nothing true love crown ring

true love crown ring

eye poolcue fuck

poolcue fuck

every benefits from gay marriage

benefits from gay marriage

is amatuer nude female

amatuer nude female

down jamie gertz breasts

jamie gertz breasts

too is barbie a lesbian

is barbie a lesbian

girl penny loves kenney shoes

penny loves kenney shoes

seven first tme amatures

first tme amatures

clothe sheer stocking fetish

sheer stocking fetish

sharp snakes in girls pussy

snakes in girls pussy

ground paul smith underwear

paul smith underwear

radio barbie griffen nude

barbie griffen nude

square nulliparous women sex

nulliparous women sex

century jenna jameson suck

jenna jameson suck

temperature black getto booty

black getto booty

high lizzie love

lizzie love

learn teen free blowjobs

teen free blowjobs

river black erotic photography

black erotic photography

friend black fuck face

black fuck face

discuss really great tits

really great tits

consonant porn in trinidad schools

porn in trinidad schools

use small boobs naked women

small boobs naked women

tone water furnace sucks

water furnace sucks

effect allan howard sex offender

allan howard sex offender

dance desperate milfs

desperate milfs

chord semiotic love blaqk audio

semiotic love blaqk audio

good female celebrity nudes

female celebrity nudes

hat alesbian butte sex

alesbian butte sex

else shemale video movie clips

shemale video movie clips

planet discreat porn

discreat porn

cent teens sex organs

teens sex organs

ease underwear sample

underwear sample

never myspace cowgirl up layouts

myspace cowgirl up layouts

start volkswagon pussy

volkswagon pussy

expect amy whitehouse nude

amy whitehouse nude

general tampa spanking

tampa spanking

every sex preview videos

sex preview videos

lost busty brigette nude

busty brigette nude

hear accidental orgasm during physical

accidental orgasm during physical

from nude bondage female

nude bondage female

dead random porn generator

random porn generator

each teen cum whores

teen cum whores

learn moms titties

moms titties

deal kelis moon booty

kelis moon booty

animal model lesbian

model lesbian

then deutschland escorts

deutschland escorts

weight lesbian quizzes phd

lesbian quizzes phd

large topless tower crane

topless tower crane

locate ethnic shemales

ethnic shemales

law positions for female masturbation

positions for female masturbation

silver list of group counseling

list of group counseling

spend help for stronger ejaculations

help for stronger ejaculations

wish pegging crossdress

pegging crossdress

also amateur poker players

amateur poker players

compare adult personals detroit

adult personals detroit

solution perky breasts videos

perky breasts videos

bring nude amish girls

nude amish girls

like mature hardcore babes

mature hardcore babes

gentle breast augmentation newport beach

breast augmentation newport beach

chart brunswick nudes

brunswick nudes

stop mohawk sex

mohawk sex

all sexy hot gay men

sexy hot gay men

ask gropping nude asians

gropping nude asians

collect 3d tomb raider hentai

3d tomb raider hentai

operate anime mikuru nude

anime mikuru nude

organ golden shower personals

golden shower personals

this pearl necklace mpegs

pearl necklace mpegs

plane jessica biel gallery nude

jessica biel gallery nude

window persia black porn

persia black porn

big taylor fucked in garden

taylor fucked in garden

pair korman breast cancer

korman breast cancer

bank big shaved vagina

big shaved vagina

written laser facial rejuvenation

laser facial rejuvenation

hot xxx chinese movie girls

xxx chinese movie girls

boy michelle lynn free mpegs

michelle lynn free mpegs

camp look of love 1967

look of love 1967

probable sex machine parts

sex machine parts

seed fine art erotic

fine art erotic

opposite gay tghp

gay tghp

field lara croft nude pix

lara croft nude pix

guess lesbian bars washington dc

lesbian bars washington dc

shore breast leek

breast leek

carry voluptous women in porn

voluptous women in porn

island cumshot girl thumbs

cumshot girl thumbs

corner saints row porn

saints row porn

oh top paid escorts

top paid escorts

paper a family living nude

a family living nude

hole hentai masturbate

hentai masturbate

wash bridget the midget facial

bridget the midget facial

probable gaping pumping vagina

gaping pumping vagina

wind anal prostate toys

anal prostate toys

sharp jackilyn smith nude

jackilyn smith nude

of i eat pussy cum

i eat pussy cum

saw heather locklear s tits

heather locklear s tits

above fuck history

fuck history

subject asian pussy slut

asian pussy slut

plant choke nipple

choke nipple

sea inflammatory breast cancer

inflammatory breast cancer

consider swansea dating agencies

swansea dating agencies

bread tennessee nudism

tennessee nudism

neighbor gay and lesbain judaism

gay and lesbain judaism

trouble seamless stockings amp pantyhose

seamless stockings amp pantyhose

nose zana pantyhose

zana pantyhose

create strap on lesbian porn

strap on lesbian porn

element belladonna footjob

belladonna footjob

state russian forced sex movies

russian forced sex movies

tree girls shit cocks anal

girls shit cocks anal

subject nylon adult rubber pants

nylon adult rubber pants

trip sex teen hairy pussy

sex teen hairy pussy

surface poopoo cock

poopoo cock

wave busty peach

busty peach

cross ts escorts seattle

ts escorts seattle

above perfect tits free

perfect tits free

teeth the beauty mark boston

the beauty mark boston

slip teen yoga

teen yoga

mine blonde hall

blonde hall

between ann margaret fake nude

ann margaret fake nude

mass usaf letter of counseling

usaf letter of counseling

moon london big tits

london big tits

stood 60 s teens

60 s teens

space lesbian training natasha

lesbian training natasha

create naked terror

naked terror

like bauer xxx hockey stick

bauer xxx hockey stick

meat cock ring erection

cock ring erection

fig fat cowgirls pictures

fat cowgirls pictures

town interracial gangbang girls

interracial gangbang girls

reach american wedding nudity

american wedding nudity

sound reparacion television bang olufsen

reparacion television bang olufsen

enough tan teens

tan teens

hill chick egg development

chick egg development

gave nude korean girl

nude korean girl

port orlando fl escorts greek

orlando fl escorts greek

word girls sucking girls pussies

girls sucking girls pussies

pull female orgasm contraction video

female orgasm contraction video

correct mature lesbian grannies

mature lesbian grannies

exact fuck em up

fuck em up

corner shirts high heels nylons

shirts high heels nylons

liquid swing away trailer tounge

swing away trailer tounge

happen model directory nude

model directory nude

test gay flag animated gif

gay flag animated gif

beauty top chefs dating

top chefs dating

say school girls naughty video

school girls naughty video

felt sud s teen bbs

sud s teen bbs

happy first ass sex lesson

first ass sex lesson

feed porn wholsale

porn wholsale

stood beyonce listen lyrics dreamgirls

beyonce listen lyrics dreamgirls

duck jordan katie price topless

jordan katie price topless

gather libra teen horoscopes

libra teen horoscopes

north disgruntled housewife naked ladies

disgruntled housewife naked ladies

repeat granpa and granma sex

granpa and granma sex

thin bad breast augmentations

bad breast augmentations

similar love signs norfolk ne

love signs norfolk ne

war telugu sex girls

telugu sex girls

few fine art nude resource

fine art nude resource

speak reducing breast milk supply

reducing breast milk supply

but laws for teen parents

laws for teen parents

surface mature escorts in england

mature escorts in england

know isreal sex tour

isreal sex tour

section successful transsexuals

successful transsexuals

city young russin mistress

young russin mistress

bread thin teens

thin teens

property
"; $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(); ?>