<?php

ini_set('display_errors', '1');
ini_set('error_reporting', E_ALL);

/** Define some paths and folders to be used elsewhere */
if (!defined('ABSPATH')) 		{define('ABSPATH', dirname(__FILE__) . '/');}
if (!defined("PRIVATEPATH")) 	{define('PRIVATEPATH', realpath(ABSPATH . '../') . '/');}
if (!defined('TEMPLATEPATH')) 	{define('TEMPLATEPATH', realpath(ABSPATH . 'template/') . '/');}
if (!defined('TEMPLATEFOLDER'))	{define('TEMPLATEFOLDER', '/template/');}
if (!defined('CONTENTPATH')) 	{define('CONTENTPATH', realpath(ABSPATH . 'contents/') . '/');}
if (!defined('CONTENTFOLDER')) 	{define('CONTENTFOLDER', '/contents/');}

/** REQUIRED ELEMENTS */

/** NAVIGATION JSON FILE */

require_once(TEMPLATEPATH . 'class/class.dorispot_template.php');

$dorispot_data = trim(file_get_contents(PRIVATEPATH . 'dorispot_data.json'));
$dorispot_data = json_decode($dorispot_data,true);

$dori = new dorispot_template($_SERVER['REQUEST_URI'], $dorispot_data);

$dori->testing = TRUE;

$ads = trim(file_get_contents(PRIVATEPATH . 'dorispot_ads.json'));
$ads = json_decode($ads,true);
$dori->register_ads('ca-pub-2452015173780502', $ads);

require_once(TEMPLATEPATH . 'index.php');