<?php
global $fullscreen_lite_themename;
global $fullscreen_lite_shortname;

if ( !class_exists( 'OT_Loader' )){	
	//THEME SHORTNAME	
	$fullscreen_lite_shortname = 'fullscreen';	
	$fullscreen_lite_themename = 'Fullscreen';	
	define('FULLSCREEN_LITE_ADMIN_MENU_NAME','Fullscreen');
}

/***************** EXCERPT LENGTH ************/
function fullscreen_excerpt_length($length) {
	return 50;
}
add_filter('excerpt_length', 'fullscreen_excerpt_length');

/***************** READ MORE ****************/
function fullscreen_excerpt_more( $more ) {
	return '...';
}
add_filter('excerpt_more', 'fullscreen_excerpt_more');

/************* CUSTOM PAGE TITLE ***********/
add_filter( 'wp_title', 'fullscreen_title' );
function fullscreen_title($title)
{
	$fullscreen_title = $title;
	if ( is_home() && !is_front_page() ) {
		$fullscreen_title .= get_bloginfo('name');
	}
	if ( is_front_page() ){
		$fullscreen_title .=  get_bloginfo('name');
		$fullscreen_title .= ' | '; 
		$fullscreen_title .= get_bloginfo('description');
	}
	if ( is_search() ) {
		$fullscreen_title .=  get_bloginfo('name');
	}
	if ( is_author() ) { 
		global $wp_query;
		$curauth = $wp_query->get_queried_object();	
		$fullscreen_title .= __('Author: ','fullscreen-lite');
		$fullscreen_title .= $curauth->display_name;
		$fullscreen_title .= ' | ';
		$fullscreen_title .= get_bloginfo('name');
	}
	if ( is_single() ) {
		$fullscreen_title .= get_bloginfo('name');
	}
	if ( is_page() && !is_front_page() ) {
		$fullscreen_title .= get_bloginfo('name');
	}
	if ( is_category() ) {
		$fullscreen_title .= get_bloginfo('name');
	}
	if ( is_year() ) { 
		$fullscreen_title .= get_bloginfo('name');
	}
	if ( is_month() ) {
		$fullscreen_title .= get_bloginfo('name');
	}
	if ( is_day() ) {
		$fullscreen_title .= get_bloginfo('name');
	}
	if (function_exists('is_tag')) { 
		if ( is_tag() ) {
			$fullscreen_title .= get_bloginfo('name');
		}
		if ( is_404() ) {
			$fullscreen_title .= get_bloginfo('name');
		}					
	}
	return $fullscreen_title;
}

/**
 * SETS UP THE CONTENT WIDTH VALUE BASED ON THE THEME'S DESIGN.
 */
if ( ! isset( $content_width ) ){
    $content_width = 900;
}
add_filter('body_class','fullscreen_lite_class_name');
function fullscreen_lite_class_name($classes) {
	$classes[] = 'fullscreen-lite';
	return $classes;
}

/********************************************************
	#DEFINE REQUIRED CONSTANTS HERE# &
	#OPTIONAL: SET 'OT_SHOW_PAGES' FILTER TO FALSE#.
	#THIS WILL HIDE THE SETTINGS & DOCUMENTATION PAGES.#
*********************************************************/

//CHECK AND FOUND OUT THE THEME VERSION AND ITS BASE NAME

if(function_exists('wp_get_theme')){
    $fullscreen_lite_theme_data = wp_get_theme(get_option('template'));
    $fullscreen_lite_theme_version = $fullscreen_lite_theme_data->Version;  
}

define( 'FULLSCREEN_LITE_OPTS_FRAMEWORK_DIRECTORY_URI', trailingslashit(get_template_directory_uri() . '/SketchBoard/includes/') );	
define( 'FULLSCREEN_LITE_OPTS_FRAMEWORK_DIRECTORY_PATH', trailingslashit(get_template_directory() . '/SketchBoard/includes/') );
define( 'FULLSCREEN_LITE_THEME_VERSION',$fullscreen_lite_theme_version);	
	
add_filter( 'ot_show_pages', '__return_false' );

// REQUIRED: SET 'OT_THEME_MODE' FILTER TO TRUE.
add_filter( 'ot_theme_mode', '__return_true' );

// DISABLE ADD NEW LAYOUT SECTION FROM OPTIONS PAGE.
add_filter( 'ot_show_new_layout', '__return_false' );

// REQUIRED: INCLUDE OPTIONTREE.
require_once get_template_directory() . '/SketchBoard/includes/ot-loader.php';

// THEME OPTIONS
require_once get_template_directory() . '/SketchBoard/includes/options/theme-options.php';


/********************************************
	GET THEME OPTIONS VALUE FUNCTION
*********************************************/
function fullscreen_lite_get_option( $option_id, $default = '' ){
	return ot_get_option( $option_id, $default = '' );
}