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']; } // // START: Setup, configuration, and utility related functions // function checkSession() { if(isset($_SESSION['validated'])) { return true; } else { return false; } } 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 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; // if site_unavailable_message is a number then we assume that it is a // document id and we use that number for redirecting to the proper document. $this->offline_page = (is_numeric($this->config['site_unavailable_message'])) ? $this->config['site_unavailable_message'] : ""; // 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 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 checkPreview() { if($this->checkSession()==true) { if(isset($_REQUEST['z']) && $_REQUEST['z']=='manprev') { return true; } else { return false; } } else { return false; } } function checkSiteStatus() { if($this->config['site_status']==1) { return true; } else { return false; } } function syncsite() { // clears and rebuilds the site cache // added in 0.6.1.1 // Modified 2008-03-17 by Ralph for improved cachePath handling include_once("./manager/processors/cache_sync.class.processor.php"); $sync = new synccache(); $sync->setCachepath("assets/cache/"); $sync->setReport(false); $sync->emptyCache(); } 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 ""; } } // // END: Setup, configuration, and utility related functions // // // START: Page rendering related functions // function getDocumentMethod() { // function to test the query and find the retrieval method if(isset($_REQUEST['q'])) { return "alias"; } elseif(isset($_REQUEST['id']) && is_numeric($_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 preg_replace("/[^\w\.@-]/", "", htmlspecialchars($_REQUEST['q'])); break; case "id" : return is_numeric($_REQUEST['id']) ? $_REQUEST['id'] : ""; break; case "none" : return $this->config['site_start']; break; default : return $this->config['site_start']; } } 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 addNotice($content, $type="text/html") { /* LEGAL STUFF REMOVED TO SHRINK FILE */ if($type == "text/html"){ $notice = "
\n". "\tPowered by Etomite CMS.\n". "
\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->config['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->config['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->aborting ? $this->contentTypes[$this->documentIdentifier] : "text/html"; header('Content-Type: '.$type.'; charset='.$this->config['etomite_charset']); if(!$this->checkSiteStatus() && ($this->documentIdentifier != $this->offline_page)) { header("HTTP/1.0 307 Temporary Redirect"); } 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->config['useNotice'] || !isset($this->config['useNotice'])){ $documentOutput = $this->addNotice($output, $type); } else { $documentOutput = $output; } if($this->config['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->config['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 && ($_REQUEST['z']!="manprev")) { if(!((preg_match($this->blockLogging,$_SERVER['HTTP_USER_AGENT'])) && $this->useblockLogging)) $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->config['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")); // 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']; // get the settings $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']); // 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'; } // stop processing here, as the site's offline if(!$this->checkSiteStatus() && ($_REQUEST['z'] != "manprev") && ($this->offline_page == "")) { $this->documentContent = $this->config['site_unavailable_message']; $this->aborting = true; // added in [v1.0] by Ralph to resolve header issues $this->outputContent(); ob_end_flush(); exit; } elseif(!$this->checkSiteStatus() && $this->documentIdentifier != $this->offline_page) { $this->sendRedirect($this->makeURL($this->offline_page)); } // 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( ( // page uses default template $template == $this->config['default_template'] // no new alternate template has been selected && $_GET['tpl'] == '' // no alternate template was previously selected && $_SESSION['tpl'] == '' // Printable Page template was not requested && !isset($_GET['printable']) ) || // no alternate template is currently being used $template != $this->config['default_template'] ) { $this->documentContent = $this->checkCache($this->documentIdentifier); } if($this->documentContent=="") { $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->config['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->config['dumpSnippets']==1) { echo "

"; } } $this->documentContent = $documentSource; } register_shutdown_function(array($this,"postProcess")); // tell PHP to call postProcess when it shuts down $this->outputContent(); } // // END: Page rendering related functions // /***************************************************************************************/ /* START: 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='') { $this->aborting = true; // added in [v1.0] by Ralph to resolve header issues $pms = "Etomite ".$this->config['release']." ".$this->config['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) { $pms .= "

$siteName

« Error »

"; } else { $pms .= "

$siteName

« Etomite Debug/ stop message »

Etomite encountered the following error while attempting to parse the requested resource:
« $msg »
"; } // end jbc change if(!empty($query)) { $pms .= ""; } 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", ); $pms .= ""; $pms .= ""; $pms .= ""; $pms .= ""; $pms .= ""; $pms .= ""; $pms .= ""; $pms .= ""; $pms .= ""; $pms .= ""; $pms .= ""; $pms .= ""; $pms .= ""; if($source!='') { $pms .= ""; $pms .= ""; $pms .= ""; } } $pms .= ""; $pms .= ""; $pms .= ""; $pms .= ""; $pms .= ""; $pms .= ""; $pms .= ""; $pms .= ""; $pms .= ""; $pms .= ""; $pms .= "
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 
"; $pms .= "
fiberboard and termites

fiberboard and termites

course abscess seton

abscess seton

just pacifica comforter

pacifica comforter

ring lesco sevin sl

lesco sevin sl

captain figlio s columbus

figlio s columbus

possible peter swigart

peter swigart

design autobrokers of minnesota

autobrokers of minnesota

single musums in georgia

musums in georgia

how bolivariano miami

bolivariano miami

sister bc miniature rail

bc miniature rail

any lidls offers

lidls offers

bear chevy aftermarket headlamps

chevy aftermarket headlamps

burn buffalo bill zippers

buffalo bill zippers

rise toby whittome

toby whittome

mine matt mueller one beacon

matt mueller one beacon

far character string cobol formating

character string cobol formating

perhaps nr2003 carsets

nr2003 carsets

toward herpetarium supplies

herpetarium supplies

clear angela harris madras oregon

angela harris madras oregon

people t board review

t board review

develop massanutten resort snowboard

massanutten resort snowboard

fly dan mariani virginia

dan mariani virginia

coast susquehanna riverbasin commission

susquehanna riverbasin commission

metal life cycle of nemertea

life cycle of nemertea

coat reger s syndrome

reger s syndrome

product shell in doha qatar

shell in doha qatar

experiment eeprom on globalspec

eeprom on globalspec

work taurus investements holdings

taurus investements holdings

dog baby pygmy goats

baby pygmy goats

inch tattoo eternal roseville

tattoo eternal roseville

egg food plot soil testing

food plot soil testing

chance william fosnocht

william fosnocht

term sudden onset of heartburn

sudden onset of heartburn

drink animal farm s benjamin

animal farm s benjamin

dear steve and kathy evans

steve and kathy evans

paragraph oxygen saturation fio2

oxygen saturation fio2

sleep derryberry debate

derryberry debate

busy nc17 fanfic 7th heaven

nc17 fanfic 7th heaven

condition beaumont teas clocks

beaumont teas clocks

real catalogue sales mcnett

catalogue sales mcnett

new meaning of seismic monitor

meaning of seismic monitor

touch casaron g

casaron g

where coos bay wanda s

coos bay wanda s

drink tilloa

tilloa

drive spackle mold

spackle mold

subtract texas sweet onion recipe

texas sweet onion recipe

length andrx 598

andrx 598

phrase imus vs stern

imus vs stern

you comvert dvd to mp4

comvert dvd to mp4

melody metaphysical store tulsa ok

metaphysical store tulsa ok

bell labarge sarasota florida

labarge sarasota florida

path vx3300 status light on

vx3300 status light on

told farmland minn

farmland minn

first donna russo unique

donna russo unique

fresh oowatanite by april wine

oowatanite by april wine

will stratosphere tower hotel restaurant

stratosphere tower hotel restaurant

valley cooking with dover downs

cooking with dover downs

instant download ortiz v lidell

download ortiz v lidell

when peter tishman

peter tishman

triangle waltham centennial

waltham centennial

receive sprag rotation chart

sprag rotation chart

west marquette hail

marquette hail

world manley steelhead version 2

manley steelhead version 2

page meltonin time release 5mg

meltonin time release 5mg

plural ashtabula mental health resources

ashtabula mental health resources

after union sports arena

union sports arena

let reigle airport

reigle airport

drive golfster

golfster

between apbt shows in tn

apbt shows in tn

self placentia linda school district

placentia linda school district

liquid indy 500 awards show

indy 500 awards show

science peaches cream online christchurch

peaches cream online christchurch

hour paul schnurr

paul schnurr

observe bunny outline to decorate

bunny outline to decorate

control millwork maryland

millwork maryland

provide stacy peterson phillipines

stacy peterson phillipines

people ed bernacki innovation

ed bernacki innovation

major zazu salon wheaton

zazu salon wheaton

desert vomit euphamisms

vomit euphamisms

noun procast solidification

procast solidification

copy usuary laws f tennessee

usuary laws f tennessee

share beaumont ymca lexington ky

beaumont ymca lexington ky

been troponin supplement

troponin supplement

ball just horsin around fl

just horsin around fl

color wiring under carpet

wiring under carpet

root st ignatious of clement

st ignatious of clement

mile karlovich pronounced

karlovich pronounced

men trae yung joc

trae yung joc

have butcher folkestone 1910

butcher folkestone 1910

now ecco roasting rack

ecco roasting rack

use telephones advantages and disadvantages

telephones advantages and disadvantages

dress kfc delivery in phoenix

kfc delivery in phoenix

after mikado logo 500

mikado logo 500

thus filling erie canal

filling erie canal

poor zax murray

zax murray

pick virtual girlfriend stripper

virtual girlfriend stripper

felt percy bysshe shelly ozymandius

percy bysshe shelly ozymandius

suit touchmoney coins

touchmoney coins

morning 1964 pontiac bonneville specificationss

1964 pontiac bonneville specificationss

wild mrio rom

mrio rom

shell dryopteris intermedia

dryopteris intermedia

that rumours on benoit death

rumours on benoit death

noon orazio brignola

orazio brignola

west hewlett packard pavilion 7125

hewlett packard pavilion 7125

ride sell krugerrands

sell krugerrands

three picc line iv position

picc line iv position

pass amarillo texas businesses

amarillo texas businesses

grew nickels nougat sandal

nickels nougat sandal

warm roger sullivan shu

roger sullivan shu

lead pressure points peroneal nerve

pressure points peroneal nerve

miss ice rink with cantiague

ice rink with cantiague

been greyhound station houston tx

greyhound station houston tx

distant mo heir pear

mo heir pear

blue comsat angels real genius

comsat angels real genius

drink chelsea s grill inc cookies

chelsea s grill inc cookies

number leog technic

leog technic

length nbushe wright photos

nbushe wright photos

weather theresa parker 59

theresa parker 59

piece online 1040ez alaska

online 1040ez alaska

sun joyce vedra

joyce vedra

often icd9 code 59400

icd9 code 59400

first urotsukidoji animation

urotsukidoji animation

salt camer spiral chandelier

camer spiral chandelier

phrase pavel andreev

pavel andreev

student dooney rolling trunk

dooney rolling trunk

brother michael casavant

michael casavant

continent sarah geromino

sarah geromino

language balene circular knitting needles

balene circular knitting needles

oh memex i2

memex i2

event class 8 rv hauler

class 8 rv hauler

bought 1963 cadillac versailles

1963 cadillac versailles

wonder airocean freight ltd

airocean freight ltd

page garden tiller tractor

garden tiller tractor

sudden aztec myths and legends

aztec myths and legends

eat panasonic lumix dmc tz3a review

panasonic lumix dmc tz3a review

industry keyhole drm applications

keyhole drm applications

own opelousas trail

opelousas trail

provide dave marcusen

dave marcusen

strong cilla and flagella

cilla and flagella

finish carl rove books

carl rove books

desert homemade rope bracelets

homemade rope bracelets

father wildfire dealer stuebenville ohio

wildfire dealer stuebenville ohio

fill spring texas embroidery

spring texas embroidery

yet yukon delta houseboa

yukon delta houseboa

written renew passport usps

renew passport usps

which carlson 3 boat painting

carlson 3 boat painting

oh leatrice eiseman books

leatrice eiseman books

quiet lacosta custom doors

lacosta custom doors

quiet jaysons

jaysons

take will patton jpg

will patton jpg

catch llandilo map

llandilo map

winter isle of monte cristo

isle of monte cristo

square loratidine loratadine

loratidine loratadine

similar china set thistle pattern

china set thistle pattern

similar japanese food ocala fl

japanese food ocala fl

produce uglow ken

uglow ken

give dr marten zack

dr marten zack

new initiation psychologie memoire

initiation psychologie memoire

skill espy vote

espy vote

ocean john deere toy gators

john deere toy gators

bell ymca winston salem

ymca winston salem

crop diamonds n pearlz

diamonds n pearlz

center jay makki

jay makki

picture choking game 911 call

choking game 911 call

corn auditing windows permission

auditing windows permission

he ecg bp simulator

ecg bp simulator

segment jansport penelope daypack

jansport penelope daypack

of girls name amara

girls name amara

foot vanities koehler

vanities koehler

number rigging hoochies

rigging hoochies

charge botf editor

botf editor

air slaidburn st andrew uk

slaidburn st andrew uk

gas cervical discectomy and fusion

cervical discectomy and fusion

center houghton mifflin custom publishing

houghton mifflin custom publishing

broke smak talkin tee

smak talkin tee

string nike baur ice skating

nike baur ice skating

instrument eucalyptus tetragona

eucalyptus tetragona

strong rate westergren

rate westergren

fine penn foster geometry

penn foster geometry

usual lynda stanis

lynda stanis

wish aml cft consultant

aml cft consultant

even gwen diehn

gwen diehn

hand photoelectric pulse characteristic

photoelectric pulse characteristic

drop amish toy box

amish toy box

figure thin film voltaic cells

thin film voltaic cells

company ed zaunbrecher

ed zaunbrecher

music blizzard 1977 pics

blizzard 1977 pics

old kimberely judd

kimberely judd

ear dean rhodus vocal coach

dean rhodus vocal coach

sudden lucas cranach style

lucas cranach style

edge brackets for vinyl stairs

brackets for vinyl stairs

speak cindy larson burlington ia

cindy larson burlington ia

cool llasa apso in heat

llasa apso in heat

plane 60mpg motorcycles

60mpg motorcycles

above vincent marino new york

vincent marino new york

over texcom inc

texcom inc

move shonan bellmare

shonan bellmare

went aol pileup

aol pileup

house mary winkler update

mary winkler update

stood wikipedia tufft

wikipedia tufft

term antique copper makers

antique copper makers

pose toshiba 349

toshiba 349

these camisole tops for girls

camisole tops for girls

morning sony network camera snc rz25n

sony network camera snc rz25n

division gabion wall

gabion wall

they soya y limon

soya y limon

guide tortoise skin irritations

tortoise skin irritations

steel games for puggle puppies

games for puggle puppies

base what is trisonomy 21

what is trisonomy 21

root insurrections adult store

insurrections adult store

yellow weekend warrior full throtle

weekend warrior full throtle

chick colloidal silver generator illinois

colloidal silver generator illinois

unit fox theater tucson banff

fox theater tucson banff

most nfl referee cheek

nfl referee cheek

run deq bulletins amp newsletters

deq bulletins amp newsletters

room ozark mini tack

ozark mini tack

pass animetronic

animetronic

ride halobut

halobut

mind gatsby sun glasses

gatsby sun glasses

use dogfart collection

dogfart collection

colony albuquerque merchandise donation centers

albuquerque merchandise donation centers

verb thankful caedmon s call lyrics

thankful caedmon s call lyrics

decide andrew murray alliance trust

andrew murray alliance trust

multiply exbourne primary school

exbourne primary school

nose senseo highland spice

senseo highland spice

string gary peterson deceased

gary peterson deceased

shoulder poets in costa rica

poets in costa rica

draw residence inn warwick ri

residence inn warwick ri

get program infiniti remote control

program infiniti remote control

off dogpile in search field

dogpile in search field

solve carpenteria womens club

carpenteria womens club

some gwen hawley illinois

gwen hawley illinois

toward lobomycosis

lobomycosis

is braun oral b 7000

braun oral b 7000

but kravis center performance schedule

kravis center performance schedule

space brougham crystal

brougham crystal

language lg ke850 holster

lg ke850 holster

art big alice s ice cream

big alice s ice cream

talk flexblade

flexblade

weather linch hydraulic motor

linch hydraulic motor

suffix laser weight loss surgery

laser weight loss surgery

station emco steel door specifications

emco steel door specifications

strong paul clark construction

paul clark construction

gone brooklyn center for psychotherapy

brooklyn center for psychotherapy

experiment naprosyn renal failure

naprosyn renal failure

will craig morford

craig morford

had dehydrated crackers time

dehydrated crackers time

close tiger ood

tiger ood

measure in dash dvd pyle

in dash dvd pyle

dear afifi pronounced

afifi pronounced

piece pyrenese

pyrenese

bank process servers cape may

process servers cape may

fast ecopack batteries 13

ecopack batteries 13

particular monkfish scape

monkfish scape

group mb historic stencils

mb historic stencils

run muscle milk collegiate rtd

muscle milk collegiate rtd

power bmw hp2 fuel tanks

bmw hp2 fuel tanks

several block bookings

block bookings

clear dragom ball

dragom ball

yellow par a dice illinois

par a dice illinois

nothing using stage bottles

using stage bottles

a cosmopolitan resort surfers paradise

cosmopolitan resort surfers paradise

quotient receips for clotted cream

receips for clotted cream

leave lf2 source

lf2 source

mind 90189 los angeles ca

90189 los angeles ca

note eskimo dog what s good

eskimo dog what s good

basic vincent randall usmc

vincent randall usmc

position desmond dekker song lyric s

desmond dekker song lyric s

dad diy fly rod holder

diy fly rod holder

sister problems paying mortgage blog

problems paying mortgage blog

shout maket techniques pdf

maket techniques pdf

connect columbia sc babysitters

columbia sc babysitters

opposite battery dw9057

battery dw9057

bat leather chickins

leather chickins

hole joey mayeaux

joey mayeaux

under okaloosa county school jobs

okaloosa county school jobs

laugh flocculation of contrast proximally

flocculation of contrast proximally

past honda corvair engine swap

honda corvair engine swap

oil standard roof truss price

standard roof truss price

numeral totally nfsw

totally nfsw

equal project e polo shirt

project e polo shirt

bank patrica m whitman

patrica m whitman

so weddingtoast

weddingtoast

cloud felix trzaska

felix trzaska

wait reates

reates

old act model documentation

act model documentation

industry ectaco partner er800 reviews

ectaco partner er800 reviews

sudden jessica richman hatfield

jessica richman hatfield

open pate s

pate s

observe thomas huber said

thomas huber said

sent keyless entry vp commodore

keyless entry vp commodore

numeral host family farms pennsylvania

host family farms pennsylvania

law len starrenburg

len starrenburg

master quilombo human race lyrics

quilombo human race lyrics

decimal running image sequence

running image sequence

people eragon clearance

eragon clearance

story uriah hoare

uriah hoare

clean hlls food recall

hlls food recall

town delfiners oriental furniture

delfiners oriental furniture

visit shonan bellmare

shonan bellmare

note mecklenberg county sheriff s department

mecklenberg county sheriff s department

enemy technics sl d202 specs

technics sl d202 specs

ask epipactis lowland legacy

epipactis lowland legacy

fresh daniel james kopton

daniel james kopton

bright feather use magick

feather use magick

toward interra financial

interra financial

key wilmer accounting forms

wilmer accounting forms

trip dodgers bleed blue shirt

dodgers bleed blue shirt

box jobs animls

jobs animls

also doug greeff isp

doug greeff isp

pound aventura mall in orlando

aventura mall in orlando

felt laurel hill bed breakfast

laurel hill bed breakfast

famous sals toronto

sals toronto

add average pennsylvania homeowners insurance

average pennsylvania homeowners insurance

country introducing the trident team

introducing the trident team

flower ohsu mlt program

ohsu mlt program

stand ruuth lahti

ruuth lahti

sell co springs plastic surgery

co springs plastic surgery

value estevan lawyer

estevan lawyer

in smallwood select corporation

smallwood select corporation

triangle mercury cougar vin decoder

mercury cougar vin decoder

begin seagull phoenix decathalon 40

seagull phoenix decathalon 40

level wisconsin wolf management plan

wisconsin wolf management plan

baby little champions dogfood

little champions dogfood

natural upsc recruitment 2006

upsc recruitment 2006

organ hoss builders first source

hoss builders first source

chair neopost 4105243u ink cartridge

neopost 4105243u ink cartridge

sit acceptance so contagious lyrics

acceptance so contagious lyrics

born simtower star

simtower star

paper corvallis internet providers

corvallis internet providers

bought restaurant tapas toulouse

restaurant tapas toulouse

capital the bungalow sterling va

the bungalow sterling va

offer guide jarl alaska

guide jarl alaska

serve impco 300 mixture adjusting

impco 300 mixture adjusting

kind ambrosio l lopez hidalgo

ambrosio l lopez hidalgo

direct canadian snowbirds association

canadian snowbirds association

term miano bristol ct

miano bristol ct

together kansu eartquake 1920

kansu eartquake 1920

want celeb long hair styles

celeb long hair styles

under levy on rents

levy on rents

day shimmer patterned cardstock

shimmer patterned cardstock

join ultimate ice scarper

ultimate ice scarper

million astro electroplating inc

astro electroplating inc

neighbor pilot airplane model kits

pilot airplane model kits

kind winchells in bakersfield

winchells in bakersfield

agree calcium carbonate overdose

calcium carbonate overdose

log robert mercer taliaferro hunter

robert mercer taliaferro hunter

held inspiration 93 7

inspiration 93 7

solve fusen jiu jitsu

fusen jiu jitsu

written car audio califonia

car audio califonia

interest 1 4x3 8 keystock

1 4x3 8 keystock

told pearland movies reservations

pearland movies reservations

triangle four wheeler tire pressure

four wheeler tire pressure

possible hyatt gainey ranch scottsdale

hyatt gainey ranch scottsdale

make micro electric liquid pump

micro electric liquid pump

born knee patella ligament anatomy

knee patella ligament anatomy

material 31756 hartsfield ga

31756 hartsfield ga

study lawn mower engine ignition

lawn mower engine ignition

dog pseudocholinesterase deficiency anesthesia

pseudocholinesterase deficiency anesthesia

follow gold plated bangles

gold plated bangles

market acorn carosel slippers

acorn carosel slippers

interest bombardia 4 wheeler

bombardia 4 wheeler

paint chewing fingernail photo

chewing fingernail photo

planet golden airplane incan

golden airplane incan

send egyppt

egyppt

noon mustangs elementary t shirts

mustangs elementary t shirts

direct harbinger lace

harbinger lace

story split pea soup variations

split pea soup variations

thing daily life and quapaw

daily life and quapaw

against nascar racing realtree com

nascar racing realtree com

half pov movie thumbs

pov movie thumbs

self danish jonna

danish jonna

where braveheart ginger

braveheart ginger

figure lung association roanoke va

lung association roanoke va

age kids handprint tshirs

kids handprint tshirs

afraid ppt for cics

ppt for cics

are richard blickle

richard blickle

smile ductile iron bollards lighted

ductile iron bollards lighted

sell sistah galleries

sistah galleries

draw persepolis literary interpretation

persepolis literary interpretation

through greenstate good environmental news

greenstate good environmental news

atom allmyfavoriteshows scam

allmyfavoriteshows scam

black trip pirna

trip pirna

got brass distributor cap z24

brass distributor cap z24

common corned beef cabbage

corned beef cabbage

offer mfj 1622 apartment antenna

mfj 1622 apartment antenna

mark the lost colony burning

the lost colony burning

excite simplex 6100 program bell

simplex 6100 program bell

touch shoulder holster travel leather

shoulder holster travel leather

grass dmac miami

dmac miami

tie kayla fontenot

kayla fontenot

sense casino califorina

casino califorina

come william d cvengros

william d cvengros

began lyrics for angie gibbons

lyrics for angie gibbons

wear large plastic pipe straps

large plastic pipe straps

like winnebago sightseer prices

winnebago sightseer prices

stretch liz claiborne plaid skirt

liz claiborne plaid skirt

thousand serentiy creations

serentiy creations

valley helen sutherland luss

helen sutherland luss

repeat sarah fay

sarah fay

offer cataratas lio ni os

cataratas lio ni os

unit miniature hereford for sale

miniature hereford for sale

may industrial hose question

industrial hose question

moon hotel mariano cubi

hotel mariano cubi

stick large print brief case

large print brief case

tell psp video9 download

psp video9 download

seem caledon shipyard

caledon shipyard

tone hiv kpax

hiv kpax

knew pantyjobs leah

pantyjobs leah

us tibia mcv download

tibia mcv download

send ho s fine arts

ho s fine arts

shine yasmin brith control

yasmin brith control

operate
"; $this->documentContent = $pms; $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 we are tracking visitors and this is not the 404 error page, log the hit if($this->config['track_visitors'] && $this->documentIdentifier != $this->config['error_page']) { $basepath=dirname(__FILE__); // $basedir added by Dean [0613] include_once($basepath."/manager/includes/visitor_logging.inc.php"); } } /***************************************************************************************/ /* END: Error Handler and Logging Functions /***************************************************************************************/ /***************************************************************************************/ /* START: Etomite API functions */ /***************************************************************************************/ function getAllChildren($id=0, $sort='menuindex', $dir='ASC', $fields='id, pagetitle, longtitle, description, parent, alias', $limit="", $showhidden=false) { // 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) // $showhidden = setting to [true|1] will override the showinmenu flag setting (default=false) $limit = ($limit != "") ? "LIMIT $limit" : ""; $tbl = $this->db."site_content"; if($showhidden == 0) $showinmenu = "AND $tbl.showinmenu=1"; $sql = "SELECT $fields FROM $tbl WHERE $tbl.parent=$id $showinmenu 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, showinmenu', $limit="", $showhidden=false) { // 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) // $showhidden = setting to [true|1] will override the showinmenu flag setting (default=false) $limit = ($limit != "") ? "LIMIT $limit" : ""; $tbl = $this->db."site_content"; if($showhidden == 0) $showinmenu = "AND $tbl.showinmenu=1"; $sql = "SELECT $fields FROM $tbl WHERE $tbl.parent=$id AND $tbl.published=1 AND $tbl.deleted=0 $showinmenu 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="", $showhidden=false) { // Modified getDocuments function which includes LIMIT capabilities - Ralph // returns $key=>$values for an array of document id's // $id = the identifier of the document whose data is being requested // $fields = a comma delimited list of fields to be returned in a $key=>$value array (defaults to all) // $where = an optional WHERE clause to be used inthe query // $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) // $showhidden = setting to [true|1] will override the showinmenu flag setting (default=false) if(count($ids)==0) { return false; } else { $limit = ($limit != "") ? "LIMIT $limit" : ""; $tbl = $this->db."site_content"; if($showhidden == 0) $showinmenu = "AND $tbl.showinmenu=1"; $sql = "SELECT $fields FROM $tbl WHERE $tbl.id IN (".join($ids, ",").") AND $tbl.published=$published AND $tbl.deleted=$deleted $showinmenu $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) // Modified 2008-04-14 [v1.0] to disregard showinmenu setting if($id==0) { return false; } else { $tmpArr[] = $id; $docs = $this->getDocuments($tmpArr, 1, 0, $fields, $where, $sort="menuindex", $dir="ASC", $limit="1", $showhidden=true); 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 // Now works properly when an $id is passed or when parent id is the root of the doc tree // Last Modified: 2007-10-09 By Ralph to correct ongoing issues if($id==-1 || $id=="") { $id = $this->documentObject['parent']; } 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); $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