<?php

/**
 *
 * @copyright  2010-2016 izend.org
 * @version    47
 * @link       http://www.izend.org
 */

require_once 'ismobile.php';

global $base_url, $base_path, $base_root;

global $request_path, $request_query;

global $sitename, $webmaster, $mailer, $blackmaillist, $blacknamelist;

$sitename = 'izendsms.com';
$webmaster = 'webmaster@izend.org';
$mailer = 'iZend';
$blackmaillist = array($webmaster);
$blacknamelist = array('izend');

global $sitekey;

$sitekey=pack('H*', '2ced8ad8e526fb9b27d683972203cdbe3b878dcd5136a18ef9c4fe9e13c29eac');	// 32 random bytes - see openssl_random_pseudo_bytes

global $siteshot;

$siteshot=false;	// false or pathname

global $blackfilelist;

$blackfilelist = array('.htaccess', 'index.html', 'index.phtml', 'index.php');

global $logoascii;

$logoascii='';

global $signature;

$signature='izendsms.com - http://www.izendsms.com';

global $socializing, $socializingmode;

$socializing='inline';	// false, 'inline', 'bar', 'either', 'both'
$socializingmode='standard';       // 'standard', 'lite', 'awesome'

global $cookieconsent;

$cookieconsent=false;

global $facebookjssdk, $facebookid, $facebooksecret;

$facebookjssdk=false;	// false

$facebookid=false;
$facebooksecret=false;

global $pinterestassets;

$pinterestassets=false;	// false

global $googleapiid;

$googleapiid=false;

global $googleanalyticsid;

$googleanalyticsid=false;

global $googleanalyticsaccount, $googleanalyticskeyfile;

$googleanalyticsaccount = false;
$googleanalyticskeyfile = false;	// ROOT_DIR . DIRECTORY_SEPARATOR . 'google-api-*.p12';

global $author;

$author=false;

global $log_dir;

$log_dir = ROOT_DIR . DIRECTORY_SEPARATOR . 'log';

global $closing_time, $opening_time;

$closing_time=0;	// true, mktime(13, 0)
$opening_time=0;	// $closing_time+30*60

global $system_languages;

$system_languages=array('fr', 'en');	// 'en', 'fr'

global $supported_languages;

$supported_languages=array('fr', 'en');	// 'en', 'fr'

global $supported_currencies;

$supported_currencies=array('EUR', 'USD', 'GBP');      // 'EUR', 'USD', 'GBP'

global $supported_roles;

$supported_roles=array('administrator', 'writer', 'reader', 'moderator', 'client');

global $supported_threads;

$supported_threads=array('thread', 'folder', 'story', 'book', 'rss', 'newsletter', 'campaign');	// 'thread', 'folder', 'story', 'book', 'rss', 'newsletter'

global $contents_model, $supported_contents, $limited_contents;

$contents_model = array(
	'text'		=>	array('text' => array('type' => 'string', 'null' => true), 'eval' => array('type' => 'boolean', 'default' => false)),
	'infile'	=>	array('path' => array('type' => 'string', 'null' => true)),
	'download'	=>	array('name' => array('type' => 'string', 'null' => true), 'path' => array('type' => 'string', 'null' => true)),
	'file'		=>	array('path' => array('type' => 'string', 'null' => true), 'start' => array('type' => 'number', 'default' => 0), 'end' => array('type' => 'number', 'default' => 0), 'format' => array('type' => 'string', 'null' => true), 'lineno' => array('type' => 'boolean', 'default' => true)),
	'youtube'	=>	array('id' => array('type' => 'string', 'null' => true), 'width' => array('type' => 'number', 'default' => 0), 'height' => array('type' => 'number', 'default' => 0), 'miniature' => array('type' => 'string', 'null' => true), 'title' => array('type' => 'string', 'null' => true), 'autoplay' => array('type' => 'boolean'), 'controls' => array('type' => 'boolean'), 'fs' => array('type' => 'boolean'), 'rel' => array('type' => 'boolean'), 'theme' => array('type' => 'enum', 'default' => 'dark')),
//	'longtail'	=>	array('file' => array('type' => 'string', 'null' => true), 'image' => array('type' => 'string', 'null' => true), 'width' => array('type' => 'number', 'default' => 0), 'height' => array('type' => 'number', 'default' => 0), 'icons' => array('type' => 'boolean'), 'skin' => array('type' => 'string', 'null' => true), 'controlbar' => array('type' => 'enum', 'default' => 'none'), 'duration' => array('type' => 'number', 'default' => 0), 'autostart' => array('type' => 'boolean'), 'repeat' => array('type' => 'boolean')),
	'sms'		=>	array('text' => array('type' => 'string', 'null' => true)),
);

$supported_contents=array('text', 'infile', 'download', 'file', 'youtube', 'sms');	// 'text', 'infile', 'download', 'file', 'youtube', 'longtail'

$limited_contents=array('rss' => array('text'), 'newsletter' => array('text'), 'campaign' => array('sms'));

global $with_toolbar;

$with_toolbar=is_mobile() ? false : true;

global $search_all, $search_distance, $search_closest, $search_pertinence;

$search_all=false;		// true, false, 'cloud'
$search_distance=2;		// 0 - exact match, 1 - close, 2 - not so close, etc.
$search_closest=true;	// true - best matches, false - all matches
$search_pertinence=0;	// 0 - at least one tag, 1 - all tags

global $session_name;

$session_name=false;	// see bootstrap

global $login_verified;

$login_verified=false;	// false or array of roles

global $login_lifetime, $login_failed_delay;

$login_lifetime=false;	// false or in seconds
$login_failed_delay=1;	// false or in seconds

global $track_db, $track_log;
global $track_visitor, $track_visitor_agent;
global $track_agent_blacklist;

$track_db=false;
$track_log=false;		// true, file name or false
$track_visitor=false;
$track_visitor_agent=false;
$track_agent_blacklist=false;	// false or array of agent signatures

global $root_node;

$root_node = 1;	// home page node, e.g. 1 or false

global $home_action, $default_action, $default_folder;

$home_action = 'home';		// 'home' or 'homepage'
$default_action = 'page';	// 'page' or 'anypage' or false
$default_folder = 1;			// can be an array

global $content_folder;

$content_folder = false;		// can be an array

global $rss_thread;

$rss_thread = false;

global $newsletter_thread;

$newsletter_thread = false;		// see cron.php

global $theme;

$theme = false;
