HEX
Server: Apache
System: Linux c119.dattaweb.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: c1190199 (57165)
PHP: 7.4.33
Disabled: mail, system, shell, exec, system_exec, shell_exec, mysql_pconnect, passthru, popen, proc_open, proc_close, proc_nice, proc_terminate, proc_get_status, escapeshellarg, escapeshellcmd, eval, dl, imap_mail, libvirt_connect, gnupg_init, unsetenv, apache_setenv, pcntl_exec, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_get_handler, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_getpriority, pcntl_setpriority, pcntl_async_signals, opcache_get_status, opcache_reset, opcache_get_configuration
Upload Files
File: /home/c1190199/public_html/wp-content/themes/directory/header.php
<?php

/**
 * AIT WordPress Theme
 *
 * Copyright (c) 2012, Affinity Information Technology, s.r.o. (http://ait-themes.com)
 */

global $aitThemeOptions, $latteParams, $wp_query, $registerErrors, $registerMessages;

// register form errors
if(isset($registerErrors)){
	$latteParams['registerErrors'] = $registerErrors->get_error_message();
}
// register form info
if(isset($registerMessages)){
	$latteParams['registerMessages'] = $registerMessages;
}

$mapCategory = 0;
$mapLocation = 0;
$mapSearch = $wp_query->query_vars['s'];
// parse tax query - only one category and location
if(isset($wp_query->tax_query)){
	$taxQueries = $wp_query->tax_query->queries;
	foreach ($taxQueries as $tax) {
		if($tax['field'] == 'id'){
			if($tax['taxonomy'] == 'ait-dir-item-category'){
				$mapCategory = (isset($tax['terms'][0])) ? $tax['terms'][0] : 0;
			} elseif ($tax['taxonomy'] == 'ait-dir-item-location') {
				$mapLocation = (isset($tax['terms'][0])) ? $tax['terms'][0] : 0;
			}
		} elseif ($tax['field'] == 'slug') {
			if($tax['taxonomy'] == 'ait-dir-item-category'){
				$mapCategory = (isset($tax['terms'][0])) ? get_term_by( 'slug', $tax['terms'][0], 'ait-dir-item-category' )->term_id : 0;
			} elseif ($tax['taxonomy'] == 'ait-dir-item-location') {
				$mapLocation = (isset($tax['terms'][0])) ? get_term_by( 'slug', $tax['terms'][0], 'ait-dir-item-location' )->term_id : 0;
			}
		}
	}
}
$latteParams['mapCategory'] = $mapCategory;
$latteParams['mapLocation'] = $mapLocation;
$latteParams['mapSearch'] = $mapSearch;

// for search form
$categories = get_terms('ait-dir-item-category', array(
	'hide_empty'		=> false,
	'orderby'			=> 'name'
));
$latteParams['categories'] = $categories;
$locations = get_terms('ait-dir-item-location', array(
	'hide_empty'		=> false,
	'orderby'			=> 'name'
));
$latteParams['locations'] = $locations;

// hierarchical autocomplete
if (isset($aitThemeOptions->search->searchCategoriesHierarchical)) {
	$hCategories = array();
	aitSortTermsHierarchicaly($categories, $hCategories);
	$latteParams['categoriesHierarchical'] = substr(aitGenerateHirerarchicalAutocomplete($hCategories), 0, -1);
}
if (isset($aitThemeOptions->search->searchLocationsHierarchical)) {
	$hLocations = array();
	aitSortTermsHierarchicaly($locations, $hLocations);
	$latteParams['locationsHierarchical'] = substr(aitGenerateHirerarchicalAutocomplete($hLocations), 0, -1);
}

// directory search
if(isset($_GET['dir-search'])){
	$latteParams['searchTerm'] = $wp_query->query_vars['s'];
	
	$latteParams['isGeolocation'] = (isset($_GET['geo'])) ? true : null;
	$latteParams['geolocationRadius'] = (isset($_GET['geo-radius'])) ? $_GET['geo-radius'] : 100;
	$latteParams['geolocationCircle'] = (isset($aitThemeOptions->search->showAdvancedSearchRadius)) ? true : null;
	if(isset($aitThemeOptions->search->searchShowMap)){
		// map
		$latteParams['headerType'] = 'map';
		$radius = array();
		if(isset($_GET['geo'])){
			$radius[] = $_GET['geo-radius'];
			$radius[] = $_GET['geo-lat'];
			$radius[] = $_GET['geo-lng'];
		}
		$latteParams['items'] = getItems($_GET['categories'],$_GET['locations'],$wp_query->query_vars['s'],$radius);
	} else {
		$latteParams['headerType'] = 'none';
	}
} else if(isset($latteParams['isDirTaxonomy']) || isset($latteParams['isDirSingle'])){
	// map
	$latteParams['headerType'] = 'map';
	$latteParams['isGeolocation'] = (isset($aitThemeOptions->directoryMap->enableGeolocation)) ? true : null;
	//$latteParams['geolocationOnlyInRadius'] = (isset($aitThemeOptions->directoryMap->geolocationOnlyInRadius)) ? true : null;
	$latteParams['geolocationRadius'] = (isset($aitThemeOptions->directoryMap->geolocationRadius)) ? $aitThemeOptions->directoryMap->geolocationRadius : 100;
	$latteParams['geolocationCircle'] = (isset($aitThemeOptions->directoryMap->geolocationCircle)) ? true : null;
} else {
	// LOCAL
	if(!empty($latteParams['post']) && isset($latteParams['post']->options('header')->overrideGlobal)){
		$latteParams['headerType'] = $latteParams['post']->options('header')->headerType;
		switch ($latteParams['post']->options('header')->headerType) {
			case 'map':
				$latteParams['items'] = getItems();
				// geolocation
				$latteParams['isGeolocation'] = (isset($latteParams['post']->options('header')->enableGeolocation)) ? true : null;
				//$latteParams['geolocationOnlyInRadius'] = (isset($latteParams['post']->options('header')->geolocationOnlyInRadius)) ? true : null;
				$latteParams['geolocationRadius'] = (isset($latteParams['post']->options('header')->geolocationRadius)) ? $latteParams['post']->options('header')->geolocationRadius : 100;
				$latteParams['geolocationCircle'] = (isset($latteParams['post']->options('header')->geolocationCircle)) ? true : null;
				break;
			case 'image':
				$latteParams['headerImage'] = $latteParams['post']->options('header')->image;
				$latteParams['headerImageSize'] = aitGetImageSize($latteParams['post']->options('header')->image);
				break;
			case 'slider':
				$latteParams['headerSlider'] = $latteParams['post']->options('header')->slider;
				break;
			default:
				break;
		}
	// GLOBAL
	} else {
		$latteParams['headerType'] = $aitThemeOptions->header->headerType;
		switch ($aitThemeOptions->header->headerType) {
			case 'map':
				$latteParams['items'] = getItems();
				// geolocation
				$latteParams['isGeolocation'] = (isset($aitThemeOptions->directoryMap->enableGeolocation)) ? true : null;
				//$latteParams['geolocationOnlyInRadius'] = (isset($aitThemeOptions->directoryMap->geolocationOnlyInRadius)) ? true : null;
				$latteParams['geolocationRadius'] = (isset($aitThemeOptions->directoryMap->geolocationRadius)) ? $aitThemeOptions->directoryMap->geolocationRadius : 100;
				$latteParams['geolocationCircle'] = (isset($aitThemeOptions->directoryMap->geolocationCircle)) ? true : null;
				break;
			case 'image':
				$latteParams['headerImage'] = $aitThemeOptions->header->image;
				$latteParams['headerImageSize'] = aitGetImageSize($aitThemeOptions->header->image);
				break;
			case 'slider': 
				$latteParams['headerSlider'] = $aitThemeOptions->header->slider;
				break;
			default:
				break;
		}
	}
}

WPLatte::createTemplate(basename(__FILE__, '.php'), $latteParams)->render();