0) { //send an email with error-information to ADMINISTRATOR $mailText = strip_tags( $errorMsg )."\n\n\n"; //get and include all the headers $mailText .= "HEADERS:\n"; $headers = getallheaders(); while (list ($header, $value) = each ($headers)) { $mailText .= "$header: $value\n"; } //get info about the page we are currently on if (is_array($_SESSION['VISITOR']->browser)) { //include info about the user agent $mailText .= "type: ".$_SESSION['VISITOR']->browser["type"]."\n"; $mailText .= "major-version: ".$_SESSION['VISITOR']->browser["major"]."\n"; $mailText .= "minor-version: ".$_SESSION['VISITOR']->browser["minor"]."\n"; $mailText .= "operating system: ".$_SESSION['VISITOR']->browser["os"]."\n"; } if ($_SESSION['VISITOR']->isLoggedIn()) { $mailText .= "\n\n\n"; $mailText .= "Användare: ".$_SESSION['VISITOR']->user->getName()." (".$_SESSION['VISITOR']->user->getUsername().")\n"; $mailText .= "Adress: ".strip_tags( $_SESSION['VISITOR']->user->getEntireAddress() )."\n"; $mailText .= "Tlf: ".$_SESSION['VISITOR']->user->getPhone()."\n"; $mailText .= "Mobiltelefon: ".$_SESSION['VISITOR']->user->getCellphone()."\n"; } //the info has been set together, send it $mailsender = createObject("PHPMailer"); $mailsender->AddAddress($sendMailTo, "Utvecklingsansvarig för falbygdensfk.se"); $mailsender->Subject = "Fel på falbygdensfk.se"; $mailsender->Body = $mailText; $mailsender->From = $RUNCONFIG["companyemail"]; $mailsender->Sender = $RUNCONFIG["companyemail"]; $mailsender->FromName = $RUNCONFIG["companyname"]; $mailsender->Send(); } //check if we shall print an error message and redirect if (!empty($redirectUrl) && ( !empty($errorHeader) || !empty($errorMsg) )) { if (strlen($errorHeader) <= 0) $errorHeader = "Ett fel har uppstått"; if (!$RUNCONFIG["topIsIncluded"]) { include_once('layout.php'); pageStart( $errorHeader ); } echo "".$errorHeader."
\n"; echo "".$errorMsg."
\n"; if ($redirectTime > 0) { echo "

Du kommer att tas till en ny sida om $redirectTime sekunder"; echo ""; } else { echo "

Klicka här för att fortsätta."; } if (!$RUNCONFIG["endIsIncluded"]) { pageEnd( ); } } //check if we shall only print an error message elseif (empty($redirectUrl) && ( !empty($errorHeader) || !empty($errorMsg) )) { //echo "skriv ut felmeddelanden"; if (strlen($errorHeader) <= 0) $errorHeader = "Ett fel har uppstått"; if (!$RUNCONFIG["topIsIncluded"]) { pageStart( $errorHeader ); } echo "".$errorHeader."
\n"; echo "".$errorMsg."
\n"; if (!$RUNCONFIG["endIsIncluded"]) { pageEnd( ); } } //check if we shall only redirect else if(!empty($redirectUrl) && empty($errorHeader) && empty($errorMsg) ) { header("Location: $redirectUrl"); exit(); } } } function fetchNewMenu($categoryID, $nodes, $ttl = 120) { $retval = array(); $ckey = 'fetchNewMenu'; //Cacher::del($ckey, $categoryID); if (null === ($retval = Cacher::get($ckey, $categoryID))): $categorylist = createObject("CategoryList"); $cats = $categorylist->getRecursiveTree(false, "yes"); foreach($cats['object'] as $key => $cat): $parentId = $cat->getParentId(); $id = $cat->getID(); $info['id'] = $id; $info['name'] = $cat->getName(); if($cat->getModule() == 'redirect' && $cat->getPresentation() == 'url' && $cat->getMetadata()): $info['href'] = $cat->getMetadata(); $info['link'] = 'extern'; else: $info['href'] = getCategoryLink($cat); $info['link'] = 'intern'; endif; $info['nodes'] = $cat->getNodeData(); if(in_array($id, $nodes) || $id == $categoryID): $info['children'] = fetchNewSub($cat->children, $nodes, $categoryID); else: $info['children'] = array(); endif; if ($cat->getParentId() == 0): $retval[$id] = $info; endif; endforeach; Cacher::set($ckey, $retval, $ttl, $categoryID); endif; return $retval; } function fetchNewSub($children, $nodes, $categoryID) { $retval = array(); foreach($children as $c): $parentId = $c->getParentId(); $id = $c->getID(); $info['id'] = $id; $info['name'] = $c->getName(); if($c->getModule() == 'redirect' && $c->getPresentation() == 'url' && $c->getMetadata()): $info['href'] = $c->getMetadata(); $info['link'] = 'extern'; else: $info['href'] = getCategoryLink($c); $info['link'] = 'intern'; endif; $info['nodes'] = $c->getNodeData(); if(in_array($id, $nodes) || $id == $categoryID): $info['children'] = fetchNewSub($c->children, $nodes, $categoryID); else: $info['children'] = array(); endif; $retval[$id] = $info; endforeach; return $retval; } function fetchTopLinks($categoryID, $ttl = 120) { $retval = array(); $ckey = 'fetchTopLinks'; //Cacher::del($ckey, $categoryID); if (null === ($retval = Cacher::get($ckey, $categoryID))): $categorylist = createObject("CategoryList"); $cats = $categorylist->getSubCategories( $_SESSION['db'], $categoryID, "catOrder asc", "yes" ); foreach($cats as $key => $cat): $info['id'] = $cat->getID(); $info['name'] = $cat->getName(); if($cat->getModule() == 'redirect' && $cat->getPresentation() == 'url' && $cat->getMetadata()): $info['href'] = $cat->getMetadata(); $info['link'] = 'extern'; else: $info['href'] = getCategoryLink($cat); $info['link'] = 'intern'; endif; $retval[] = $info; endforeach; Cacher::set($ckey, $retval, $ttl, $categoryID); endif; return $retval; } ?>