?php error_reporting(E_ALL); if (function_exists('ini_set')) { ini_set('register_globals', 'Off'); ini_set('display_errors', 'On'); ini_set('magic_quotes_gpc', 'Off'); ini_set('arg_separator.output', '&'); ini_set('url_rewriter.tags', 'a=href,area=href,frame=src,input=src'); ini_set('session.gc_maxlifetime', 3600); } if (function_exists('date_default_timezone_set')) { date_default_timezone_set('Europe/Paris'); } session_start(); include('axipi.class.php'); include('_custom.class.php'); $a = new custom(); $chrono_start = $a->getmicrotime(); $output = ''; include('database.class.php'); $a->d1 = new database(); include('database1.inc.php'); $a->d1->connect($a->d1->type, $a->d1->host, $a->d1->name, $a->d1->login, $a->d1->password); if (!$a->d1->_connect) { include_once('components/system/languages/'.$a->language['language'].'.inc.php'); $a->errors[] = sprintf($a->s[$a->language['language']]['system']['no-database-host'], $a->d1->host, $a->d1->login); $a->d1->database = 0; } else if($a->d1->select_db == 0) { include_once('components/system/languages/'.$a->language['language'].'.inc.php'); $a->errors[] = sprintf($a->s[$a->language['language']]['system']['no-database-name'], $a->d1->name, $a->d1->login); $a->d1->database = 0; } else { $a->d1->database = 1; if(isset($_SERVER['HTTP_HOST']) == 1) { $sqlSelect = 'SELECT i.language, i.section, h.host, h.settings, h.itemfirst FROM '.$a->d1->prefix.'hosts h LEFT JOIN '.$a->d1->prefix.'items i ON i.item = h.itemfirst WHERE h.host = \''.$_SERVER['HTTP_HOST'].'\' AND h.publishedby != 0'; $detailHost = $a->d1->query_select($sqlSelect, array('cache'=>1, 'cachecode'=>'host-'.$_SERVER['HTTP_HOST'])); if($detailHost['total'] != 0) { $a->host['defaultlanguage'] = $detailHost['results']['language'][0]; $a->host['defaultsection'] = $detailHost['results']['section'][0]; $a->host['itemfirst'] = $detailHost['results']['itemfirst'][0]; $a->host['host'] = $detailHost['results']['host'][0]; $a->host['settings'] = $a->get_settings($detailHost['results']['settings'][0]); } else { $sqlSelect = 'SELECT i.language, i.section, l.itemfirst FROM '.$a->d1->prefix.'languages l LEFT JOIN '.$a->d1->prefix.'items i ON i.item = l.itemfirst WHERE l.language = \'fr\''; $detailLanguage = $a->d1->query_select($sqlSelect); $a->host['defaultlanguage'] = $detailLanguage['results']['language'][0]; $a->host['defaultsection'] = $detailLanguage['results']['section'][0]; $a->host['itemfirst'] = $detailLanguage['results']['itemfirst'][0]; } if($a->d1->table == 0) { include_once('components/system/languages/'.$a->language['language'].'.inc.php'); $a->errors[] = $a->s[$a->language['language']]['system']['no-database-table']; $a->d1->database = 0; $a->d1->errors = array(); } } } if ($a->d1->database == 0) { $a->user['settings']['display_debug'] = 1; $a->user['settings']['enable_wysiwyg'] = 0; include_once('components/system/system.prepend.php'); $a->section['settings']['content_type'] = 'text/html'; $a->titles[] = 'axipi'; $a->titlesTotal = count($a->titles); $a->get['p'] = 'axipi'; $a->section['settings']['charset'] = 'iso-8859-1'; $a->section['settings']['doctype'] = 'xhtml-1.0-transitional'; $a->language['title'] = 'axipi'; $a->settings['layout'] = 'admin/admin'; $a->items[$itemZone]['classes-box'] = array('box', 'box-breadcrumbs'); $a->items[$itemZone]['classes-display'] = array('display', 'display-breadcrumbs'); $a->breadcrumbs[] = $a->s[$a->language['language']]['system']['database-error']; include('components/misc/breadcrumbs.php'); $buffer['header'] = $output; $output = ''; $itemZone = 'errors'; $a->items[$itemZone]['classes-box'] = array('box', 'box-errors'); $a->items[$itemZone]['classes-display'] = array('display', 'display-errors'); $a->items[$itemZone]['title'] = $a->s[$a->language['language']]['system']['errors']; include('components/misc/errors.php'); $buffer['content-append'] = $output; $buffer['content-prepend'] = ''; $buffer['content'] = ''; $buffer['sidebar'] = ''; $a->debug['php'] = array(); $a->classes = array($a->language['language']); } if ($a->d1->database == 1) { if(isset($_GET['p']) == 1 && $_GET['p'] != '' && $a->isitem($_GET['p'])) { $a->get['p'] = strval($_GET['p']); } else { $a->get['p'] = $a->host['itemfirst']; } if(isset($_GET['a']) == 1) { $a->get['a'] = strval($_GET['a']); } if(isset($_GET['item']) == 1 && $_GET['item'] != '' && $a->isitem($_GET['item'])) { $a->get['item'] = strval($_GET['item']); } else { $a->get['item'] = ''; } if(isset($_GET['itemparent']) == 1 && $_GET['itemparent'] != '' && $a->isitem($_GET['itemparent'])) { $a->get['itemparent'] = strval($_GET['itemparent']); } else { $a->get['itemparent'] = ''; } if(isset($_GET['id']) == 1) { $a->get['id'] = intval($_GET['id']); } if(isset($_GET['version']) == 1) { $a->get['version'] = intval($_GET['version']); } $sqlSelect = 'SELECT i.*, c.layout AS componentlayout, c.alternative AS componentalternative FROM '.$a->d1->prefix.'items i LEFT JOIN '.$a->d1->prefix.'components c ON c.component = i.component WHERE ((CONCAT(i.publishstartdate,\' \', i.publishstarttime) <= \''.date('Y-m-d H:i:s').'\') OR (i.unpublishdatebefore != \'0000-00-00\' AND i.unpublishdatebefore <= \''.date('Y-m-d').'\')) AND c.incontent = 1 AND i.item = \''.$a->get['p'].'\' AND i.item != \'\' AND i.publishedby != 0'; $detailItem = $a->d1->query_select($sqlSelect); if($detailItem['total'] == 0) { $a->section['section'] = 'site'; } else { $a->section['section'] = $detailItem['results']['section'][0]; } $sqlSelect = 'SELECT s.* FROM '.$a->d1->prefix.'sections s WHERE s.section = \''.$a->section['section'].'\' AND s.publishedby != 0'; $detailSection = $a->d1->query_select($sqlSelect, array('cache'=>1, 'cachecode'=>'section-'.$a->section['section'])); $a->section['settings'] = $a->get_settings($detailSection['results']['settings'][0]); $a->session_key = $a->section['settings']['session_key']; if(isset($_SESSION[$a->session_key]['id']) == 1) { $a->user['id'] = $_SESSION[$a->session_key]['id']; } if($a->user['id'] != -1) { $sqlSelect = 'SELECT u.* FROM '.$a->d1->prefix.'users u WHERE u.id = \''.$a->user['id'].'\' AND u.publishedby != 0'; $detailUser = $a->d1->query_select($sqlSelect); if($detailUser['total'] != 0) { if($detailUser['results']['publishedby'][0] != 0 && $detailUser['results']['lockedby'][0] == 0 && $detailUser['results']['password'][0] != '' && $_SESSION[$a->session_key]['password'] == $detailUser['results']['password'][0]) { $a->user['email'] = $detailUser['results']['email'][0]; $a->user['lastname'] = $detailUser['results']['lastname'][0]; $a->user['firstname'] = $detailUser['results']['firstname'][0]; $a->user['nickname'] = $detailUser['results']['nickname'][0]; if ($a->user['nickname'] != '') { $a->user['displayname'] = $detailUser['results']['nickname'][0]; } else { $a->user['displayname'] = $detailUser['results']['firstname'][0].' '.$detailUser['results']['lastname'][0]; } $a->user['settings'] = $a->get_settings($detailUser['results']['settings'][0]); $a->user['access'] = 'connected'; $newtimestamp = date('U'); $_SESSION[$a->session_key]['timestamp-live'] = $newtimestamp; } else { $_SESSION[$a->session_key] = array(); $logoutValues = $a->getitemunique('users/logout', 'site', $a->language['language']); header('Location: index.php?p='.$logoutValues['item']); exit(0); } } else { $_SESSION[$a->session_key] = array(); $logoutValues = $a->getitemunique('users/logout', 'site', $a->language['language']); header('Location: index.php?p='.$logoutValues['item']); exit(0); } unset($detailUser); $sqlSelect = 'SELECT ug.group FROM '.$a->d1->prefix.'users_groups ug WHERE ug.publishedby != 0 AND ug.user = '.$a->user['id']; $groupsUser = $a->d1->query_select($sqlSelect, array('cache'=>1, 'cachecode'=>'user-'.$a->user['id'].'-groups')); if($groupsUser['total'] != 0) { $a->user['groups'] = $groupsUser['results']['group']; $a->user['groups'][] = 'connected'; } else { $a->user['groups'] = array('connected'); } $sqlSelect = 'SELECT permission FROM '.$a->d1->prefix.'groups_permissions WHERE `group` IN('.$a->array2in($a->user['groups']).') GROUP BY permission'; $listGroupsPermissions = $a->d1->query_select($sqlSelect); for ($i=0;$i<$listGroupsPermissions['total'];$i++) { $perm[$listGroupsPermissions['results']['permission'][$i]] = 1; } unset($listGroupsPermissions); $sqlSelect = 'SELECT item, permission FROM '.$a->d1->prefix.'items_permissions WHERE `group` IN('.$a->array2in($a->user['groups']).') GROUP BY item, permission'; $listPermissions = $a->d1->query_select($sqlSelect); for ($i=0;$i<$listPermissions['total'];$i++) { $a->perm['local'][$listPermissions['results']['item'][$i]][$listPermissions['results']['permission'][$i]] = 1; } } else { $perm = array(); $a->user['settings']['display_debug'] = 0; $a->user['settings']['enable_wysiwyg'] = 0; $a->user['email'] = ''; $a->user['lastname'] = ''; $a->user['firstname'] = ''; $a->user['displayname'] = ''; $a->user['access'] = 'guest'; $a->user['groups'] = array('guest'); $groupsUser['total'] = 0; } $sqlSelect = 'SELECT p.permission FROM '.$a->d1->prefix.'permissions p'; $listPermissions = $a->d1->query_select($sqlSelect, array('cache'=>1, 'cachecode'=>'permissions')); for ($i=0;$i<$listPermissions['total'];$i++) { if(isset($perm[$listPermissions['results']['permission'][$i]]) == 1) { $a->perm['global'][$listPermissions['results']['permission'][$i]] = 1; } else { $a->perm['global'][$listPermissions['results']['permission'][$i]] = 0; } } unset($listPermissions); unset($perm); if(isset($_SESSION[$a->session_key]['wrong-auth']) == 1 && $_SESSION[$a->session_key]['wrong-auth'] > 2) { $redirectstatus = 401; $_SESSION[$a->session_key]['wrong-auth'] = 0; } else if($detailItem['total'] == 0) { $redirectstatus = 404; } else if($detailItem['results']['groups'][0] == 'guest' && $a->user['access'] == 'connected') { $redirectstatus = 403; } else if($detailItem['results']['groups'][0] == 'connected' && $a->user['access'] == 'guest') { $redirectstatus = 403; } else if($detailItem['results']['groups'][0] == 'groups') { $sqlSelect = 'SELECT ig.group FROM '.$a->d1->prefix.'items_groups ig WHERE ig.item = \''.$a->get['p'].'\''; $groupsItem = $a->d1->query_select($sqlSelect, array('cache'=>1, 'cachecode'=>'groups-'.$a->get['p'])); if($groupsUser['total'] == 0 || $groupsItem['total'] == 0) { $redirectstatus = 403; } else { $diffRights = array_intersect($groupsItem['results']['group'], $a->user['groups']); $diffRightsTotal = count($diffRights); if($diffRightsTotal == 0) { $redirectstatus = 403; } else { $redirectstatus = 200; } unset($diffRights); } } else { $redirectstatus = 200; } unset($groupsUser); if(isset($_GET['v']) == 1 && ($a->perm['global']['content/revision-view'] == 1 || isset($a->perm['local'][$a->get['p']]['content/revision-view']) == 1)) { $sqlSelect = 'SELECT r.*, c.layout AS componentlayout, c.alternative AS componentalternative FROM '.$a->d1->prefix.'revisions r LEFT JOIN '.$a->d1->prefix.'components c ON c.component = r.component WHERE r.item = \''.$a->get['p'].'\' AND r.version = '.intval($_GET['v']); $detailItem = $a->d1->query_select($sqlSelect); if($detailItem['total'] == 0) { $redirectstatus = 404; } else { $redirectstatus = 200; } } if($redirectstatus != 200) { $sqlSelect = 'SELECT i.*, c.layout AS componentlayout, c.alternative AS componentalternative FROM '.$a->d1->prefix.'items i LEFT JOIN '.$a->d1->prefix.'components c ON c.component = i.component WHERE i.section = \''.$a->host['defaultsection'].'\' AND i.language = \''.$a->host['defaultlanguage'].'\' AND i.component = \'errorcodes/error'.$redirectstatus.'\' AND i.publishedby != 0'; $detailItem = $a->d1->query_select($sqlSelect); $a->section['section'] = $detailItem['results']['section'][0]; $sqlSelect = 'SELECT s.* FROM '.$a->d1->prefix.'sections s WHERE s.section = \''.$a->section['section'].'\' AND s.publishedby != 0'; $detailSection = $a->d1->query_select($sqlSelect); $a->section['settings'] = $a->get_settings($detailSection['results']['settings'][0]); } $a->get['p'] = $detailItem['results']['item'][0]; $a->item['itemvirtual'] = $detailItem['results']['itemvirtual'][0]; $a->item['itemparent'] = $detailItem['results']['itemparent'][0]; $a->item['itemlink'] = $detailItem['results']['itemlink'][0]; $a->item['itemfile'] = $detailItem['results']['itemfile'][0]; $a->item['itemmedia_s'] = $detailItem['results']['itemmedia_s'][0]; $a->item['itemmedia_m'] = $detailItem['results']['itemmedia_m'][0]; $a->item['publishstartdate'] = $detailItem['results']['publishstartdate'][0]; $a->item['publishstarttime'] = $detailItem['results']['publishstarttime'][0]; $a->item['title'] = $a->display_data(strip_tags($detailItem['results']['title'][0])); $a->item['titlesub'] = $detailItem['results']['titlesub'][0]; $a->item['description'] = $detailItem['results']['description'][0]; $a->item['keywords'] = $detailItem['results']['keywords'][0]; $a->item['summary'] = $detailItem['results']['summary'][0]; $a->item['content'] = $detailItem['results']['content'][0]; if($detailItem['results']['componentalternative'][0] != '') { $a->item['component'] = $detailItem['results']['componentalternative'][0]; } else { $a->item['component'] = $detailItem['results']['component'][0]; } $a->item['layout'] = $detailItem['results']['layout'][0]; $a->item['componentlayout'] = $detailItem['results']['componentlayout'][0]; $a->item['ordering'] = $detailItem['results']['ordering'][0]; $a->item['datecreatedby'] = $detailItem['results']['datecreatedby'][0]; $a->item['datemodifiedby'] = $detailItem['results']['datemodifiedby'][0]; $a->item['language'] = $detailItem['results']['language'][0]; $a->item['settings'] = $a->get_settings($detailItem['results']['settings'][0]); unset($detailItem); if($a->item['language'] != '') { $a->language['language'] = $a->item['language']; } else { $a->language['language'] = $a->section['language']; } include_once('components/system/languages/'.$a->language['language'].'.inc.php'); include_once('components/users/languages/'.$a->language['language'].'.inc.php'); $sqlSelect = 'SELECT l.* FROM '.$a->d1->prefix.'languages l WHERE l.language = \''.$a->language['language'].'\''; $detailLanguage = $a->d1->query_select($sqlSelect, array('cache'=>1, 'cachecode'=>'language-'.$a->language['language'])); $a->language['title'] = $a->display_data($detailLanguage['results']['title'][0]); $a->language['description'] = $detailLanguage['results']['description'][0]; $a->language['keywords'] = $detailLanguage['results']['keywords'][0]; $a->language['itemfirst'] = $detailLanguage['results']['itemfirst'][0]; unset($detailLanguage); if($a->item['description'] != '') { $a->settings['description'] = $a->item['description']; } else if($a->language['description'] != '') { $a->settings['description'] = $a->language['description']; } if($a->item['keywords'] != '') { $a->settings['keywords'] = $a->item['keywords']; } else if($a->language['keywords'] != '') { $a->settings['keywords'] = $a->language['keywords']; } $a->head[] = ''; $a->head[] = ''; $a->head[] = ''; $a->head[] = ''; $a->head[] = ''; $a->head[] = ''; if (isset($a->settings['keywords']) == 1) { $a->head[] = ''; } $a->head[] = ''; if ($a->item['datemodifiedby'] != '0000-00-00 00:00:00') { $a->head[] = ''; } if (isset($a->settings['description']) == 1) { $a->head[] = ''; } if (isset($a->settings['keywords']) == 1) { $a->head[] = ''; } $a->head[] = ''; $a->head[] = ''; $a->head[] = ''; $a->head[] = ''; $a->head['robots'] = ''; $a->section['layout'] = $detailSection['results']['layout'][0]; $a->get_parent_tree($a->get['p']); $a->items_tree = array_reverse($a->items_tree); if(isset($a->item['settings']['no_concat_title']) == 1 && $a->item['settings']['no_concat_title'] == 1) { $a->titles[] = $a->item['title']; } else { if($a->section['section'] == 'admin') { include_once('components/system/languages/'.$a->language['language'].'.inc.php'); $a->titles[] = $a->s[$a->language['language']]['system']['sections_array']['admin']; } $a->titles[] = $a->language['title']; } $u = 1; foreach($a->items_tree as $keyItem => $valueItem) { $title = $a->display_data(strip_tags($valueItem['title'])); $a->items[$u]['item'] = $keyItem; $a->items[$u]['title'] = $title; $a->items[$u]['component'] = $valueItem['component']; $a->titles[] = $title; $u++; } if(isset($_POST) == 1 && count($_POST) != 0) { $attack = 0; $vars = array(); foreach($_POST as $post) { if(is_string($post)) { foreach($a->strings_post as $string) { if(mb_eregi($string, $post)) { $attack = 1; $vars[] = $string; } } } } if($attack == 1) { $a->errors[] = sprintf($a->s[$a->language['language']]['system']['attack_post'], implode(', ', $vars)); $detail = implode(', ', $_POST)."\n".$_SERVER['REMOTE_ADDR']; if(isset($_SERVER['HTTP_USER_AGENT']) == 1) { $detail .= "\n".str_replace('&', '& ', $_SERVER['HTTP_USER_AGENT']); } if(isset($_SERVER['HTTP_REFERER']) == 1) { $detail .= "\n".str_replace('&', '& ', $_SERVER['HTTP_REFERER']); } $a->insert_log('system/attack-POST', $detail); } } if(isset($_GET) == 1 && count($_GET) != 0) { $attack = 0; $vars = array(); foreach($_GET as $get) { if(is_string($get)) { foreach($a->strings_get as $string) { if(mb_eregi($string, $get)) { $attack = 1; $vars[] = $string; } } } } if($attack == 1) { $a->errors[] = sprintf($a->s[$a->language['language']]['system']['attack_get'], implode(', ', $vars)); $detail = implode(', ', $_GET)."\n".$_SERVER['REMOTE_ADDR']; if(isset($_SERVER['HTTP_USER_AGENT']) == 1) { $detail .= "\n".str_replace('&', '& ', $_SERVER['HTTP_USER_AGENT']); } if(isset($_SERVER['HTTP_REFERER']) == 1) { $detail .= "\n".str_replace('&', '& ', $_SERVER['HTTP_REFERER']); } $a->insert_log('system/attack-GET', $detail); } } if(isset($_FILES) == 1 && count($_FILES) != 0) { $attack = 0; $vars = array(); foreach($_FILES as $key => $file) { if(is_array($file)) { if($file['error'] == 0) { foreach($a->strings_files as $string) { if(mb_eregi($string, $file['tmp_name']) || mb_eregi($string, $file['name'])) { $attack = 1; $vars[] = $string; } } } } } if($attack == 1) { $a->errors[] = sprintf($a->s[$a->language['language']]['system']['attack_files'], str_replace('\\', '', implode(', ', $vars))); $detail = implode(', ', $_FILES[$key])."\n".$_SERVER['REMOTE_ADDR']; if(isset($_SERVER['HTTP_USER_AGENT']) == 1) { $detail .= "\n".str_replace('&', '& ', $_SERVER['HTTP_USER_AGENT']); } if(isset($_SERVER['HTTP_REFERER']) == 1) { $detail .= "\n".str_replace('&', '& ', $_SERVER['HTTP_REFERER']); } $a->insert_log('system/attack-FILES', $detail); } } $sqlSelect = 'SELECT component FROM '.$a->d1->prefix.'components WHERE prepend_content = 1'; $listComponents = $a->d1->query_select($sqlSelect, array('cache'=>1, 'cachecode'=>'components-prepend')); if($listComponents['total'] != 0) { for ($cc=0;$cc<$listComponents['total'];$cc++) { if(file_exists('components/'.$listComponents['results']['component'][$cc].'.prepend.php') && $a->iscomponent($listComponents['results']['component'][$cc])) { include('components/'.$listComponents['results']['component'][$cc].'.prepend.php'); } else { $a->debug['axipi'][] = sprintf($a->s[$a->language['language']]['system']['missing-file'], 'components/'.$listComponents['results']['component'][$cc].'.prepend.php'); } } } unset($listComponents); if($a->item['layout'] != '' && $a->item['layout'] != '0') { $a->settings['layout'] = $a->item['layout']; } else if($a->item['componentlayout'] != '' && $a->item['componentlayout'] != '0') { $a->settings['layout'] = $a->item['componentlayout']; } else { $a->settings['layout'] = $a->section['layout']; } if(isset($_SESSION[$a->session_key]['history']) == 0) { $_SESSION[$a->session_key]['history'] = array(); } $buffer['content'] = ''; if(file_exists('components/'.$a->item['component'].'.php') && $a->iscomponent($a->item['component'])) { if((isset($a->item['settings']['no_hits']) == 0 || $a->item['settings']['no_hits'] == 0) && !in_array('root', $a->user['groups']) && !in_array('administration', $a->user['groups']) && !in_array($a->get['p'], $_SESSION[$a->session_key]['history'])) { $sqlAction = 'UPDATE '.$a->d1->prefix.'items SET hits = hits + 1 WHERE item = \''.$a->get['p'].'\''; $a->d1->query_action($sqlAction); } if(!in_array($a->get['p'], $_SESSION[$a->session_key]['history'])) { $_SESSION[$a->session_key]['history'][] = $a->get['p']; } include('components/'.$a->item['component'].'.php'); $buffer['content'] = $output; } else { $a->debug['axipi'][] = sprintf($a->s[$a->language['language']]['system']['missing-file'], 'components/'.$a->item['component'].'.php'); } $sqlSelect = 'SELECT component FROM '.$a->d1->prefix.'components WHERE append_content = 1'; $listComponents = $a->d1->query_select($sqlSelect, array('cache'=>1, 'cachecode'=>'components-append')); if($listComponents['total'] != 0) { for ($cc=0;$cc<$listComponents['total'];$cc++) { if(file_exists('components/'.$listComponents['results']['component'][$cc].'.append.php') && $a->iscomponent($listComponents['results']['component'][$cc])) { include('components/'.$listComponents['results']['component'][$cc].'.append.php'); } else { $a->debug['axipi'][] = sprintf($a->s[$a->language['language']]['system']['missing-file'], 'components/'.$listComponents['results']['component'][$cc].'.append.php'); } } } unset($listComponents); $sqlSelect = 'SELECT z.zone, i.settings, i.component, i.item, i.itemvirtual, i.itemparent, i.title, c.alternative AS componentalternative FROM '.$a->d1->prefix.'items_zones iz LEFT JOIN '.$a->d1->prefix.'items i ON iz.item = i.item LEFT JOIN '.$a->d1->prefix.'components c ON c.component = i.component LEFT JOIN '.$a->d1->prefix.'zones z ON iz.zone = z.zone LEFT JOIN '.$a->d1->prefix.'items_groups ig ON ig.item = i.item LEFT JOIN '.$a->d1->prefix.'items_displays id ON id.item = iz.item AND id.zone = iz.zone AND id.layout = iz.layout WHERE c.inzone = 1 AND (i.language = \''.$a->language['language'].'\' OR i.language = \'\') AND iz.layout = \''.$a->settings['layout'].'\' AND z.layout = \''.$a->settings['layout'].'\' AND z.publishedby != 0 AND iz.publishedby != 0 AND i.publishedby != 0 AND (i.groups = \'all\' OR i.groups = \''.$a->user['access'].'\' OR ig.`group` IN ('.$a->array2in($a->user['groups']).')) AND (iz.displays = \'all\' OR id.display = \''.$a->get['p'].'\') GROUP BY iz.zone, iz.item ORDER BY iz.ordering ASC'; $listItemZone = $a->d1->query_select($sqlSelect); if($listItemZone['total'] != 0) { for ($z=0;$z<$listItemZone['total'];$z++) { $zone = $listItemZone['results']['zone'][$z]; if(isset($buffer[$zone]) == 0) { $buffer[$zone] = ''; } if($listItemZone['results']['componentalternative'][$z] != '') { $component = $listItemZone['results']['componentalternative'][$z]; } else { $component = $listItemZone['results']['component'][$z]; } if(file_exists('components/'.$component.'.php') && $a->iscomponent($component)) { $itemZone = $listItemZone['results']['item'][$z]; $itemvirtualZone = $listItemZone['results']['itemvirtual'][$z]; $itemparentZone = $listItemZone['results']['itemparent'][$z]; if($itemvirtualZone != '') { $a->items[$itemZone]['classes-box'] = array('box', 'box-'.$itemvirtualZone); $a->items[$itemZone]['classes-display'] = array('display', 'display-'.$itemvirtualZone); } else { $a->items[$itemZone]['classes-box'] = array('box'); $a->items[$itemZone]['classes-display'] = array('display'); } $a->items[$itemZone]['title'] = $listItemZone['results']['title'][$z]; $a->items[$itemZone]['settings'] = $a->get_settings($listItemZone['results']['settings'][$z]); $output = ''; include('components/'.$component.'.php'); $buffer[$zone] .= $output; unset($output); } else { $a->debug['axipi'][] = sprintf($a->s[$a->language['language']]['system']['missing-file'], 'components/'.$component.'.php'); } } } unset($listItemZone); if($detailHost['total'] == 0 && in_array('root', $a->user['groups'])) { $a->debug['axipi'][] = sprintf($a->s[$a->language['language']]['system']['nohost'], $_SERVER['HTTP_HOST']); } unset($detailHost); if($a->user['email'] == 'install@axipi.com') { $a->debug['axipi'][] = $a->s[$a->language['language']]['system']['change-default-email']; } if($a->item['itemvirtual'] != '') { $a->classes = array($a->language['language'], 'body-'.$a->item['itemvirtual']); } else { $a->classes = array($a->language['language']); } } if ($a->section['settings']['content_type'] == 'application/xhtml+xml' && isset($_SERVER['HTTP_ACCEPT']) == 1 && strstr($_SERVER['HTTP_ACCEPT'], 'application/xhtml+xml')) { header('content-type: application/xhtml+xml; charset='.$a->section['settings']['charset']); $a->section['settings']['content_type'] = 'application/xhtml+xml'; } else { header('content-type: text/html; charset='.$a->section['settings']['charset']); $a->section['settings']['content_type'] = 'text/html'; } $a->debug['sql'] = array_merge($a->debug['sql'], $a->d1->errors); $a->queries = 'select '.$a->d1->queriesSelect.' :: cache '.$a->d1->queriesCache.' :: action '.$a->d1->queriesAction; if ($a->debug['php'] || $a->debug['sql']) { if(isset($a->host['settings']['email_debug']) == 1 && $a->host['settings']['email_debug'] != '') { if(isset($a->user['email']) == 1 && $a->user['email'] != '') { $from = $a->user['email']; } else { $from = $a->host['settings']['email_debug']; } $message = print_r($a->user, 1); $message .= print_r($a->settings, 1); $message .= print_r($a->debug, 1); // $a->email($from, $a->host['settings']['email_debug'], $a->language['title'].' - Debug', $message); } } $a->d1->close(); $chrono_end = $a->getmicrotime(); $chrono_final = $chrono_end - $chrono_start; $a->chrono['php'] = round($chrono_final-$a->d1->chrono, 5); $a->chrono['sql'] = round($a->d1->chrono, 5); $a->chrono['total'] = round($chrono_final, 5); ob_start(); include('layouts/'.$a->settings['layout'].'.php'); $output = ob_get_contents(); ob_end_clean(); $output = str_replace("\r\n".'<', '<', $output); $output = str_replace("\n".'<', '<', $output); $output = str_replace('>'."\r\n", '>', $output); $output = str_replace('>'."\n", '>', $output); $output = str_replace("\t", '', $output); $output = str_replace(' ', '', $output); $output = str_replace('', '', $output); $output = str_replace('', '', $output); } if (isset($a->host['settings']['url_rewrite']) == 1 && $a->host['settings']['url_rewrite'] == 1) { echo $a->rewrite($output); } else { echo $output; } ?>