<?php

/**
Plugin Name: Event Countdown for Calendarize it!
Plugin URI: http://plugins.righthere.com/calendarize-it-countdown/
Description: Provides Event Countdown for Calendarize it! and also provides next upcoming date meta for the custom fields, and the [rhc_next_upcoming_dates] for calendarized posts.
Version: 1.0.3.81887
Author: Alberto Lau (RightHere LLC)
Author URI: http://plugins.righthere.com
 **/
 
if(defined('RHCCD_PATH')) throw new Exception( __('A duplicate of this addon/plugin is already active.','rhc-cd') );
if(defined('RHCNUP_PATH')) throw new Exception( __('Deactivate the Next Upcoming Meta addon before activating this addon.','rhc-cd') ); 
if( RHC_VERSION<'3.2.1' ) throw new Exception( __('Event Countdown for Calendarize it! requires a version greater than 3.2.1.','rhc-cd') );
 
if(defined('RHC_ADDON_PATH')){
	define('RHCCD_PATH', trailingslashit(RHC_ADDON_PATH . dirname($addon)) ); 
	define("RHCCD_URL", trailingslashit(RHC_ADDON_URL . dirname($addon)) );
	//-- Next Upcoming Addon is bundled with this addon.
	define('RHCNUP_PATH', trailingslashit(RHC_ADDON_PATH . dirname($addon)) ); 
	define("RHCNUP_URL", trailingslashit(RHC_ADDON_URL . dirname($addon)) );
}else{
	define('RHCCD_PATH', plugin_dir_path(__FILE__) ); 
	define("RHCCD_URL", plugin_dir_url(__FILE__) );
	//-- Next Upcoming Addon is bundled with this addon.
	define('RHCNUP_PATH', plugin_dir_path(__FILE__) ); 
	define("RHCNUP_URL", plugin_dir_url(__FILE__) );	
} 

define('RHCCD_AUTO_TEMPLATE_DEFAULT', '1');

//-- countdown plugin:
require_once RHCCD_PATH.'includes/class.plugin_rhc_countdown.php';
new plugin_rhc_countdown();

//-- Next Upcoming Meta
global $rhc_plugin;
if( RHC_VERSION<'3.2.1' || 0!==intval($rhc_plugin->get_option('original_ajax_enable',0,true)) ){
	require_once RHCNUP_PATH.'includes/class.plugin_rhc_next_upcoming.pre321.php';
}else{
	require_once RHCNUP_PATH.'includes/class.plugin_rhc_next_upcoming.php';
}
new plugin_rhc_next_upcoming();